diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c7fcb28e4..000000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen -target diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b42cb9074..000000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM nginx:alpine - -COPY uidocker/conf.d /etc/nginx/conf.d - -COPY src/main/ui /var/www/royalpay - -COPY uidocker/upstream.conf.tpl /opt/upstream.conf.tpl - -EXPOSE 80 - -CMD envsubst < /opt/upstream.conf.tpl > /etc/nginx/conf.d/upstream.conf && cat /etc/nginx/conf.d/upstream.conf && exec nginx -g 'daemon off;' \ No newline at end of file diff --git a/checkstyle/GeekCheckStyle.xml b/checkstyle/GeekCheckStyle.xml deleted file mode 100644 index f7b6658e7..000000000 --- a/checkstyle/GeekCheckStyle.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/checkstyle/checkstyle-8.38-all.jar b/checkstyle/checkstyle-8.38-all.jar deleted file mode 100644 index 52076fe4f..000000000 Binary files a/checkstyle/checkstyle-8.38-all.jar and /dev/null differ diff --git a/checkstyle/pre-commit b/checkstyle/pre-commit deleted file mode 100644 index 274e80d25..000000000 --- a/checkstyle/pre-commit +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/bash -# @author:haloo# -#@func:pre-commit# -## cp ./checkstyle/pre-commit ./.git/hooks/ - -echo 避免NPE是程序员的基本修养 -echo 开始style checking - -wd=`pwd` -echo "当前工作目录:$wd" - -# check-style版本号 -check_style_version="checkstyle-8.38-all.jar" -check_style_xml_name="GeekCheckStyle.xml" -check_jar_path="$wd/checkstyle/$check_style_version" -check_xml_path="$wd/checkstyle/$check_style_xml_name" - -## 清空temp文件 - -rm -f temp - -is_err=0 -errorCount=0 -warnCount=0 - -## 查找add到git 缓冲区中,以.java后缀的文件 -for file in `git status --porcelain | sed s/^...// | grep '\.java$'`; do - path="$wd/$file" - echo "检查文件: $path" - re=`java -jar $check_jar_path -c $check_xml_path $path >> temp` - - warn=`cat temp | grep "WARN"` - if [[ $warn = *"WARN"* ]];then - echo "${warn}" - needle="WARN" - number_of_occurrences=$(grep -o "$needle" <<< "$warn" | wc -l) - ((warnCount = warnCount + number_of_occurrences)) - is_err=1 - fi - - err=`cat temp | grep "ERROR"` - if [[ $err = *"ERROR"* ]];then - echo "${err}" - needle="ERROR" - number_of_occurrences=$(grep -o "$needle" <<< "$err" | wc -l) - ((errorCount = errorCount + number_of_occurrences)) - is_err=1 - fi -done - -echo "检查完成,祝你好运" - -rm -f temp - -if [ $is_err -ne 0 ];then - echo "出现了 $errorCount 个error" - echo "出现了 $warnCount 个warn" - echo "请先符合style才能提交" - exit 1 -fi -echo "No Bug ,It is Good!!" -exit 0 diff --git a/extra/1004300651201.pfx b/extra/1004300651201.pfx deleted file mode 100644 index 0a1dc621d..000000000 Binary files a/extra/1004300651201.pfx and /dev/null differ diff --git a/extra/GeoLiteCity.dat b/extra/GeoLiteCity.dat deleted file mode 100644 index 1adb8c3c4..000000000 Binary files a/extra/GeoLiteCity.dat and /dev/null differ diff --git a/extra/crypt/alipay_private.pem b/extra/crypt/alipay_private.pem deleted file mode 100644 index b3546c08e..000000000 --- a/extra/crypt/alipay_private.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC72cPSVWP66+5iDU+Yyg6ODfjDeb+nty90e5UtESIB1YOn4qaq -gjPiNgDZUDpaUhHKCW95U/V3pQi2FBbIj16z8uAAxVe+Uz45NlWhBIT9+4PY57oF -yLkaVCr/6Kwir/ql28cvwkhkbrQ2veOpGd7/W8UpMjWMyNuZGelEibmBKQIDAQAB -AoGABdjpd4qg6had/P9dEux3N4TH0Y3goV/aYk3Wfuihnlz/FCLB/VzAMLJtpFYS -+uzDEP7qMWSjp23Dr6dAbk3ILNQgogrJ4a4z9Uq9fVYt8lBo/T98hjR1xSXDJEQS -FsUw8XRbYGFOFxnLzlTjLix1b6+gmTJsKihbETMXBKRl/WECQQDkf0LRjoDCME4H -kgLzm4dq5iCPdJNQLOZT+xJsQy72/RNdnlbYJVO0E9NSo1oIpFtKA2C8z/BTnAUk -5nuLeac/AkEA0nYN1i4TZCyaB0MbGIgFU/dc7aIY/5QIY4oGrs//3CnqLDxU0Doa -yFEQAaZTINa7hy4aZqtPl7rdeYBPFwRllwJBAOIrCRNtbwtHTuT1ZJCGQKrR8Cau -p+WzG6TCnoCkm0cERvfic2lswQY8nW5tm/9z15xR7Z3WYLYRd5IHxP/QQXcCQQC1 -fDveUAlEvvlr/cAl3VXK3Gp0OO4Zpsu9Gk88+/yFHFflIXl5vkFOMCj/YzAYB1Pa -9DSsCFowW2GU3sJU9OOtAkBB8WLs1AGsBRdMy9b2ucfeeCDjMip5deLCwX9jii/p -Am5f2ajaEkr60blSbG4sbK/EKZ2uENUZzKqcIje83TB8 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/extra/crypt/alipay_public.pem b/extra/crypt/alipay_public.pem deleted file mode 100644 index d0ef3cc49..000000000 --- a/extra/crypt/alipay_public.pem +++ /dev/null @@ -1 +0,0 @@ -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB \ No newline at end of file diff --git a/extra/custom/ali_custom_config.json b/extra/custom/ali_custom_config.json deleted file mode 100644 index fc244ff5b..000000000 --- a/extra/custom/ali_custom_config.json +++ /dev/null @@ -1,102 +0,0 @@ -[ - { - "code": "hangzhou", - "name": "杭州海关", - "target": [ - "HANGZHOU_ZONGSHU" - ] - }, - { - "code": "guangzhou", - "name": "广州海关", - "target": [ - "ZONGSHU" - ] - }, - { - "code": "zhengzhou", - "name": "河南保税物流中心", - "target": [ - "ZHENGZHOU" - ] - }, - { - "code": "xinzheng", - "name": "新郑综合保税区(空港)", - "target": [ - "HENAN", - "ZONGSHU" - ] - }, - { - "code": "chongqing", - "name": "重庆海关", - "target": [ - "ZONGSHU" - ] - }, - { - "code": "ningbo", - "name": "宁波", - "target": [ - "NINGBO" - ] - }, - { - "code": "shengzhen", - "name": "深圳海关", - "target": [ - "SHENZHEN_ZS", - "ZONGSHU" - ] - }, - { - "code": "shanghai", - "name": "上海海关", - "target": [ - "SHANGHAI_CBT" - ] - }, - { - "code": "xian", - "name": "西安海关", - "target": [ - "ZONGSHU" - ] - }, - { - "code": "NANSHAGJ", - "name": "南沙国检", - "target": [ - "NANSHAGJ" - ] - }, - { - "code": "tianjin", - "name": "天津海关", - "target": [ - "ZONGSHU" - ] - }, - { - "code": "hefei", - "name": "合肥海关", - "target": [ - "ZONGSHU" - ] - }, - { - "code": "suzhou", - "name": "苏州海关", - "target": [ - "ZONGSHU" - ] - }, - { - "code": "guangzhouhuangpu", - "name": "广州黄埔海关", - "target": [ - "GUANGZHOU_HUANGPU" - ] - } -] diff --git a/extra/wx_test.p12 b/extra/wx_test.p12 deleted file mode 100644 index f8962b8cf..000000000 Binary files a/extra/wx_test.p12 and /dev/null differ diff --git a/init.sh b/init.sh deleted file mode 100644 index 42f10fb1c..000000000 --- a/init.sh +++ /dev/null @@ -1,2 +0,0 @@ -cp checkstyle/pre-commit .git/hooks/ -chmod +x .git/hooks/pre-commit diff --git a/kafka/pom.xml b/kafka/pom.xml new file mode 100644 index 000000000..fcc2b44ab --- /dev/null +++ b/kafka/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + org.example + kafka + 1.0-SNAPSHOT + + + 8 + 8 + + + + org.apache.kafka + kafka-clients + 3.2.0 + + + org.apache.rocketmq + rocketmq-client + 4.9.4 + + + org.apache.rocketmq + rocketmq-tools + 4.9.4 + + + junit + junit + 4.12 + + + + \ No newline at end of file diff --git a/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer.java b/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer.java new file mode 100644 index 000000000..8efed71e7 --- /dev/null +++ b/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer.java @@ -0,0 +1,65 @@ +package com.dalong.kafka.producer; + +import org.apache.kafka.clients.consumer.*; +import org.apache.kafka.clients.producer.ProducerConfig; +import org.apache.kafka.common.TopicPartition; +import org.apache.kafka.common.serialization.StringDeserializer; +import org.apache.kafka.common.serialization.StringSerializer; + +import java.time.Duration; +import java.util.*; + +public class CustomConsumer { + + public static void main(String[] args) { +// 基础配置 + Properties properties=new Properties(); + properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092"); + properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); + properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); + + properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,"XXDD8"); + properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"latest"); + //自动提交时异步提交 + properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true"); + + //设置分区策略 + properties.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,"org.apache.kafka.clients.consumer.RoundRobinAssignor"); + +// properties.setProperty(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,""); +// properties.setProperty(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,""); + KafkaConsumer kafkaConsumer=new KafkaConsumer(properties); + kafkaConsumer.subscribe(Arrays.asList("dalong1")); + while (true) { + ConsumerRecords records = kafkaConsumer.poll(Duration.ofMillis(0)); + + if (!records.isEmpty()) { + System.out.println("======>partition:!isEmpty"); + + Set partitions= records.partitions(); + for(TopicPartition partition:partitions){ + List> recordStringList= records.records(partition);//每次poll的时候是取多个分区的数据 + //分区获取数据 + Iterator> iterator= recordStringList.iterator(); + //kafka offset是按分区去维护的 + while (iterator.hasNext()){ + ConsumerRecord consumerRecord= iterator.next(); + int par= consumerRecord.partition(); + long offset= consumerRecord.offset(); + String v= consumerRecord.value(); + String k=consumerRecord.key(); + System.out.println("======>partition:"+partition+"===par:"+par+"====>k:"+k+"=====v:"+v+"===offset:"+offset); + } + } +// System.out.println("============"+records.count()+"=================="); +// Iterator iterator = records.iterator(); +// while (iterator.hasNext()) { +// ConsumerRecord consumerRecord = iterator.next(); +// int p = consumerRecord.partition(); +// long offset = consumerRecord.offset(); +// System.out.println("=====>key: " + consumerRecord.key() + "===>partition:" + p + "==offset:" + offset+"=="+consumerRecord.value()); +// } + } + } + } +} diff --git a/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer2.java b/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer2.java new file mode 100644 index 000000000..ee24a46e1 --- /dev/null +++ b/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer2.java @@ -0,0 +1,48 @@ +package com.dalong.kafka.producer; + +import org.apache.kafka.clients.consumer.ConsumerConfig; +import org.apache.kafka.clients.consumer.ConsumerRecord; +import org.apache.kafka.clients.consumer.ConsumerRecords; +import org.apache.kafka.clients.consumer.KafkaConsumer; +import org.apache.kafka.common.serialization.StringDeserializer; + +import java.time.Duration; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Properties; + +public class CustomConsumer2 { + + public static void main(String[] args) { +// 基础配置 + Properties properties=new Properties(); + properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092"); + properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); + properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); + + properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,"XXDD6"); + properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"latest"); + //自动提交时异步提交 + properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true"); + //设置分区策略 + properties.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,"org.apache.kafka.clients.consumer.RoundRobinAssignor"); + +// properties.setProperty(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,""); +// properties.setProperty(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,""); + KafkaConsumer kafkaConsumer=new KafkaConsumer(properties); + kafkaConsumer.subscribe(Arrays.asList("dalong1")); + while (true) { + ConsumerRecords records = kafkaConsumer.poll(Duration.ofMillis(0)); + if (!records.isEmpty()) { + System.out.println("============》"+records.count()+"《=================="); + Iterator iterator = records.iterator(); + while (iterator.hasNext()) { + ConsumerRecord consumerRecord = iterator.next(); + int p = consumerRecord.partition(); + long offset = consumerRecord.offset(); + System.out.println("=====》》key: " + consumerRecord.key() + "===>partition:" + p + "==offset:" + offset+"=="+consumerRecord.value()); + } + } + } + } +} diff --git a/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer3.java b/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer3.java new file mode 100644 index 000000000..555196479 --- /dev/null +++ b/kafka/src/main/java/com/dalong/kafka/producer/CustomConsumer3.java @@ -0,0 +1,48 @@ +package com.dalong.kafka.producer; + +import org.apache.kafka.clients.consumer.*; +import org.apache.kafka.clients.producer.ProducerConfig; +import org.apache.kafka.common.serialization.StringDeserializer; +import org.apache.kafka.common.serialization.StringSerializer; + +import java.time.Duration; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Properties; + +public class CustomConsumer3 { + + public static void main(String[] args) { +// 基础配置 + Properties properties=new Properties(); + properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092"); + properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); + properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); + + properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,"XXDD6"); + properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"latest"); + //自动提交时异步提交 + properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true"); + + //设置分区策略 + properties.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,"org.apache.kafka.clients.consumer.RoundRobinAssignor"); + +// properties.setProperty(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,""); +// properties.setProperty(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,""); + KafkaConsumer kafkaConsumer=new KafkaConsumer(properties); + kafkaConsumer.subscribe(Arrays.asList("dalong1")); + while (true) { + ConsumerRecords records = kafkaConsumer.poll(Duration.ofMillis(0)); + if (!records.isEmpty()) { + System.out.println("============"+records.count()+"=================="); + Iterator iterator = records.iterator(); + while (iterator.hasNext()) { + ConsumerRecord consumerRecord = iterator.next(); + int p = consumerRecord.partition(); + long offset = consumerRecord.offset(); + System.out.println("=====>key: " + consumerRecord.key() + "===>partition:" + p + "==offset:" + offset+"=="+consumerRecord.value()); + } + } + } + } +} diff --git a/kafka/src/main/java/com/dalong/kafka/producer/CustomProducer.java b/kafka/src/main/java/com/dalong/kafka/producer/CustomProducer.java new file mode 100644 index 000000000..71d472899 --- /dev/null +++ b/kafka/src/main/java/com/dalong/kafka/producer/CustomProducer.java @@ -0,0 +1,27 @@ +package com.dalong.kafka.producer; + +import org.apache.kafka.clients.producer.KafkaProducer; +import org.apache.kafka.clients.producer.Producer; +import org.apache.kafka.clients.producer.ProducerConfig; +import org.apache.kafka.clients.producer.ProducerRecord; +import org.apache.kafka.common.serialization.StringSerializer; + +import java.util.Properties; + +public class CustomProducer { + public static void main(String[] args) { + Properties properties=new Properties(); + properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.132:9092"); + properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); + properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); + // + properties.setProperty(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION,"5"); + properties.setProperty(ProducerConfig.SEND_BUFFER_CONFIG,"32768");//32K 改成-1 使用系统的默认值 + properties.setProperty(ProducerConfig.RECEIVE_BUFFER_CONFIG,"32768"); + KafkaProducer producer= new KafkaProducer(properties); + for (int i=0;i<50;i++) { + producer.send(new ProducerRecord<>("dalong1", "dalong2eeeeesdd额1"+i)); + } + producer.close(); + } +} diff --git a/kafka/src/main/java/com/dalong/kafka/producer/CustomProducerCallback.java b/kafka/src/main/java/com/dalong/kafka/producer/CustomProducerCallback.java new file mode 100644 index 000000000..2f97ffcd7 --- /dev/null +++ b/kafka/src/main/java/com/dalong/kafka/producer/CustomProducerCallback.java @@ -0,0 +1,26 @@ +package com.dalong.kafka.producer; + +import org.apache.kafka.clients.producer.*; +import org.apache.kafka.common.serialization.StringSerializer; + +import java.util.Properties; + +public class CustomProducerCallback { + public static void main(String[] args) { + Properties properties=new Properties(); + properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092"); + properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); + properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); + + KafkaProducer producer= new KafkaProducer(properties); + for (int i=0;i<60;i++) { + producer.send(new ProducerRecord("dalong1", i%6,"","对对对44=11144=55555" + i), new Callback() { + @Override + public void onCompletion(RecordMetadata recordMetadata, Exception e) { + System.out.println("=======主题:" + recordMetadata.topic() +"====分区:"+recordMetadata.partition()+ ", e = " + e); + } + }); + } + producer.close(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq.java b/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq.java new file mode 100644 index 000000000..a4768f3e2 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq.java @@ -0,0 +1,43 @@ +package com.dalong.rocketmq; + +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +public class ConsumerMq { + + public static void main(String[] args) throws MQClientException { +// 集群消費 + DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx2"); + consumer.setNamesrvAddr("192.168.37.133:9876"); + consumer.subscribe("PartOrder","*"); + consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费 +// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 同一个组里多个消费者都能消费到消息 + consumer.registerMessageListener(new MessageListenerConcurrently() { + @Override + public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println(Thread.currentThread().getName()+"========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags); + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq2.java b/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq2.java new file mode 100644 index 000000000..22f41d1e7 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq2.java @@ -0,0 +1,43 @@ +package com.dalong.rocketmq; + +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +public class ConsumerMq2 { + + public static void main(String[] args) throws MQClientException { +// 集群消費 + DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx2"); + consumer.setNamesrvAddr("192.168.37.133:9876"); + consumer.subscribe("wula","*"); +// consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费 + consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 + + consumer.registerMessageListener(new MessageListenerConcurrently() { + @Override + public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags); + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq3.java b/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq3.java new file mode 100644 index 000000000..0ccedee7a --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/ConsumerMq3.java @@ -0,0 +1,53 @@ +package com.dalong.rocketmq; + +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +public class ConsumerMq3 { + + public static void main(String[] args) throws MQClientException { +// 集群消費 + DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx6"); + consumer.setNamesrvAddr("192.168.37.133:9876;192.168.37.131:9876"); + consumer.subscribe("BALA2","*"); + consumer.setConsumeMessageBatchMaxSize(1); + consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费 +// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 同一个组里多个消费者都能消费到消息 + consumer.registerMessageListener(new MessageListenerConcurrently() { + @Override + public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println(System.currentTimeMillis()+":"+Thread.currentThread().getName()+"========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags); + + try { + if( mes.getKeys().equals("KEY==2")){ + int i=1/0; + } + } catch (Exception e) { + e.printStackTrace(); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + + } + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/ExRocketMQ.java b/kafka/src/main/java/com/dalong/rocketmq/ExRocketMQ.java new file mode 100644 index 000000000..5b1f58f61 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/ExRocketMQ.java @@ -0,0 +1,27 @@ +package com.dalong.rocketmq; + +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.common.message.MessageExt; + +import java.util.ArrayList; +import java.util.Arrays; + +public class ExRocketMQ { + public static void main(String[] args) throws Exception { + DefaultMQProducer producer = new DefaultMQProducer("ooxx5"); +// 设置NameServer的地址 + producer.setNamesrvAddr("192.168.37.133:9876;192.168.37.131:9876"); + // 启动Producer实例 + producer.start(); + ArrayList list=new ArrayList<>(); + for (int i=0;i<10;i++){ + list.add(new Message("BALA2","TAGA","KEY=="+i,("message=="+i).getBytes())); + } + SendResult sendResult= producer.send(list); + System.out.println("=====》" + sendResult); + producer.shutdown(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/SimpleRocketMQ.java b/kafka/src/main/java/com/dalong/rocketmq/SimpleRocketMQ.java new file mode 100644 index 000000000..1826a8f07 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/SimpleRocketMQ.java @@ -0,0 +1,212 @@ +package com.dalong.rocketmq; + +import com.dalong.rocketmq.bean.Order; +import com.sun.corba.se.pept.broker.Broker; +import org.apache.kafka.clients.producer.Producer; +import org.apache.rocketmq.client.consumer.DefaultLitePullConsumer; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQBrokerException; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.client.producer.MessageQueueSelector; +import org.apache.rocketmq.client.producer.SendCallback; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.message.MessageQueue; +import org.apache.rocketmq.common.protocol.body.ClusterInfo; +import org.apache.rocketmq.common.protocol.body.TopicList; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.apache.rocketmq.common.protocol.route.BrokerData; +import org.apache.rocketmq.common.protocol.route.TopicRouteData; +import org.apache.rocketmq.remoting.exception.RemotingException; +import org.apache.rocketmq.tools.admin.DefaultMQAdminExt; +import org.junit.Test; + +import java.util.*; + +public class SimpleRocketMQ { + @Test + public void producer() throws MQClientException, MQBrokerException, RemotingException, InterruptedException { + DefaultMQProducer producer = new DefaultMQProducer("ooxx"); +// 设置NameServer的地址 + producer.setNamesrvAddr("192.168.37.133:9876"); + // 启动Producer实例 + producer.start(); +// send5(producer); + MessageQueue messageQueue=new MessageQueue("wula","broker-a",0); + for (int i=0;i<20;i++){ + Message message=new Message(); + message.setTopic("wula"); + message.setTags("taga"); + message.setBody(("bodyooxx==="+i).getBytes()); + message.setWaitStoreMsgOK(true); + //第一种 +// send1(producer,message); +// // 第二种 +// send2(producer,message); +// //第三种 +// producer.sendOneway(message); + // 第四种 + send4(producer,message,messageQueue); + + } + + producer.shutdown(); + } + private void send1(DefaultMQProducer producer, Message message) throws MQBrokerException, RemotingException, InterruptedException, MQClientException { + SendResult sendResult= producer.send(message); + + System.out.println("=====>sendResult:"+sendResult); + } + + private void send2(DefaultMQProducer producer, Message message) throws RemotingException, InterruptedException, MQClientException { + producer.send(message,new SendCallback(){ + + @Override + public void onSuccess(SendResult sendResult) { + System.out.println("sendResult = " + sendResult); + } + + @Override + public void onException(Throwable throwable) { + + } + }); + } + private void send4(DefaultMQProducer producer, Message message, MessageQueue messageQueue) throws MQBrokerException, RemotingException, InterruptedException, MQClientException { + messageQueue=new MessageQueue("wula","broker-a",0); + SendResult sendResult=producer.send(message,messageQueue); + System.out.println(sendResult); + } + /** + * 发送部分顺序消息 + */ + private void send5(DefaultMQProducer producer) throws MQBrokerException, RemotingException, InterruptedException, MQClientException { + List list= buildOrders(); + for(int i=0;i list, Message message, Object o) { + System.out.println("====>list = " + list + ", message = " + message + ", o = " + o); + long id=(Long)o; + long index= id%list.size(); + return list.get((int)index); + } + }, list.get(i).getId()); + } + + } + private List buildOrders(){ + List orders=new ArrayList<>(); + Order order=new Order(); + order.setId(001); + order.setDes("创建"); + orders.add(order); + + order=new Order(); + order.setId(002); + order.setDes("创建"); + orders.add(order); + + order=new Order(); + order.setId(003); + order.setDes("创建"); + orders.add(order); + + order=new Order(); + order.setId(001); + order.setDes("付款"); + orders.add(order); + + + order=new Order(); + order.setId(001); + order.setDes("推送"); + orders.add(order); + + order=new Order(); + order.setId(002); + order.setDes("付款"); + orders.add(order); + + order=new Order(); + order.setId(003); + order.setDes("付款"); + orders.add(order); + + order=new Order(); + order.setId(002); + order.setDes("推送"); + orders.add(order); + + order=new Order(); + order.setId(003); + order.setDes("推送"); + orders.add(order); + + + return orders; + } + @Test + public void consumerPull() throws Exception { + DefaultLitePullConsumer consumer= new DefaultLitePullConsumer("consumer_xxoo"); + consumer.setNamesrvAddr("192.168.37.133:9876"); + consumer.start(); + Collection mqs= consumer.fetchMessageQueues("FilterTopic"); + mqs.forEach(mq->System.out.println("=====>"+mq)); + + } + @Test + public void consumerPush() throws MQClientException { + + + } + @Test + public void admin() throws Exception { + DefaultMQAdminExt adminExt= new DefaultMQAdminExt(); + adminExt.setNamesrvAddr("192.168.37.133:9876"); + adminExt.start(); + ClusterInfo clusterInfo= adminExt.examineBrokerClusterInfo(); + HashMap addr= clusterInfo.getBrokerAddrTable(); + Set> setss=addr.entrySet(); + Iterator> ITS= setss.iterator(); + Map.Entry stringBrokerEntry= ITS.next(); + System.out.println(stringBrokerEntry.getKey()+" "+stringBrokerEntry.getValue()); + TopicList topicList= adminExt.fetchAllTopicList(); + Set sets= topicList.getTopicList(); + sets.forEach(s->System.out.println("======>s:"+s)); + + System.out.println("=========>topiclist==============="); + TopicRouteData wula= adminExt.examineTopicRouteInfo("wula_3"); + System.out.println("=========>wula:"+wula); + + } + @Test + public void admin2() throws Exception { + DefaultMQAdminExt adminExt= new DefaultMQAdminExt(); + adminExt.setNamesrvAddr("192.168.37.133:9876;192.168.37.131:9876"); + adminExt.start(); + ClusterInfo clusterInfo = adminExt.examineBrokerClusterInfo(); + HashMap brokerAddrTable = clusterInfo.getBrokerAddrTable(); + Set> entries = brokerAddrTable.entrySet(); + Iterator> iterator = entries.iterator(); + while (iterator.hasNext()){ + Map.Entry next = iterator.next(); + System.out.println("====>:"+next.getKey()+":value:"+next.getValue()); + + } + + } + + +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/batch/BatchRocketConsumer.java b/kafka/src/main/java/com/dalong/rocketmq/batch/BatchRocketConsumer.java new file mode 100644 index 000000000..98befebae --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/batch/BatchRocketConsumer.java @@ -0,0 +1,41 @@ +package com.dalong.rocketmq.batch; + +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +public class BatchRocketConsumer { + public static void main(String[] args) throws MQClientException { + // 集群消費 + DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4"); + consumer.setNamesrvAddr("192.168.37.133:9876"); + consumer.subscribe("BatchTopic","*"); + consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费 +// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 + + consumer.registerMessageListener(new MessageListenerConcurrently() { + @Override + public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/batch/BatchRocketProducer.java b/kafka/src/main/java/com/dalong/rocketmq/batch/BatchRocketProducer.java new file mode 100644 index 000000000..bf8cd15e4 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/batch/BatchRocketProducer.java @@ -0,0 +1,25 @@ +package com.dalong.rocketmq.batch; + +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.common.message.Message; + +import java.util.ArrayList; +import java.util.List; + +public class BatchRocketProducer { + public static void main(String[] args) throws Exception { + DefaultMQProducer producer = new DefaultMQProducer("ooxxk"); +// 设置NameServer的地址 + producer.setNamesrvAddr("192.168.37.133:9876"); + // 启动Producer实例 + producer.start(); + int total=10; + List mesList=new ArrayList<>(); + for (int i=0;i list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/filter/FilterRocketProducer.java b/kafka/src/main/java/com/dalong/rocketmq/filter/FilterRocketProducer.java new file mode 100644 index 000000000..32ed1df1b --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/filter/FilterRocketProducer.java @@ -0,0 +1,28 @@ +package com.dalong.rocketmq.filter; + +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.common.message.Message; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class FilterRocketProducer { + public static void main(String[] args) throws Exception { + DefaultMQProducer producer = new DefaultMQProducer("ooxxz",false); +// 设置NameServer的地址 + producer.setNamesrvAddr("192.168.37.133:9876"); + // 启动Producer实例 + producer.start(); + int total=10; + List mesList=new ArrayList<>(); + for (int i=0;i msgs, ConsumeOrderlyContext context) { + context.setAutoCommit(true); + for(MessageExt msg:msgs){ + System.out.println(Thread.currentThread().getName()+"========>msgs = " + new String(msg.getBody()) + ", context = " + context); + } + try { + TimeUnit.MILLISECONDS.sleep(round.nextInt(300)); + } catch (InterruptedException e) { + e.printStackTrace(); + return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT; + } + return ConsumeOrderlyStatus.SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/order/OrderProducer.java b/kafka/src/main/java/com/dalong/rocketmq/order/OrderProducer.java new file mode 100644 index 000000000..29484d8c4 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/order/OrderProducer.java @@ -0,0 +1,105 @@ +package com.dalong.rocketmq.order; + +import com.dalong.rocketmq.bean.Order; +import org.apache.rocketmq.client.exception.MQBrokerException; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.client.producer.MessageQueueSelector; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.common.message.MessageQueue; +import org.apache.rocketmq.remoting.exception.RemotingException; + +import java.util.ArrayList; +import java.util.List; + +public class OrderProducer { + public static void main(String[] args) throws MQClientException, MQBrokerException, RemotingException, InterruptedException { + DefaultMQProducer producer = new DefaultMQProducer("ooxx"); +// 设置NameServer的地址 + producer.setNamesrvAddr("192.168.37.133:9876"); + // 启动Producer实例 + producer.start(); +// send5(producer); + MessageQueue messageQueue=new MessageQueue("wula","broker-a",0); + for (int i=0;i<20;i++){ +// Message message=new Message(); +// message.setTopic("wula"); +// message.setTags("taga"); +// message.setBody(("bodyooxx==="+i).getBytes()); +// message.setWaitStoreMsgOK(true); + List list= buildOrders(); + for(int j=0;i list, Message message, Object o) { + System.out.println("====>list = " + list + ", message = " + message + ", o = " + o); + long id=(Long)o; + long index= id%list.size(); + return list.get((int)index); + } + }, list.get(i).getId()); + } + + } + + producer.shutdown(); + } + private static List buildOrders(){ + List orders=new ArrayList<>(); + Order order=new Order(); + order.setId(001); + order.setDes("创建"); + orders.add(order); + + order=new Order(); + order.setId(002); + order.setDes("创建"); + orders.add(order); + + order=new Order(); + order.setId(003); + order.setDes("创建"); + orders.add(order); + + order=new Order(); + order.setId(001); + order.setDes("付款"); + orders.add(order); + + + order=new Order(); + order.setId(001); + order.setDes("推送"); + orders.add(order); + + order=new Order(); + order.setId(002); + order.setDes("付款"); + orders.add(order); + + order=new Order(); + order.setId(003); + order.setDes("付款"); + orders.add(order); + + order=new Order(); + order.setId(002); + order.setDes("推送"); + orders.add(order); + + order=new Order(); + order.setId(003); + order.setDes("推送"); + orders.add(order); + + + return orders; + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/schedule/ScheduleRocketConsumer.java b/kafka/src/main/java/com/dalong/rocketmq/schedule/ScheduleRocketConsumer.java new file mode 100644 index 000000000..65e878270 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/schedule/ScheduleRocketConsumer.java @@ -0,0 +1,41 @@ +package com.dalong.rocketmq.schedule; + +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +public class ScheduleRocketConsumer { + public static void main(String[] args) throws MQClientException { + // 集群消費 + DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4"); + consumer.setNamesrvAddr("192.168.37.133:9876"); + consumer.subscribe("ScTopic","*"); + consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费 +// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 + + consumer.registerMessageListener(new MessageListenerConcurrently() { + @Override + public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/schedule/ScheduleRocketProducer.java b/kafka/src/main/java/com/dalong/rocketmq/schedule/ScheduleRocketProducer.java new file mode 100644 index 000000000..7d99cefdb --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/schedule/ScheduleRocketProducer.java @@ -0,0 +1,28 @@ +package com.dalong.rocketmq.schedule; + +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.common.message.Message; + +/** + * 延时消息发送 + */ +public class ScheduleRocketProducer { + public static void main(String[] args) throws Exception { + DefaultMQProducer producer = new DefaultMQProducer("ooxxk"); +// 设置NameServer的地址 + producer.setNamesrvAddr("192.168.37.133:9876"); + // 启动Producer实例 + producer.start(); + int total=10; + for (int i=0;i执行executeLocalTransaction:"+s); + return LocalTransactionState.UNKNOW; + } + + @Override + public LocalTransactionState checkLocalTransaction(MessageExt msg) { + System.out.println("=======>检查checkLocalTransaction"); + + return LocalTransactionState.COMMIT_MESSAGE; + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionListenerImpl2.java b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionListenerImpl2.java new file mode 100644 index 000000000..814a92be0 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionListenerImpl2.java @@ -0,0 +1,21 @@ +package com.dalong.rocketmq.transaction; + +import org.apache.rocketmq.client.producer.LocalTransactionState; +import org.apache.rocketmq.client.producer.TransactionListener; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.common.message.MessageExt; + +public class TransactionListenerImpl2 implements TransactionListener { + @Override + public LocalTransactionState executeLocalTransaction(Message msg, Object arg) { + System.out.println("=======>执行2executeLocalTransaction"); + return LocalTransactionState.COMMIT_MESSAGE; + } + + @Override + public LocalTransactionState checkLocalTransaction(MessageExt msg) { + System.out.println("=======>检查2checkLocalTransaction"); + + return LocalTransactionState.COMMIT_MESSAGE; + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionProducer.java b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionProducer.java new file mode 100644 index 000000000..6f18a705c --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionProducer.java @@ -0,0 +1,53 @@ +package com.dalong.rocketmq.transaction; + +import ch.qos.logback.core.util.TimeUtil; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.TransactionListener; +import org.apache.rocketmq.client.producer.TransactionMQProducer; +import org.apache.rocketmq.common.message.Message; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.TimerTask; +import java.util.concurrent.*; + +public class TransactionProducer { + public static void main(String[] args) throws MQClientException { + TransactionListener transactionListener=new TransactionListenerImpl(); + + TransactionMQProducer producer=new TransactionMQProducer("TransactionMQProducer3"); +// producer.setNamesrvAddr("192.168.37.133:9876"); + producer.setNamesrvAddr("192.168.37.131:9876;192.168.37.133:9876"); + + ExecutorService executorService=new ThreadPoolExecutor(2,5,100,TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(16),new ThreadFactory(){ + + @Override + public Thread newThread(Runnable r) { + Thread thread=new Thread(r); + thread.setName("=====>check-thread"); + return thread; + } + }); + producer.setExecutorService(executorService); + producer.setTransactionListener(transactionListener); + // 启动Producer实例 + producer.start(); + + Message message=new Message("TransactionProducer2"," A转钱B to==1》".getBytes()); + SendResult sendResult= producer.sendMessageInTransaction(message,null); + SimpleDateFormat simpleDateFormat=new SimpleDateFormat(); + System.out.println("===>sendResult:" + sendResult.getSendStatus()+":"+simpleDateFormat.format(new Date())); + // 让主线程等待,以便执行事务状态回查 + for (int i = 0; i < 10000; i++) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + producer.shutdown(); + + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionProducer2.java b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionProducer2.java new file mode 100644 index 000000000..be9c7f55b --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionProducer2.java @@ -0,0 +1,49 @@ +package com.dalong.rocketmq.transaction; + +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.TransactionListener; +import org.apache.rocketmq.client.producer.TransactionMQProducer; +import org.apache.rocketmq.common.message.Message; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.*; + +public class TransactionProducer2 { + public static void main(String[] args) throws MQClientException { + TransactionListener transactionListener=new TransactionListenerImpl2(); + + TransactionMQProducer producer=new TransactionMQProducer("TransactionMQProducer"); + producer.setNamesrvAddr("192.168.37.133:9876"); + + ExecutorService executorService=new ThreadPoolExecutor(2,5,100,TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(16),new ThreadFactory(){ + + @Override + public Thread newThread(Runnable r) { + Thread thread=new Thread(r); + thread.setName("=====>check-thread"); + return thread; + } + }); + producer.setExecutorService(executorService); + producer.setTransactionListener(transactionListener); + // 启动Producer实例 + producer.start(); + + Message message=new Message("TransactionProducer"," A转钱B to==2》".getBytes()); + SendResult sendResult= producer.sendMessageInTransaction(message,null); + SimpleDateFormat simpleDateFormat=new SimpleDateFormat(); + System.out.println("===>sendResult:" + sendResult.getSendStatus()+simpleDateFormat.format(new Date())); + // 让主线程等待,以便执行事务状态回查 + for (int i = 0; i < 10000; i++) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + producer.shutdown(); + + } +} diff --git a/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionRocketConsumer.java b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionRocketConsumer.java new file mode 100644 index 000000000..c2acc0741 --- /dev/null +++ b/kafka/src/main/java/com/dalong/rocketmq/transaction/TransactionRocketConsumer.java @@ -0,0 +1,41 @@ +package com.dalong.rocketmq.transaction; + +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +public class TransactionRocketConsumer { + public static void main(String[] args) throws MQClientException { + // 集群消費 + DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4"); + consumer.setNamesrvAddr("192.168.37.133:9876"); + consumer.subscribe("TransactionProducer","*"); + consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费 +// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 + + consumer.registerMessageListener(new MessageListenerConcurrently() { + @Override + public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { + for(MessageExt mes:list){ + String topic= mes.getTopic(); + try { + String msgbody=new String(mes.getBody(),"UTF-8"); + String tags=mes.getTags(); + System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + consumer.start(); + } +} diff --git a/msb-mall/mall-commons/pom.xml b/msb-mall/mall-commons/pom.xml new file mode 100644 index 000000000..a8d806e03 --- /dev/null +++ b/msb-mall/mall-commons/pom.xml @@ -0,0 +1,71 @@ + + + + msb-mall + com.msb.mall + 1.0-SNAPSHOT + + 4.0.0 + + mall-commons + + + 8 + 8 + + + + + org.projectlombok + lombok + 1.18.24 + + + com.baomidou + mybatis-plus + 3.4.3.4 + + + org.apache.httpcomponents + httpcore + 4.4.14 + + + javax.validation + validation-api + 1.1.0.Final + + + commons-lang + commons-lang + 2.6 + + + com.baomidou + mybatis-plus-boot-starter + 3.3.1 + + + mysql + mysql-connector-java + 8.0.28 + + + com.alibaba.cloud + spring-cloud-starter-alibaba-seata + + + + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + 2.2.8.RELEASE + pom + import + + + + \ No newline at end of file diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/exception/RRException.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/exception/RRException.java new file mode 100644 index 000000000..275c6dde3 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/exception/RRException.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.exception; + +/** + * 自定义异常 + * + * @author Mark sunlightcs@gmail.com + */ +public class RRException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private String msg; + private int code = 500; + + public RRException(String msg) { + super(msg); + this.msg = msg; + } + + public RRException(String msg, Throwable e) { + super(msg, e); + this.msg = msg; + } + + public RRException(String msg, int code) { + super(msg); + this.msg = msg; + this.code = code; + } + + public RRException(String msg, int code, Throwable e) { + super(msg, e); + this.msg = msg; + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/exception/RRExceptionHandler.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/exception/RRExceptionHandler.java new file mode 100644 index 000000000..7472c1d86 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/exception/RRExceptionHandler.java @@ -0,0 +1,64 @@ +///** +// * Copyright (c) 2016-2019 人人开源 All rights reserved. +// * +// * https://www.renren.io +// * +// * 版权所有,侵权必究! +// */ +// +//package com.msb.mall.commons.exception; +// +//import io.renren.common.utils.R; +//import org.apache.shiro.authz.AuthorizationException; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.dao.DuplicateKeyException; +//import org.springframework.web.bind.annotation.ExceptionHandler; +//import org.springframework.web.bind.annotation.RestControllerAdvice; +//import org.springframework.web.servlet.NoHandlerFoundException; +// +///** +// * 异常处理器 +// * +// * @author Mark sunlightcs@gmail.com +// */ +//@RestControllerAdvice +//public class RRExceptionHandler { +// private Logger logger = LoggerFactory.getLogger(getClass()); +// +// /** +// * 处理自定义异常 +// */ +// @ExceptionHandler(RRException.class) +// public R handleRRException(RRException e){ +// R r = new R(); +// r.put("code", e.getCode()); +// r.put("msg", e.getMessage()); +// +// return r; +// } +// +// @ExceptionHandler(NoHandlerFoundException.class) +// public R handlerNoFoundException(Exception e) { +// logger.error(e.getMessage(), e); +// return R.error(404, "路径不存在,请检查路径是否正确"); +// } +// +// @ExceptionHandler(DuplicateKeyException.class) +// public R handleDuplicateKeyException(DuplicateKeyException e){ +// logger.error(e.getMessage(), e); +// return R.error("数据库中已存在该记录"); +// } +// +// @ExceptionHandler(AuthorizationException.class) +// public R handleAuthorizationException(AuthorizationException e){ +// logger.error(e.getMessage(), e); +// return R.error("没有权限,请联系管理员授权"); +// } +// +// @ExceptionHandler(Exception.class) +// public R handleException(Exception e){ +// logger.error(e.getMessage(), e); +// return R.error(); +// } +//} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/Constant.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/Constant.java new file mode 100644 index 000000000..64cc7f96e --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/Constant.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.util; + + +import com.msb.mall.commons.validator.group.AliyunGroup; +import com.msb.mall.commons.validator.group.QcloudGroup; +import com.msb.mall.commons.validator.group.QiniuGroup; + +import java.util.Optional; +import java.util.stream.Stream; + +/** + * 常量 + * + * @author Mark sunlightcs@gmail.com + */ +public class Constant { + /** + * 超级管理员ID + */ + public static final int SUPER_ADMIN = 1; + /** + * 当前页码 + */ + public static final String PAGE = "page"; + /** + * 每页显示记录数 + */ + public static final String LIMIT = "limit"; + /** + * 排序字段 + */ + public static final String ORDER_FIELD = "sidx"; + /** + * 排序方式 + */ + public static final String ORDER = "order"; + /** + * 升序 + */ + public static final String ASC = "asc"; + + /** + * 菜单类型 + * + * @author chenshun + * @email sunlightcs@gmail.com + * @date 2016年11月15日 下午1:24:29 + */ + public enum MenuType { + /** + * 目录 + */ + CATALOG(0), + /** + * 菜单 + */ + MENU(1), + /** + * 按钮 + */ + BUTTON(2); + + private int value; + + MenuType(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 定时任务状态 + * + * @author chenshun + * @email sunlightcs@gmail.com + * @date 2016年12月3日 上午12:07:22 + */ + public enum ScheduleStatus { + /** + * 正常 + */ + NORMAL(0), + /** + * 暂停 + */ + PAUSE(1); + + private int value; + + ScheduleStatus(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 云服务商 + */ + public enum CloudService { + /** + * 七牛云 + */ + QINIU(1, QiniuGroup.class), + /** + * 阿里云 + */ + ALIYUN(2, AliyunGroup.class), + /** + * 腾讯云 + */ + QCLOUD(3, QcloudGroup.class); + + private int value; + + private Class validatorGroupClass; + + CloudService(int value, Class validatorGroupClass) { + this.value = value; + this.validatorGroupClass = validatorGroupClass; + } + + public int getValue() { + return value; + } + + public Class getValidatorGroupClass() { + return this.validatorGroupClass; + } + + public static CloudService getByValue(Integer value) { + Optional first = Stream.of(CloudService.values()).filter(cs -> value.equals(cs.value)).findFirst(); + if (!first.isPresent()) { + throw new IllegalArgumentException("非法的枚举值:" + value); + } + return first.get(); + } + } + +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/PageUtils.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/PageUtils.java new file mode 100644 index 000000000..bdb14b2a1 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/PageUtils.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.util; + +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class PageUtils implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 总记录数 + */ + private int totalCount; + /** + * 每页记录数 + */ + private int pageSize; + /** + * 总页数 + */ + private int totalPage; + /** + * 当前页数 + */ + private int currPage; + /** + * 列表数据 + */ + private List list; + + /** + * 分页 + * @param list 列表数据 + * @param totalCount 总记录数 + * @param pageSize 每页记录数 + * @param currPage 当前页数 + */ + public PageUtils(List list, int totalCount, int pageSize, int currPage) { + this.list = list; + this.totalCount = totalCount; + this.pageSize = pageSize; + this.currPage = currPage; + this.totalPage = (int)Math.ceil((double)totalCount/pageSize); + } + + /** + * 分页 + */ + public PageUtils(IPage page) { + this.list = page.getRecords(); + this.totalCount = (int)page.getTotal(); + this.pageSize = (int)page.getSize(); + this.currPage = (int)page.getCurrent(); + this.totalPage = (int)page.getPages(); + } + + public int getTotalCount() { + return totalCount; + } + + public void setTotalCount(int totalCount) { + this.totalCount = totalCount; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getTotalPage() { + return totalPage; + } + + public void setTotalPage(int totalPage) { + this.totalPage = totalPage; + } + + public int getCurrPage() { + return currPage; + } + + public void setCurrPage(int currPage) { + this.currPage = currPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/Query.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/Query.java new file mode 100644 index 000000000..ab16b7c9f --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/Query.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.util; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.msb.mall.commons.xss.SQLFilter; +import org.apache.commons.lang.StringUtils; + +import java.util.Map; + +/** + * 查询参数 + * + * @author Mark sunlightcs@gmail.com + */ +public class Query { + + public IPage getPage(Map params) { + return this.getPage(params, null, false); + } + + public IPage getPage(Map params, String defaultOrderField, boolean isAsc) { + //分页参数 + long curPage = 1; + long limit = 10; + + if(params.get(Constant.PAGE) != null){ + curPage = Long.parseLong((String)params.get(Constant.PAGE)); + } + if(params.get(Constant.LIMIT) != null){ + limit = Long.parseLong((String)params.get(Constant.LIMIT)); + } + + //分页对象 + Page page = new Page<>(curPage, limit); + + //分页参数 + params.put(Constant.PAGE, page); + + //排序字段 + //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) + String orderField = SQLFilter.sqlInject((String)params.get(Constant.ORDER_FIELD)); + String order = (String)params.get(Constant.ORDER); + + + //前端字段排序 + if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){ + if(Constant.ASC.equalsIgnoreCase(order)) { + return page.addOrder(OrderItem.asc(orderField)); + }else { + return page.addOrder(OrderItem.desc(orderField)); + } + } + + //没有排序字段,则不排序 + if(StringUtils.isBlank(defaultOrderField)){ + return page; + } + + //默认排序 + if(isAsc) { + page.addOrder(OrderItem.asc(defaultOrderField)); + }else { + page.addOrder(OrderItem.desc(defaultOrderField)); + } + + return page; + } +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/R.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/R.java new file mode 100644 index 000000000..186f52f59 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/util/R.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.util; + +import org.apache.http.HttpStatus; + +import java.util.HashMap; +import java.util.Map; + +/** + * 返回数据 + * + * @author Mark sunlightcs@gmail.com + */ +public class R extends HashMap { + private static final long serialVersionUID = 1L; + + public R() { + put("code", 0); + put("msg", "success"); + } + + public static R error() { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员"); + } + + public static R error(String msg) { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); + } + + public static R error(int code, String msg) { + R r = new R(); + r.put("code", code); + r.put("msg", msg); + return r; + } + + public static R ok(String msg) { + R r = new R(); + r.put("msg", msg); + return r; + } + + public static R ok(Map map) { + R r = new R(); + r.putAll(map); + return r; + } + + public static R ok() { + return new R(); + } + + public R put(String key, Object value) { + super.put(key, value); + return this; + } +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/Assert.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/Assert.java new file mode 100644 index 000000000..dbfad0c6f --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/Assert.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator; + +import com.msb.mall.commons.exception.RRException; +import org.apache.commons.lang.StringUtils; + +/** + * 数据校验 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class Assert { + + public static void isBlank(String str, String message) { + if (StringUtils.isBlank(str)) { + throw new RRException(message); + } + } + + public static void isNull(Object object, String message) { + if (object == null) { + throw new RRException(message); + } + } +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/ValidatorUtils.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/ValidatorUtils.java new file mode 100644 index 000000000..27bbe05e1 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/ValidatorUtils.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator; + + + +import com.msb.mall.commons.exception.RRException; +import com.msb.mall.commons.util.Constant; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import java.util.Set; + +/** + * hibernate-validator校验工具类 + * + * 参考文档:http://docs.jboss.org/hibernate/validator/5.4/reference/en-US/html_single/ + * + * @author Mark sunlightcs@gmail.com + */ +public class ValidatorUtils { + private static Validator validator; + + static { + validator = Validation.buildDefaultValidatorFactory().getValidator(); + } + + /** + * 校验对象 + * @param object 待校验对象 + * @param groups 待校验的组 + * @throws RRException 校验不通过,则报RRException异常 + */ + public static void validateEntity(Object object, Class... groups) + throws RRException { + Set> constraintViolations = validator.validate(object, groups); + if (!constraintViolations.isEmpty()) { + StringBuilder msg = new StringBuilder(); + for (ConstraintViolation constraint : constraintViolations) { + msg.append(constraint.getMessage()).append("
"); + } + throw new RRException(msg.toString()); + } + } + + public static void validateEntity(Object object, Constant.CloudService type) { + validateEntity(object, type.getValidatorGroupClass()); + } +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/AddGroup.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/AddGroup.java new file mode 100644 index 000000000..1614d8839 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/AddGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator.group; + +/** + * 新增数据 Group + * + * @author Mark sunlightcs@gmail.com + */ +public interface AddGroup { +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/AliyunGroup.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/AliyunGroup.java new file mode 100644 index 000000000..15ccbe7fe --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/AliyunGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator.group; + +/** + * 阿里云 + * + * @author Mark sunlightcs@gmail.com + */ +public interface AliyunGroup { +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/Group.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/Group.java new file mode 100644 index 000000000..7e2f7fc51 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/Group.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator.group; + +import javax.validation.GroupSequence; + +/** + * 定义校验顺序,如果AddGroup组失败,则UpdateGroup组不会再校验 + * + * @author Mark sunlightcs@gmail.com + */ +@GroupSequence({AddGroup.class, UpdateGroup.class}) +public interface Group { + +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/QcloudGroup.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/QcloudGroup.java new file mode 100644 index 000000000..0e651d28b --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/QcloudGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator.group; + +/** + * 腾讯云 + * + * @author Mark sunlightcs@gmail.com + */ +public interface QcloudGroup { +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/QiniuGroup.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/QiniuGroup.java new file mode 100644 index 000000000..ffa459627 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/QiniuGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator.group; + +/** + * 七牛 + * + * @author Mark sunlightcs@gmail.com + */ +public interface QiniuGroup { +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/UpdateGroup.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/UpdateGroup.java new file mode 100644 index 000000000..dab8f2aa8 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/validator/group/UpdateGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.validator.group; + +/** + * 更新数据 Group + * + * @author Mark sunlightcs@gmail.com + */ + +public interface UpdateGroup { + +} diff --git a/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/xss/SQLFilter.java b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/xss/SQLFilter.java new file mode 100644 index 000000000..1453f74f0 --- /dev/null +++ b/msb-mall/mall-commons/src/main/java/com/msb/mall/commons/xss/SQLFilter.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.msb.mall.commons.xss; + +import com.msb.mall.commons.exception.RRException; +import org.apache.commons.lang.StringUtils; + +/** + * SQL过滤 + * + * @author Mark sunlightcs@gmail.com + */ +public class SQLFilter { + + /** + * SQL注入过滤 + * @param str 待验证的字符串 + */ + public static String sqlInject(String str){ + if(StringUtils.isBlank(str)){ + return null; + } + //去掉'|"|;|\字符 + str = StringUtils.replace(str, "'", ""); + str = StringUtils.replace(str, "\"", ""); + str = StringUtils.replace(str, ";", ""); + str = StringUtils.replace(str, "\\", ""); + + //转换成小写 + str = str.toLowerCase(); + + //非法字符 + String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; + + //判断是否包含非法字符 + for(String keyword : keywords){ + if(str.indexOf(keyword) != -1){ + throw new RRException("包含非法字符"); + } + } + + return str; + } +} diff --git a/msb-mall/mall-coupon/.gitignore b/msb-mall/mall-coupon/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-coupon/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-coupon/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-coupon/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-coupon/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-coupon/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-coupon/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-coupon/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-coupon/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-coupon/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-coupon/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-coupon/README.md b/msb-mall/mall-coupon/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-coupon/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-coupon/mvnw b/msb-mall/mall-coupon/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-coupon/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-coupon/mvnw.cmd b/msb-mall/mall-coupon/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-coupon/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-coupon/pom.xml b/msb-mall/mall-coupon/pom.xml new file mode 100644 index 000000000..9205a2463 --- /dev/null +++ b/msb-mall/mall-coupon/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + com.msb.mall + mall-coupon + 0.0.1-SNAPSHOT + mall-coupon + mall-coupon + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.coupon.MallCouponApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/MallCouponApplication.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/MallCouponApplication.java new file mode 100644 index 000000000..526cdad44 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/MallCouponApplication.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +@MapperScan("com.msb.mall.coupon.dao") +public class MallCouponApplication { + + public static void main(String[] args) { + SpringApplication.run(MallCouponApplication.class, args); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponController.java new file mode 100644 index 000000000..5530c9e90 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.CouponEntity; +import com.msb.mall.coupon.service.CouponService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 优惠券信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/coupon") +public class CouponController { + @Autowired + private CouponService couponService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = couponService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + CouponEntity coupon = couponService.getById(id); + + return R.ok().put("coupon", coupon); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CouponEntity coupon){ + couponService.save(coupon); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CouponEntity coupon){ + couponService.updateById(coupon); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + couponService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponHistoryController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponHistoryController.java new file mode 100644 index 000000000..cbeb8fab4 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponHistoryController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.CouponHistoryEntity; +import com.msb.mall.coupon.service.CouponHistoryService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 优惠券领取历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/couponhistory") +public class CouponHistoryController { + @Autowired + private CouponHistoryService couponHistoryService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = couponHistoryService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + CouponHistoryEntity couponHistory = couponHistoryService.getById(id); + + return R.ok().put("couponHistory", couponHistory); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CouponHistoryEntity couponHistory){ + couponHistoryService.save(couponHistory); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CouponHistoryEntity couponHistory){ + couponHistoryService.updateById(couponHistory); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + couponHistoryService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponSpuCategoryRelationController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponSpuCategoryRelationController.java new file mode 100644 index 000000000..69046f80a --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponSpuCategoryRelationController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.CouponSpuCategoryRelationEntity; +import com.msb.mall.coupon.service.CouponSpuCategoryRelationService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 优惠券分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/couponspucategoryrelation") +public class CouponSpuCategoryRelationController { + @Autowired + private CouponSpuCategoryRelationService couponSpuCategoryRelationService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = couponSpuCategoryRelationService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + CouponSpuCategoryRelationEntity couponSpuCategoryRelation = couponSpuCategoryRelationService.getById(id); + + return R.ok().put("couponSpuCategoryRelation", couponSpuCategoryRelation); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CouponSpuCategoryRelationEntity couponSpuCategoryRelation){ + couponSpuCategoryRelationService.save(couponSpuCategoryRelation); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CouponSpuCategoryRelationEntity couponSpuCategoryRelation){ + couponSpuCategoryRelationService.updateById(couponSpuCategoryRelation); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + couponSpuCategoryRelationService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponSpuRelationController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponSpuRelationController.java new file mode 100644 index 000000000..62a504e3b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/CouponSpuRelationController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.CouponSpuRelationEntity; +import com.msb.mall.coupon.service.CouponSpuRelationService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 优惠券与产品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/couponspurelation") +public class CouponSpuRelationController { + @Autowired + private CouponSpuRelationService couponSpuRelationService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = couponSpuRelationService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + CouponSpuRelationEntity couponSpuRelation = couponSpuRelationService.getById(id); + + return R.ok().put("couponSpuRelation", couponSpuRelation); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CouponSpuRelationEntity couponSpuRelation){ + couponSpuRelationService.save(couponSpuRelation); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CouponSpuRelationEntity couponSpuRelation){ + couponSpuRelationService.updateById(couponSpuRelation); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + couponSpuRelationService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeAdvController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeAdvController.java new file mode 100644 index 000000000..2a2596f79 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeAdvController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.HomeAdvEntity; +import com.msb.mall.coupon.service.HomeAdvService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 首页轮播广告 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/homeadv") +public class HomeAdvController { + @Autowired + private HomeAdvService homeAdvService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = homeAdvService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + HomeAdvEntity homeAdv = homeAdvService.getById(id); + + return R.ok().put("homeAdv", homeAdv); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody HomeAdvEntity homeAdv){ + homeAdvService.save(homeAdv); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody HomeAdvEntity homeAdv){ + homeAdvService.updateById(homeAdv); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + homeAdvService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeSubjectController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeSubjectController.java new file mode 100644 index 000000000..83f833959 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeSubjectController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.HomeSubjectEntity; +import com.msb.mall.coupon.service.HomeSubjectService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/homesubject") +public class HomeSubjectController { + @Autowired + private HomeSubjectService homeSubjectService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = homeSubjectService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + HomeSubjectEntity homeSubject = homeSubjectService.getById(id); + + return R.ok().put("homeSubject", homeSubject); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody HomeSubjectEntity homeSubject){ + homeSubjectService.save(homeSubject); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody HomeSubjectEntity homeSubject){ + homeSubjectService.updateById(homeSubject); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + homeSubjectService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeSubjectSpuController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeSubjectSpuController.java new file mode 100644 index 000000000..06a0e85f3 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/HomeSubjectSpuController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.HomeSubjectSpuEntity; +import com.msb.mall.coupon.service.HomeSubjectSpuService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 专题商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/homesubjectspu") +public class HomeSubjectSpuController { + @Autowired + private HomeSubjectSpuService homeSubjectSpuService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = homeSubjectSpuService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + HomeSubjectSpuEntity homeSubjectSpu = homeSubjectSpuService.getById(id); + + return R.ok().put("homeSubjectSpu", homeSubjectSpu); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody HomeSubjectSpuEntity homeSubjectSpu){ + homeSubjectSpuService.save(homeSubjectSpu); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody HomeSubjectSpuEntity homeSubjectSpu){ + homeSubjectSpuService.updateById(homeSubjectSpu); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + homeSubjectSpuService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/MemberPriceController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/MemberPriceController.java new file mode 100644 index 000000000..5d972c020 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/MemberPriceController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.MemberPriceEntity; +import com.msb.mall.coupon.service.MemberPriceService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品会员价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/memberprice") +public class MemberPriceController { + @Autowired + private MemberPriceService memberPriceService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberPriceService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberPriceEntity memberPrice = memberPriceService.getById(id); + + return R.ok().put("memberPrice", memberPrice); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberPriceEntity memberPrice){ + memberPriceService.save(memberPrice); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberPriceEntity memberPrice){ + memberPriceService.updateById(memberPrice); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberPriceService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillPromotionController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillPromotionController.java new file mode 100644 index 000000000..1c1732cc5 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillPromotionController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SeckillPromotionEntity; +import com.msb.mall.coupon.service.SeckillPromotionService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 秒杀活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/seckillpromotion") +public class SeckillPromotionController { + @Autowired + private SeckillPromotionService seckillPromotionService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = seckillPromotionService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SeckillPromotionEntity seckillPromotion = seckillPromotionService.getById(id); + + return R.ok().put("seckillPromotion", seckillPromotion); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SeckillPromotionEntity seckillPromotion){ + seckillPromotionService.save(seckillPromotion); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SeckillPromotionEntity seckillPromotion){ + seckillPromotionService.updateById(seckillPromotion); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + seckillPromotionService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSessionController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSessionController.java new file mode 100644 index 000000000..f5c43c2a5 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSessionController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SeckillSessionEntity; +import com.msb.mall.coupon.service.SeckillSessionService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 秒杀活动场次 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/seckillsession") +public class SeckillSessionController { + @Autowired + private SeckillSessionService seckillSessionService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = seckillSessionService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SeckillSessionEntity seckillSession = seckillSessionService.getById(id); + + return R.ok().put("seckillSession", seckillSession); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SeckillSessionEntity seckillSession){ + seckillSessionService.save(seckillSession); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SeckillSessionEntity seckillSession){ + seckillSessionService.updateById(seckillSession); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + seckillSessionService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSkuNoticeController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSkuNoticeController.java new file mode 100644 index 000000000..f5ee4a6ac --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSkuNoticeController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SeckillSkuNoticeEntity; +import com.msb.mall.coupon.service.SeckillSkuNoticeService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 秒杀商品通知订阅 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/seckillskunotice") +public class SeckillSkuNoticeController { + @Autowired + private SeckillSkuNoticeService seckillSkuNoticeService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = seckillSkuNoticeService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SeckillSkuNoticeEntity seckillSkuNotice = seckillSkuNoticeService.getById(id); + + return R.ok().put("seckillSkuNotice", seckillSkuNotice); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SeckillSkuNoticeEntity seckillSkuNotice){ + seckillSkuNoticeService.save(seckillSkuNotice); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SeckillSkuNoticeEntity seckillSkuNotice){ + seckillSkuNoticeService.updateById(seckillSkuNotice); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + seckillSkuNoticeService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSkuRelationController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSkuRelationController.java new file mode 100644 index 000000000..b21ea5ae5 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SeckillSkuRelationController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SeckillSkuRelationEntity; +import com.msb.mall.coupon.service.SeckillSkuRelationService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 秒杀活动商品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/seckillskurelation") +public class SeckillSkuRelationController { + @Autowired + private SeckillSkuRelationService seckillSkuRelationService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = seckillSkuRelationService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SeckillSkuRelationEntity seckillSkuRelation = seckillSkuRelationService.getById(id); + + return R.ok().put("seckillSkuRelation", seckillSkuRelation); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SeckillSkuRelationEntity seckillSkuRelation){ + seckillSkuRelationService.save(seckillSkuRelation); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SeckillSkuRelationEntity seckillSkuRelation){ + seckillSkuRelationService.updateById(seckillSkuRelation); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + seckillSkuRelationService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SkuFullReductionController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SkuFullReductionController.java new file mode 100644 index 000000000..9aa66b9b4 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SkuFullReductionController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SkuFullReductionEntity; +import com.msb.mall.coupon.service.SkuFullReductionService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品满减信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/skufullreduction") +public class SkuFullReductionController { + @Autowired + private SkuFullReductionService skuFullReductionService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = skuFullReductionService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SkuFullReductionEntity skuFullReduction = skuFullReductionService.getById(id); + + return R.ok().put("skuFullReduction", skuFullReduction); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SkuFullReductionEntity skuFullReduction){ + skuFullReductionService.save(skuFullReduction); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SkuFullReductionEntity skuFullReduction){ + skuFullReductionService.updateById(skuFullReduction); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + skuFullReductionService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SkuLadderController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SkuLadderController.java new file mode 100644 index 000000000..40a16f4c3 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SkuLadderController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SkuLadderEntity; +import com.msb.mall.coupon.service.SkuLadderService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品阶梯价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/skuladder") +public class SkuLadderController { + @Autowired + private SkuLadderService skuLadderService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = skuLadderService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SkuLadderEntity skuLadder = skuLadderService.getById(id); + + return R.ok().put("skuLadder", skuLadder); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SkuLadderEntity skuLadder){ + skuLadderService.save(skuLadder); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SkuLadderEntity skuLadder){ + skuLadderService.updateById(skuLadder); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + skuLadderService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SpuBoundsController.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SpuBoundsController.java new file mode 100644 index 000000000..cfdf861cf --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/controller/SpuBoundsController.java @@ -0,0 +1,84 @@ +package com.msb.mall.coupon.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.coupon.entity.SpuBoundsEntity; +import com.msb.mall.coupon.service.SpuBoundsService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品spu积分设置 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@RestController +@RequestMapping("coupon/spubounds") +public class SpuBoundsController { + @Autowired + private SpuBoundsService spuBoundsService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = spuBoundsService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SpuBoundsEntity spuBounds = spuBoundsService.getById(id); + + return R.ok().put("spuBounds", spuBounds); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SpuBoundsEntity spuBounds){ + spuBoundsService.save(spuBounds); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SpuBoundsEntity spuBounds){ + spuBoundsService.updateById(spuBounds); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + spuBoundsService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponDao.java new file mode 100644 index 000000000..b64cccfc8 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.CouponEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 优惠券信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface CouponDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponHistoryDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponHistoryDao.java new file mode 100644 index 000000000..52737ca38 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponHistoryDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.CouponHistoryEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 优惠券领取历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface CouponHistoryDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponSpuCategoryRelationDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponSpuCategoryRelationDao.java new file mode 100644 index 000000000..0ade07737 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponSpuCategoryRelationDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.CouponSpuCategoryRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 优惠券分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface CouponSpuCategoryRelationDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponSpuRelationDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponSpuRelationDao.java new file mode 100644 index 000000000..d174f4f0e --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/CouponSpuRelationDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.CouponSpuRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 优惠券与产品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface CouponSpuRelationDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeAdvDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeAdvDao.java new file mode 100644 index 000000000..9264af956 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeAdvDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.HomeAdvEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 首页轮播广告 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface HomeAdvDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeSubjectDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeSubjectDao.java new file mode 100644 index 000000000..e4e747870 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeSubjectDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.HomeSubjectEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface HomeSubjectDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeSubjectSpuDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeSubjectSpuDao.java new file mode 100644 index 000000000..a10b435a5 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/HomeSubjectSpuDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.HomeSubjectSpuEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 专题商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface HomeSubjectSpuDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/MemberPriceDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/MemberPriceDao.java new file mode 100644 index 000000000..b74953f75 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/MemberPriceDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.MemberPriceEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品会员价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface MemberPriceDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillPromotionDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillPromotionDao.java new file mode 100644 index 000000000..1f30fdc79 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillPromotionDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SeckillPromotionEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 秒杀活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SeckillPromotionDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSessionDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSessionDao.java new file mode 100644 index 000000000..17d4e05af --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSessionDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SeckillSessionEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 秒杀活动场次 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SeckillSessionDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSkuNoticeDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSkuNoticeDao.java new file mode 100644 index 000000000..d9ec924b5 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSkuNoticeDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SeckillSkuNoticeEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 秒杀商品通知订阅 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SeckillSkuNoticeDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSkuRelationDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSkuRelationDao.java new file mode 100644 index 000000000..b91527671 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SeckillSkuRelationDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SeckillSkuRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 秒杀活动商品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SeckillSkuRelationDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SkuFullReductionDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SkuFullReductionDao.java new file mode 100644 index 000000000..293c838e3 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SkuFullReductionDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SkuFullReductionEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品满减信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SkuFullReductionDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SkuLadderDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SkuLadderDao.java new file mode 100644 index 000000000..e64f6cb8f --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SkuLadderDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SkuLadderEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品阶梯价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SkuLadderDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SpuBoundsDao.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SpuBoundsDao.java new file mode 100644 index 000000000..1b8ceb027 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/dao/SpuBoundsDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.coupon.dao; + +import com.msb.mall.coupon.entity.SpuBoundsEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品spu积分设置 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Mapper +public interface SpuBoundsDao extends BaseMapper { + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponEntity.java new file mode 100644 index 000000000..08da129e4 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponEntity.java @@ -0,0 +1,105 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 优惠券信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_coupon") +public class CouponEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 优惠卷类型[0->全场赠券;1->会员赠券;2->购物赠券;3->注册赠券] + */ + private Integer couponType; + /** + * 优惠券图片 + */ + private String couponImg; + /** + * 优惠卷名字 + */ + private String couponName; + /** + * 数量 + */ + private Integer num; + /** + * 金额 + */ + private BigDecimal amount; + /** + * 每人限领张数 + */ + private Integer perLimit; + /** + * 使用门槛 + */ + private BigDecimal minPoint; + /** + * 开始时间 + */ + private Date startTime; + /** + * 结束时间 + */ + private Date endTime; + /** + * 使用类型[0->全场通用;1->指定分类;2->指定商品] + */ + private Integer useType; + /** + * 备注 + */ + private String note; + /** + * 发行数量 + */ + private Integer publishCount; + /** + * 已使用数量 + */ + private Integer useCount; + /** + * 领取数量 + */ + private Integer receiveCount; + /** + * 可以领取的开始日期 + */ + private Date enableStartTime; + /** + * 可以领取的结束日期 + */ + private Date enableEndTime; + /** + * 优惠码 + */ + private String code; + /** + * 可以领取的会员等级[0->不限等级,其他-对应等级] + */ + private Integer memberLevel; + /** + * 发布状态[0-未发布,1-已发布] + */ + private Integer publish; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponHistoryEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponHistoryEntity.java new file mode 100644 index 000000000..10ebeeb14 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponHistoryEntity.java @@ -0,0 +1,64 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 优惠券领取历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_coupon_history") +public class CouponHistoryEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 优惠券id + */ + private Long couponId; + /** + * 会员id + */ + private Long memberId; + /** + * 会员名字 + */ + private String memberNickName; + /** + * 获取方式[0->后台赠送;1->主动领取] + */ + private Integer getType; + /** + * 创建时间 + */ + private Date createTime; + /** + * 使用状态[0->未使用;1->已使用;2->已过期] + */ + private Integer useType; + /** + * 使用时间 + */ + private Date useTime; + /** + * 订单id + */ + private Long orderId; + /** + * 订单号 + */ + private Long orderSn; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponSpuCategoryRelationEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponSpuCategoryRelationEntity.java new file mode 100644 index 000000000..af7760863 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponSpuCategoryRelationEntity.java @@ -0,0 +1,40 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 优惠券分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_coupon_spu_category_relation") +public class CouponSpuCategoryRelationEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 优惠券id + */ + private Long couponId; + /** + * 产品分类id + */ + private Long categoryId; + /** + * 产品分类名称 + */ + private String categoryName; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponSpuRelationEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponSpuRelationEntity.java new file mode 100644 index 000000000..1cd70dc4a --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/CouponSpuRelationEntity.java @@ -0,0 +1,40 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 优惠券与产品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_coupon_spu_relation") +public class CouponSpuRelationEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 优惠券id + */ + private Long couponId; + /** + * spu_id + */ + private Long spuId; + /** + * spu_name + */ + private String spuName; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeAdvEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeAdvEntity.java new file mode 100644 index 000000000..d5bf9c218 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeAdvEntity.java @@ -0,0 +1,72 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 首页轮播广告 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_home_adv") +public class HomeAdvEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 名字 + */ + private String name; + /** + * 图片地址 + */ + private String pic; + /** + * 开始时间 + */ + private Date startTime; + /** + * 结束时间 + */ + private Date endTime; + /** + * 状态 + */ + private Integer status; + /** + * 点击数 + */ + private Integer clickCount; + /** + * 广告详情连接地址 + */ + private String url; + /** + * 备注 + */ + private String note; + /** + * 排序 + */ + private Integer sort; + /** + * 发布者 + */ + private Long publisherId; + /** + * 审核者 + */ + private Long authId; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeSubjectEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeSubjectEntity.java new file mode 100644 index 000000000..96906ec73 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeSubjectEntity.java @@ -0,0 +1,56 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_home_subject") +public class HomeSubjectEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 专题名字 + */ + private String name; + /** + * 专题标题 + */ + private String title; + /** + * 专题副标题 + */ + private String subTitle; + /** + * 显示状态 + */ + private Integer status; + /** + * 详情连接 + */ + private String url; + /** + * 排序 + */ + private Integer sort; + /** + * 专题图片地址 + */ + private String img; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeSubjectSpuEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeSubjectSpuEntity.java new file mode 100644 index 000000000..a66d3b46b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/HomeSubjectSpuEntity.java @@ -0,0 +1,44 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 专题商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_home_subject_spu") +public class HomeSubjectSpuEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 专题名字 + */ + private String name; + /** + * 专题id + */ + private Long subjectId; + /** + * spu_id + */ + private Long spuId; + /** + * 排序 + */ + private Integer sort; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/MemberPriceEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/MemberPriceEntity.java new file mode 100644 index 000000000..c756f3fed --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/MemberPriceEntity.java @@ -0,0 +1,49 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品会员价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_member_price") +public class MemberPriceEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * sku_id + */ + private Long skuId; + /** + * 会员等级id + */ + private Long memberLevelId; + /** + * 会员等级名 + */ + private String memberLevelName; + /** + * 会员对应价格 + */ + private BigDecimal memberPrice; + /** + * 可否叠加其他优惠[0-不可叠加优惠,1-可叠加] + */ + private Integer addOther; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillPromotionEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillPromotionEntity.java new file mode 100644 index 000000000..7ee2d9c83 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillPromotionEntity.java @@ -0,0 +1,52 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 秒杀活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_seckill_promotion") +public class SeckillPromotionEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 活动标题 + */ + private String title; + /** + * 开始日期 + */ + private Date startTime; + /** + * 结束日期 + */ + private Date endTime; + /** + * 上下线状态 + */ + private Integer status; + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private Long userId; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSessionEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSessionEntity.java new file mode 100644 index 000000000..66fb5b688 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSessionEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 秒杀活动场次 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_seckill_session") +public class SeckillSessionEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 场次名称 + */ + private String name; + /** + * 每日开始时间 + */ + private Date startTime; + /** + * 每日结束时间 + */ + private Date endTime; + /** + * 启用状态 + */ + private Integer status; + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSkuNoticeEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSkuNoticeEntity.java new file mode 100644 index 000000000..0d35b3bbf --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSkuNoticeEntity.java @@ -0,0 +1,52 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 秒杀商品通知订阅 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_seckill_sku_notice") +public class SeckillSkuNoticeEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * member_id + */ + private Long memberId; + /** + * sku_id + */ + private Long skuId; + /** + * 活动场次id + */ + private Long sessionId; + /** + * 订阅时间 + */ + private Date subcribeTime; + /** + * 发送时间 + */ + private Date sendTime; + /** + * 通知方式[0-短信,1-邮件] + */ + private Integer noticeType; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSkuRelationEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSkuRelationEntity.java new file mode 100644 index 000000000..09b48e833 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SeckillSkuRelationEntity.java @@ -0,0 +1,57 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 秒杀活动商品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_seckill_sku_relation") +public class SeckillSkuRelationEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 活动id + */ + private Long promotionId; + /** + * 活动场次id + */ + private Long promotionSessionId; + /** + * 商品id + */ + private Long skuId; + /** + * 秒杀价格 + */ + private BigDecimal seckillPrice; + /** + * 秒杀总量 + */ + private BigDecimal seckillCount; + /** + * 每人限购数量 + */ + private BigDecimal seckillLimit; + /** + * 排序 + */ + private Integer seckillSort; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SkuFullReductionEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SkuFullReductionEntity.java new file mode 100644 index 000000000..3f50bbadb --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SkuFullReductionEntity.java @@ -0,0 +1,45 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品满减信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_sku_full_reduction") +public class SkuFullReductionEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * spu_id + */ + private Long skuId; + /** + * 满多少 + */ + private BigDecimal fullPrice; + /** + * 减多少 + */ + private BigDecimal reducePrice; + /** + * 是否参与其他优惠 + */ + private Integer addOther; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SkuLadderEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SkuLadderEntity.java new file mode 100644 index 000000000..50127709f --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SkuLadderEntity.java @@ -0,0 +1,49 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品阶梯价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_sku_ladder") +public class SkuLadderEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * spu_id + */ + private Long skuId; + /** + * 满几件 + */ + private Integer fullCount; + /** + * 打几折 + */ + private BigDecimal discount; + /** + * 折后价 + */ + private BigDecimal price; + /** + * 是否叠加其他优惠[0-不可叠加,1-可叠加] + */ + private Integer addOther; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SpuBoundsEntity.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SpuBoundsEntity.java new file mode 100644 index 000000000..9334bf341 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/entity/SpuBoundsEntity.java @@ -0,0 +1,45 @@ +package com.msb.mall.coupon.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品spu积分设置 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +@Data +@TableName("sms_spu_bounds") +public class SpuBoundsEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * + */ + private Long spuId; + /** + * 成长积分 + */ + private BigDecimal growBounds; + /** + * 购物积分 + */ + private BigDecimal buyBounds; + /** + * 优惠生效情况[1111(四个状态位,从右到左);0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠,购物积分是否赠送【状态位0:不赠送,1:赠送】] + */ + private Integer work; + +} diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponHistoryService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponHistoryService.java new file mode 100644 index 000000000..79b8cb67d --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponHistoryService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.CouponHistoryEntity; + +import java.util.Map; + +/** + * 优惠券领取历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface CouponHistoryService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponService.java new file mode 100644 index 000000000..37eeb1150 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.CouponEntity; + +import java.util.Map; + +/** + * 优惠券信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface CouponService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponSpuCategoryRelationService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponSpuCategoryRelationService.java new file mode 100644 index 000000000..214253691 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponSpuCategoryRelationService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.CouponSpuCategoryRelationEntity; + +import java.util.Map; + +/** + * 优惠券分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface CouponSpuCategoryRelationService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponSpuRelationService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponSpuRelationService.java new file mode 100644 index 000000000..dbfde844e --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/CouponSpuRelationService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.CouponSpuRelationEntity; + +import java.util.Map; + +/** + * 优惠券与产品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface CouponSpuRelationService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeAdvService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeAdvService.java new file mode 100644 index 000000000..c9232ab3a --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeAdvService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.HomeAdvEntity; + +import java.util.Map; + +/** + * 首页轮播广告 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface HomeAdvService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeSubjectService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeSubjectService.java new file mode 100644 index 000000000..fe768ee17 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeSubjectService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.HomeSubjectEntity; + +import java.util.Map; + +/** + * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface HomeSubjectService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeSubjectSpuService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeSubjectSpuService.java new file mode 100644 index 000000000..034c3b32b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/HomeSubjectSpuService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.HomeSubjectSpuEntity; + +import java.util.Map; + +/** + * 专题商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface HomeSubjectSpuService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/MemberPriceService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/MemberPriceService.java new file mode 100644 index 000000000..868511332 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/MemberPriceService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.MemberPriceEntity; + +import java.util.Map; + +/** + * 商品会员价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface MemberPriceService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillPromotionService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillPromotionService.java new file mode 100644 index 000000000..a248a360e --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillPromotionService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SeckillPromotionEntity; + +import java.util.Map; + +/** + * 秒杀活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SeckillPromotionService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSessionService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSessionService.java new file mode 100644 index 000000000..2c5121bd7 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSessionService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SeckillSessionEntity; + +import java.util.Map; + +/** + * 秒杀活动场次 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SeckillSessionService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSkuNoticeService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSkuNoticeService.java new file mode 100644 index 000000000..5a2461587 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSkuNoticeService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SeckillSkuNoticeEntity; + +import java.util.Map; + +/** + * 秒杀商品通知订阅 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SeckillSkuNoticeService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSkuRelationService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSkuRelationService.java new file mode 100644 index 000000000..5c3b86350 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SeckillSkuRelationService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SeckillSkuRelationEntity; + +import java.util.Map; + +/** + * 秒杀活动商品关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SeckillSkuRelationService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SkuFullReductionService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SkuFullReductionService.java new file mode 100644 index 000000000..cf86113e9 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SkuFullReductionService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SkuFullReductionEntity; + +import java.util.Map; + +/** + * 商品满减信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SkuFullReductionService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SkuLadderService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SkuLadderService.java new file mode 100644 index 000000000..c5bdf9c53 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SkuLadderService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SkuLadderEntity; + +import java.util.Map; + +/** + * 商品阶梯价格 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SkuLadderService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SpuBoundsService.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SpuBoundsService.java new file mode 100644 index 000000000..6a3343dee --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/SpuBoundsService.java @@ -0,0 +1,20 @@ +package com.msb.mall.coupon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.coupon.entity.SpuBoundsEntity; + +import java.util.Map; + +/** + * 商品spu积分设置 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:45:20 + */ +public interface SpuBoundsService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponHistoryServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponHistoryServiceImpl.java new file mode 100644 index 000000000..19c10f44a --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponHistoryServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.CouponHistoryDao; +import com.msb.mall.coupon.entity.CouponHistoryEntity; +import com.msb.mall.coupon.service.CouponHistoryService; + + +@Service("couponHistoryService") +public class CouponHistoryServiceImpl extends ServiceImpl implements CouponHistoryService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponServiceImpl.java new file mode 100644 index 000000000..c4a5f9d22 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.CouponDao; +import com.msb.mall.coupon.entity.CouponEntity; +import com.msb.mall.coupon.service.CouponService; + + +@Service("couponService") +public class CouponServiceImpl extends ServiceImpl implements CouponService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponSpuCategoryRelationServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponSpuCategoryRelationServiceImpl.java new file mode 100644 index 000000000..58d289d59 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponSpuCategoryRelationServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.CouponSpuCategoryRelationDao; +import com.msb.mall.coupon.entity.CouponSpuCategoryRelationEntity; +import com.msb.mall.coupon.service.CouponSpuCategoryRelationService; + + +@Service("couponSpuCategoryRelationService") +public class CouponSpuCategoryRelationServiceImpl extends ServiceImpl implements CouponSpuCategoryRelationService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponSpuRelationServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponSpuRelationServiceImpl.java new file mode 100644 index 000000000..51ef3d6d3 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/CouponSpuRelationServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.CouponSpuRelationDao; +import com.msb.mall.coupon.entity.CouponSpuRelationEntity; +import com.msb.mall.coupon.service.CouponSpuRelationService; + + +@Service("couponSpuRelationService") +public class CouponSpuRelationServiceImpl extends ServiceImpl implements CouponSpuRelationService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeAdvServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeAdvServiceImpl.java new file mode 100644 index 000000000..064dd99c9 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeAdvServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.HomeAdvDao; +import com.msb.mall.coupon.entity.HomeAdvEntity; +import com.msb.mall.coupon.service.HomeAdvService; + + +@Service("homeAdvService") +public class HomeAdvServiceImpl extends ServiceImpl implements HomeAdvService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeSubjectServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeSubjectServiceImpl.java new file mode 100644 index 000000000..d59305bc4 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeSubjectServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.HomeSubjectDao; +import com.msb.mall.coupon.entity.HomeSubjectEntity; +import com.msb.mall.coupon.service.HomeSubjectService; + + +@Service("homeSubjectService") +public class HomeSubjectServiceImpl extends ServiceImpl implements HomeSubjectService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeSubjectSpuServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeSubjectSpuServiceImpl.java new file mode 100644 index 000000000..cd001d078 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/HomeSubjectSpuServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.HomeSubjectSpuDao; +import com.msb.mall.coupon.entity.HomeSubjectSpuEntity; +import com.msb.mall.coupon.service.HomeSubjectSpuService; + + +@Service("homeSubjectSpuService") +public class HomeSubjectSpuServiceImpl extends ServiceImpl implements HomeSubjectSpuService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/MemberPriceServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/MemberPriceServiceImpl.java new file mode 100644 index 000000000..4d3e4193f --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/MemberPriceServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.MemberPriceDao; +import com.msb.mall.coupon.entity.MemberPriceEntity; +import com.msb.mall.coupon.service.MemberPriceService; + + +@Service("memberPriceService") +public class MemberPriceServiceImpl extends ServiceImpl implements MemberPriceService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillPromotionServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillPromotionServiceImpl.java new file mode 100644 index 000000000..67c46d091 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillPromotionServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SeckillPromotionDao; +import com.msb.mall.coupon.entity.SeckillPromotionEntity; +import com.msb.mall.coupon.service.SeckillPromotionService; + + +@Service("seckillPromotionService") +public class SeckillPromotionServiceImpl extends ServiceImpl implements SeckillPromotionService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSessionServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSessionServiceImpl.java new file mode 100644 index 000000000..06f92a027 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSessionServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SeckillSessionDao; +import com.msb.mall.coupon.entity.SeckillSessionEntity; +import com.msb.mall.coupon.service.SeckillSessionService; + + +@Service("seckillSessionService") +public class SeckillSessionServiceImpl extends ServiceImpl implements SeckillSessionService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSkuNoticeServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSkuNoticeServiceImpl.java new file mode 100644 index 000000000..d02640fa7 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSkuNoticeServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SeckillSkuNoticeDao; +import com.msb.mall.coupon.entity.SeckillSkuNoticeEntity; +import com.msb.mall.coupon.service.SeckillSkuNoticeService; + + +@Service("seckillSkuNoticeService") +public class SeckillSkuNoticeServiceImpl extends ServiceImpl implements SeckillSkuNoticeService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSkuRelationServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSkuRelationServiceImpl.java new file mode 100644 index 000000000..1ebcf5e25 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SeckillSkuRelationServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SeckillSkuRelationDao; +import com.msb.mall.coupon.entity.SeckillSkuRelationEntity; +import com.msb.mall.coupon.service.SeckillSkuRelationService; + + +@Service("seckillSkuRelationService") +public class SeckillSkuRelationServiceImpl extends ServiceImpl implements SeckillSkuRelationService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SkuFullReductionServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SkuFullReductionServiceImpl.java new file mode 100644 index 000000000..2f980bd93 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SkuFullReductionServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SkuFullReductionDao; +import com.msb.mall.coupon.entity.SkuFullReductionEntity; +import com.msb.mall.coupon.service.SkuFullReductionService; + + +@Service("skuFullReductionService") +public class SkuFullReductionServiceImpl extends ServiceImpl implements SkuFullReductionService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SkuLadderServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SkuLadderServiceImpl.java new file mode 100644 index 000000000..6af026986 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SkuLadderServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SkuLadderDao; +import com.msb.mall.coupon.entity.SkuLadderEntity; +import com.msb.mall.coupon.service.SkuLadderService; + + +@Service("skuLadderService") +public class SkuLadderServiceImpl extends ServiceImpl implements SkuLadderService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SpuBoundsServiceImpl.java b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SpuBoundsServiceImpl.java new file mode 100644 index 000000000..a210d94bf --- /dev/null +++ b/msb-mall/mall-coupon/src/main/java/com/msb/mall/coupon/service/impl/SpuBoundsServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.coupon.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.coupon.dao.SpuBoundsDao; +import com.msb.mall.coupon.entity.SpuBoundsEntity; +import com.msb.mall.coupon.service.SpuBoundsService; + + +@Service("spuBoundsService") +public class SpuBoundsServiceImpl extends ServiceImpl implements SpuBoundsService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/application.yml b/msb-mall/mall-coupon/src/main/resources/application.yml new file mode 100644 index 000000000..2a68a1abb --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/application.yml @@ -0,0 +1,19 @@ +spring: + datasource: + username: root + password: root + url: jdbc:mysql://192.168.37.133:3306/msb-sms?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai + driver-class-name: com.mysql.cj.jdbc.Driver + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + application: + name: mall-coupon +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + global-config: + db-config: + id-type: auto #主键自增 +server: + port: 8010 \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponDao.xml new file mode 100644 index 000000000..3fb9a27ec --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponHistoryDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponHistoryDao.xml new file mode 100644 index 000000000..0c1adb898 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponHistoryDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponSpuCategoryRelationDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponSpuCategoryRelationDao.xml new file mode 100644 index 000000000..536d29023 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponSpuCategoryRelationDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponSpuRelationDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponSpuRelationDao.xml new file mode 100644 index 000000000..7de45bc6b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/CouponSpuRelationDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeAdvDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeAdvDao.xml new file mode 100644 index 000000000..d623a8e4c --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeAdvDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeSubjectDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeSubjectDao.xml new file mode 100644 index 000000000..36396db4a --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeSubjectDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeSubjectSpuDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeSubjectSpuDao.xml new file mode 100644 index 000000000..cf7deaffc --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/HomeSubjectSpuDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/MemberPriceDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/MemberPriceDao.xml new file mode 100644 index 000000000..dabcf751b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/MemberPriceDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillPromotionDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillPromotionDao.xml new file mode 100644 index 000000000..01f4e587f --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillPromotionDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSessionDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSessionDao.xml new file mode 100644 index 000000000..52e456dfe --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSessionDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSkuNoticeDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSkuNoticeDao.xml new file mode 100644 index 000000000..72095dad4 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSkuNoticeDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSkuRelationDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSkuRelationDao.xml new file mode 100644 index 000000000..8ffce45a7 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SeckillSkuRelationDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SkuFullReductionDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SkuFullReductionDao.xml new file mode 100644 index 000000000..b4b0f1f91 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SkuFullReductionDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SkuLadderDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SkuLadderDao.xml new file mode 100644 index 000000000..b84fa5047 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SkuLadderDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SpuBoundsDao.xml b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SpuBoundsDao.xml new file mode 100644 index 000000000..1d66deb01 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/mapper/coupon/SpuBoundsDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/coupon-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/coupon-add-or-update.vue new file mode 100644 index 000000000..8a1af9973 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/coupon-add-or-update.vue @@ -0,0 +1,246 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/coupon.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/coupon.vue new file mode 100644 index 000000000..8aeadb423 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/coupon.vue @@ -0,0 +1,271 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponhistory-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponhistory-add-or-update.vue new file mode 100644 index 000000000..f05d4f135 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponhistory-add-or-update.vue @@ -0,0 +1,156 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponhistory.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponhistory.vue new file mode 100644 index 000000000..1576a541d --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponhistory.vue @@ -0,0 +1,211 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspucategoryrelation-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspucategoryrelation-add-or-update.vue new file mode 100644 index 000000000..6a1be43fb --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspucategoryrelation-add-or-update.vue @@ -0,0 +1,102 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspucategoryrelation.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspucategoryrelation.vue new file mode 100644 index 000000000..c8ef56bde --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspucategoryrelation.vue @@ -0,0 +1,175 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspurelation-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspurelation-add-or-update.vue new file mode 100644 index 000000000..b60c2935e --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspurelation-add-or-update.vue @@ -0,0 +1,102 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspurelation.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspurelation.vue new file mode 100644 index 000000000..60f64b9ae --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/couponspurelation.vue @@ -0,0 +1,175 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homeadv-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homeadv-add-or-update.vue new file mode 100644 index 000000000..301ad8478 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homeadv-add-or-update.vue @@ -0,0 +1,174 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homeadv.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homeadv.vue new file mode 100644 index 000000000..611f49592 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homeadv.vue @@ -0,0 +1,223 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubject-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubject-add-or-update.vue new file mode 100644 index 000000000..a143b61c3 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubject-add-or-update.vue @@ -0,0 +1,138 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubject.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubject.vue new file mode 100644 index 000000000..45c9dcdcc --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubject.vue @@ -0,0 +1,199 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubjectspu-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubjectspu-add-or-update.vue new file mode 100644 index 000000000..5403bbf00 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubjectspu-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubjectspu.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubjectspu.vue new file mode 100644 index 000000000..8502733bc --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/homesubjectspu.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/memberprice-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/memberprice-add-or-update.vue new file mode 100644 index 000000000..19118007b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/memberprice-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/memberprice.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/memberprice.vue new file mode 100644 index 000000000..7a7554b85 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/memberprice.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillpromotion-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillpromotion-add-or-update.vue new file mode 100644 index 000000000..6d3004f03 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillpromotion-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillpromotion.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillpromotion.vue new file mode 100644 index 000000000..abe040994 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillpromotion.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillsession-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillsession-add-or-update.vue new file mode 100644 index 000000000..35e3c8f42 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillsession-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillsession.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillsession.vue new file mode 100644 index 000000000..502aa140e --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillsession.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskunotice-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskunotice-add-or-update.vue new file mode 100644 index 000000000..ff57a485c --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskunotice-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskunotice.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskunotice.vue new file mode 100644 index 000000000..d802abd11 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskunotice.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskurelation-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskurelation-add-or-update.vue new file mode 100644 index 000000000..358fbac2e --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskurelation-add-or-update.vue @@ -0,0 +1,138 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskurelation.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskurelation.vue new file mode 100644 index 000000000..9f0cf092d --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/seckillskurelation.vue @@ -0,0 +1,199 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skufullreduction-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skufullreduction-add-or-update.vue new file mode 100644 index 000000000..021c0f741 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skufullreduction-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skufullreduction.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skufullreduction.vue new file mode 100644 index 000000000..f03cb23be --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skufullreduction.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skuladder-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skuladder-add-or-update.vue new file mode 100644 index 000000000..7ee79d934 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skuladder-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skuladder.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skuladder.vue new file mode 100644 index 000000000..3aa0c70e0 --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/skuladder.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/spubounds-add-or-update.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/spubounds-add-or-update.vue new file mode 100644 index 000000000..cdedb51dd --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/spubounds-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/spubounds.vue b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/spubounds.vue new file mode 100644 index 000000000..75930a59b --- /dev/null +++ b/msb-mall/mall-coupon/src/main/resources/src/views/modules/coupon/spubounds.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-coupon/src/test/java/com/msb/mall/coupon/MallCouponApplicationTests.java b/msb-mall/mall-coupon/src/test/java/com/msb/mall/coupon/MallCouponApplicationTests.java new file mode 100644 index 000000000..d4468b131 --- /dev/null +++ b/msb-mall/mall-coupon/src/test/java/com/msb/mall/coupon/MallCouponApplicationTests.java @@ -0,0 +1,13 @@ +package com.msb.mall.coupon; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MallCouponApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/msb-mall/mall-gateway/.gitignore b/msb-mall/mall-gateway/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-gateway/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-gateway/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-gateway/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-gateway/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-gateway/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-gateway/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-gateway/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-gateway/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-gateway/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-gateway/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-gateway/README.md b/msb-mall/mall-gateway/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-gateway/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-gateway/mvnw b/msb-mall/mall-gateway/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-gateway/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-gateway/mvnw.cmd b/msb-mall/mall-gateway/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-gateway/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-gateway/pom.xml b/msb-mall/mall-gateway/pom.xml new file mode 100644 index 000000000..ba832c7e2 --- /dev/null +++ b/msb-mall/mall-gateway/pom.xml @@ -0,0 +1,112 @@ + + + 4.0.0 + com.msb.gateway + mall-gateway + 0.0.1-SNAPSHOT + mall-gateway + mall-gateway + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + com.baomidou + mybatis-plus-boot-starter + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + + + + + org.springframework.cloud + spring-cloud-starter-gateway + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.gateway.MallGatewayApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-gateway/src/main/java/com/msb/mall/gateway/MallGatewayApplication.java b/msb-mall/mall-gateway/src/main/java/com/msb/mall/gateway/MallGatewayApplication.java new file mode 100644 index 000000000..bf1fe8bc6 --- /dev/null +++ b/msb-mall/mall-gateway/src/main/java/com/msb/mall/gateway/MallGatewayApplication.java @@ -0,0 +1,16 @@ +package com.msb.mall.gateway; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) +public class MallGatewayApplication { + + public static void main(String[] args) { + SpringApplication.run(MallGatewayApplication.class, args); + } + +} diff --git a/msb-mall/mall-gateway/src/main/java/com/msb/mall/gateway/config/MallCorsConfiguration.java b/msb-mall/mall-gateway/src/main/java/com/msb/mall/gateway/config/MallCorsConfiguration.java new file mode 100644 index 000000000..30e726266 --- /dev/null +++ b/msb-mall/mall-gateway/src/main/java/com/msb/mall/gateway/config/MallCorsConfiguration.java @@ -0,0 +1,24 @@ +package com.msb.mall.gateway.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.reactive.CorsConfigurationSource; +import org.springframework.web.cors.reactive.CorsWebFilter; +import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; + +@Configuration +public class MallCorsConfiguration { + //此方法要记得加@bean + @Bean + public CorsWebFilter corsWebFilter(){ + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration corsConfiguration=new CorsConfiguration(); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.setAllowCredentials(true); + source.registerCorsConfiguration("/**",corsConfiguration); + return new CorsWebFilter(source); + } +} diff --git a/msb-mall/mall-gateway/src/main/resources/application.yml b/msb-mall/mall-gateway/src/main/resources/application.yml new file mode 100644 index 000000000..efde136bd --- /dev/null +++ b/msb-mall/mall-gateway/src/main/resources/application.yml @@ -0,0 +1,44 @@ +spring: +# datasource: +# username: root +# password: root +# url: jdbc:mysql://192.168.37.133:3306/msb-oms?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai +# driver-class-name: com.mysql.cj.jdbc.Driver + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + gateway: + routes: + - id: route1 + uri: http://www.baidu.com + predicates: + - Query=url,baidu + - id: product_route + uri: lb://mall-product + predicates: + - Path=/app/product/** + filters: + - RewritePath=/app/(?/?.*),/$\{segment} + - id: app-route + uri: lb://renren-fast + predicates: + - Path=/app/** + filters: + - RewritePath=/app/(?/?.*),/renren-fast/$\{segment} + - id: msbmall_host_route + uri: lb://mall-product + predicates: + - Host=msb.mall.com + application: + name: mall-gateway +#mybatis-plus: +# mapper-locations: classpath*:/mapper/**/*.xml +# global-config: +# db-config: +# id-type: auto #主键自增 +server: + port: 8070 +user: + uasername: dalong1 + age: 17 \ No newline at end of file diff --git a/msb-mall/mall-gateway/src/main/resources/bootstrap.properties b/msb-mall/mall-gateway/src/main/resources/bootstrap.properties new file mode 100644 index 000000000..94c94b822 --- /dev/null +++ b/msb-mall/mall-gateway/src/main/resources/bootstrap.properties @@ -0,0 +1,3 @@ +spring.application.name=mall-gateway +spring.cloud.nacos.config.server-addr=192.168.37.133:8848 +spring.cloud.nacos.config.namespace=0fc6fc2c-0063-4e44-a879-f46fc9f7fb5f diff --git a/msb-mall/mall-gateway/src/test/java/com/msb/mall/gateway/MallGatewayApplicationTests.java b/msb-mall/mall-gateway/src/test/java/com/msb/mall/gateway/MallGatewayApplicationTests.java new file mode 100644 index 000000000..6b3fe604c --- /dev/null +++ b/msb-mall/mall-gateway/src/test/java/com/msb/mall/gateway/MallGatewayApplicationTests.java @@ -0,0 +1,13 @@ +package com.msb.mall.gateway; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MallGatewayApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/msb-mall/mall-member/.gitignore b/msb-mall/mall-member/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-member/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-member/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-member/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-member/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-member/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-member/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-member/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-member/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-member/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-member/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-member/README.md b/msb-mall/mall-member/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-member/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-member/mvnw b/msb-mall/mall-member/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-member/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-member/mvnw.cmd b/msb-mall/mall-member/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-member/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-member/pom.xml b/msb-mall/mall-member/pom.xml new file mode 100644 index 000000000..f5aa45e30 --- /dev/null +++ b/msb-mall/mall-member/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + com.msb.mall + mall-member + 0.0.1-SNAPSHOT + mall-member + mall-member + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.member.MallMemberApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/MallMemberApplication.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/MallMemberApplication.java new file mode 100644 index 000000000..77393660a --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/MallMemberApplication.java @@ -0,0 +1,17 @@ +package com.msb.mall.member; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +@MapperScan("com.msb.mall.member.dao") +public class MallMemberApplication { + + public static void main(String[] args) { + SpringApplication.run(MallMemberApplication.class, args); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/GrowthChangeHistoryController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/GrowthChangeHistoryController.java new file mode 100644 index 000000000..f2a8a808a --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/GrowthChangeHistoryController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.GrowthChangeHistoryEntity; +import com.msb.mall.member.service.GrowthChangeHistoryService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 成长值变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/growthchangehistory") +public class GrowthChangeHistoryController { + @Autowired + private GrowthChangeHistoryService growthChangeHistoryService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = growthChangeHistoryService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + GrowthChangeHistoryEntity growthChangeHistory = growthChangeHistoryService.getById(id); + + return R.ok().put("growthChangeHistory", growthChangeHistory); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody GrowthChangeHistoryEntity growthChangeHistory){ + growthChangeHistoryService.save(growthChangeHistory); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody GrowthChangeHistoryEntity growthChangeHistory){ + growthChangeHistoryService.updateById(growthChangeHistory); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + growthChangeHistoryService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/IntegrationChangeHistoryController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/IntegrationChangeHistoryController.java new file mode 100644 index 000000000..845d9e656 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/IntegrationChangeHistoryController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.IntegrationChangeHistoryEntity; +import com.msb.mall.member.service.IntegrationChangeHistoryService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 积分变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/integrationchangehistory") +public class IntegrationChangeHistoryController { + @Autowired + private IntegrationChangeHistoryService integrationChangeHistoryService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = integrationChangeHistoryService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + IntegrationChangeHistoryEntity integrationChangeHistory = integrationChangeHistoryService.getById(id); + + return R.ok().put("integrationChangeHistory", integrationChangeHistory); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody IntegrationChangeHistoryEntity integrationChangeHistory){ + integrationChangeHistoryService.save(integrationChangeHistory); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody IntegrationChangeHistoryEntity integrationChangeHistory){ + integrationChangeHistoryService.updateById(integrationChangeHistory); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + integrationChangeHistoryService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberCollectSpuController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberCollectSpuController.java new file mode 100644 index 000000000..118572be8 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberCollectSpuController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberCollectSpuEntity; +import com.msb.mall.member.service.MemberCollectSpuService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员收藏的商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/membercollectspu") +public class MemberCollectSpuController { + @Autowired + private MemberCollectSpuService memberCollectSpuService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberCollectSpuService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberCollectSpuEntity memberCollectSpu = memberCollectSpuService.getById(id); + + return R.ok().put("memberCollectSpu", memberCollectSpu); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberCollectSpuEntity memberCollectSpu){ + memberCollectSpuService.save(memberCollectSpu); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberCollectSpuEntity memberCollectSpu){ + memberCollectSpuService.updateById(memberCollectSpu); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberCollectSpuService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberCollectSubjectController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberCollectSubjectController.java new file mode 100644 index 000000000..791728927 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberCollectSubjectController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberCollectSubjectEntity; +import com.msb.mall.member.service.MemberCollectSubjectService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员收藏的专题活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/membercollectsubject") +public class MemberCollectSubjectController { + @Autowired + private MemberCollectSubjectService memberCollectSubjectService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberCollectSubjectService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberCollectSubjectEntity memberCollectSubject = memberCollectSubjectService.getById(id); + + return R.ok().put("memberCollectSubject", memberCollectSubject); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberCollectSubjectEntity memberCollectSubject){ + memberCollectSubjectService.save(memberCollectSubject); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberCollectSubjectEntity memberCollectSubject){ + memberCollectSubjectService.updateById(memberCollectSubject); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberCollectSubjectService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberController.java new file mode 100644 index 000000000..a9a286e32 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberEntity; +import com.msb.mall.member.service.MemberService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/member") +public class MemberController { + @Autowired + private MemberService memberService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberEntity member = memberService.getById(id); + + return R.ok().put("member", member); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberEntity member){ + memberService.save(member); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberEntity member){ + memberService.updateById(member); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberLevelController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberLevelController.java new file mode 100644 index 000000000..a200f6516 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberLevelController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberLevelEntity; +import com.msb.mall.member.service.MemberLevelService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员等级 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/memberlevel") +public class MemberLevelController { + @Autowired + private MemberLevelService memberLevelService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberLevelService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberLevelEntity memberLevel = memberLevelService.getById(id); + + return R.ok().put("memberLevel", memberLevel); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberLevelEntity memberLevel){ + memberLevelService.save(memberLevel); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberLevelEntity memberLevel){ + memberLevelService.updateById(memberLevel); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberLevelService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberLoginLogController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberLoginLogController.java new file mode 100644 index 000000000..a8a4c3ac8 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberLoginLogController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberLoginLogEntity; +import com.msb.mall.member.service.MemberLoginLogService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员登录记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/memberloginlog") +public class MemberLoginLogController { + @Autowired + private MemberLoginLogService memberLoginLogService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberLoginLogService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberLoginLogEntity memberLoginLog = memberLoginLogService.getById(id); + + return R.ok().put("memberLoginLog", memberLoginLog); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberLoginLogEntity memberLoginLog){ + memberLoginLogService.save(memberLoginLog); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberLoginLogEntity memberLoginLog){ + memberLoginLogService.updateById(memberLoginLog); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberLoginLogService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberReceiveAddressController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberReceiveAddressController.java new file mode 100644 index 000000000..8ff5e656c --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberReceiveAddressController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberReceiveAddressEntity; +import com.msb.mall.member.service.MemberReceiveAddressService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员收货地址 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/memberreceiveaddress") +public class MemberReceiveAddressController { + @Autowired + private MemberReceiveAddressService memberReceiveAddressService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberReceiveAddressService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberReceiveAddressEntity memberReceiveAddress = memberReceiveAddressService.getById(id); + + return R.ok().put("memberReceiveAddress", memberReceiveAddress); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberReceiveAddressEntity memberReceiveAddress){ + memberReceiveAddressService.save(memberReceiveAddress); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberReceiveAddressEntity memberReceiveAddress){ + memberReceiveAddressService.updateById(memberReceiveAddress); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberReceiveAddressService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberStatisticsInfoController.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberStatisticsInfoController.java new file mode 100644 index 000000000..a46d93857 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/controller/MemberStatisticsInfoController.java @@ -0,0 +1,84 @@ +package com.msb.mall.member.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.member.entity.MemberStatisticsInfoEntity; +import com.msb.mall.member.service.MemberStatisticsInfoService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 会员统计信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@RestController +@RequestMapping("member/memberstatisticsinfo") +public class MemberStatisticsInfoController { + @Autowired + private MemberStatisticsInfoService memberStatisticsInfoService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = memberStatisticsInfoService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + MemberStatisticsInfoEntity memberStatisticsInfo = memberStatisticsInfoService.getById(id); + + return R.ok().put("memberStatisticsInfo", memberStatisticsInfo); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo){ + memberStatisticsInfoService.save(memberStatisticsInfo); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo){ + memberStatisticsInfoService.updateById(memberStatisticsInfo); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + memberStatisticsInfoService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/GrowthChangeHistoryDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/GrowthChangeHistoryDao.java new file mode 100644 index 000000000..3c639f42c --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/GrowthChangeHistoryDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.GrowthChangeHistoryEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 成长值变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface GrowthChangeHistoryDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/IntegrationChangeHistoryDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/IntegrationChangeHistoryDao.java new file mode 100644 index 000000000..a9c6b3bbe --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/IntegrationChangeHistoryDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.IntegrationChangeHistoryEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface IntegrationChangeHistoryDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberCollectSpuDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberCollectSpuDao.java new file mode 100644 index 000000000..764ae4d59 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberCollectSpuDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberCollectSpuEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员收藏的商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberCollectSpuDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberCollectSubjectDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberCollectSubjectDao.java new file mode 100644 index 000000000..487798b62 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberCollectSubjectDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberCollectSubjectEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员收藏的专题活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberCollectSubjectDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberDao.java new file mode 100644 index 000000000..ddcb85aaa --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberLevelDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberLevelDao.java new file mode 100644 index 000000000..4ea9a14ae --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberLevelDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberLevelEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员等级 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberLevelDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberLoginLogDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberLoginLogDao.java new file mode 100644 index 000000000..60da72ce7 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberLoginLogDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberLoginLogEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员登录记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberLoginLogDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberReceiveAddressDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberReceiveAddressDao.java new file mode 100644 index 000000000..f8f3209a5 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberReceiveAddressDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberReceiveAddressEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员收货地址 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberReceiveAddressDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberStatisticsInfoDao.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberStatisticsInfoDao.java new file mode 100644 index 000000000..3903de388 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/dao/MemberStatisticsInfoDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.member.dao; + +import com.msb.mall.member.entity.MemberStatisticsInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员统计信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Mapper +public interface MemberStatisticsInfoDao extends BaseMapper { + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/GrowthChangeHistoryEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/GrowthChangeHistoryEntity.java new file mode 100644 index 000000000..4e6d00d71 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/GrowthChangeHistoryEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 成长值变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_growth_change_history") +public class GrowthChangeHistoryEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * member_id + */ + private Long memberId; + /** + * create_time + */ + private Date createTime; + /** + * 改变的值(正负计数) + */ + private Integer changeCount; + /** + * 备注 + */ + private String note; + /** + * 积分来源[0-购物,1-管理员修改] + */ + private Integer sourceType; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/IntegrationChangeHistoryEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/IntegrationChangeHistoryEntity.java new file mode 100644 index 000000000..dafa9704e --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/IntegrationChangeHistoryEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 积分变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_integration_change_history") +public class IntegrationChangeHistoryEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * member_id + */ + private Long memberId; + /** + * create_time + */ + private Date createTime; + /** + * 变化的值 + */ + private Integer changeCount; + /** + * 备注 + */ + private String note; + /** + * 来源[0->购物;1->管理员修改;2->活动] + */ + private Integer sourceTyoe; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberCollectSpuEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberCollectSpuEntity.java new file mode 100644 index 000000000..e020b99d6 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberCollectSpuEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员收藏的商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member_collect_spu") +public class MemberCollectSpuEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 会员id + */ + private Long memberId; + /** + * spu_id + */ + private Long spuId; + /** + * spu_name + */ + private String spuName; + /** + * spu_img + */ + private String spuImg; + /** + * create_time + */ + private Date createTime; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberCollectSubjectEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberCollectSubjectEntity.java new file mode 100644 index 000000000..7e4430466 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberCollectSubjectEntity.java @@ -0,0 +1,44 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员收藏的专题活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member_collect_subject") +public class MemberCollectSubjectEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * subject_id + */ + private Long subjectId; + /** + * subject_name + */ + private String subjectName; + /** + * subject_img + */ + private String subjectImg; + /** + * 活动url + */ + private String subjectUrll; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberEntity.java new file mode 100644 index 000000000..a183beb83 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberEntity.java @@ -0,0 +1,96 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member") +public class MemberEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 会员等级id + */ + private Long levelId; + /** + * 用户名 + */ + private String username; + /** + * 密码 + */ + private String password; + /** + * 昵称 + */ + private String nickname; + /** + * 手机号码 + */ + private String mobile; + /** + * 邮箱 + */ + private String email; + /** + * 头像 + */ + private String header; + /** + * 性别 + */ + private Integer gender; + /** + * 生日 + */ + private Date birth; + /** + * 所在城市 + */ + private String city; + /** + * 职业 + */ + private String job; + /** + * 个性签名 + */ + private String sign; + /** + * 用户来源 + */ + private Integer sourceType; + /** + * 积分 + */ + private Integer integration; + /** + * 成长值 + */ + private Integer growth; + /** + * 启用状态 + */ + private Integer status; + /** + * 注册时间 + */ + private Date createTime; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberLevelEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberLevelEntity.java new file mode 100644 index 000000000..9d4fd0005 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberLevelEntity.java @@ -0,0 +1,65 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员等级 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member_level") +public class MemberLevelEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 等级名称 + */ + private String name; + /** + * 等级需要的成长值 + */ + private Integer growthPoint; + /** + * 是否为默认等级[0->不是;1->是] + */ + private Integer defaultStatus; + /** + * 免运费标准 + */ + private BigDecimal freeFreightPoint; + /** + * 每次评价获取的成长值 + */ + private Integer commentGrowthPoint; + /** + * 是否有免邮特权 + */ + private Integer priviledgeFreeFreight; + /** + * 是否有会员价格特权 + */ + private Integer priviledgeMemberPrice; + /** + * 是否有生日特权 + */ + private Integer priviledgeBirthday; + /** + * 备注 + */ + private String note; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberLoginLogEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberLoginLogEntity.java new file mode 100644 index 000000000..3b220bf3a --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberLoginLogEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员登录记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member_login_log") +public class MemberLoginLogEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * member_id + */ + private Long memberId; + /** + * 创建时间 + */ + private Date createTime; + /** + * ip + */ + private String ip; + /** + * city + */ + private String city; + /** + * 登录类型[1-web,2-app] + */ + private Integer loginType; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberReceiveAddressEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberReceiveAddressEntity.java new file mode 100644 index 000000000..4ba263677 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberReceiveAddressEntity.java @@ -0,0 +1,68 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员收货地址 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member_receive_address") +public class MemberReceiveAddressEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * member_id + */ + private Long memberId; + /** + * 收货人姓名 + */ + private String name; + /** + * 电话 + */ + private String phone; + /** + * 邮政编码 + */ + private String postCode; + /** + * 省份/直辖市 + */ + private String province; + /** + * 城市 + */ + private String city; + /** + * 区 + */ + private String region; + /** + * 详细地址(街道) + */ + private String detailAddress; + /** + * 省市区代码 + */ + private String areacode; + /** + * 是否默认 + */ + private Integer defaultStatus; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberStatisticsInfoEntity.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberStatisticsInfoEntity.java new file mode 100644 index 000000000..18906a3db --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/entity/MemberStatisticsInfoEntity.java @@ -0,0 +1,85 @@ +package com.msb.mall.member.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 会员统计信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +@Data +@TableName("ums_member_statistics_info") +public class MemberStatisticsInfoEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 会员id + */ + private Long memberId; + /** + * 累计消费金额 + */ + private BigDecimal consumeAmount; + /** + * 累计优惠金额 + */ + private BigDecimal couponAmount; + /** + * 订单数量 + */ + private Integer orderCount; + /** + * 优惠券数量 + */ + private Integer couponCount; + /** + * 评价数 + */ + private Integer commentCount; + /** + * 退货数量 + */ + private Integer returnOrderCount; + /** + * 登录次数 + */ + private Integer loginCount; + /** + * 关注数量 + */ + private Integer attendCount; + /** + * 粉丝数量 + */ + private Integer fansCount; + /** + * 收藏的商品数量 + */ + private Integer collectProductCount; + /** + * 收藏的专题活动数量 + */ + private Integer collectSubjectCount; + /** + * 收藏的评论数量 + */ + private Integer collectCommentCount; + /** + * 邀请的朋友数量 + */ + private Integer inviteFriendCount; + +} diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/GrowthChangeHistoryService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/GrowthChangeHistoryService.java new file mode 100644 index 000000000..955407212 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/GrowthChangeHistoryService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.GrowthChangeHistoryEntity; + +import java.util.Map; + +/** + * 成长值变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface GrowthChangeHistoryService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/IntegrationChangeHistoryService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/IntegrationChangeHistoryService.java new file mode 100644 index 000000000..3891c2aeb --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/IntegrationChangeHistoryService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.IntegrationChangeHistoryEntity; + +import java.util.Map; + +/** + * 积分变化历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface IntegrationChangeHistoryService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberCollectSpuService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberCollectSpuService.java new file mode 100644 index 000000000..5f80dd052 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberCollectSpuService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberCollectSpuEntity; + +import java.util.Map; + +/** + * 会员收藏的商品 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberCollectSpuService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberCollectSubjectService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberCollectSubjectService.java new file mode 100644 index 000000000..c9d026ae6 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberCollectSubjectService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberCollectSubjectEntity; + +import java.util.Map; + +/** + * 会员收藏的专题活动 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberCollectSubjectService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberLevelService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberLevelService.java new file mode 100644 index 000000000..7bcd0024c --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberLevelService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberLevelEntity; + +import java.util.Map; + +/** + * 会员等级 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberLevelService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberLoginLogService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberLoginLogService.java new file mode 100644 index 000000000..1526fbdb2 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberLoginLogService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberLoginLogEntity; + +import java.util.Map; + +/** + * 会员登录记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberLoginLogService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberReceiveAddressService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberReceiveAddressService.java new file mode 100644 index 000000000..02f67c923 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberReceiveAddressService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberReceiveAddressEntity; + +import java.util.Map; + +/** + * 会员收货地址 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberReceiveAddressService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberService.java new file mode 100644 index 000000000..42367554f --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberEntity; + +import java.util.Map; + +/** + * 会员 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberStatisticsInfoService.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberStatisticsInfoService.java new file mode 100644 index 000000000..6d61b2284 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/MemberStatisticsInfoService.java @@ -0,0 +1,20 @@ +package com.msb.mall.member.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.member.entity.MemberStatisticsInfoEntity; + +import java.util.Map; + +/** + * 会员统计信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:46:39 + */ +public interface MemberStatisticsInfoService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/GrowthChangeHistoryServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/GrowthChangeHistoryServiceImpl.java new file mode 100644 index 000000000..4e3ca1f60 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/GrowthChangeHistoryServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.GrowthChangeHistoryDao; +import com.msb.mall.member.entity.GrowthChangeHistoryEntity; +import com.msb.mall.member.service.GrowthChangeHistoryService; + + +@Service("growthChangeHistoryService") +public class GrowthChangeHistoryServiceImpl extends ServiceImpl implements GrowthChangeHistoryService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/IntegrationChangeHistoryServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/IntegrationChangeHistoryServiceImpl.java new file mode 100644 index 000000000..52b8b8c87 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/IntegrationChangeHistoryServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.IntegrationChangeHistoryDao; +import com.msb.mall.member.entity.IntegrationChangeHistoryEntity; +import com.msb.mall.member.service.IntegrationChangeHistoryService; + + +@Service("integrationChangeHistoryService") +public class IntegrationChangeHistoryServiceImpl extends ServiceImpl implements IntegrationChangeHistoryService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberCollectSpuServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberCollectSpuServiceImpl.java new file mode 100644 index 000000000..0293931f0 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberCollectSpuServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberCollectSpuDao; +import com.msb.mall.member.entity.MemberCollectSpuEntity; +import com.msb.mall.member.service.MemberCollectSpuService; + + +@Service("memberCollectSpuService") +public class MemberCollectSpuServiceImpl extends ServiceImpl implements MemberCollectSpuService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberCollectSubjectServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberCollectSubjectServiceImpl.java new file mode 100644 index 000000000..fa53d82b2 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberCollectSubjectServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberCollectSubjectDao; +import com.msb.mall.member.entity.MemberCollectSubjectEntity; +import com.msb.mall.member.service.MemberCollectSubjectService; + + +@Service("memberCollectSubjectService") +public class MemberCollectSubjectServiceImpl extends ServiceImpl implements MemberCollectSubjectService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberLevelServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberLevelServiceImpl.java new file mode 100644 index 000000000..8e8c72e31 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberLevelServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberLevelDao; +import com.msb.mall.member.entity.MemberLevelEntity; +import com.msb.mall.member.service.MemberLevelService; + + +@Service("memberLevelService") +public class MemberLevelServiceImpl extends ServiceImpl implements MemberLevelService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberLoginLogServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberLoginLogServiceImpl.java new file mode 100644 index 000000000..4d8d3a5e8 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberLoginLogServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberLoginLogDao; +import com.msb.mall.member.entity.MemberLoginLogEntity; +import com.msb.mall.member.service.MemberLoginLogService; + + +@Service("memberLoginLogService") +public class MemberLoginLogServiceImpl extends ServiceImpl implements MemberLoginLogService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberReceiveAddressServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberReceiveAddressServiceImpl.java new file mode 100644 index 000000000..b9578754c --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberReceiveAddressServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberReceiveAddressDao; +import com.msb.mall.member.entity.MemberReceiveAddressEntity; +import com.msb.mall.member.service.MemberReceiveAddressService; + + +@Service("memberReceiveAddressService") +public class MemberReceiveAddressServiceImpl extends ServiceImpl implements MemberReceiveAddressService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberServiceImpl.java new file mode 100644 index 000000000..9b1d44d79 --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberDao; +import com.msb.mall.member.entity.MemberEntity; +import com.msb.mall.member.service.MemberService; + + +@Service("memberService") +public class MemberServiceImpl extends ServiceImpl implements MemberService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberStatisticsInfoServiceImpl.java b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberStatisticsInfoServiceImpl.java new file mode 100644 index 000000000..9171b288f --- /dev/null +++ b/msb-mall/mall-member/src/main/java/com/msb/mall/member/service/impl/MemberStatisticsInfoServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.member.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.member.dao.MemberStatisticsInfoDao; +import com.msb.mall.member.entity.MemberStatisticsInfoEntity; +import com.msb.mall.member.service.MemberStatisticsInfoService; + + +@Service("memberStatisticsInfoService") +public class MemberStatisticsInfoServiceImpl extends ServiceImpl implements MemberStatisticsInfoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/application.yml b/msb-mall/mall-member/src/main/resources/application.yml new file mode 100644 index 000000000..cf0af49d2 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/application.yml @@ -0,0 +1,19 @@ +spring: + datasource: + username: root + password: root + url: jdbc:mysql://192.168.37.133:3306/msb-ums?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai + driver-class-name: com.mysql.cj.jdbc.Driver + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + application: + name: mall-member +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + global-config: + db-config: + id-type: auto #主键自增 +server: + port: 8020 \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/GrowthChangeHistoryDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/GrowthChangeHistoryDao.xml new file mode 100644 index 000000000..e85b86826 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/GrowthChangeHistoryDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/IntegrationChangeHistoryDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/IntegrationChangeHistoryDao.xml new file mode 100644 index 000000000..513887899 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/IntegrationChangeHistoryDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberCollectSpuDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberCollectSpuDao.xml new file mode 100644 index 000000000..570c62ab4 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberCollectSpuDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberCollectSubjectDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberCollectSubjectDao.xml new file mode 100644 index 000000000..b0f6f984f --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberCollectSubjectDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberDao.xml new file mode 100644 index 000000000..d2d38b8dd --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberLevelDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberLevelDao.xml new file mode 100644 index 000000000..e24b00b55 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberLevelDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberLoginLogDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberLoginLogDao.xml new file mode 100644 index 000000000..8eb79f291 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberLoginLogDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberReceiveAddressDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberReceiveAddressDao.xml new file mode 100644 index 000000000..cc5cb72a6 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberReceiveAddressDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/mapper/member/MemberStatisticsInfoDao.xml b/msb-mall/mall-member/src/main/resources/mapper/member/MemberStatisticsInfoDao.xml new file mode 100644 index 000000000..f85c180be --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/mapper/member/MemberStatisticsInfoDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/growthchangehistory-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/growthchangehistory-add-or-update.vue new file mode 100644 index 000000000..38cf0214f --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/growthchangehistory-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/growthchangehistory.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/growthchangehistory.vue new file mode 100644 index 000000000..a23fd63d7 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/growthchangehistory.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/integrationchangehistory-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/integrationchangehistory-add-or-update.vue new file mode 100644 index 000000000..d1a087060 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/integrationchangehistory-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/integrationchangehistory.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/integrationchangehistory.vue new file mode 100644 index 000000000..e572f5029 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/integrationchangehistory.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/member-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/member-add-or-update.vue new file mode 100644 index 000000000..e4983cc7e --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/member-add-or-update.vue @@ -0,0 +1,228 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/member.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/member.vue new file mode 100644 index 000000000..62f747257 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/member.vue @@ -0,0 +1,259 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectspu-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectspu-add-or-update.vue new file mode 100644 index 000000000..919766517 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectspu-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectspu.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectspu.vue new file mode 100644 index 000000000..587c95f1d --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectspu.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectsubject-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectsubject-add-or-update.vue new file mode 100644 index 000000000..f30455d10 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectsubject-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectsubject.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectsubject.vue new file mode 100644 index 000000000..98bfccf1e --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/membercollectsubject.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberlevel-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberlevel-add-or-update.vue new file mode 100644 index 000000000..962a28e52 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberlevel-add-or-update.vue @@ -0,0 +1,156 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberlevel.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberlevel.vue new file mode 100644 index 000000000..002679682 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberlevel.vue @@ -0,0 +1,211 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberloginlog-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberloginlog-add-or-update.vue new file mode 100644 index 000000000..eeeb0598b --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberloginlog-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberloginlog.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberloginlog.vue new file mode 100644 index 000000000..43a8074fe --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberloginlog.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberreceiveaddress-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberreceiveaddress-add-or-update.vue new file mode 100644 index 000000000..77dda3b5e --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberreceiveaddress-add-or-update.vue @@ -0,0 +1,165 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberreceiveaddress.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberreceiveaddress.vue new file mode 100644 index 000000000..763e037ac --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberreceiveaddress.vue @@ -0,0 +1,217 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberstatisticsinfo-add-or-update.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberstatisticsinfo-add-or-update.vue new file mode 100644 index 000000000..dbfbbf35c --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberstatisticsinfo-add-or-update.vue @@ -0,0 +1,201 @@ + + + diff --git a/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberstatisticsinfo.vue b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberstatisticsinfo.vue new file mode 100644 index 000000000..8228149d0 --- /dev/null +++ b/msb-mall/mall-member/src/main/resources/src/views/modules/member/memberstatisticsinfo.vue @@ -0,0 +1,241 @@ + + + diff --git a/msb-mall/mall-member/src/test/java/com/msb/mall/member/MallMemberApplicationTests.java b/msb-mall/mall-member/src/test/java/com/msb/mall/member/MallMemberApplicationTests.java new file mode 100644 index 000000000..ab09ae489 --- /dev/null +++ b/msb-mall/mall-member/src/test/java/com/msb/mall/member/MallMemberApplicationTests.java @@ -0,0 +1,13 @@ +package com.msb.mall.member; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MallMemberApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/msb-mall/mall-order/.gitignore b/msb-mall/mall-order/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-order/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-order/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-order/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-order/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-order/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-order/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-order/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-order/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-order/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-order/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-order/README.md b/msb-mall/mall-order/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-order/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-order/mvnw b/msb-mall/mall-order/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-order/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-order/mvnw.cmd b/msb-mall/mall-order/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-order/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-order/pom.xml b/msb-mall/mall-order/pom.xml new file mode 100644 index 000000000..62558fe4c --- /dev/null +++ b/msb-mall/mall-order/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + com.msb.mall + mall-order + 0.0.1-SNAPSHOT + mall-order + mall-order + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-starter-aop + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.order.MallOrderApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/MallOrderApplication.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/MallOrderApplication.java new file mode 100644 index 000000000..df3abeccc --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/MallOrderApplication.java @@ -0,0 +1,23 @@ +package com.msb.mall.order; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.EnableAspectJAutoProxy; + + +@EnableFeignClients(basePackages = "com.msb.mall.order.fegin") +@EnableDiscoveryClient +@SpringBootApplication +@MapperScan("com.msb.mall.order.dao") +@EnableAspectJAutoProxy(exposeProxy = true) +public class MallOrderApplication { + + public static void main(String[] args) { + SpringApplication.run(MallOrderApplication.class, args); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderController.java new file mode 100644 index 000000000..0eaff6067 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderController.java @@ -0,0 +1,111 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import com.msb.mall.order.fegin.ProductService; +import io.seata.spring.annotation.GlobalTransactional; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.web.bind.annotation.*; + +import com.msb.mall.order.entity.OrderEntity; +import com.msb.mall.order.service.OrderService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 订单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@RefreshScope +@RestController +@RequestMapping("order/order") +public class OrderController { + @Autowired + private OrderService orderService; + + @Autowired + ProductService productService; + + @GlobalTransactional + @GetMapping("/products") + public R queryAllBrands(){ + OrderEntity orderEntity = new OrderEntity(); + orderEntity.setMemberUsername("dalong"); + orderService.save(orderEntity); + R r = productService.queryAllBrands(); + System.out.println("====>queryAllBrands"); + int i=10/0; + return R.ok().put("brands",r); + } + + @Value("${user.uasername}") + private String name; + + @Value("${user.age}") + private Integer age; + @GetMapping("/users") + public R queryUsers(){ + System.out.println("=====>name:"+name); + System.out.println("=====>age:"+age); + return R.ok().put("name",name).put("age",age); + } + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = orderService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + OrderEntity order = orderService.getById(id); + + return R.ok().put("order", order); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody OrderEntity order){ + orderService.save(order); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody OrderEntity order){ + orderService.updateById(order); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + orderService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderItemController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderItemController.java new file mode 100644 index 000000000..dd8346649 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderItemController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.OrderItemEntity; +import com.msb.mall.order.service.OrderItemService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 订单项信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@RestController +@RequestMapping("order/orderitem") +public class OrderItemController { + @Autowired + private OrderItemService orderItemService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = orderItemService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + OrderItemEntity orderItem = orderItemService.getById(id); + + return R.ok().put("orderItem", orderItem); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody OrderItemEntity orderItem){ + orderItemService.save(orderItem); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody OrderItemEntity orderItem){ + orderItemService.updateById(orderItem); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + orderItemService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderOperateHistoryController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderOperateHistoryController.java new file mode 100644 index 000000000..f07353177 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderOperateHistoryController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.OrderOperateHistoryEntity; +import com.msb.mall.order.service.OrderOperateHistoryService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 订单操作历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@RestController +@RequestMapping("order/orderoperatehistory") +public class OrderOperateHistoryController { + @Autowired + private OrderOperateHistoryService orderOperateHistoryService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = orderOperateHistoryService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + OrderOperateHistoryEntity orderOperateHistory = orderOperateHistoryService.getById(id); + + return R.ok().put("orderOperateHistory", orderOperateHistory); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody OrderOperateHistoryEntity orderOperateHistory){ + orderOperateHistoryService.save(orderOperateHistory); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody OrderOperateHistoryEntity orderOperateHistory){ + orderOperateHistoryService.updateById(orderOperateHistory); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + orderOperateHistoryService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderReturnApplyController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderReturnApplyController.java new file mode 100644 index 000000000..13042ce95 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderReturnApplyController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.OrderReturnApplyEntity; +import com.msb.mall.order.service.OrderReturnApplyService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 订单退货申请 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@RestController +@RequestMapping("order/orderreturnapply") +public class OrderReturnApplyController { + @Autowired + private OrderReturnApplyService orderReturnApplyService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = orderReturnApplyService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + OrderReturnApplyEntity orderReturnApply = orderReturnApplyService.getById(id); + + return R.ok().put("orderReturnApply", orderReturnApply); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody OrderReturnApplyEntity orderReturnApply){ + orderReturnApplyService.save(orderReturnApply); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody OrderReturnApplyEntity orderReturnApply){ + orderReturnApplyService.updateById(orderReturnApply); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + orderReturnApplyService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderReturnReasonController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderReturnReasonController.java new file mode 100644 index 000000000..1f2f6f497 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderReturnReasonController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.OrderReturnReasonEntity; +import com.msb.mall.order.service.OrderReturnReasonService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 退货原因 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@RestController +@RequestMapping("order/orderreturnreason") +public class OrderReturnReasonController { + @Autowired + private OrderReturnReasonService orderReturnReasonService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = orderReturnReasonService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + OrderReturnReasonEntity orderReturnReason = orderReturnReasonService.getById(id); + + return R.ok().put("orderReturnReason", orderReturnReason); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody OrderReturnReasonEntity orderReturnReason){ + orderReturnReasonService.save(orderReturnReason); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody OrderReturnReasonEntity orderReturnReason){ + orderReturnReasonService.updateById(orderReturnReason); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + orderReturnReasonService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderSettingController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderSettingController.java new file mode 100644 index 000000000..aca1f436d --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/OrderSettingController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.OrderSettingEntity; +import com.msb.mall.order.service.OrderSettingService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 订单配置信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@RestController +@RequestMapping("order/ordersetting") +public class OrderSettingController { + @Autowired + private OrderSettingService orderSettingService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = orderSettingService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + OrderSettingEntity orderSetting = orderSettingService.getById(id); + + return R.ok().put("orderSetting", orderSetting); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody OrderSettingEntity orderSetting){ + orderSettingService.save(orderSetting); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody OrderSettingEntity orderSetting){ + orderSettingService.updateById(orderSetting); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + orderSettingService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/PaymentInfoController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/PaymentInfoController.java new file mode 100644 index 000000000..911bb84e4 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/PaymentInfoController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.PaymentInfoEntity; +import com.msb.mall.order.service.PaymentInfoService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 支付信息表 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@RestController +@RequestMapping("order/paymentinfo") +public class PaymentInfoController { + @Autowired + private PaymentInfoService paymentInfoService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = paymentInfoService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + PaymentInfoEntity paymentInfo = paymentInfoService.getById(id); + + return R.ok().put("paymentInfo", paymentInfo); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody PaymentInfoEntity paymentInfo){ + paymentInfoService.save(paymentInfo); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody PaymentInfoEntity paymentInfo){ + paymentInfoService.updateById(paymentInfo); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + paymentInfoService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/RefundInfoController.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/RefundInfoController.java new file mode 100644 index 000000000..b53a234a2 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/controller/RefundInfoController.java @@ -0,0 +1,84 @@ +package com.msb.mall.order.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.order.entity.RefundInfoEntity; +import com.msb.mall.order.service.RefundInfoService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 退款信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@RestController +@RequestMapping("order/refundinfo") +public class RefundInfoController { + @Autowired + private RefundInfoService refundInfoService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = refundInfoService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + RefundInfoEntity refundInfo = refundInfoService.getById(id); + + return R.ok().put("refundInfo", refundInfo); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody RefundInfoEntity refundInfo){ + refundInfoService.save(refundInfo); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody RefundInfoEntity refundInfo){ + refundInfoService.updateById(refundInfo); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + refundInfoService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderDao.java new file mode 100644 index 000000000..e60b35d68 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.OrderEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Mapper +public interface OrderDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderItemDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderItemDao.java new file mode 100644 index 000000000..10a650de4 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderItemDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.OrderItemEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单项信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Mapper +public interface OrderItemDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderOperateHistoryDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderOperateHistoryDao.java new file mode 100644 index 000000000..812fc3f80 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderOperateHistoryDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.OrderOperateHistoryEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单操作历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Mapper +public interface OrderOperateHistoryDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderReturnApplyDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderReturnApplyDao.java new file mode 100644 index 000000000..864491540 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderReturnApplyDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.OrderReturnApplyEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单退货申请 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Mapper +public interface OrderReturnApplyDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderReturnReasonDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderReturnReasonDao.java new file mode 100644 index 000000000..5966b3efa --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderReturnReasonDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.OrderReturnReasonEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 退货原因 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Mapper +public interface OrderReturnReasonDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderSettingDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderSettingDao.java new file mode 100644 index 000000000..ff9e367b5 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/OrderSettingDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.OrderSettingEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单配置信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Mapper +public interface OrderSettingDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/PaymentInfoDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/PaymentInfoDao.java new file mode 100644 index 000000000..a8680597d --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/PaymentInfoDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.PaymentInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 支付信息表 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Mapper +public interface PaymentInfoDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/RefundInfoDao.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/RefundInfoDao.java new file mode 100644 index 000000000..784daaa2e --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/dao/RefundInfoDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.order.dao; + +import com.msb.mall.order.entity.RefundInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 退款信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Mapper +public interface RefundInfoDao extends BaseMapper { + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderEntity.java new file mode 100644 index 000000000..1fe5d2458 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderEntity.java @@ -0,0 +1,193 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 订单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Data +@TableName("oms_order") +public class OrderEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * member_id + */ + private Long memberId; + /** + * 订单号 + */ + private String orderSn; + /** + * 使用的优惠券 + */ + private Long couponId; + /** + * create_time + */ + private Date createTime; + /** + * 用户名 + */ + private String memberUsername; + /** + * 订单总额 + */ + private BigDecimal totalAmount; + /** + * 应付总额 + */ + private BigDecimal payAmount; + /** + * 运费金额 + */ + private BigDecimal freightAmount; + /** + * 促销优化金额(促销价、满减、阶梯价) + */ + private BigDecimal promotionAmount; + /** + * 积分抵扣金额 + */ + private BigDecimal integrationAmount; + /** + * 优惠券抵扣金额 + */ + private BigDecimal couponAmount; + /** + * 后台调整订单使用的折扣金额 + */ + private BigDecimal discountAmount; + /** + * 支付方式【1->支付宝;2->微信;3->银联; 4->货到付款;】 + */ + private Integer payType; + /** + * 订单来源[0->PC订单;1->app订单] + */ + private Integer sourceType; + /** + * 订单状态【0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单】 + */ + private Integer status; + /** + * 物流公司(配送方式) + */ + private String deliveryCompany; + /** + * 物流单号 + */ + private String deliverySn; + /** + * 自动确认时间(天) + */ + private Integer autoConfirmDay; + /** + * 可以获得的积分 + */ + private Integer integration; + /** + * 可以获得的成长值 + */ + private Integer growth; + /** + * 发票类型[0->不开发票;1->电子发票;2->纸质发票] + */ + private Integer billType; + /** + * 发票抬头 + */ + private String billHeader; + /** + * 发票内容 + */ + private String billContent; + /** + * 收票人电话 + */ + private String billReceiverPhone; + /** + * 收票人邮箱 + */ + private String billReceiverEmail; + /** + * 收货人姓名 + */ + private String receiverName; + /** + * 收货人电话 + */ + private String receiverPhone; + /** + * 收货人邮编 + */ + private String receiverPostCode; + /** + * 省份/直辖市 + */ + private String receiverProvince; + /** + * 城市 + */ + private String receiverCity; + /** + * 区 + */ + private String receiverRegion; + /** + * 详细地址 + */ + private String receiverDetailAddress; + /** + * 订单备注 + */ + private String note; + /** + * 确认收货状态[0->未确认;1->已确认] + */ + private Integer confirmStatus; + /** + * 删除状态【0->未删除;1->已删除】 + */ + private Integer deleteStatus; + /** + * 下单时使用的积分 + */ + private Integer useIntegration; + /** + * 支付时间 + */ + private Date paymentTime; + /** + * 发货时间 + */ + private Date deliveryTime; + /** + * 确认收货时间 + */ + private Date receiveTime; + /** + * 评价时间 + */ + private Date commentTime; + /** + * 修改时间 + */ + private Date modifyTime; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderItemEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderItemEntity.java new file mode 100644 index 000000000..98b770592 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderItemEntity.java @@ -0,0 +1,105 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 订单项信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Data +@TableName("oms_order_item") +public class OrderItemEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * order_id + */ + private Long orderId; + /** + * order_sn + */ + private String orderSn; + /** + * spu_id + */ + private Long spuId; + /** + * spu_name + */ + private String spuName; + /** + * spu_pic + */ + private String spuPic; + /** + * 品牌 + */ + private String spuBrand; + /** + * 商品分类id + */ + private Long categoryId; + /** + * 商品sku编号 + */ + private Long skuId; + /** + * 商品sku名字 + */ + private String skuName; + /** + * 商品sku图片 + */ + private String skuPic; + /** + * 商品sku价格 + */ + private BigDecimal skuPrice; + /** + * 商品购买的数量 + */ + private Integer skuQuantity; + /** + * 商品销售属性组合(JSON) + */ + private String skuAttrsVals; + /** + * 商品促销分解金额 + */ + private BigDecimal promotionAmount; + /** + * 优惠券优惠分解金额 + */ + private BigDecimal couponAmount; + /** + * 积分优惠分解金额 + */ + private BigDecimal integrationAmount; + /** + * 该商品经过优惠后的分解金额 + */ + private BigDecimal realAmount; + /** + * 赠送积分 + */ + private Integer giftIntegration; + /** + * 赠送成长值 + */ + private Integer giftGrowth; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderOperateHistoryEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderOperateHistoryEntity.java new file mode 100644 index 000000000..8a4a22c46 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderOperateHistoryEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 订单操作历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Data +@TableName("oms_order_operate_history") +public class OrderOperateHistoryEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 订单id + */ + private Long orderId; + /** + * 操作人[用户;系统;后台管理员] + */ + private String operateMan; + /** + * 操作时间 + */ + private Date createTime; + /** + * 订单状态【0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单】 + */ + private Integer orderStatus; + /** + * 备注 + */ + private String note; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderReturnApplyEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderReturnApplyEntity.java new file mode 100644 index 000000000..b5c714551 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderReturnApplyEntity.java @@ -0,0 +1,137 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 订单退货申请 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +@Data +@TableName("oms_order_return_apply") +public class OrderReturnApplyEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * order_id + */ + private Long orderId; + /** + * 退货商品id + */ + private Long skuId; + /** + * 订单编号 + */ + private String orderSn; + /** + * 申请时间 + */ + private Date createTime; + /** + * 会员用户名 + */ + private String memberUsername; + /** + * 退款金额 + */ + private BigDecimal returnAmount; + /** + * 退货人姓名 + */ + private String returnName; + /** + * 退货人电话 + */ + private String returnPhone; + /** + * 申请状态[0->待处理;1->退货中;2->已完成;3->已拒绝] + */ + private Integer status; + /** + * 处理时间 + */ + private Date handleTime; + /** + * 商品图片 + */ + private String skuImg; + /** + * 商品名称 + */ + private String skuName; + /** + * 商品品牌 + */ + private String skuBrand; + /** + * 商品销售属性(JSON) + */ + private String skuAttrsVals; + /** + * 退货数量 + */ + private Integer skuCount; + /** + * 商品单价 + */ + private BigDecimal skuPrice; + /** + * 商品实际支付单价 + */ + private BigDecimal skuRealPrice; + /** + * 原因 + */ + private String reason; + /** + * 描述 + */ + private String description述; + /** + * 凭证图片,以逗号隔开 + */ + private String descPics; + /** + * 处理备注 + */ + private String handleNote; + /** + * 处理人员 + */ + private String handleMan; + /** + * 收货人 + */ + private String receiveMan; + /** + * 收货时间 + */ + private Date receiveTime; + /** + * 收货备注 + */ + private String receiveNote; + /** + * 收货电话 + */ + private String receivePhone; + /** + * 公司收货地址 + */ + private String companyAddress; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderReturnReasonEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderReturnReasonEntity.java new file mode 100644 index 000000000..868227563 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderReturnReasonEntity.java @@ -0,0 +1,44 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 退货原因 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Data +@TableName("oms_order_return_reason") +public class OrderReturnReasonEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 退货原因名 + */ + private String name; + /** + * 排序 + */ + private Integer sort; + /** + * 启用状态 + */ + private Integer status; + /** + * create_time + */ + private Date createTime; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderSettingEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderSettingEntity.java new file mode 100644 index 000000000..43c8a4cb1 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/OrderSettingEntity.java @@ -0,0 +1,52 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 订单配置信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Data +@TableName("oms_order_setting") +public class OrderSettingEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 秒杀订单超时关闭时间(分) + */ + private Integer flashOrderOvertime; + /** + * 正常订单超时时间(分) + */ + private Integer normalOrderOvertime; + /** + * 发货后自动确认收货时间(天) + */ + private Integer confirmOvertime; + /** + * 自动完成交易时间,不能申请退货(天) + */ + private Integer finishOvertime; + /** + * 订单完成后自动好评时间(天) + */ + private Integer commentOvertime; + /** + * 会员等级【0-不限会员等级,全部通用;其他-对应的其他会员等级】 + */ + private Integer memberLevel; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/PaymentInfoEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/PaymentInfoEntity.java new file mode 100644 index 000000000..3d177e712 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/PaymentInfoEntity.java @@ -0,0 +1,69 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 支付信息表 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Data +@TableName("oms_payment_info") +public class PaymentInfoEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 订单号(对外业务号) + */ + private String orderSn; + /** + * 订单id + */ + private Long orderId; + /** + * 支付宝交易流水号 + */ + private String alipayTradeNo; + /** + * 支付总金额 + */ + private BigDecimal totalAmount; + /** + * 交易内容 + */ + private String subject; + /** + * 支付状态 + */ + private String paymentStatus; + /** + * 创建时间 + */ + private Date createTime; + /** + * 确认时间 + */ + private Date confirmTime; + /** + * 回调内容 + */ + private String callbackContent; + /** + * 回调时间 + */ + private Date callbackTime; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/RefundInfoEntity.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/RefundInfoEntity.java new file mode 100644 index 000000000..9f1def55f --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/entity/RefundInfoEntity.java @@ -0,0 +1,53 @@ +package com.msb.mall.order.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 退款信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +@Data +@TableName("oms_refund_info") +public class RefundInfoEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 退款的订单 + */ + private Long orderReturnId; + /** + * 退款金额 + */ + private BigDecimal refund; + /** + * 退款交易流水号 + */ + private String refundSn; + /** + * 退款状态 + */ + private Integer refundStatus; + /** + * 退款渠道[1-支付宝,2-微信,3-银联,4-汇款] + */ + private Integer refundChannel; + /** + * + */ + private String refundContent; + +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/fegin/ProductService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/fegin/ProductService.java new file mode 100644 index 000000000..f990dda69 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/fegin/ProductService.java @@ -0,0 +1,11 @@ +package com.msb.mall.order.fegin; + +import com.msb.mall.commons.util.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +@FeignClient(name = "mall-product") +public interface ProductService { + @GetMapping("product/brand/all") + public R queryAllBrands(); +} diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderItemService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderItemService.java new file mode 100644 index 000000000..d18ccbb48 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderItemService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.OrderItemEntity; + +import java.util.Map; + +/** + * 订单项信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +public interface OrderItemService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderOperateHistoryService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderOperateHistoryService.java new file mode 100644 index 000000000..49a4eb357 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderOperateHistoryService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.OrderOperateHistoryEntity; + +import java.util.Map; + +/** + * 订单操作历史记录 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +public interface OrderOperateHistoryService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderReturnApplyService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderReturnApplyService.java new file mode 100644 index 000000000..fc29eaf4a --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderReturnApplyService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.OrderReturnApplyEntity; + +import java.util.Map; + +/** + * 订单退货申请 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +public interface OrderReturnApplyService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderReturnReasonService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderReturnReasonService.java new file mode 100644 index 000000000..cb3cd67d8 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderReturnReasonService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.OrderReturnReasonEntity; + +import java.util.Map; + +/** + * 退货原因 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +public interface OrderReturnReasonService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderService.java new file mode 100644 index 000000000..3aa294cb2 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.OrderEntity; + +import java.util.Map; + +/** + * 订单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:32 + */ +public interface OrderService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderSettingService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderSettingService.java new file mode 100644 index 000000000..32f4570c0 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/OrderSettingService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.OrderSettingEntity; + +import java.util.Map; + +/** + * 订单配置信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +public interface OrderSettingService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/PaymentInfoService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/PaymentInfoService.java new file mode 100644 index 000000000..004a540d5 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/PaymentInfoService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.PaymentInfoEntity; + +import java.util.Map; + +/** + * 支付信息表 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +public interface PaymentInfoService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/RefundInfoService.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/RefundInfoService.java new file mode 100644 index 000000000..9d940b568 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/RefundInfoService.java @@ -0,0 +1,20 @@ +package com.msb.mall.order.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.order.entity.RefundInfoEntity; + +import java.util.Map; + +/** + * 退款信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:48:31 + */ +public interface RefundInfoService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderItemServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderItemServiceImpl.java new file mode 100644 index 000000000..40c8ef3be --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderItemServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.OrderItemDao; +import com.msb.mall.order.entity.OrderItemEntity; +import com.msb.mall.order.service.OrderItemService; + + +@Service("orderItemService") +public class OrderItemServiceImpl extends ServiceImpl implements OrderItemService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderOperateHistoryServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderOperateHistoryServiceImpl.java new file mode 100644 index 000000000..ed3cd0791 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderOperateHistoryServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.OrderOperateHistoryDao; +import com.msb.mall.order.entity.OrderOperateHistoryEntity; +import com.msb.mall.order.service.OrderOperateHistoryService; + + +@Service("orderOperateHistoryService") +public class OrderOperateHistoryServiceImpl extends ServiceImpl implements OrderOperateHistoryService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderReturnApplyServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderReturnApplyServiceImpl.java new file mode 100644 index 000000000..b33173375 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderReturnApplyServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.OrderReturnApplyDao; +import com.msb.mall.order.entity.OrderReturnApplyEntity; +import com.msb.mall.order.service.OrderReturnApplyService; + + +@Service("orderReturnApplyService") +public class OrderReturnApplyServiceImpl extends ServiceImpl implements OrderReturnApplyService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderReturnReasonServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderReturnReasonServiceImpl.java new file mode 100644 index 000000000..980dd7c00 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderReturnReasonServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.OrderReturnReasonDao; +import com.msb.mall.order.entity.OrderReturnReasonEntity; +import com.msb.mall.order.service.OrderReturnReasonService; + + +@Service("orderReturnReasonService") +public class OrderReturnReasonServiceImpl extends ServiceImpl implements OrderReturnReasonService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderServiceImpl.java new file mode 100644 index 000000000..b1a2df2fd --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.OrderDao; +import com.msb.mall.order.entity.OrderEntity; +import com.msb.mall.order.service.OrderService; + + +@Service("orderService") +public class OrderServiceImpl extends ServiceImpl implements OrderService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderSettingServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderSettingServiceImpl.java new file mode 100644 index 000000000..b27dec0f9 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/OrderSettingServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.OrderSettingDao; +import com.msb.mall.order.entity.OrderSettingEntity; +import com.msb.mall.order.service.OrderSettingService; + + +@Service("orderSettingService") +public class OrderSettingServiceImpl extends ServiceImpl implements OrderSettingService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/PaymentInfoServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/PaymentInfoServiceImpl.java new file mode 100644 index 000000000..c82943ef0 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/PaymentInfoServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.PaymentInfoDao; +import com.msb.mall.order.entity.PaymentInfoEntity; +import com.msb.mall.order.service.PaymentInfoService; + + +@Service("paymentInfoService") +public class PaymentInfoServiceImpl extends ServiceImpl implements PaymentInfoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/RefundInfoServiceImpl.java b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/RefundInfoServiceImpl.java new file mode 100644 index 000000000..98f8e5f39 --- /dev/null +++ b/msb-mall/mall-order/src/main/java/com/msb/mall/order/service/impl/RefundInfoServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.order.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.order.dao.RefundInfoDao; +import com.msb.mall.order.entity.RefundInfoEntity; +import com.msb.mall.order.service.RefundInfoService; + + +@Service("refundInfoService") +public class RefundInfoServiceImpl extends ServiceImpl implements RefundInfoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/application.yml b/msb-mall/mall-order/src/main/resources/application.yml new file mode 100644 index 000000000..83e23adfd --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/application.yml @@ -0,0 +1,53 @@ +#spring: +# datasource: +# username: root +# password: root +# url: jdbc:mysql://192.168.37.133:3306/msb-oms?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai +# driver-class-name: com.mysql.cj.jdbc.Driver +# cloud: +# nacos: +# discovery: +# server-addr: 192.168.37.133:8848 +# application: +# name: mall-order +#mybatis-plus: +# mapper-locations: classpath*:/mapper/**/*.xml +# global-config: +# db-config: +# id-type: auto #主键自增 +#server: +# port: 8030 +#user: +# uasername: dalong1 +# age: 17 +base: + config: + mdb: + hostname: 192.168.37.133 #your mysql server ip address + dbname: seata #your database name for test + port: 3306 #your mysql server listening port + username: root #your mysql server username + password: root #your mysql server password +spring: + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 +seata: + enabled: true + application-id: ${spring.application.name} + tx-service-group: ${spring.application.name}-tx-group + config: + type: nacos + nacos: + serverAddr: 192.168.37.133:8848 + dataId: "seata.properties" + username: "nacos" + password: "nacos" + registry: + type: nacos + nacos: + application: seata-server + server-addr: 192.168.37.133:8848 + username: "nacos" + password: "nacos" \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/bootstrap.properties b/msb-mall/mall-order/src/main/resources/bootstrap.properties new file mode 100644 index 000000000..7ec556360 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/bootstrap.properties @@ -0,0 +1,21 @@ +spring.application.name=mall-order +spring.cloud.nacos.config.server-addr=192.168.37.133:8848 +spring.cloud.nacos.config.namespace=0fc6fc2c-0063-4e44-a879-f46fc9f7fb5f +#???? +spring.cloud.nacos.config.group=prod + + +#??????? +spring.cloud.nacos.config.ext-config[0].data-id=mybatis.yml +spring.cloud.nacos.config.ext-config[0].group=prod +spring.cloud.nacos.config.ext-config[0].refresh=false + +spring.cloud.nacos.config.ext-config[1].data-id=datasours.yml +spring.cloud.nacos.config.ext-config[1].group=prod +spring.cloud.nacos.config.ext-config[1].refresh=false + +spring.cloud.nacos.config.ext-config[2].data-id=other.yml +spring.cloud.nacos.config.ext-config[2].group=prod +spring.cloud.nacos.config.ext-config[2].refresh=false + + diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/OrderDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/OrderDao.xml new file mode 100644 index 000000000..d332021f5 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/OrderDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/OrderItemDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/OrderItemDao.xml new file mode 100644 index 000000000..db16c8837 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/OrderItemDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/OrderOperateHistoryDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/OrderOperateHistoryDao.xml new file mode 100644 index 000000000..789466f31 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/OrderOperateHistoryDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/OrderReturnApplyDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/OrderReturnApplyDao.xml new file mode 100644 index 000000000..b9a621b77 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/OrderReturnApplyDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/OrderReturnReasonDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/OrderReturnReasonDao.xml new file mode 100644 index 000000000..275a75d42 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/OrderReturnReasonDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/OrderSettingDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/OrderSettingDao.xml new file mode 100644 index 000000000..3e68688ef --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/OrderSettingDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/PaymentInfoDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/PaymentInfoDao.xml new file mode 100644 index 000000000..e1907e035 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/PaymentInfoDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/mapper/order/RefundInfoDao.xml b/msb-mall/mall-order/src/main/resources/mapper/order/RefundInfoDao.xml new file mode 100644 index 000000000..f0479b1de --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/mapper/order/RefundInfoDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/order-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/order-add-or-update.vue new file mode 100644 index 000000000..30c6d1ad7 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/order-add-or-update.vue @@ -0,0 +1,444 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/order.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/order.vue new file mode 100644 index 000000000..c2615f564 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/order.vue @@ -0,0 +1,403 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderitem-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderitem-add-or-update.vue new file mode 100644 index 000000000..230153c6a --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderitem-add-or-update.vue @@ -0,0 +1,246 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderitem.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderitem.vue new file mode 100644 index 000000000..da32e6816 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderitem.vue @@ -0,0 +1,271 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderoperatehistory-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderoperatehistory-add-or-update.vue new file mode 100644 index 000000000..6f77c46cf --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderoperatehistory-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderoperatehistory.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderoperatehistory.vue new file mode 100644 index 000000000..8fcca8264 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderoperatehistory.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnapply-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnapply-add-or-update.vue new file mode 100644 index 000000000..784e49675 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnapply-add-or-update.vue @@ -0,0 +1,318 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnapply.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnapply.vue new file mode 100644 index 000000000..97ffde6a5 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnapply.vue @@ -0,0 +1,319 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnreason-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnreason-add-or-update.vue new file mode 100644 index 000000000..eb71508b6 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnreason-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnreason.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnreason.vue new file mode 100644 index 000000000..cace13e46 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/orderreturnreason.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/ordersetting-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/ordersetting-add-or-update.vue new file mode 100644 index 000000000..9cf5907cd --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/ordersetting-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/ordersetting.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/ordersetting.vue new file mode 100644 index 000000000..531a64870 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/ordersetting.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/paymentinfo-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/paymentinfo-add-or-update.vue new file mode 100644 index 000000000..e66334f4b --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/paymentinfo-add-or-update.vue @@ -0,0 +1,165 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/paymentinfo.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/paymentinfo.vue new file mode 100644 index 000000000..8ddbc5b3c --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/paymentinfo.vue @@ -0,0 +1,217 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/refundinfo-add-or-update.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/refundinfo-add-or-update.vue new file mode 100644 index 000000000..c76a044c2 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/refundinfo-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-order/src/main/resources/src/views/modules/order/refundinfo.vue b/msb-mall/mall-order/src/main/resources/src/views/modules/order/refundinfo.vue new file mode 100644 index 000000000..87b422e64 --- /dev/null +++ b/msb-mall/mall-order/src/main/resources/src/views/modules/order/refundinfo.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-order/src/test/java/com/msb/mall/order/MallOrderApplicationTests.java b/msb-mall/mall-order/src/test/java/com/msb/mall/order/MallOrderApplicationTests.java new file mode 100644 index 000000000..8e2a7e977 --- /dev/null +++ b/msb-mall/mall-order/src/test/java/com/msb/mall/order/MallOrderApplicationTests.java @@ -0,0 +1,13 @@ +package com.msb.mall.order; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MallOrderApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/msb-mall/mall-producet/.gitignore b/msb-mall/mall-producet/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-producet/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-producet/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-producet/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-producet/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-producet/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-producet/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-producet/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-producet/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-producet/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-producet/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-producet/README.md b/msb-mall/mall-producet/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-producet/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-producet/mvnw b/msb-mall/mall-producet/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-producet/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-producet/mvnw.cmd b/msb-mall/mall-producet/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-producet/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-producet/pom.xml b/msb-mall/mall-producet/pom.xml new file mode 100644 index 000000000..cf2fccbda --- /dev/null +++ b/msb-mall/mall-producet/pom.xml @@ -0,0 +1,134 @@ + + + 4.0.0 + com.msb.mall + mall-producet + 0.0.1-SNAPSHOT + mall-producet + mall-producet1 + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-devtools + true + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.redisson + redisson + 3.16.1 + + + org.springframework.boot + spring-boot-starter-cache + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.product.MallProducetApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/MallProducetApplication.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/MallProducetApplication.java new file mode 100644 index 000000000..d52b5ed66 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/MallProducetApplication.java @@ -0,0 +1,20 @@ +package com.msb.mall.product; + +import org.apache.ibatis.annotations.Mapper; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +//@EnableDiscoveryClient +@EnableCaching +@SpringBootApplication +@MapperScan("com.msb.mall.product.dao") +public class MallProducetApplication { + + public static void main(String[] args) { + SpringApplication.run(MallProducetApplication.class, args); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/config/MyRedisConfig.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/config/MyRedisConfig.java new file mode 100644 index 000000000..a9a565b2b --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/config/MyRedisConfig.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.config; + +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.redisson.client.RedisClient; +import org.redisson.config.Config; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MyRedisConfig { + @Bean + public RedissonClient redissonClient(){ + System.out.println("=====>redissonClient"); + Config config=new Config(); + config.useSingleServer().setAddress("redis://192.168.37.133:6379"); + RedissonClient redissonClient = Redisson.create(config); + return redissonClient; + } +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrAttrgroupRelationController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrAttrgroupRelationController.java new file mode 100644 index 000000000..e2c01a3e0 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrAttrgroupRelationController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.AttrAttrgroupRelationEntity; +import com.msb.mall.product.service.AttrAttrgroupRelationService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 属性&属性分组关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@RestController +@RequestMapping("product/attrattrgrouprelation") +public class AttrAttrgroupRelationController { + @Autowired + private AttrAttrgroupRelationService attrAttrgroupRelationService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = attrAttrgroupRelationService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + AttrAttrgroupRelationEntity attrAttrgroupRelation = attrAttrgroupRelationService.getById(id); + + return R.ok().put("attrAttrgroupRelation", attrAttrgroupRelation); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){ + attrAttrgroupRelationService.save(attrAttrgroupRelation); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){ + attrAttrgroupRelationService.updateById(attrAttrgroupRelation); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + attrAttrgroupRelationService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrController.java new file mode 100644 index 000000000..949c9ff46 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.AttrEntity; +import com.msb.mall.product.service.AttrService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品属性 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@RestController +@RequestMapping("product/attr") +public class AttrController { + @Autowired + private AttrService attrService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = attrService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{attrId}") + public R info(@PathVariable("attrId") Long attrId){ + AttrEntity attr = attrService.getById(attrId); + + return R.ok().put("attr", attr); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody AttrEntity attr){ + attrService.save(attr); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody AttrEntity attr){ + attrService.updateById(attr); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] attrIds){ + attrService.removeByIds(Arrays.asList(attrIds)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrGroupController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrGroupController.java new file mode 100644 index 000000000..65bda1c9d --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/AttrGroupController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.AttrGroupEntity; +import com.msb.mall.product.service.AttrGroupService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 属性分组 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/attrgroup") +public class AttrGroupController { + @Autowired + private AttrGroupService attrGroupService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = attrGroupService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{attrGroupId}") + public R info(@PathVariable("attrGroupId") Long attrGroupId){ + AttrGroupEntity attrGroup = attrGroupService.getById(attrGroupId); + + return R.ok().put("attrGroup", attrGroup); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody AttrGroupEntity attrGroup){ + attrGroupService.save(attrGroup); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody AttrGroupEntity attrGroup){ + attrGroupService.updateById(attrGroup); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] attrGroupIds){ + attrGroupService.removeByIds(Arrays.asList(attrGroupIds)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/BrandController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/BrandController.java new file mode 100644 index 000000000..e409f882d --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/BrandController.java @@ -0,0 +1,108 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import com.msb.mall.product.entity.CategoryBrandRelationEntity; +import com.msb.mall.product.service.CategoryBrandRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.web.bind.annotation.*; + +import com.msb.mall.product.entity.BrandEntity; +import com.msb.mall.product.service.BrandService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 品牌 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/brand") +public class BrandController { + @Autowired + private BrandService brandService; + @Autowired + private CategoryBrandRelationService categoryBrandRelationService; + + @Cacheable(value = "category",key = "#root.method.name") + @GetMapping("all") + public R queryBrand(){ + BrandEntity brandEntity=new BrandEntity(); + brandEntity.setName("华为huawei2"); + System.out.println("=====>queryBrand被远程调用了"); + saveTest(); + return R.ok().put("brands",brandEntity); + } + public R saveTest(){ + System.out.println("=====>savetest"); + CategoryBrandRelationEntity categoryBrandRelationEntity = new CategoryBrandRelationEntity(); + categoryBrandRelationEntity.setId(4L); + categoryBrandRelationEntity.setCatelogId(30L); + categoryBrandRelationEntity.setBrandId(40L); + categoryBrandRelationEntity.setBrandName("huawei4"); + categoryBrandRelationEntity.setCatelogName("hua4"); + categoryBrandRelationService.save(categoryBrandRelationEntity); + return R.ok(); + } + /** + * 列表 + */ + @Cacheable("category") + @RequestMapping("/list") + public R list(@RequestParam Map params){ + System.out.println("==================>params = " + params); + PageUtils page = brandService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{brandId}") + public R info(@PathVariable("brandId") Long brandId){ + BrandEntity brand = brandService.getById(brandId); + + return R.ok().put("brand", brand); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody BrandEntity brand){ + brandService.save(brand); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody BrandEntity brand){ + brandService.updateById(brand); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] brandIds){ + brandService.removeByIds(Arrays.asList(brandIds)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CategoryBrandRelationController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CategoryBrandRelationController.java new file mode 100644 index 000000000..750f65e6f --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CategoryBrandRelationController.java @@ -0,0 +1,101 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import io.seata.spring.annotation.GlobalTransactional; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.CategoryBrandRelationEntity; +import com.msb.mall.product.service.CategoryBrandRelationService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 品牌分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/categorybrandrelation") +public class CategoryBrandRelationController { + @Autowired + private CategoryBrandRelationService categoryBrandRelationService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = categoryBrandRelationService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + CategoryBrandRelationEntity categoryBrandRelation = categoryBrandRelationService.getById(id); + + return R.ok().put("categoryBrandRelation", categoryBrandRelation); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CategoryBrandRelationEntity categoryBrandRelation){ + categoryBrandRelationService.save(categoryBrandRelation); + + return R.ok(); + } + @GlobalTransactional + @RequestMapping("/savetest") + public R saveTest(){ + System.out.println("=====>savetest"); + CategoryBrandRelationEntity categoryBrandRelationEntity = new CategoryBrandRelationEntity(); + categoryBrandRelationEntity.setId(4L); + categoryBrandRelationEntity.setCatelogId(40L); + categoryBrandRelationEntity.setBrandId(50L); + categoryBrandRelationEntity.setBrandName("huawei4"); + categoryBrandRelationEntity.setCatelogName("hua4"); + categoryBrandRelationService.save(categoryBrandRelationEntity); + int i=10/0; + System.out.println("====>end"); + + return R.ok(); + } + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CategoryBrandRelationEntity categoryBrandRelation){ + categoryBrandRelationService.updateById(categoryBrandRelation); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + categoryBrandRelationService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CategoryController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CategoryController.java new file mode 100644 index 000000000..203036025 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CategoryController.java @@ -0,0 +1,93 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.CategoryEntity; +import com.msb.mall.product.service.CategoryService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品三级分类 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/category") +public class CategoryController { + @Autowired + private CategoryService categoryService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = categoryService.queryPage(params); +// PageUtils page = categoryService.queryPageWithTree(params); + + return R.ok().put("page", page); + } + + @RequestMapping("/listTree") + public R listTree(@RequestParam Map params){ +// PageUtils page = categoryService.queryPage(params); + List list = categoryService.queryPageWithTree(params); + + return R.ok().put("data", list); + } + /** + * 信息 + */ + @RequestMapping("/info/{catId}") + public R info(@PathVariable("catId") Long catId){ + CategoryEntity category = categoryService.getById(catId); + + return R.ok().put("category", category); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CategoryEntity category){ + categoryService.save(category); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CategoryEntity category){ + categoryService.updateById(category); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] catIds){ + categoryService.removeByIds(Arrays.asList(catIds)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CommentReplayController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CommentReplayController.java new file mode 100644 index 000000000..87f8ef132 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/CommentReplayController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.CommentReplayEntity; +import com.msb.mall.product.service.CommentReplayService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品评价回复关系 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/commentreplay") +public class CommentReplayController { + @Autowired + private CommentReplayService commentReplayService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = commentReplayService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + CommentReplayEntity commentReplay = commentReplayService.getById(id); + + return R.ok().put("commentReplay", commentReplay); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody CommentReplayEntity commentReplay){ + commentReplayService.save(commentReplay); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody CommentReplayEntity commentReplay){ + commentReplayService.updateById(commentReplay); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + commentReplayService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/ProductAttrValueController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/ProductAttrValueController.java new file mode 100644 index 000000000..16bf46427 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/ProductAttrValueController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.ProductAttrValueEntity; +import com.msb.mall.product.service.ProductAttrValueService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * spu属性值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/productattrvalue") +public class ProductAttrValueController { + @Autowired + private ProductAttrValueService productAttrValueService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = productAttrValueService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + ProductAttrValueEntity productAttrValue = productAttrValueService.getById(id); + + return R.ok().put("productAttrValue", productAttrValue); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody ProductAttrValueEntity productAttrValue){ + productAttrValueService.save(productAttrValue); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody ProductAttrValueEntity productAttrValue){ + productAttrValueService.updateById(productAttrValue); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + productAttrValueService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuImagesController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuImagesController.java new file mode 100644 index 000000000..53b9c4adb --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuImagesController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SkuImagesEntity; +import com.msb.mall.product.service.SkuImagesService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * sku图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/skuimages") +public class SkuImagesController { + @Autowired + private SkuImagesService skuImagesService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = skuImagesService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SkuImagesEntity skuImages = skuImagesService.getById(id); + + return R.ok().put("skuImages", skuImages); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SkuImagesEntity skuImages){ + skuImagesService.save(skuImages); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SkuImagesEntity skuImages){ + skuImagesService.updateById(skuImages); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + skuImagesService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuInfoController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuInfoController.java new file mode 100644 index 000000000..32ac4b9f0 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuInfoController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SkuInfoEntity; +import com.msb.mall.product.service.SkuInfoService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * sku信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/skuinfo") +public class SkuInfoController { + @Autowired + private SkuInfoService skuInfoService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = skuInfoService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{skuId}") + public R info(@PathVariable("skuId") Long skuId){ + SkuInfoEntity skuInfo = skuInfoService.getById(skuId); + + return R.ok().put("skuInfo", skuInfo); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SkuInfoEntity skuInfo){ + skuInfoService.save(skuInfo); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SkuInfoEntity skuInfo){ + skuInfoService.updateById(skuInfo); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] skuIds){ + skuInfoService.removeByIds(Arrays.asList(skuIds)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuSaleAttrValueController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuSaleAttrValueController.java new file mode 100644 index 000000000..db2231548 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SkuSaleAttrValueController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SkuSaleAttrValueEntity; +import com.msb.mall.product.service.SkuSaleAttrValueService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * sku销售属性&值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@RestController +@RequestMapping("product/skusaleattrvalue") +public class SkuSaleAttrValueController { + @Autowired + private SkuSaleAttrValueService skuSaleAttrValueService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = skuSaleAttrValueService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SkuSaleAttrValueEntity skuSaleAttrValue = skuSaleAttrValueService.getById(id); + + return R.ok().put("skuSaleAttrValue", skuSaleAttrValue); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SkuSaleAttrValueEntity skuSaleAttrValue){ + skuSaleAttrValueService.save(skuSaleAttrValue); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SkuSaleAttrValueEntity skuSaleAttrValue){ + skuSaleAttrValueService.updateById(skuSaleAttrValue); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + skuSaleAttrValueService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuCommentController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuCommentController.java new file mode 100644 index 000000000..5d30ce9af --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuCommentController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SpuCommentEntity; +import com.msb.mall.product.service.SpuCommentService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品评价 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@RestController +@RequestMapping("product/spucomment") +public class SpuCommentController { + @Autowired + private SpuCommentService spuCommentService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = spuCommentService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SpuCommentEntity spuComment = spuCommentService.getById(id); + + return R.ok().put("spuComment", spuComment); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SpuCommentEntity spuComment){ + spuCommentService.save(spuComment); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SpuCommentEntity spuComment){ + spuCommentService.updateById(spuComment); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + spuCommentService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuImagesController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuImagesController.java new file mode 100644 index 000000000..4d4b7f704 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuImagesController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SpuImagesEntity; +import com.msb.mall.product.service.SpuImagesService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * spu图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@RestController +@RequestMapping("product/spuimages") +public class SpuImagesController { + @Autowired + private SpuImagesService spuImagesService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = spuImagesService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SpuImagesEntity spuImages = spuImagesService.getById(id); + + return R.ok().put("spuImages", spuImages); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SpuImagesEntity spuImages){ + spuImagesService.save(spuImages); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SpuImagesEntity spuImages){ + spuImagesService.updateById(spuImages); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + spuImagesService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuInfoController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuInfoController.java new file mode 100644 index 000000000..244806f1f --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuInfoController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SpuInfoEntity; +import com.msb.mall.product.service.SpuInfoService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * spu信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/spuinfo") +public class SpuInfoController { + @Autowired + private SpuInfoService spuInfoService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = spuInfoService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + SpuInfoEntity spuInfo = spuInfoService.getById(id); + + return R.ok().put("spuInfo", spuInfo); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SpuInfoEntity spuInfo){ + spuInfoService.save(spuInfo); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SpuInfoEntity spuInfo){ + spuInfoService.updateById(spuInfo); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + spuInfoService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuInfoDescController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuInfoDescController.java new file mode 100644 index 000000000..3c2a863bd --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/controller/SpuInfoDescController.java @@ -0,0 +1,85 @@ +package com.msb.mall.product.controller; + +import java.util.Arrays; +import java.util.Map; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.product.entity.SpuInfoDescEntity; +import com.msb.mall.product.service.SpuInfoDescService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * spu信息介绍 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@RestController +@RequestMapping("product/spuinfodesc") +public class SpuInfoDescController { + @Autowired + private SpuInfoDescService spuInfoDescService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = spuInfoDescService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{spuId}") + public R info(@PathVariable("spuId") Long spuId){ + SpuInfoDescEntity spuInfoDesc = spuInfoDescService.getById(spuId); + + return R.ok().put("spuInfoDesc", spuInfoDesc); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody SpuInfoDescEntity spuInfoDesc){ + spuInfoDescService.save(spuInfoDesc); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody SpuInfoDescEntity spuInfoDesc){ + spuInfoDescService.updateById(spuInfoDesc); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] spuIds){ + spuInfoDescService.removeByIds(Arrays.asList(spuIds)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrAttrgroupRelationDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrAttrgroupRelationDao.java new file mode 100644 index 000000000..e67bdb3e6 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrAttrgroupRelationDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.AttrAttrgroupRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 属性&属性分组关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Mapper +public interface AttrAttrgroupRelationDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrDao.java new file mode 100644 index 000000000..2a82659cc --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.AttrEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品属性 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Mapper +public interface AttrDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrGroupDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrGroupDao.java new file mode 100644 index 000000000..67983cf52 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/AttrGroupDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.AttrGroupEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 属性分组 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface AttrGroupDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/BrandDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/BrandDao.java new file mode 100644 index 000000000..ec9ae45cb --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/BrandDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.BrandEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 品牌 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface BrandDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CategoryBrandRelationDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CategoryBrandRelationDao.java new file mode 100644 index 000000000..e7940696c --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CategoryBrandRelationDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.CategoryBrandRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 品牌分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface CategoryBrandRelationDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CategoryDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CategoryDao.java new file mode 100644 index 000000000..9f3e9e0b1 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CategoryDao.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.CategoryEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 商品三级分类 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface CategoryDao extends BaseMapper { + + List queryLeve1Category(); +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CommentReplayDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CommentReplayDao.java new file mode 100644 index 000000000..6edf244cd --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/CommentReplayDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.CommentReplayEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品评价回复关系 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface CommentReplayDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/ProductAttrValueDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/ProductAttrValueDao.java new file mode 100644 index 000000000..dbf609ec5 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/ProductAttrValueDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.ProductAttrValueEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * spu属性值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface ProductAttrValueDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuImagesDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuImagesDao.java new file mode 100644 index 000000000..e5467957b --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuImagesDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SkuImagesEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * sku图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface SkuImagesDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuInfoDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuInfoDao.java new file mode 100644 index 000000000..b253b277e --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuInfoDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SkuInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * sku信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface SkuInfoDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuSaleAttrValueDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuSaleAttrValueDao.java new file mode 100644 index 000000000..05782cef2 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SkuSaleAttrValueDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SkuSaleAttrValueEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * sku销售属性&值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Mapper +public interface SkuSaleAttrValueDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuCommentDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuCommentDao.java new file mode 100644 index 000000000..48400d00b --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuCommentDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SpuCommentEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品评价 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Mapper +public interface SpuCommentDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuImagesDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuImagesDao.java new file mode 100644 index 000000000..241ed7358 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuImagesDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SpuImagesEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * spu图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Mapper +public interface SpuImagesDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuInfoDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuInfoDao.java new file mode 100644 index 000000000..29388fb00 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuInfoDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SpuInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * spu信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface SpuInfoDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuInfoDescDao.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuInfoDescDao.java new file mode 100644 index 000000000..02a0352d3 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/dao/SpuInfoDescDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.product.dao; + +import com.msb.mall.product.entity.SpuInfoDescEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * spu信息介绍 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Mapper +public interface SpuInfoDescDao extends BaseMapper { + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrAttrgroupRelationEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrAttrgroupRelationEntity.java new file mode 100644 index 000000000..952491da8 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrAttrgroupRelationEntity.java @@ -0,0 +1,40 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 属性&属性分组关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Data +@TableName("pms_attr_attrgroup_relation") +public class AttrAttrgroupRelationEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 属性id + */ + private Long attrId; + /** + * 属性分组id + */ + private Long attrGroupId; + /** + * 属性组内排序 + */ + private Integer attrSort; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrEntity.java new file mode 100644 index 000000000..d5167f210 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrEntity.java @@ -0,0 +1,60 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品属性 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Data +@TableName("pms_attr") +public class AttrEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 属性id + */ + @TableId + private Long attrId; + /** + * 属性名 + */ + private String attrName; + /** + * 是否需要检索[0-不需要,1-需要] + */ + private Integer searchType; + /** + * 属性图标 + */ + private String icon; + /** + * 可选值列表[用逗号分隔] + */ + private String valueSelect; + /** + * 属性类型[0-销售属性,1-基本属性,2-既是销售属性又是基本属性] + */ + private Integer attrType; + /** + * 启用状态[0 - 禁用,1 - 启用] + */ + private Long enable; + /** + * 所属分类 + */ + private Long catelogId; + /** + * 快速展示【是否展示在介绍上;0-否 1-是】,在sku中仍然可以调整 + */ + private Integer showDesc; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrGroupEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrGroupEntity.java new file mode 100644 index 000000000..386c86bb6 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/AttrGroupEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 属性分组 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_attr_group") +public class AttrGroupEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 分组id + */ + @TableId + private Long attrGroupId; + /** + * 组名 + */ + private String attrGroupName; + /** + * 排序 + */ + private Integer sort; + /** + * 描述 + */ + private String descript; + /** + * 组图标 + */ + private String icon; + /** + * 所属分类id + */ + private Long catelogId; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/BrandEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/BrandEntity.java new file mode 100644 index 000000000..0745f6697 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/BrandEntity.java @@ -0,0 +1,52 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 品牌 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_brand") +public class BrandEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 品牌id + */ + @TableId + private Long brandId; + /** + * 品牌名 + */ + private String name; + /** + * 品牌logo地址 + */ + private String logo; + /** + * 介绍 + */ + private String descript; + /** + * 显示状态[0-不显示;1-显示] + */ + private Integer showStatus; + /** + * 检索首字母 + */ + private String firstLetter; + /** + * 排序 + */ + private Integer sort; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CategoryBrandRelationEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CategoryBrandRelationEntity.java new file mode 100644 index 000000000..732169da9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CategoryBrandRelationEntity.java @@ -0,0 +1,44 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 品牌分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_category_brand_relation") +public class CategoryBrandRelationEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId + private Long id; + /** + * 品牌id + */ + private Long brandId; + /** + * 分类id + */ + private Long catelogId; + /** + * + */ + private String brandName; + /** + * + */ + private String catelogName; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CategoryEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CategoryEntity.java new file mode 100644 index 000000000..25897e485 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CategoryEntity.java @@ -0,0 +1,67 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import lombok.Data; + +/** + * 商品三级分类 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_category") +public class CategoryEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 分类id + */ + @TableId + private Long catId; + /** + * 分类名称 + */ + private String name; + /** + * 父分类id + */ + private Long parentCid; + /** + * 层级 + */ + private Integer catLevel; + /** + * 是否显示[0-不显示,1显示] + */ + private Integer showStatus; + /** + * 排序 + */ + private Integer sort; + /** + * 图标地址 + */ + private String icon; + /** + * 计量单位 + */ + private String productUnit; + /** + * 商品数量 + */ + private Integer productCount; + + @TableField(exist = false) + private List childrens; + + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CommentReplayEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CommentReplayEntity.java new file mode 100644 index 000000000..261a76971 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/CommentReplayEntity.java @@ -0,0 +1,36 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品评价回复关系 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_comment_replay") +public class CommentReplayEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 评论id + */ + private Long commentId; + /** + * 回复id + */ + private Long replyId; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/ProductAttrValueEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/ProductAttrValueEntity.java new file mode 100644 index 000000000..2c753c21b --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/ProductAttrValueEntity.java @@ -0,0 +1,52 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * spu属性值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_product_attr_value") +public class ProductAttrValueEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 商品id + */ + private Long spuId; + /** + * 属性id + */ + private Long attrId; + /** + * 属性名 + */ + private String attrName; + /** + * 属性值 + */ + private String attrValue; + /** + * 顺序 + */ + private Integer attrSort; + /** + * 快速展示【是否展示在介绍上;0-否 1-是】 + */ + private Integer quickShow; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuImagesEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuImagesEntity.java new file mode 100644 index 000000000..847e4ced0 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuImagesEntity.java @@ -0,0 +1,44 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * sku图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_sku_images") +public class SkuImagesEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * sku_id + */ + private Long skuId; + /** + * 图片地址 + */ + private String imgUrl; + /** + * 排序 + */ + private Integer imgSort; + /** + * 默认图[0 - 不是默认图,1 - 是默认图] + */ + private Integer defaultImg; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuInfoEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuInfoEntity.java new file mode 100644 index 000000000..bb4dfd199 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuInfoEntity.java @@ -0,0 +1,69 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * sku信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_sku_info") +public class SkuInfoEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * skuId + */ + @TableId + private Long skuId; + /** + * spuId + */ + private Long spuId; + /** + * sku名称 + */ + private String skuName; + /** + * sku介绍描述 + */ + private String skuDesc; + /** + * 所属分类id + */ + private Long catalogId; + /** + * 品牌id + */ + private Long brandId; + /** + * 默认图片 + */ + private String skuDefaultImg; + /** + * 标题 + */ + private String skuTitle; + /** + * 副标题 + */ + private String skuSubtitle; + /** + * 价格 + */ + private BigDecimal price; + /** + * 销量 + */ + private Long saleCount; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuSaleAttrValueEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuSaleAttrValueEntity.java new file mode 100644 index 000000000..103378cbf --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SkuSaleAttrValueEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * sku销售属性&值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Data +@TableName("pms_sku_sale_attr_value") +public class SkuSaleAttrValueEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * sku_id + */ + private Long skuId; + /** + * attr_id + */ + private Long attrId; + /** + * 销售属性名 + */ + private String attrName; + /** + * 销售属性值 + */ + private String attrValue; + /** + * 顺序 + */ + private Integer attrSort; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuCommentEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuCommentEntity.java new file mode 100644 index 000000000..ddc6f9104 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuCommentEntity.java @@ -0,0 +1,88 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品评价 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Data +@TableName("pms_spu_comment") +public class SpuCommentEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * sku_id + */ + private Long skuId; + /** + * spu_id + */ + private Long spuId; + /** + * 商品名字 + */ + private String spuName; + /** + * 会员昵称 + */ + private String memberNickName; + /** + * 星级 + */ + private Integer star; + /** + * 会员ip + */ + private String memberIp; + /** + * 创建时间 + */ + private Date createTime; + /** + * 显示状态[0-不显示,1-显示] + */ + private Integer showStatus; + /** + * 购买时属性组合 + */ + private String spuAttributes; + /** + * 点赞数 + */ + private Integer likesCount; + /** + * 回复数 + */ + private Integer replyCount; + /** + * 评论图片/视频[json数据;[{type:文件类型,url:资源路径}]] + */ + private String resources; + /** + * 内容 + */ + private String content; + /** + * 用户头像 + */ + private String memberIcon; + /** + * 评论类型[0 - 对商品的直接评论,1 - 对评论的回复] + */ + private Integer commentType; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuImagesEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuImagesEntity.java new file mode 100644 index 000000000..ef46f33da --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuImagesEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * spu图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +@Data +@TableName("pms_spu_images") +public class SpuImagesEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * spu_id + */ + private Long spuId; + /** + * 图片名 + */ + private String imgName; + /** + * 图片地址 + */ + private String imgUrl; + /** + * 顺序 + */ + private Integer imgSort; + /** + * 是否默认图 + */ + private Integer defaultImg; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuInfoDescEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuInfoDescEntity.java new file mode 100644 index 000000000..3d648b10b --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuInfoDescEntity.java @@ -0,0 +1,32 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * spu信息介绍 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_spu_info_desc") +public class SpuInfoDescEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 商品id + */ + @TableId + private Long spuId; + /** + * 商品介绍 + */ + private String decript; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuInfoEntity.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuInfoEntity.java new file mode 100644 index 000000000..ce4b619bb --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/entity/SpuInfoEntity.java @@ -0,0 +1,61 @@ +package com.msb.mall.product.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * spu信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +@Data +@TableName("pms_spu_info") +public class SpuInfoEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 商品id + */ + @TableId + private Long id; + /** + * 商品名称 + */ + private String spuName; + /** + * 商品描述 + */ + private String spuDescription; + /** + * 所属分类id + */ + private Long catalogId; + /** + * 品牌id + */ + private Long brandId; + /** + * + */ + private BigDecimal weight; + /** + * 上架状态[0 - 下架,1 - 上架] + */ + private Integer publishStatus; + /** + * + */ + private Date createTime; + /** + * + */ + private Date updateTime; + +} diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrAttrgroupRelationService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrAttrgroupRelationService.java new file mode 100644 index 000000000..5679f9676 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrAttrgroupRelationService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.AttrAttrgroupRelationEntity; + +import java.util.Map; + +/** + * 属性&属性分组关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +public interface AttrAttrgroupRelationService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrGroupService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrGroupService.java new file mode 100644 index 000000000..fb77d0f80 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrGroupService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.AttrGroupEntity; + +import java.util.Map; + +/** + * 属性分组 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface AttrGroupService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrService.java new file mode 100644 index 000000000..3143756d1 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/AttrService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.AttrEntity; + +import java.util.Map; + +/** + * 商品属性 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +public interface AttrService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/BrandService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/BrandService.java new file mode 100644 index 000000000..9d3beef33 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/BrandService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.BrandEntity; + +import java.util.Map; + +/** + * 品牌 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface BrandService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CategoryBrandRelationService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CategoryBrandRelationService.java new file mode 100644 index 000000000..be2a8899a --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CategoryBrandRelationService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.CategoryBrandRelationEntity; + +import java.util.Map; + +/** + * 品牌分类关联 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface CategoryBrandRelationService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CategoryService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CategoryService.java new file mode 100644 index 000000000..79a5ce6b8 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CategoryService.java @@ -0,0 +1,25 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.CategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 商品三级分类 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface CategoryService extends IService { + + PageUtils queryPage(Map params); + + List queryPageWithTree(Map params); + + List getLeve1Category(); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CommentReplayService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CommentReplayService.java new file mode 100644 index 000000000..a60d68114 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/CommentReplayService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.CommentReplayEntity; + +import java.util.Map; + +/** + * 商品评价回复关系 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface CommentReplayService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/ProductAttrValueService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/ProductAttrValueService.java new file mode 100644 index 000000000..103fbab5c --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/ProductAttrValueService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.ProductAttrValueEntity; + +import java.util.Map; + +/** + * spu属性值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface ProductAttrValueService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuImagesService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuImagesService.java new file mode 100644 index 000000000..13f8a49be --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuImagesService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SkuImagesEntity; + +import java.util.Map; + +/** + * sku图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface SkuImagesService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuInfoService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuInfoService.java new file mode 100644 index 000000000..a353b4051 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuInfoService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SkuInfoEntity; + +import java.util.Map; + +/** + * sku信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface SkuInfoService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuSaleAttrValueService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuSaleAttrValueService.java new file mode 100644 index 000000000..fbadda3ce --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SkuSaleAttrValueService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SkuSaleAttrValueEntity; + +import java.util.Map; + +/** + * sku销售属性&值 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +public interface SkuSaleAttrValueService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuCommentService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuCommentService.java new file mode 100644 index 000000000..69f0236b9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuCommentService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SpuCommentEntity; + +import java.util.Map; + +/** + * 商品评价 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +public interface SpuCommentService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuImagesService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuImagesService.java new file mode 100644 index 000000000..3c7be4dae --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuImagesService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SpuImagesEntity; + +import java.util.Map; + +/** + * spu图片 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:56 + */ +public interface SpuImagesService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuInfoDescService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuInfoDescService.java new file mode 100644 index 000000000..7508f0dae --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuInfoDescService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SpuInfoDescEntity; + +import java.util.Map; + +/** + * spu信息介绍 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface SpuInfoDescService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuInfoService.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuInfoService.java new file mode 100644 index 000000000..b619be7c4 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/SpuInfoService.java @@ -0,0 +1,20 @@ +package com.msb.mall.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.product.entity.SpuInfoEntity; + +import java.util.Map; + +/** + * spu信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-09 00:42:57 + */ +public interface SpuInfoService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrAttrgroupRelationServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrAttrgroupRelationServiceImpl.java new file mode 100644 index 000000000..7675d1bc9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrAttrgroupRelationServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.AttrAttrgroupRelationDao; +import com.msb.mall.product.entity.AttrAttrgroupRelationEntity; +import com.msb.mall.product.service.AttrAttrgroupRelationService; + + +@Service("attrAttrgroupRelationService") +public class AttrAttrgroupRelationServiceImpl extends ServiceImpl implements AttrAttrgroupRelationService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrGroupServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrGroupServiceImpl.java new file mode 100644 index 000000000..cdfee38a9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrGroupServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.AttrGroupDao; +import com.msb.mall.product.entity.AttrGroupEntity; +import com.msb.mall.product.service.AttrGroupService; + + +@Service("attrGroupService") +public class AttrGroupServiceImpl extends ServiceImpl implements AttrGroupService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrServiceImpl.java new file mode 100644 index 000000000..9274dd282 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/AttrServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.AttrDao; +import com.msb.mall.product.entity.AttrEntity; +import com.msb.mall.product.service.AttrService; + + +@Service("attrService") +public class AttrServiceImpl extends ServiceImpl implements AttrService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/BrandServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/BrandServiceImpl.java new file mode 100644 index 000000000..8126b3fba --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/BrandServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.BrandDao; +import com.msb.mall.product.entity.BrandEntity; +import com.msb.mall.product.service.BrandService; + + +@Service("brandService") +public class BrandServiceImpl extends ServiceImpl implements BrandService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CategoryBrandRelationServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CategoryBrandRelationServiceImpl.java new file mode 100644 index 000000000..81aed02c9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CategoryBrandRelationServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.CategoryBrandRelationDao; +import com.msb.mall.product.entity.CategoryBrandRelationEntity; +import com.msb.mall.product.service.CategoryBrandRelationService; + + +@Service("categoryBrandRelationService") +public class CategoryBrandRelationServiceImpl extends ServiceImpl implements CategoryBrandRelationService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CategoryServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CategoryServiceImpl.java new file mode 100644 index 000000000..f19ab52ed --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CategoryServiceImpl.java @@ -0,0 +1,95 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.CategoryDao; +import com.msb.mall.product.entity.CategoryEntity; +import com.msb.mall.product.service.CategoryService; + + +@Service("categoryService") +public class CategoryServiceImpl extends ServiceImpl implements CategoryService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + + @Override + public List queryPageWithTree(Map params) { + List categoryEntities = baseMapper.selectList(null); + List collect = categoryEntities.stream().filter(categoryEntity -> categoryEntity.getParentCid() == 0).map( + categoryEntity -> { + categoryEntity.setChildrens(getChildEntiy(categoryEntity, categoryEntities)); + return categoryEntity; + } + ).sorted((e1, e2) -> { + return (e1.getSort() == null ? 0 : e1.getSort()) - (e2.getSort() == null ? 0 : e2.getSort()); + } + ) + .collect(Collectors.toList()); + + return collect; + } + + /** + * 查询出所有的商品大类(一级分类) + * 在注解中我们可以指定对应的缓存的名称,起到一个分区的作用,一般按照业务来区分 + * @Cacheable({"catagory","product"}) 代表当前的方法的返回结果是需要缓存的, + * 调用该方法的时候,如果缓存中有数据,那么该方法就不会执行, + * 如果缓存中没有数据,那么就执行该方法并且把查询的结果缓存起来 + * 缓存处理 + * 1.存储在Redis中的缓存数据的Key是默认生成的:缓存名称::SimpleKey[] + * 2.默认缓存的数据的过期时间是-1永久 + * 3.缓存的数据,默认使用的是jdk的序列化机制 + * 改进: + * 1.生成的缓存数据我们需要指定自定义的key: key属性来指定,可以直接字符串定义也可以通过SPEL表达式处理:#root.method.name + * 2.指定缓存数据的存活时间: spring.cache.redis.time-to-live 指定过期时间 + * 3.把缓存的数据保存为JSON数据 + * SpringCache的原理 + * CacheAutoConfiguration--》根据指定的spring.cache.type=reids会导入 RedisCacheAutoConfiguration + * @return + */ +// @Trace + @Cacheable(value = {"catagory"},key = "#root.method.name",sync = true) + @Override + public List getLeve1Category() { + System.out.println("查询了数据库操作...."); + long start = System.currentTimeMillis(); + List list = baseMapper.queryLeve1Category(); + System.out.println("查询消耗的时间:" + (System.currentTimeMillis() - start)); + return list; + } + private List getChildEntiy(CategoryEntity categoryEntity, List categoryEntities) { + List collect = categoryEntities.stream().filter(entity -> { + + return entity.getParentCid() == categoryEntity.getCatId(); + }).map(entity -> { + entity.setChildrens(getChildEntiy(entity, categoryEntities)); + return entity; + }).sorted((e1, e2) -> { + return (e1.getSort() == null ? 0 : e1.getSort()) - (e2.getSort() == null ? 0 : e2.getSort()); + } + ) + .collect(Collectors.toList()); + return collect; + } + + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CommentReplayServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CommentReplayServiceImpl.java new file mode 100644 index 000000000..a1170eb2a --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/CommentReplayServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.CommentReplayDao; +import com.msb.mall.product.entity.CommentReplayEntity; +import com.msb.mall.product.service.CommentReplayService; + + +@Service("commentReplayService") +public class CommentReplayServiceImpl extends ServiceImpl implements CommentReplayService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/ProductAttrValueServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/ProductAttrValueServiceImpl.java new file mode 100644 index 000000000..afee1ddec --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/ProductAttrValueServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.ProductAttrValueDao; +import com.msb.mall.product.entity.ProductAttrValueEntity; +import com.msb.mall.product.service.ProductAttrValueService; + + +@Service("productAttrValueService") +public class ProductAttrValueServiceImpl extends ServiceImpl implements ProductAttrValueService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuImagesServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuImagesServiceImpl.java new file mode 100644 index 000000000..c187a5541 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuImagesServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SkuImagesDao; +import com.msb.mall.product.entity.SkuImagesEntity; +import com.msb.mall.product.service.SkuImagesService; + + +@Service("skuImagesService") +public class SkuImagesServiceImpl extends ServiceImpl implements SkuImagesService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuInfoServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuInfoServiceImpl.java new file mode 100644 index 000000000..53f78505a --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuInfoServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SkuInfoDao; +import com.msb.mall.product.entity.SkuInfoEntity; +import com.msb.mall.product.service.SkuInfoService; + + +@Service("skuInfoService") +public class SkuInfoServiceImpl extends ServiceImpl implements SkuInfoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuSaleAttrValueServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuSaleAttrValueServiceImpl.java new file mode 100644 index 000000000..44dcb3e5b --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SkuSaleAttrValueServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SkuSaleAttrValueDao; +import com.msb.mall.product.entity.SkuSaleAttrValueEntity; +import com.msb.mall.product.service.SkuSaleAttrValueService; + + +@Service("skuSaleAttrValueService") +public class SkuSaleAttrValueServiceImpl extends ServiceImpl implements SkuSaleAttrValueService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuCommentServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuCommentServiceImpl.java new file mode 100644 index 000000000..ff55c160a --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuCommentServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SpuCommentDao; +import com.msb.mall.product.entity.SpuCommentEntity; +import com.msb.mall.product.service.SpuCommentService; + + +@Service("spuCommentService") +public class SpuCommentServiceImpl extends ServiceImpl implements SpuCommentService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuImagesServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuImagesServiceImpl.java new file mode 100644 index 000000000..4a54c2887 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuImagesServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SpuImagesDao; +import com.msb.mall.product.entity.SpuImagesEntity; +import com.msb.mall.product.service.SpuImagesService; + + +@Service("spuImagesService") +public class SpuImagesServiceImpl extends ServiceImpl implements SpuImagesService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuInfoDescServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuInfoDescServiceImpl.java new file mode 100644 index 000000000..f0845a758 --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuInfoDescServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SpuInfoDescDao; +import com.msb.mall.product.entity.SpuInfoDescEntity; +import com.msb.mall.product.service.SpuInfoDescService; + + +@Service("spuInfoDescService") +public class SpuInfoDescServiceImpl extends ServiceImpl implements SpuInfoDescService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuInfoServiceImpl.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuInfoServiceImpl.java new file mode 100644 index 000000000..ae69b59ea --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/service/impl/SpuInfoServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.product.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.product.dao.SpuInfoDao; +import com.msb.mall.product.entity.SpuInfoEntity; +import com.msb.mall.product.service.SpuInfoService; + + +@Service("spuInfoService") +public class SpuInfoServiceImpl extends ServiceImpl implements SpuInfoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/java/com/msb/mall/product/web/IndexController.java b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/web/IndexController.java new file mode 100644 index 000000000..28d6aba7e --- /dev/null +++ b/msb-mall/mall-producet/src/main/java/com/msb/mall/product/web/IndexController.java @@ -0,0 +1,84 @@ +package com.msb.mall.product.web; + +import com.msb.mall.product.entity.CategoryEntity; +import com.msb.mall.product.service.CategoryService; +import org.redisson.api.RCountDownLatch; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Controller:标识一个Spring类是Spring MVC controller处理器, + * @RestController:@RestController是@Controller和@ResponseBody的结合体,两个标注合并起来的作用。@Controller类中的方法可以直接通过返回String跳转到jsp、ftl、html等模版页面。 + * 在方法上加@ResponseBody注解,也可以返回实体对象。@RestController类中的所有方法只能返回String、Object、Json等实体对象,不能跳转到模版页面。Linux就该这么学 + */ +@Controller +public class IndexController { + CategoryService categoryService; + + + @Autowired + RedissonClient redissonClient; + +// @Trace + @GetMapping({"/","/home","/index"}) + public String index(Model model){ + + // 查询出所有的一级分类的信息 + List list = categoryService.getLeve1Category(); + model.addAttribute("categorys",list); + // classPath:/templates/ + // .html + return "index"; + } + @ResponseBody + @GetMapping("/hello") + public String hello(){ + RLock mylock = redissonClient.getLock("mylock"); + mylock.lock(20, TimeUnit.SECONDS); + System.out.println("=====>加锁成功,业务处理:"+Thread.currentThread().getName()); + try { + Thread.sleep(20000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + finally { +// mylock.unlock(); + System.out.println("=====>释放锁:"+Thread.currentThread().getName()); + } + return "hello"; + + } + @ResponseBody + @GetMapping("/lockdoor") + public String lockDoor(){ + RCountDownLatch countDownLatch = redissonClient.getCountDownLatch("countDownLatch"); + countDownLatch.trySetCount(5); + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("=======>lockDoor"); + + return "关灯熄火.."; + } + public int index=0; + @ResponseBody + @GetMapping("/goHome") + public String goHome(){ + RCountDownLatch countDownLatch = redissonClient.getCountDownLatch("countDownLatch"); + countDownLatch.countDown(); + System.out.println("=======>goHome:"+index); + index++; + return "下班走人.."; + } + +} diff --git a/msb-mall/mall-producet/src/main/resources/application.yml b/msb-mall/mall-producet/src/main/resources/application.yml new file mode 100644 index 000000000..52e851a57 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/application.yml @@ -0,0 +1,62 @@ +base: + config: + mdb: + hostname: 192.168.37.133 #your mysql server ip address + dbname: seata #your database name for test + port: 3306 #your mysql server listening port + username: root #your mysql server username + password: root #your mysql server password +spring: + datasource: + username: root + password: root + url: jdbc:mysql://192.168.37.133:3306/msb-pms?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai + driver-class-name: com.mysql.cj.jdbc.Driver + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + config: + import: + - optional:nacos:seata-client-demo.yml + application: + name: mall-product + main: + allow-bean-definition-overriding: true + jackson: + date-format: yyyy-MM-dd HH:mm:ss + thymeleaf: + cache: false #关闭默认thymeleaf的缓存 + redis: + host: 192.168.37.133 + port: 6379 + cache: + type: redis + redis: + time-to-live: 60000 +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + global-config: + db-config: + id-type: auto #主键自增 + +server: + port: 8040 +seata: + enabled: true + application-id: ${spring.application.name} + tx-service-group: ${spring.application.name}-tx-group + config: + type: nacos + nacos: + serverAddr: 192.168.37.133:8848 + dataId: "seata.properties" + username: "nacos" + password: "nacos" + registry: + type: nacos + nacos: + application: seata-server + server-addr: 192.168.37.133:8848 + username: "nacos" + password: "nacos" \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml new file mode 100644 index 000000000..e9d20670d --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/AttrDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/AttrDao.xml new file mode 100644 index 000000000..e3c889dfd --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/AttrDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/AttrGroupDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/AttrGroupDao.xml new file mode 100644 index 000000000..e4633c8c8 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/AttrGroupDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/BrandDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/BrandDao.xml new file mode 100644 index 000000000..e599428f4 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/BrandDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/CategoryBrandRelationDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/CategoryBrandRelationDao.xml new file mode 100644 index 000000000..bff430224 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/CategoryBrandRelationDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/CategoryDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/CategoryDao.xml new file mode 100644 index 000000000..e733cfcf2 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/CategoryDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/CommentReplayDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/CommentReplayDao.xml new file mode 100644 index 000000000..563e0903f --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/CommentReplayDao.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/ProductAttrValueDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/ProductAttrValueDao.xml new file mode 100644 index 000000000..1a33363e0 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/ProductAttrValueDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SkuImagesDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SkuImagesDao.xml new file mode 100644 index 000000000..f3236aea3 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SkuImagesDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SkuInfoDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SkuInfoDao.xml new file mode 100644 index 000000000..3c297674b --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SkuInfoDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml new file mode 100644 index 000000000..c56ee1597 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SpuCommentDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuCommentDao.xml new file mode 100644 index 000000000..a94805452 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuCommentDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SpuImagesDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuImagesDao.xml new file mode 100644 index 000000000..8e65b3976 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuImagesDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SpuInfoDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuInfoDao.xml new file mode 100644 index 000000000..8f3351109 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuInfoDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/mapper/product/SpuInfoDescDao.xml b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuInfoDescDao.xml new file mode 100644 index 000000000..947c77177 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/mapper/product/SpuInfoDescDao.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attr-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attr-add-or-update.vue new file mode 100644 index 000000000..c72bde4de --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attr-add-or-update.vue @@ -0,0 +1,147 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attr.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attr.vue new file mode 100644 index 000000000..02985cdd8 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attr.vue @@ -0,0 +1,205 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue new file mode 100644 index 000000000..86c84a9c8 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue @@ -0,0 +1,102 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue new file mode 100644 index 000000000..0abfcb921 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue @@ -0,0 +1,175 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue new file mode 100644 index 000000000..4b970ea19 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrgroup.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrgroup.vue new file mode 100644 index 000000000..ad7efd0c1 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/attrgroup.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/brand-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/brand-add-or-update.vue new file mode 100644 index 000000000..79c5d6893 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/brand-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/brand.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/brand.vue new file mode 100644 index 000000000..92d617a91 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/brand.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/category-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/category-add-or-update.vue new file mode 100644 index 000000000..242ce9846 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/category-add-or-update.vue @@ -0,0 +1,147 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/category.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/category.vue new file mode 100644 index 000000000..b5e06b1ca --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/category.vue @@ -0,0 +1,205 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue new file mode 100644 index 000000000..e73668cb3 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/categorybrandrelation.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/categorybrandrelation.vue new file mode 100644 index 000000000..66e9f8d43 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/categorybrandrelation.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue new file mode 100644 index 000000000..14545c82a --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue @@ -0,0 +1,93 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/commentreplay.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/commentreplay.vue new file mode 100644 index 000000000..857bbf352 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/commentreplay.vue @@ -0,0 +1,169 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue new file mode 100644 index 000000000..188d51ba9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/productattrvalue.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/productattrvalue.vue new file mode 100644 index 000000000..e6e06306b --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/productattrvalue.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue new file mode 100644 index 000000000..e9b8d4f18 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuimages.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuimages.vue new file mode 100644 index 000000000..7a13ec70c --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuimages.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue new file mode 100644 index 000000000..a58839e72 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue @@ -0,0 +1,165 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuinfo.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuinfo.vue new file mode 100644 index 000000000..717e6c1a5 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skuinfo.vue @@ -0,0 +1,217 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue new file mode 100644 index 000000000..4c5176f2c --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skusaleattrvalue.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skusaleattrvalue.vue new file mode 100644 index 000000000..bbd2f1cba --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/skusaleattrvalue.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue new file mode 100644 index 000000000..b10107461 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue @@ -0,0 +1,210 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spucomment.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spucomment.vue new file mode 100644 index 000000000..577a6e8b9 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spucomment.vue @@ -0,0 +1,247 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue new file mode 100644 index 000000000..f25e52ab5 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuimages.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuimages.vue new file mode 100644 index 000000000..1465f6750 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuimages.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue new file mode 100644 index 000000000..7ddc8ae9c --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue @@ -0,0 +1,147 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfo.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfo.vue new file mode 100644 index 000000000..82bfa00c2 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfo.vue @@ -0,0 +1,205 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue new file mode 100644 index 000000000..a543727ee --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue @@ -0,0 +1,84 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfodesc.vue b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfodesc.vue new file mode 100644 index 000000000..c33bb11c5 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/src/views/modules/product/spuinfodesc.vue @@ -0,0 +1,163 @@ + + + diff --git a/msb-mall/mall-producet/src/main/resources/static/index/css/GL.css b/msb-mall/mall-producet/src/main/resources/static/index/css/GL.css new file mode 100644 index 000000000..527d93b1f --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/css/GL.css @@ -0,0 +1,9222 @@ +@charset "UTF-8"; +* { + margin: 0; + padding: 0; } + +li, +ul { + list-style: none; } + +body, +html { + background: #F6F6F6; + position: relative; } + +.top_find { + width: 100%; + border-bottom: 2px solid red; + position: fixed; + top: -66px; + left: 0; + z-index: 9999; + background: #fff; } + .top_find .top_find_son { + width: 1190px; + margin: 0 auto; + position: relative; + padding: 10px 5px; } + .top_find .top_find_son .input_find { + overflow: hidden; + background: #EFEFEF; + position: absolute; + left: 320px; + top: 15px; + width: 550px; + height: 35px; } + .top_find .top_find_son .input_find input { + padding: 4px; + width: 490px; + height: 27px; + line-height: 33px; + font-size: 14px; + color: #989898; + border: 0; + outline: none; + background: none; + float: left; } + .top_find .top_find_son .input_find span { + position: absolute; + right: 65px; + top: 8px; + width: 19px; + height: 15px; + overflow: hidden; + cursor: pointer; } + .top_find .top_find_son .input_find img { + width: 52px; + height: 35px; + position: absolute; + float: left; } + +.left_floor { + position: fixed; + left: 15px; + top: 24%; + z-index: 9999; + opacity: 0; } + .left_floor .left_floor_active { + background: #F10215; + color: #ffffff; } + .left_floor .left_floor_active1 { + background: #F10215; + color: #ffffff; } + .left_floor li { + width: 30px; + font-size: 12px; + color: #ffffff; + background: #999; + border-bottom: 1px solid #F6F6F6; + text-align: center; + padding: 3px; + cursor: pointer; } + +.head { + position: relative; } + .head img { + display: block; + width: 100%; } + .head p { + position: absolute; + top: 5px; + right: 84px; + z-index: 200; + font-size: 16px; + font-weight: 500; + cursor: pointer; + color: #999; } + +header { + width: 100%; } + header .header_head { + background: #E3E4E5; + height: 30px; + line-height: 30px; + position: relative; } + header .header_head .header_head_box { + width: 1190px; + margin: 0 auto; } + header .header_head .header_head_box .img { + float: left; + display: block; + width: 190px; + height: 170px; } + header .header_head .header_head_box .header_head_p { + font-size: 12px; + float: left; + position: relative; + width: 60px; + height: 30px; + margin-left: 10px; + font-weight: 100; } + header .header_head .header_head_box .header_head_p a { + text-decoration: none; + color: #999; } + header .header_head .header_head_box .header_head_p a img { + width: 12px; + height: 15px; + vertical-align: middle; + margin-left: 10px; } + header .header_head .header_head_box .header_head_p_cs { + position: absolute; + width: 340px; + height: 230px; + top: 30px; + left: 0; + background: #fff; + z-index: 200; + display: none; } + header .header_head .header_head_box .header_head_p_cs a { + color: #999; + display: block; + width: 15%; + margin: 5px 5px 0 0; + text-align: center; + float: left; + font-weight: 100; + text-decoration: none; } + header .header_head .header_head_box .header_head_p_cs a:hover { + color: #C81623; } + header .header_head .header_head_box ul { + float: right; } + header .header_head .header_head_box ul li { + float: left; + padding: 0 10px; } + header .header_head .header_head_box ul li a { + text-decoration: none; + color: #999; + font-size: 12px; } + header .header_head .header_head_box ul li .li_2 { + color: red; } + header .header_head .header_head_box ul a:hover { + color: #C81623; } + header .header_head .header_head_box ul .header_wdjd { + position: relative; } + header .header_head .header_head_box ul .header_wdjd .header_wdjd_txt { + position: absolute; + top: 30px; + left: 0; + width: 208px; + height: 170px; + background: #fff; + z-index: 10; + display: none; } + header .header_head .header_head_box ul .header_wdjd .header_wdjd_txt ul:nth-child(2) { + margin-top: 15px; + padding-top: 10px; + border-top: 1px solid #ccc; } + header .header_head .header_head_box ul .header_wdjd .header_wdjd_txt li { + width: 84px; + height: 25px; } + header .header_head .header_head_box ul .header_wdjd1 { + position: relative; } + header .header_head .header_head_box ul .header_wdjd1 .header_wdjd_txt { + position: absolute; + top: 30px; + left: -100px; + width: 180px; + height: 270px; + background: #fff; + z-index: 10; + display: none; } + header .header_head .header_head_box ul .header_wdjd1 .header_wdjd_txt p { + color: #666; + font-size: 14px; + padding: 0 20px 0 10px; } + header .header_head .header_head_box ul .header_wdjd1 .header_wdjd_txt ul:nth-child(2) { + margin-top: 10px; + border-top: 1px solid #ccc; } + header .header_head .header_head_box ul .header_wdjd1 .header_wdjd_txt li { + width: 70px; + height: 27px; } + header .header_head .header_head_box ul .header_sjjd { + position: relative; } + header .header_head .header_head_box ul .header_sjjd .header_sjjd_div { + position: absolute; + top: 30px; + right: 5px; + border: 1px solid #ccc; + padding: 3px 3px 0; } + header .header_head .header_head_box ul .header_wzdh { + position: relative; } + header .header_head .header_head_box ul .header_wzdh .header_wzdh_txt { + position: absolute; + top: 30px; + left: -1037px; + background: #fff; + z-index: 10; + width: 1190px; + height: 190px; + display: none; } + header .header_head .header_head_box ul .header_wzdh .header_wzdh_txt ul { + padding: 10px; + float: left; + width: 25%; + height: 100%; + border-right: 1px solid #eee; } + header .header_head .header_head_box ul .header_wzdh .header_wzdh_txt ul p { + margin-left: 10px; + margin-bottom: -5px; } + header .header_head .header_head_box ul .header_wzdh .header_wzdh_txt ul li { + height: 25px; } + header .header_head .header_head_box ul span { + font-size: 12px; + color: #ccc; + float: left; } + header .header_sous { + width: 1190px; + margin: 0 auto; + position: relative; + z-index: 1; + height: 140px; } + header .header_sous .header_form { + overflow: hidden; + background: #f10215; + position: absolute; + left: 320px; + top: 25px; + width: 550px; + height: 35px; + border: 1px solid #f10215; } + header .header_sous .header_form input { + padding: 4px; + width: 490px; + height: 33px; + line-height: 33px; + font-size: 14px; + color: #989898; + border: 0; + outline: none; } + header .header_sous .header_form span { + position: absolute; + right: 65px; + top: 8px; + width: 19px; + height: 15px; + overflow: hidden; + cursor: pointer; } + header .header_sous .header_form img { + width: 47; + height: 32px; + position: absolute; } + header .header_sous .header_ico { + position: absolute; + right: 99px; + top: 25px; } + header .header_sous .header_ico .header_gw { + width: 190px; + height: 35px; + background-color: #fff; + text-align: center; + line-height: 35px; + border: 1px solid #f0f0f0; } + header .header_sous .header_ico .header_gw span:nth-child(2) { + font-size: 13px; } + header .header_sous .header_ico .header_gw span:nth-child(2) a { + color: #F10214; + text-decoration: none; } + header .header_sous .header_ico .header_gw span:nth-child(3) { + background: #F10214; + color: #fff; + border-radius: 50%; + position: absolute; + width: 13px; + height: 13px; + line-height: 14px; + top: 5px; + left: 142px; + font-size: 12px; } + header .header_sous .header_ico .header_ko { + position: absolute; + top: 34px; + left: -110px; + width: 298px; + height: 70px; + line-height: 70px; + text-align: right; + background: #fff; + z-index: 200; + display: none; } + header .header_sous .header_ico .header_ko p { + background: url(../img/58004d6dN2927f0f7.png) no-repeat 20px 14px; + font-size: 12px; + padding-right: 30px; } + header .header_sous .header_form_nav { + overflow: hidden; + position: absolute; + left: 320px; + top: 65px; + width: 550px; + height: 20px; + line-height: 20px; } + header .header_sous .header_form_nav ul li { + float: left; + margin-right: 10px; + white-space: nowrap; } + header .header_sous .header_form_nav ul li a { + color: #666; + font-size: 12px; + text-decoration: none; } + header .header_sous .header_form_nav ul li .aaaaa { + color: #f10215; } + header .header_sous .header_form_nav ul li:hover a { + color: #c81623; } + header .header_sous nav { + overflow: hidden; + position: absolute; + left: 200px; + bottom: 0; + width: 790px; + height: 40px; + line-height: 40px; + float: left; } + header .header_sous nav ul { + float: left; } + header .header_sous nav ul li { + float: left; + margin-left: 30px; } + header .header_sous nav ul li a { + position: relative; + display: block; + height: 40px; + line-height: 40px; + font-size: 16px; + font-weight: 700; + color: #555; + text-decoration: none; } + header .header_sous nav ul li:hover a { + color: #c81623; } + header .header_sous nav .spacer { + overflow: hidden; + margin-top: 15px; + margin-left: 20px; + margin-right: -10px; + width: 1px; + height: 10px; + background-color: #ccc; + float: left; } + header .header_sous .right { + position: absolute; + right: 0; + bottom: 0; + width: 190px; + height: 40px; } + header .header_main { + position: relative; + z-index: 9; + width: 100%; + height: 480px; } + header .header_main .header_banner { + overflow: hidden; + position: absolute; + width: 1190px; + height: 480px; + left: 50%; + top: 0; + margin: 0px 0px 0px -595px; } + header .header_main .header_banner .header_main_left { + height: 100%; + float: left; + width: 190px; + margin-right: 10px; } + header .header_main .header_banner .header_main_left ul { + padding: 16px 0; + background-color: #6e6568; } + header .header_main .header_banner .header_main_left ul li { + padding-left: 12px; + height: 28px; + line-height: 28px; + font-size: 0; + position: relative; } + header .header_main .header_banner .header_main_left ul li a { + font-size: 14px; + color: #fff; + text-decoration: none; } + header .header_main .header_banner .header_main_left ul li a b { + font-weight: 200; } + header .header_main .header_banner .header_main_left ul li a b:hover { + color: #C81623; } + header .header_main .header_banner .header_main_left .header_li2 .header_main_left_main { + position: absolute; + left: 190px; + top: -44px; + width: 1000px; + height: 480px; + background: #fff; + z-index: 200; + padding: 20px; + display: none; } + header .header_main .header_banner .header_main_left .header_li2:nth-child(3) .header_main_left_main{ + margin-top:-28px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(4) .header_main_left_main{ + margin-top:-56px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(5) .header_main_left_main{ + margin-top:-85px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(6) .header_main_left_main{ + margin-top:-115px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(7) .header_main_left_main{ + margin-top:-140px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(8) .header_main_left_main{ + margin-top:-170px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(9) .header_main_left_main{ + margin-top:-197px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(10) .header_main_left_main{ + margin-top:-225px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(11) .header_main_left_main{ + margin-top:-253px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(12) .header_main_left_main{ + margin-top:-280px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(13) .header_main_left_main{ + margin-top:-310px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(14) .header_main_left_main{ + margin-top:-337px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(15) .header_main_left_main{ + margin-top:-365px; + } + header .header_main .header_banner .header_main_left .header_li2:nth-child(16) .header_main_left_main{ + margin-top:-393px; + } + header .header_main .header_banner .header_main_left .header_li2 .header_main_left_main .header_sj { + width: 800px; + overflow: hidden; } + header .header_main .header_banner .header_main_left .header_li2 .header_main_left_main .header_sj .header_sj_a { + display: block; + background: #6e6568; + float: left; + margin-right: 10px; + padding: 0 10px; } + header .header_main .header_banner .header_main_left .header_li2 .header_ol { + margin-top: 10px; + width: 730px; + overflow: hidden; } + header .header_main .header_banner .header_main_left .header_li2 .header_ol .aaa { + float: left; + width: 70px; + font-size: 8px; } + header .header_main .header_banner .header_main_left .header_li2 .header_ol li { + border-bottom: 1px solid #eee; + margin-left: 70px; } + header .header_main .header_banner .header_main_left .header_li2 .header_ol li a { + border-left: 1px solid #999; + font-size: 12px; + padding-left: 10px; + margin-right: 10px; } + header .header_main .header_banner .header_main_left .header_li2 .header_r { + position: absolute; + width: 220px; + height: 480px; + top: 0; + right: 45px; } + header .header_main .header_banner .header_main_left .header_li2 .header_r .header_r_tu { + width: 220px; + margin-top: 20px; } + header .header_main .header_banner .header_main_left .header_li2 .header_r .header_r_tu a { + display: block; + float: left; + width: 100px; + height: 38px; + text-align: center; + border: 1px solid #f0f0f0; } + header .header_main .header_banner .header_main_left .header_li2 .header_r .header_r_tu1 { + position: absolute; + bottom: 0; + right: 20px; } + header .header_main .header_banner .header_main_left .header_li2 .header_r .header_r_tu1 a { + display: block; + border: 1px solid #fff; } + header .header_main .header_banner .header_main_center { + float: left; + width: 790px; + height: 100%; } + header .header_main .header_banner .header_main_center .swiper1 { + height: 340px; + margin-bottom: 10px; } + header .header_main .header_banner .header_main_center .swiper1 .swiper-pagination-bullet-active { + opacity: 1; + background: red !important; } + header .header_main .header_banner .header_main_center .swiper1 .swiper-pagination-bullet { + width: 14px; + height: 14px; + background: #fff; + opacity: 1; + margin-top: 5px; } + header .header_main .header_banner .header_main_center .swiper1 .swiper-pagination-bullets { + bottom: 10px; + left: 0; + background: rgba(255, 255, 255, 0.3); + width: 25%; + border-radius: 20px; + margin-left: 280px; } + header .header_main .header_banner .header_main_center .swiper1 .swiper-button-next, + header .header_main .header_banner .header_main_center .swiper1 .swiper-button-prev { + background-size: 14px 39px; } + header .header_main .header_banner .header_main_center .header_main_center_b a:nth-child(1) { + margin-right: 5px; } + header .header_main .header_banner .header_main_right { + float: right; + margin-left: 10px; + width: 190px; + height: 100%; + background: #fff; } + header .header_main .header_banner .header_main_right a { + text-decoration: none; } + header .header_main .header_banner .header_main_right .header_main_right_user { + padding: 0 15px; + height: 115px; + border-bottom: 1px solid #e6e6e6; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info { + padding: 15px 0 4px 54px; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info .user_info_tou { + margin-left: -54px; + float: left; + width: 50px; + height: 50px; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info .user_info_tou img { + display: block; + height: 50px; + width: 50px; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info .user_info_show p { + color: #666; + font-size: 12px; + margin-top: 4px; + width: 100%; + white-space: nowrap; + text-overflow: ellipsis; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info .user_info_show p:nth-child(2) a { + color: #666; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info .user_info_show p:nth-child(2) a:hover { + color: #e01222; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info_hide { + height: 24px; + margin-right: -10px; + position: absolute; + top: 75px; + width: 190px; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info_hide a { + display: inline-block; + margin-right: 10px; + width: 70px; + height: 20px; + border: 2px solid #e01222; + line-height: 20px; + font-size: 12px; + text-align: center; + color: #e01222; } + header .header_main .header_banner .header_main_right .header_main_right_user .user_info_hide a:hover { + background: #e01222; + color: #fff; } + header .header_main .header_banner .header_main_right .header_main_right_new { + overflow: hidden; + padding: 0 15px; + height: 154px; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t { + border-bottom: 1px solid #e6e6e6; + position: relative; + line-height: 23px; + height: 23px; + overflow: hidden; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t p { + color: #333; + float: left; + font-size: 12px; + height: 22px; + text-align: center; + padding-bottom: 5px; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t p a { + color: #000; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t p:nth-child(1) { + padding: 0 10px; + border-right: 1px solid #dfe0e1; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t p:nth-child(2) { + padding: 0 10px; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t a:nth-child(3) { + position: absolute; + right: 0; + top: 0; + color: #000; + font-size: 12px; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t a:nth-child(3):hover { + color: #C81623; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_t .active { + padding-bottom: 2px; + border-bottom: 2px solid red; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_connter { + padding: 12px 0; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_connter .header_new_connter_1 li { + line-height: 24px; + max-width: 160px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_connter .header_new_connter_1 li a { + color: #666; + font-size: 12px; } + header .header_main .header_banner .header_main_right .header_main_right_new .header_new_connter .header_new_connter_1 li a:hover { + color: #F10215; } + header .header_main .header_banner .header_main_right .header_main_right_ser { + overflow: hidden; + position: relative; + height: 210px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box { + overflow: hidden; + width: 200px; + position: relative; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box ul { + margin-left: -1px; + width: 200px; + height: 210px; + overflow: hidden; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box ul li { + position: relative; + overflow: hidden; + float: left; + width: 47px; + height: 69px; + padding-top: 15px; + border-top: 1px solid #e7e7e7; + border-left: 1px solid #e7e7e7; + text-align: center; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box ul li a { + padding-top: 14px; + height: 55px; + color: #666; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box ul li a i { + width: 24px; + height: 24px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box ul li a span { + display: block; + font-size: 12px; + height: 22px; + line-height: 22px; + border-top: 2px solid #fff; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box ul li a:hover span { + color: #E01222; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one { + position: absolute; + top: 210px; + left: 0; + width: 200px; + height: 200px; + display: none; + background: #fff; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav ol { + border-top: 1px solid #e7e7e7; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav ol li { + float: left; + height: 20px; + line-height: 20px; + overflow: hidden; + text-align: center; + padding: 0 7px; + border-left: 1px solid #e7e7e7; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav ol li a { + padding: 0; + height: 20px; + width: 100%; + text-align: center; + color: #666; + display: block; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav ol .active { + border-top: 1px solid red; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li { + background: #fff; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li .guanbi { + position: absolute; + top: 0; + right: 34px; + color: #666; + cursor: pointer; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li .guanbi:hover { + background: #C0C0C0; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul { + position: relative; + padding: 20px 8px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul a { + color: #000; + display: block; + float: left; + text-align: center; + width: 29.333%; + font-size: 12px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .active { + background: #C81623; + color: #fff; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .ser_ol_div { + font-size: 12px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .ser_ol_div p:nth-child(1) { + margin-top: 35px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .ser_ol_div input { + width: 100px; + height: 20px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .ser_ol_div span { + color: red; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .ser_ol_div1 p:nth-child(1) input { + width: 15px; + margin-left: 20px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .ser_ol_div1 input { + width: 120px; + margin-bottom: 5px; + height: 18px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul button { + background: red; + color: #fff; + border: 0; + padding: 2px 5px; } + header .header_main .header_banner .header_main_right .header_main_right_ser .ser_box .ser_box_aaa > .ser_box_aaa_one .ser_box_aaa_nav .ser_ol_li ul .p { + color: blue; + margin-top: 10px; + font-size: 12px; } + header .header_main .header_banner1 { + position: absolute; + height: 480px; + left: 50%; + margin: 0px 0px 0px -595px; } + header .header_main .header_banner1 .a { + background: #F6F6F6; + display: block; + overflow: hidden; + position: absolute; + left: -350px; + top: 0; + width: 350px; + height: 480px; + z-index: 10; } + header .header_main .header_banner1 .a img { + float: right; } + header .header_main .header_banner1_div { + background: url(../img/5a1e5ceaNecb55079.jpg); + position: absolute; + z-index: 1; + top: 0; + width: 0; + height: 480px; } + header .header_main .header_banner1_div p { + position: absolute; + top: 20px; + right: 50px; + color: #fff; + cursor: pointer; } + +.header_bar { + position: fixed; + right: 0; + top: 0; + width: 8px; + height: 100%; + background: #7A6E6E; + z-index: 999; } + .header_bar ul:nth-child(1) { + position: fixed; + right: 8px; + bottom: 23%; + height: 216px; + width: 34px; + z-index: 999; } + .header_bar ul:nth-child(1) li { + text-align: center; + width: 42px; + height: 36px; + line-height: 36px; + background: #7A6E6E; + position: relative; + border-bottom: 1px solid #fff; + border-radius: 5px; + position: relative; } + .header_bar ul:nth-child(1) li .right_gouwuche { + height: 15px; + width: 15px; + background: red; + color: white; + text-align: center; + position: absolute; + top: 0; + right: 10px; + font-size: 10px; + border-radius: 50%; + line-height: 15px; + font-weight: 100; } + .header_bar ul:nth-child(1) li div { + position: absolute; + left: 0; + top: 0; + background: #7A6E6E; + color: #fff; + width: 60px; + font-size: 12px; + height: 36px; + display: none; + z-index: -999; } + .header_bar ul:nth-child(1) li div a { + color: #fff; + text-decoration: none; } + .header_bar ul:nth-child(2) { + position: fixed; + right: 8px; + bottom: -17px; + height: 126px; + width: 34px; + z-index: 200; } + .header_bar ul:nth-child(2) li { + text-align: center; + width: 42px; + height: 36px; + line-height: 36px; + background: #7A6E6E; + position: relative; + border-bottom: 1px solid #fff; + border-radius: 5px; } + .header_bar ul:nth-child(2) li .div { + position: absolute; + left: 0; + top: 0; + background: #7A6E6E; + color: #fff; + width: 60px; + font-size: 12px; + height: 35px; + display: none; + z-index: -999; } + .header_bar ul:nth-child(2) li .div a { + color: #fff; + text-decoration: none; } + .header_bar ul:nth-child(2) p { + background: #C81623; + border-radius: 0; + width: 43px; + height: 36px; } + .header_bar ul:nth-child(2) p em { + left: 0; + width: 35px; + height: 30px; + padding: 2px 0 3px; + line-height: 15px; + background: #c81623; + color: white; + text-align: center; + font-family: 微软雅黑; + position: absolute; + z-index: 1; + font-size: 12px; + cursor: pointer; } + +.section_second { + width: 100%; + background: #F6F6F6; + overflow: hidden; + margin-bottom: 20px; } + .section_second .section_second_header { + box-sizing: border-box; + margin: 0 auto; + width: 1190px; + height: 55px; + padding: 0 30px; + background: url("../img/section_second_header_background.png") no-repeat; + position: relative; + margin-top: 20px; } + .section_second .section_second_header .section_second_header_img { + width: 28px; + height: 28px; + background: url("../img/section_second.png") no-repeat; + background-position: -194px -52px; + position: absolute; + top: 0; + left: 0; + z-index: 9; } + .section_second .section_second_header .section_second_header_left { + float: left; + color: #ffffff; + font-size: 14px; } + .section_second .section_second_header .section_second_header_left > * { + margin-left: 5px; + display: inline-block; + float: left; + margin-top: 20px; } + .section_second .section_second_header .section_second_header_left p { + width: 40px; + height: 40px; + background: url("../img/section_second.png") no-repeat; + background-position: 6px -39px; + margin-top: 10px; } + .section_second .section_second_header .section_second_header_left > span:nth-child(2) { + font-size: 25px; + font-weight: 500; + margin: 10px 10px 0; } + .section_second .section_second_header .section_second_header_left > span:nth-child(4) { + display: inline-block; + width: 20px; + height: 20px; + background: url("../img/section_second.png") no-repeat; + background-position: -154px -39px; } + .section_second .section_second_header .section_second_header_right { + float: right; } + .section_second .section_second_header .section_second_header_right > * { + float: left; } + .section_second .section_second_header .section_second_header_right p { + line-height: 55px; + color: #FFFFFF; + font-size: 14px; } + .section_second .section_second_header .section_second_header_right .section_second_header_right_hours, + .section_second .section_second_header .section_second_header_right .section_second_header_right_minutes, + .section_second .section_second_header .section_second_header_right .section_second_header_right_second { + display: inline-block; + width: 30px; + height: 30px; + background: #440106; + border-radius: 3px; + margin-top: 14px; + color: #F90013; + font-size: 22px; + font-weight: 700; + line-height: 30px; + text-align: center; + box-sizing: border-box; } + .section_second .section_second_header .section_second_header_right .section_second_header_right_hours { + margin-left: 10px; } + .section_second .section_second_header .section_second_header_right .section_second_header_right_second { + margin-right: 10px; } + .section_second .section_second_header .section_second_header_right .section_second_header_right_mao { + width: 30px; + height: 30px; + font-size: 30px; + text-align: left; + margin-top: 5px; } + .section_second .section_second_list { + width: 1190px; + margin: 0 auto; + overflow: hidden; + background: #fff; + padding: 10px 0; } + .section_second .section_second_list .swiper-container { + overflow: hidden; } + .section_second .section_second_list .swiper-container .swiper_warpper { + overflow: hidden; } + .section_second .section_second_list .swiper-container .swiper_warpper .swiper_slide { + overflow: hidden; } + .section_second .section_second_list .swiper-container .second_list { + top: 40%; + width: 20px; + height: 50px; + background-size: 10px 44px; + display: none; } + .section_second .section_second_list .swiper-container .second_list p { + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.1) !important; } + .section_second .section_second_list .swiper_section_second_list_left { + width: 1000px; + float: left; + height: 225px; } + .section_second .section_second_list .swiper_section_second_list_left > li:last-child { + border-right: none; } + .section_second .section_second_list .swiper_section_second_list_left li { + width: 200px; + height: 225px; + float: left; + padding: 5px 10px; + border-right: 1px solid #e7e7e7; + box-sizing: border-box; } + .section_second .section_second_list .swiper_section_second_list_left li > * { + margin-top: 8px; } + .section_second .section_second_list .swiper_section_second_list_left li img { + margin-left: 25px; + margin-top: 8px; } + .section_second .section_second_list .swiper_section_second_list_left li img:hover { + transition: transform 0.4s ease, -webkit-transform 0.4s ease, -moz-transform 0.4s ease; + transform: translateY(0); } + .section_second .section_second_list .swiper_section_second_list_left li p { + height: 30px; + overflow-y: hidden; } + .section_second .section_second_list .swiper_section_second_list_left li p, + .section_second .section_second_list .swiper_section_second_list_left li s { + font-size: 12px; + color: #999; } + .section_second .section_second_list .swiper_section_second_list_left li span { + font-size: 18px; + color: red; + font-weight: 600; } + .section_second .section_second_list .section_second_list_right { + float: right; + width: 180px; + height: 225px; + margin-right: 10px; + position: relative; } + .section_second .section_second_list .section_second_list_right li { + position: absolute; + top: 0; + left: 0; } + .section_second .section_second_list .section_second_list_right li img { + display: block; } + .section_second .section_second_list .section_second_list_right > li:nth-of-type(2) { + opacity: 0; } + .section_second .section_second_list .section_second_list_right .section_second_list_right_button { + width: 50px; + height: 10px; + position: absolute; + left: 67px; + bottom: 5px; + z-index: 9; } + .section_second .section_second_list .section_second_list_right .section_second_list_right_button p { + width: 10px; + height: 10px; + border-radius: 50%; + background: #333; + float: left; + margin-left: 10px; } + .section_second .section_second_list .section_second_list_right .section_second_list_right_button .section_second_list_right_button_active { + background: #E01222 !important; } + .section_second .section_find { + width: 1190px; + overflow: hidden; + margin: 20px auto; } + .section_second .section_find .center-list { + top: 40%; + width: 20px; + height: 50px; + background-size: 10px 44px; + display: none; } + .section_second .section_find .center-list p { + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.1) !important; } + .section_second .section_find .section_find_right { + margin-right: 0 !important; } + .section_second .section_find .section_find_center, + .section_second .section_find .section_find_left, + .section_second .section_find .section_find_right { + width: 390px; + float: left; + margin-right: 10px; } + .section_second .section_find .section_find_center .section_find_center_header, + .section_second .section_find .section_find_center .section_find_left_header, + .section_second .section_find .section_find_center .section_find_right_header, + .section_second .section_find .section_find_left .section_find_center_header, + .section_second .section_find .section_find_left .section_find_left_header, + .section_second .section_find .section_find_left .section_find_right_header, + .section_second .section_find .section_find_right .section_find_center_header, + .section_second .section_find .section_find_right .section_find_left_header, + .section_second .section_find .section_find_right .section_find_right_header { + width: 100%; + height: 55px; + background-image: linear-gradient(90deg, #4998a1, #2e828b); + color: #FFFFFF; + font-size: 14px; + padding: 0 20px; + box-sizing: border-box; + position: relative; } + .section_second .section_find .section_find_center .section_find_center_header s, + .section_second .section_find .section_find_center .section_find_left_header s, + .section_second .section_find .section_find_center .section_find_right_header s, + .section_second .section_find .section_find_left .section_find_center_header s, + .section_second .section_find .section_find_left .section_find_left_header s, + .section_second .section_find .section_find_left .section_find_right_header s, + .section_second .section_find .section_find_right .section_find_center_header s, + .section_second .section_find .section_find_right .section_find_left_header s, + .section_second .section_find .section_find_right .section_find_right_header s { + display: inline-block; + width: 0; + height: 0; + border-top: 20px solid #f6f6f6; + border-right: 19px solid transparent; + position: absolute; + top: 0; + left: 0; } + .section_second .section_find .section_find_center .section_find_center_header .section_find_center_header_img, + .section_second .section_find .section_find_center .section_find_center_header .section_find_left_header_img, + .section_second .section_find .section_find_center .section_find_center_header .section_find_right_header_img, + .section_second .section_find .section_find_center .section_find_left_header .section_find_center_header_img, + .section_second .section_find .section_find_center .section_find_left_header .section_find_left_header_img, + .section_second .section_find .section_find_center .section_find_left_header .section_find_right_header_img, + .section_second .section_find .section_find_center .section_find_right_header .section_find_center_header_img, + .section_second .section_find .section_find_center .section_find_right_header .section_find_left_header_img, + .section_second .section_find .section_find_center .section_find_right_header .section_find_right_header_img, + .section_second .section_find .section_find_left .section_find_center_header .section_find_center_header_img, + .section_second .section_find .section_find_left .section_find_center_header .section_find_left_header_img, + .section_second .section_find .section_find_left .section_find_center_header .section_find_right_header_img, + .section_second .section_find .section_find_left .section_find_left_header .section_find_center_header_img, + .section_second .section_find .section_find_left .section_find_left_header .section_find_left_header_img, + .section_second .section_find .section_find_left .section_find_left_header .section_find_right_header_img, + .section_second .section_find .section_find_left .section_find_right_header .section_find_center_header_img, + .section_second .section_find .section_find_left .section_find_right_header .section_find_left_header_img, + .section_second .section_find .section_find_left .section_find_right_header .section_find_right_header_img, + .section_second .section_find .section_find_right .section_find_center_header .section_find_center_header_img, + .section_second .section_find .section_find_right .section_find_center_header .section_find_left_header_img, + .section_second .section_find .section_find_right .section_find_center_header .section_find_right_header_img, + .section_second .section_find .section_find_right .section_find_left_header .section_find_center_header_img, + .section_second .section_find .section_find_right .section_find_left_header .section_find_left_header_img, + .section_second .section_find .section_find_right .section_find_left_header .section_find_right_header_img, + .section_second .section_find .section_find_right .section_find_right_header .section_find_center_header_img, + .section_second .section_find .section_find_right .section_find_right_header .section_find_left_header_img, + .section_second .section_find .section_find_right .section_find_right_header .section_find_right_header_img { + width: 28px; + height: 28px; + background-color: #FFFFFF; + background: url("../img/section_second.png") no-repeat; + background-position: -194px -100px; + position: absolute; + top: 0; + left: 0; + z-index: 9; } + .section_second .section_find .section_find_center .section_find_center_header > span:nth-of-type(1), + .section_second .section_find .section_find_center .section_find_left_header > span:nth-of-type(1), + .section_second .section_find .section_find_center .section_find_right_header > span:nth-of-type(1), + .section_second .section_find .section_find_left .section_find_center_header > span:nth-of-type(1), + .section_second .section_find .section_find_left .section_find_left_header > span:nth-of-type(1), + .section_second .section_find .section_find_left .section_find_right_header > span:nth-of-type(1), + .section_second .section_find .section_find_right .section_find_center_header > span:nth-of-type(1), + .section_second .section_find .section_find_right .section_find_left_header > span:nth-of-type(1), + .section_second .section_find .section_find_right .section_find_right_header > span:nth-of-type(1) { + display: inline-block; + font-size: 25px; + font-weight: 500; + margin: 10px 10px 0; } + .section_second .section_find .section_find_center .section_find_center_header div, + .section_second .section_find .section_find_center .section_find_left_header div, + .section_second .section_find .section_find_center .section_find_right_header div, + .section_second .section_find .section_find_left .section_find_center_header div, + .section_second .section_find .section_find_left .section_find_left_header div, + .section_second .section_find .section_find_left .section_find_right_header div, + .section_second .section_find .section_find_right .section_find_center_header div, + .section_second .section_find .section_find_right .section_find_left_header div, + .section_second .section_find .section_find_right .section_find_right_header div { + float: right; } + .section_second .section_find .section_find_center .section_find_center_header div > *, + .section_second .section_find .section_find_center .section_find_left_header div > *, + .section_second .section_find .section_find_center .section_find_right_header div > *, + .section_second .section_find .section_find_left .section_find_center_header div > *, + .section_second .section_find .section_find_left .section_find_left_header div > *, + .section_second .section_find .section_find_left .section_find_right_header div > *, + .section_second .section_find .section_find_right .section_find_center_header div > *, + .section_second .section_find .section_find_right .section_find_left_header div > *, + .section_second .section_find .section_find_right .section_find_right_header div > * { + margin-top: 20px; + margin-left: 5px; + height: 20px; + display: inline-block; + float: left; } + .section_second .section_find .section_find_center .section_find_center_header div > span:nth-child(2), + .section_second .section_find .section_find_center .section_find_left_header div > span:nth-child(2), + .section_second .section_find .section_find_center .section_find_right_header div > span:nth-child(2), + .section_second .section_find .section_find_left .section_find_center_header div > span:nth-child(2), + .section_second .section_find .section_find_left .section_find_left_header div > span:nth-child(2), + .section_second .section_find .section_find_left .section_find_right_header div > span:nth-child(2), + .section_second .section_find .section_find_right .section_find_center_header div > span:nth-child(2), + .section_second .section_find .section_find_right .section_find_left_header div > span:nth-child(2), + .section_second .section_find .section_find_right .section_find_right_header div > span:nth-child(2) { + width: 20px; + height: 20px; + background: url("../img/section_second.png") no-repeat; + background-position: -154px -39px; } + .section_second .section_find .section_find_center .section_find_left_list, + .section_second .section_find .section_find_left .section_find_left_list, + .section_second .section_find .section_find_right .section_find_left_list { + width: 390px; + height: 389px; + padding: 10px; + background: #FFFFFF; + box-sizing: border-box; } + .section_second .section_find .section_find_center .section_find_left_list ul, + .section_second .section_find .section_find_left .section_find_left_list ul, + .section_second .section_find .section_find_right .section_find_left_list ul { + width: 370px; + height: 269px; } + .section_second .section_find .section_find_center .section_find_left_list ul > li:nth-of-type(2), .section_second .section_find .section_find_center .section_find_left_list ul > li:nth-of-type(4), + .section_second .section_find .section_find_left .section_find_left_list ul > li:nth-of-type(2), + .section_second .section_find .section_find_left .section_find_left_list ul > li:nth-of-type(4), + .section_second .section_find .section_find_right .section_find_left_list ul > li:nth-of-type(2), + .section_second .section_find .section_find_right .section_find_left_list ul > li:nth-of-type(4) { + border-right: none; + border-bottom: 1px solid #E7E7E7; } + .section_second .section_find .section_find_center .section_find_left_list ul > li:nth-of-type(5), + .section_second .section_find .section_find_left .section_find_left_list ul > li:nth-of-type(5), + .section_second .section_find .section_find_right .section_find_left_list ul > li:nth-of-type(5) { + border-right: 1px solid #E7E7E7; + border-bottom: none; } + .section_second .section_find .section_find_center .section_find_left_list ul > li:nth-of-type(6), + .section_second .section_find .section_find_left .section_find_left_list ul > li:nth-of-type(6), + .section_second .section_find .section_find_right .section_find_left_list ul > li:nth-of-type(6) { + border-right: none; + border-bottom: none; } + .section_second .section_find .section_find_center .section_find_left_list ul li, + .section_second .section_find .section_find_left .section_find_left_list ul li, + .section_second .section_find .section_find_right .section_find_left_list ul li { + width: 50%; + height: 121px; + box-sizing: border-box; + float: left; + position: relative; + border-right: 1px solid #E7E7E7; + border-bottom: 1px solid #E7E7E7; } + .section_second .section_find .section_find_center .section_find_left_list ul li p, + .section_second .section_find .section_find_left .section_find_left_list ul li p, + .section_second .section_find .section_find_right .section_find_left_list ul li p { + color: #4998a1; + font-size: 14px; + width: 100px; + height: 40px; + position: absolute; + top: 10px; + left: 10px; } + .section_second .section_find .section_find_center .section_find_left_list ul li img, + .section_second .section_find .section_find_left .section_find_left_list ul li img, + .section_second .section_find .section_find_right .section_find_left_list ul li img { + position: absolute; + right: 10px; + bottom: 10px; } + .section_second .section_find .section_find_center .section_find_center_header, + .section_second .section_find .section_find_left .section_find_center_header, + .section_second .section_find .section_find_right .section_find_center_header { + background-image: linear-gradient(90deg, #76488e, #662d72); } + .section_second .section_find .section_find_center .section_find_center_header .section_find_center_header_img, + .section_second .section_find .section_find_left .section_find_center_header .section_find_center_header_img, + .section_second .section_find .section_find_right .section_find_center_header .section_find_center_header_img { + background: url("../img/section_find_center_header.png") no-repeat; + background-position: -4px -4px; } + .section_second .section_find .section_find_center .swiper_section_find_center_list, + .section_second .section_find .section_find_left .swiper_section_find_center_list, + .section_second .section_find .section_find_right .swiper_section_find_center_list { + width: 390px; + height: 389px; + padding: 10px; + background: #FFFFFF; + box-sizing: border-box; } + .section_second .section_find .section_find_center .swiper_section_find_center_list .swiper-pagination-bullet-active, + .section_second .section_find .section_find_left .swiper_section_find_center_list .swiper-pagination-bullet-active, + .section_second .section_find .section_find_right .swiper_section_find_center_list .swiper-pagination-bullet-active { + background: red; } + .section_second .section_find .section_find_center .swiper_section_find_center_list .center_list, + .section_second .section_find .section_find_left .swiper_section_find_center_list .center_list, + .section_second .section_find .section_find_right .swiper_section_find_center_list .center_list { + top: 40%; + width: 20px; + height: 50px; + background-size: 10px 44px; + display: none; } + .section_second .section_find .section_find_center .swiper_section_find_center_list .center_list p, + .section_second .section_find .section_find_left .swiper_section_find_center_list .center_list p, + .section_second .section_find .section_find_right .swiper_section_find_center_list .center_list p { + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.1) !important; } + .section_second .section_find .section_find_center .swiper_section_find_center_list h1, + .section_second .section_find .section_find_left .swiper_section_find_center_list h1, + .section_second .section_find .section_find_right .swiper_section_find_center_list h1 { + padding: 10px; + box-sizing: border-box; + font-size: 14px; + font-weight: 400; + color: #666; + margin-bottom: 20px; + background: #FFFFFF; } + .section_second .section_find .section_find_center .swiper_section_find_center_list h1 p, + .section_second .section_find .section_find_left .swiper_section_find_center_list h1 p, + .section_second .section_find .section_find_right .swiper_section_find_center_list h1 p { + width: 100%; + margin-bottom: 10px; } + .section_second .section_find .section_find_center .swiper_section_find_center_list h1 > img:nth-of-type(2), + .section_second .section_find .section_find_left .swiper_section_find_center_list h1 > img:nth-of-type(2), + .section_second .section_find .section_find_right .swiper_section_find_center_list h1 > img:nth-of-type(2) { + margin: 0 5px; } + .section_second .section_find .section_find_center .section_find_right_header, + .section_second .section_find .section_find_left .section_find_right_header, + .section_second .section_find .section_find_right .section_find_right_header { + background-image: linear-gradient(90deg, #e77005, #e45d04); } + .section_second .section_find .section_find_center .section_find_right_header .section_find_right_header_img, + .section_second .section_find .section_find_left .section_find_right_header .section_find_right_header_img, + .section_second .section_find .section_find_right .section_find_right_header .section_find_right_header_img { + background-position: -194px -4px; } + .section_second .section_find .section_find_center .section_find_right_list, + .section_second .section_find .section_find_left .section_find_right_list, + .section_second .section_find .section_find_right .section_find_right_list { + width: 390px; + height: 389px; + background: #FFFFFF; + box-sizing: border-box; + position: relative; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul { + width: 100%; + padding: 5px 0; + border-bottom: 2px solid #E7E7E7; + height: 20px; + position: relative; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul .xiahua, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul .xiahua, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul .xiahua { + width: 60px; + height: 2px; + background: red; + position: absolute; + left: 10px; + bottom: -2px; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li { + float: left; + width: 20%; + text-align: center; + font-size: 14px; + border-right: 1px solid #E7E7E7; + box-sizing: border-box; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .active, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .active, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .active { + display: block !important; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol { + width: 370px; + height: 345px; + box-sizing: border-box; + position: absolute; + left: 10px; + top: 40px; + display: none; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:hover p, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:hover p, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:hover p { + color: #c81623; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li { + width: 123px; + padding: 10px 0; + float: left; + position: relative; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li p, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li p, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li p { + font-size: 12px; + color: #666; + height: 35px; + overflow: hidden; + margin: 10px 0; + text-align: left; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li h2, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li h2, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol li h2 { + width: 30px; + height: 40px; + position: absolute; + top: 10px; + left: 10px; + background: url("../img/section_second.png") no-repeat; + background-position: -104px -40px; + line-height: 35px; + color: #FFFFFF; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(2) h2, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(2) h2, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(2) h2 { + background-position: -50px -100px; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(3) h2, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(3) h2, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(3) h2 { + background-position: -100px -100px; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(4) h2, .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(5) h2, .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(6) h2, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(4) h2, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(5) h2, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(6) h2, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(4) h2, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(5) h2, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li .section_find_right_list_ul_ol > li:nth-of-type(6) h2 { + background-position: -100px -100px; } + .section_second .section_find .section_find_center .section_find_right_list .section_find_right_list_ul > li:hover, + .section_second .section_find .section_find_left .section_find_right_list .section_find_right_list_ul > li:hover, + .section_second .section_find .section_find_right .section_find_right_list .section_find_right_list_ul > li:hover { + color: #c81623; + cursor: pointer; } + .section_second .section_ling { + width: 1190px; + height: 270px; + margin: 0 auto; } + .section_second .section_ling .section_ling_left { + width: 790px; + height: 270px; + float: left; } + .section_second .section_ling .section_ling_left .section_ling_left_header { + width: 100%; + height: 55px; + background: linear-gradient(90deg, #f03118, #e62910); + color: #FFFFFF; + font-size: 14px; + padding: 0 20px; + box-sizing: border-box; + position: relative; } + .section_second .section_ling .section_ling_left .section_ling_left_header s { + display: inline-block; + width: 0; + height: 0; + border-top: 20px solid #f6f6f6; + border-right: 19px solid transparent; + position: absolute; + top: 0; + left: 0; } + .section_second .section_ling .section_ling_left .section_ling_left_header .section_ling_left_header_img { + width: 28px; + height: 28px; + background-color: #FFFFFF; + background: url("../img/section_second.png") no-repeat; + background-position: -194px -52px; + position: absolute; + top: 0; + left: 0; + z-index: 9; } + .section_second .section_ling .section_ling_left .section_ling_left_header > span:nth-of-type(1) { + display: inline-block; + font-size: 25px; + font-weight: 500; + margin: 10px 10px 0; } + .section_second .section_ling .section_ling_left .section_ling_left_header div { + float: right; } + .section_second .section_ling .section_ling_left .section_ling_left_header div > * { + margin-top: 20px; + margin-left: 5px; + height: 20px; + display: inline-block; + float: left; } + .section_second .section_ling .section_ling_left .section_ling_left_header div > span:nth-child(2) { + width: 20px; + height: 20px; + background: url("../img/section_second.png") no-repeat; + background-position: -154px -39px; } + .section_second .section_ling .section_ling_left .section_ling_left_list { + width: 790px; + height: 215px; + overflow: hidden; + background: #FFFFFF; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul { + width: 800px; + height: 215px; + padding: 10px 0; + box-sizing: border-box; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li { + width: 198px; + height: 195px; + position: relative; + border-right: 1px solid #E7E7E7; + float: left; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li img { + position: absolute; + top: 30px; + left: 40px; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div { + width: 100px; + position: absolute; + top: 10px; + left: 10px; + z-index: 9; + font-size: 12px; + background: #ffffff; + box-shadow: 3px 3px 10px 0 gray; + border-top: 3px solid #E93524; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div > * { + margin-top: 5px; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div > p:nth-of-type(1) { + font-size: 30px; + font-weight: 600; + color: #E93524; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div > p:nth-of-type(1) i { + font-size: 12px; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div > p:nth-of-type(2) { + color: #E93524; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div > p:nth-of-type(3) { + background: #e7e7e7; + padding: 10px; + width: 100%; + box-sizing: border-box; + color: #666; } + .section_second .section_ling .section_ling_left .section_ling_left_list ul li div > p:nth-of-type(4) { + width: 100%; + height: 30px; + background: #E93524; + text-align: center; + line-height: 30px; + color: #ffffff; + margin-top: 0; } + .section_second .section_ling .section_ling_right { + width: 390px; + height: 270px; + float: left; + margin-left: 10px; } + .section_second .section_ling .section_ling_right .section_ling_right_header { + width: 100%; + height: 55px; + background: -webkit-linear-gradient(left, #4f629f, #5b5c95); + background: -o-linear-gradient(left, #4f629f, #5b5c95); + background: linear-gradient(to right, #4f629f, #5b5c95); + color: #FFFFFF; + font-size: 14px; + padding: 0 20px; + box-sizing: border-box; + position: relative; } + .section_second .section_ling .section_ling_right .section_ling_right_header s { + display: inline-block; + width: 0; + height: 0; + border-top: 20px solid #f6f6f6; + border-right: 19px solid transparent; + position: absolute; + top: 0; + left: 0; } + .section_second .section_ling .section_ling_right .section_ling_right_header .section_ling_right_header_img { + width: 28px; + height: 28px; + background-color: #FFFFFF; + background: url("../img/section_ling_right_header_img.png") no-repeat; + background-position: -52px -4px; + position: absolute; + top: 0; + left: 0; + z-index: 9; } + .section_second .section_ling .section_ling_right .section_ling_right_header > span:nth-of-type(1) { + display: inline-block; + font-size: 25px; + font-weight: 500; + margin: 10px 10px 0; } + .section_second .section_ling .section_ling_right .section_ling_right_header div { + float: right; } + .section_second .section_ling .section_ling_right .section_ling_right_header div > * { + margin-top: 20px; + margin-left: 5px; + height: 20px; + display: inline-block; + float: left; } + .section_second .section_ling .section_ling_right .section_ling_right_header div > span:nth-child(2) { + width: 20px; + height: 20px; + background: url("../img/section_second.png") no-repeat; + background-position: -154px -39px; } + .section_second .section_ling .swiper_section_ling_right_list { + width: 390px; + height: 210px; + box-sizing: border-box; + padding: 25px 30px 40px; + background: #ffffff; + position: relative; } + .section_second .section_ling .swiper_section_ling_right_list .swiper-slide-active { + background: #FFFFFF !important; } + .section_second .section_ling .swiper_section_ling_right_list .right_list1, + .section_second .section_ling .swiper_section_ling_right_list .right_list2 { + top: 40%; + width: 20px; + height: 50px; + background-size: 10px 44px; + display: none; } + .section_second .section_ling .swiper_section_ling_right_list .right_list1 p, + .section_second .section_ling .swiper_section_ling_right_list .right_list2 p { + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.1) !important; } + .section_second .section_ling .swiper_section_ling_right_list .right_list1 { + left: 0 !important; } + .section_second .section_ling .swiper_section_ling_right_list .right_list2 { + right: 0 !important; } + .section_second .section_ling .swiper_section_ling_right_list img { + float: left; + margin-right: 10px; } + .section_second .section_ling .swiper_section_ling_right_list span { + margin-bottom: 15px; } + .section_second .section_ling .swiper_section_ling_right_list .a { + font-size: 14px; + text-align: justify; + display: block; + font-weight: 700; } + .section_second .section_ling .swiper_section_ling_right_list .b { + font-size: 12px; + display: block; + color: #999; } + .section_second .section_ling .swiper_section_ling_right_list .b a { + display: inline-block; + color: #4f629f; + text-decoration: none; } + .section_second .section_ling .swiper_section_ling_right_list .c { + font-size: 12px; + display: block; + position: absolute; + bottom: -15px; + right: 40px; } + .section_second .section_ling .swiper_section_ling_right_list .c i { + display: inline-block; + width: 20px; + height: 20px; + background: url("../img/section_ling_right_header_img.png") no-repeat; + background-position: -0px -45px; + float: left; } + .section_second .section_img { + width: 100%; + margin-top: 20px; + background: #E0E0E0; } + .section_second .section_img ul { + width: 1190px; + height: 100px; + margin: 0 auto; } + .section_second .section_img ul li { + width: 396px; + height: 100px; + float: left; } + .section_second .section_img ul li img { + width: 100%; } + +.section_xpz { + width: 100%; + height: 620px; } + .section_xpz .section_xpz_title { + width: 1190px; + padding: 0 0 20px; + height: 35px; + background: url("../img/xiazai1.png") repeat-x 0 18px; + text-align: center; + font-size: 24px; + line-height: 35px; + margin: 0 auto; } + .section_xpz .section_xpz_title h3 { + display: inline-block; + padding: 0 50px; + background: #f6f6f6; + font-weight: 400; + font-size: 26px; + color: #333; } + .section_xpz .section_xpz_content { + width: 1190px; + overflow: hidden; + margin: 0 auto; } + .section_xpz .section_xpz_content .section_xpz_content_left { + width: 800px; + float: left; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con { + width: 390px; + height: 170px; + position: relative; + float: left; + margin-top: 10px; + margin-right: 10px; + overflow: hidden; + cursor: pointer; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con img { + width: 400px; + height: 170px; + position: absolute; + left: 0; + top: 0; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con .img_title { + width: 140.39px; + height: 170px; + background: #66B687; + opacity: 0.8; + position: absolute; + left: 0; + top: 0; + z-index: 22px; + margin: 0 auto; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con .img_title .img_title_tit { + margin-top: 45px; + width: 100px; + font-size: 22px; + height: 40px; + line-height: 40px; + text-align: center; + border-top: 2px solid #fff; + border-bottom: 2px solid #fff; + color: #F5F9F7; + margin-left: 20.1px; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con .img_title .img_title_p { + width: 100px; + margin-top: 8px; + margin-left: 20.1px; + height: 32px; + line-height: 16px; + font-size: 14px; + color: #F5F9F7; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con:nth-child(2) .img_title { + background: #DDD279; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con:nth-child(3) .img_title { + background: #5D5566; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con:nth-child(4) .img_title { + background: #498C94; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con:nth-child(5) .img_title { + background: #d58717; } + .section_xpz .section_xpz_content .section_xpz_content_left .left_con:nth-child(6) .img_title { + background: #7e5944; } + .section_xpz .section_xpz_content_right { + width: 390px; + float: left; + margin-top: 10px; } + .section_xpz .section_xpz_content_right .right_top { + width: 390px; + height: 350px; + position: relative; } + .section_xpz .section_xpz_content_right .right_top .right_top_tit { + width: 390px; + height: 38px; + line-height: 38px; + background: #000; + opacity: 0.5; + position: absolute; + left: 0; + top: 0; + z-index: 22; } + .section_xpz .section_xpz_content_right .right_top .right_top_tit .right_top_tit_left { + font-size: 16px; + color: white; + text-indent: 24px; + float: left; } + .section_xpz .section_xpz_content_right .right_top .right_top_tit .right_top_tit_right { + font-size: 14px; + color: white; + float: right; + margin-right: 38px; } + .section_xpz .section_xpz_content_right .right_top .right_top_tit .right_top_tit_span { + width: 15px; + height: 16px; + position: absolute; + right: 20px; + top: 11px; + background: url("../img/sprite_entrylive@1x.png") no-repeat; + background-position: -205px -128px; + background-size: 237px 170px; } + .section_xpz .section_xpz_content_right .right_top .banner { + width: 390px; + height: 350px; + position: absolute; + top: 0; + left: 0; + background: red; } + .section_xpz .section_xpz_content_right .right_top .banner img { + width: 390px; + height: 350px; } + .section_xpz .section_xpz_content_right .right_top .banner .swiper-pagination-bullet { + background: white !important; + opacity: 1 !important; } + .section_xpz .section_xpz_content_right .right_top .banner .swiper-pagination-bullet-active { + background: red !important; } + .section_xpz .section_xpz_content_right .right_top .zanting { + position: absolute; + left: 42%; + top: 44%; + width: 65px; + height: 65px; + z-index: 66; + background: url("../img/sprite_entrylive@1x.png") no-repeat; + background-position: 0 -105px; + background-size: 237px 170px; } + .section_xpz .section_xpz_content_right .right_top .swiper-button-prev { + position: absolute; + left: 0; + top: 184px; + background: rgba(0, 0, 0, 0.42); + width: 20px; + height: 48px; + line-height: 48px; + color: #fff; + text-align: center; } + .section_xpz .section_xpz_content_right .right_top .swiper-button-next { + position: absolute; + right: 0; + top: 184px; + background: rgba(0, 0, 0, 0.42); + width: 20px; + height: 48px; + line-height: 48px; + color: #fff; + text-align: center; } + .section_xpz .section_xpz_content_right .xpz_right_bottom { + width: 400px; + height: 170px; + margin-top: 10px; + clear: both; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left { + width: 190px; + height: 170px; + float: left; + margin-right: 10px; + z-index: 77; + overflow: hidden; + position: relative; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left img { + width: 200px; + height: 170px; + margin-left: -5px; + position: absolute; + left: 0; + bottom: 0; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left .right_bottom_left_tit { + position: absolute; + left: 0; + bottom: 0; + width: 190px; + height: 80px; + background: #AF463E; + opacity: 0.8; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left .right_bottom_left_tit .right_bottom_left_tit_h4 { + width: 100px; + font-size: 16px; + height: 30px; + line-height: 34px; + text-align: center; + margin-top: 10px; + margin-left: 45px; + border-top: 2px solid #fff; + border-bottom: 2px solid #fff; + color: #F5F9F7; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left .right_bottom_left_tit .right_bottom_left_tit_p { + width: 100px; + margin-top: 8px; + margin-left: 45px; + height: 32px; + line-height: 16px; + font-size: 14px; + color: #F5F9F7; + text-align: center; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left1 { + width: 190px; + height: 170px; + float: left; + margin-right: 10px; + z-index: 77; + overflow: hidden; + position: relative; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left1 img { + width: 200px; + height: 170px; + margin-left: -5px; + position: absolute; + left: 0; + bottom: 0; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left1 .right_bottom_left_tit { + position: absolute; + left: 0; + bottom: 0; + width: 190px; + height: 80px; + background: #6C326B; + opacity: 0.8; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left1 .right_bottom_left_tit .right_bottom_left_tit_h4 { + width: 100px; + font-size: 16px; + height: 30px; + line-height: 34px; + text-align: center; + margin-top: 10px; + margin-left: 45px; + border-top: 2px solid #fff; + border-bottom: 2px solid #fff; + color: #F5F9F7; } + .section_xpz .section_xpz_content_right .xpz_right_bottom .right_bottom_left1 .right_bottom_left_tit .right_bottom_left_tit_p { + width: 100px; + margin-top: 8px; + margin-left: 45px; + height: 32px; + line-height: 16px; + font-size: 14px; + color: #F5F9F7; + text-align: center; } + +.section_xpz_footer { + width: 100%; + height: 100px; + clear: both; + margin-bottom: 30px; + background: #e0e0e0; } + .section_xpz_footer .section_xpz_footer1 { + width: 1190px; + height: 100px; + margin: 0 auto; } + .section_xpz_footer .section_xpz_footer1 img { + width: 396px; + height: 100px; + float: left; } + +.section_ash { + width: 1190px; + margin: 0 auto; } + .section_ash .section_ash_title { + width: 1190px; + padding: 0 0 20px; + height: 35px; + background: url("../img/xiazai1.png") repeat-x 0 18px; + text-align: center; + font-size: 24px; + line-height: 35px; } + .section_ash .section_ash_title h3 { + display: inline-block; + padding: 0 50px; + background: #f6f6f6; + font-weight: 400; + font-size: 26px; + color: #333; } + .section_ash .section_ash_content1 { + width: 1190px; + float: left; } + .section_ash .section_ash_content1 .section_ash_content { + width: 590px; + height: 523px; + overflow: hidden; + float: left; + margin-right: 5px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit { + width: 590px; + height: 58px; + background: #974676; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit .section_ash_tit1 { + padding: 16px 20px 16px 25px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit .section_ash_tit1 .section_ash_h3 { + float: left; + font-size: 22px; + color: #fff; + height: 26px; + line-height: 30px; + font-weight: 400; + max-width: 100px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit .section_ash_tit1 .section_ash_img { + width: 20px; + height: 32px; + float: left; + padding-top: 3px; + margin-left: 15px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit .section_ash_tit1 .section_ash_tit1_right { + float: right; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit .section_ash_tit1 .section_ash_tit1_right .section_ash_ul li { + display: inline-block; + float: left; + line-height: 26px; + text-align: center; + padding: 0 5px; + background: rgba(255, 255, 255, 0.3); + font-size: 14px; + border: 1px solid #e3e3e3; + margin-left: 10px; + color: white; + z-index: 33; + white-space: normal; + cursor: pointer; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_content_tit .section_ash_tit1 .section_ash_tit1_right .section_ash_ul li:hover { + border: 1px solid white; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont { + width: 590px; + height: 465px; + padding: 5px; + background: white; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_left { + width: 183px; + height: 260px; + overflow: hidden; + position: relative; + float: left; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_left img { + width: 193px; + height: 260px; + position: absolute; + left: 0; + top: 0; + margin-left: -5px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right { + width: 390px; + float: left; + margin-left: 7px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con { + width: 188px; + height: 130px; + float: left; + border-bottom: 1px solid #e7e7e7; + border-right: 1px solid #e7e7e7; + position: relative; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con .right_con_p1 { + max-width: 130px; + position: absolute; + top: 25px; + left: 25px; + font-size: 14px; + z-index: 44; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con .right_con_p2 { + position: absolute; + left: 25px; + top: 50px; + max-width: 50px; + font-size: 12px; + color: #666; + z-index: 33; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con .right_con_img { + width: 100px; + height: 100px; + background-color: #fff; + position: absolute; + right: 5px; + bottom: 10px; + cursor: pointer; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con:nth-child(2), + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con:nth-child(4) { + border-right: none; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con:nth-child(3), + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_top .con_top_right .right_con:nth-child(4) { + border-bottom: none; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_center { + width: 590px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_center .section_ash_center_img { + width: 183px; + height: 130px; + overflow: hidden; + margin-right: 10px; + float: left; + margin-top: 10px; + position: relative; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_center .section_ash_center_img img { + width: 193px; + height: 130px; + margin-right: 10px; + background: #fff; + position: absolute; + left: 0; + top: 0; + margin-left: -5px; + cursor: pointer; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom { + width: 590px; + height: 45px; + cursor: pointer; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 { + width: 590px; + height: 45px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1 .swiper-slide, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2 .swiper-slide, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3 .swiper-slide, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 .swiper-slide { + width: 590px; + height: 45px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1 .swiper-slide .bottom_con1_img, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2 .swiper-slide .bottom_con1_img, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3 .swiper-slide .bottom_con1_img, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 .swiper-slide .bottom_con1_img { + width: 95px; + height: 20px; + border-right: 1px solid #dedfe0; + padding: 0 12px; + margin-top: 17px; + float: left; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1 .swiper-slide .bottom_con1_img img, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2 .swiper-slide .bottom_con1_img img, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3 .swiper-slide .bottom_con1_img img, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 .swiper-slide .bottom_con1_img img { + margin-top: -7px; + width: 70px; + height: 35px; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1 .swiper-slide .bottom_con1_img:last-child, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2 .swiper-slide .bottom_con1_img:last-child, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3 .swiper-slide .bottom_con1_img:last-child, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 .swiper-slide .bottom_con1_img:last-child { + border-right: none; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1 .swiper-button-prev, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2 .swiper-button-prev, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3 .swiper-button-prev, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 .swiper-button-prev { + width: 15px; + height: 15px; + display: none; + line-height: 15px; + text-align: center; + background: white; + color: black; + position: absolute; + left: -4px; + top: 41px; + font-weight: 100; } + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner1 .swiper-button-next, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner2 .swiper-button-next, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner3 .swiper-button-next, + .section_ash .section_ash_content1 .section_ash_content .section_ash_cont .section_ash_con_bottom .banner4 .swiper-button-next { + width: 15px; + height: 15px; + display: none; + line-height: 15px; + text-align: center; + background: white; + color: black; + position: absolute; + right: 10px; + top: 41px; + font-weight: 100; } + .section_ash .section_ash_content1 .section_ash_content:first-child .right_con_p1 { + color: #974676; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(2) { + margin-right: none; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(2) .section_ash_content_tit { + background: #cd375e; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(2) .right_con_p1 { + color: #CD375E; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(3) { + margin-top: 15px; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(3) .section_ash_content_tit { + background: #78538e; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(3) .right_con_p1 { + color: #78538E; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(4) { + margin-top: 15px; + margin-right: none; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(4) .section_ash_content_tit { + background: #5e6c90; } + .section_ash .section_ash_content1 .section_ash_content:nth-child(4) .right_con_p1 { + color: #5e6c90; } + +a { + text-decoration: none; + color: black; } + +li, +ol, +ul { + list-style: none; } + +.section_ac_main, +.section_ac_top, +.section_ayd, +.section_dnsm_main, +.section_dnsm_top, +.section_w3c { + box-sizing: border-box; } + .section_ac_main *, + .section_ac_top *, + .section_ayd *, + .section_dnsm_main *, + .section_dnsm_top *, + .section_w3c * { + box-sizing: border-box; } + +.section_dnsm_top { + background: #4489A7; } + .section_dnsm_top .section_dnsm_ding { + border: 1px solid #4489A7; } + .section_dnsm_top .section_dnsm_ding p { + color: #4489A7; } + .section_dnsm_top .section_dnsm_list { + width: 868px; } + .section_dnsm_top .section_dnsm_list li { + background: #629AAC; + border: 1px solid #77B6C3; } + +.section_dnsm_txt p:first-child { + color: #4489A7; } + +.section_ac_top { + background: #ECB128; } + .section_ac_top .section_ac_ding { + border: 1px solid #ECB128; } + .section_ac_top .section_ac_ding p { + color: #ECB128; } + .section_ac_top .section_ac_list { + width: 788px; } + .section_ac_top .section_ac_list li { + background: #EFBC55; + border: 1px solid #F9D661; } + +.section_ac_txt p:first-child { + color: #ECB128; } + +#section_ac_box { + width: 183px; } + #section_ac_box li { + clear: both; + border: none; } + #section_ac_box li:first-child { + border-bottom: 1px solid #E6E6E6; } + +.section_ac_top, +.section_ayd_top, +.section_dnsm_top, +.section_w3c_top { + clear: both; + width: 1190px; + margin: 0 auto; + height: 58px; + color: white; + padding: 16px 20px 16px 25px; } + .section_ac_top h3, + .section_ayd_top h3, + .section_dnsm_top h3, + .section_w3c_top h3 { + float: left; } + .section_ac_top .section_ac_ewm, + .section_ac_top .section_ayd_ewm, + .section_ac_top .section_dnsm_ewm, + .section_ac_top .section_w3c_ewm, + .section_ayd_top .section_ac_ewm, + .section_ayd_top .section_ayd_ewm, + .section_ayd_top .section_dnsm_ewm, + .section_ayd_top .section_w3c_ewm, + .section_dnsm_top .section_ac_ewm, + .section_dnsm_top .section_ayd_ewm, + .section_dnsm_top .section_dnsm_ewm, + .section_dnsm_top .section_w3c_ewm, + .section_w3c_top .section_ac_ewm, + .section_w3c_top .section_ayd_ewm, + .section_w3c_top .section_dnsm_ewm, + .section_w3c_top .section_w3c_ewm { + position: relative; + width: 20px; + height: 24px; + float: left; + margin-left: 15px; + margin-top: 3px; } + .section_ac_top .section_ac_ewm > img, + .section_ac_top .section_ayd_ewm > img, + .section_ac_top .section_dnsm_ewm > img, + .section_ac_top .section_w3c_ewm > img, + .section_ayd_top .section_ac_ewm > img, + .section_ayd_top .section_ayd_ewm > img, + .section_ayd_top .section_dnsm_ewm > img, + .section_ayd_top .section_w3c_ewm > img, + .section_dnsm_top .section_ac_ewm > img, + .section_dnsm_top .section_ayd_ewm > img, + .section_dnsm_top .section_dnsm_ewm > img, + .section_dnsm_top .section_w3c_ewm > img, + .section_w3c_top .section_ac_ewm > img, + .section_w3c_top .section_ayd_ewm > img, + .section_w3c_top .section_dnsm_ewm > img, + .section_w3c_top .section_w3c_ewm > img { + width: 20px; + height: 20px; } + .section_ac_top .section_ac_ewm .section_ac_ding, + .section_ac_top .section_ac_ewm .section_ayd_ding, + .section_ac_top .section_ac_ewm .section_dnsm_ding, + .section_ac_top .section_ac_ewm .section_w3c_ding, + .section_ac_top .section_ayd_ewm .section_ac_ding, + .section_ac_top .section_ayd_ewm .section_ayd_ding, + .section_ac_top .section_ayd_ewm .section_dnsm_ding, + .section_ac_top .section_ayd_ewm .section_w3c_ding, + .section_ac_top .section_dnsm_ewm .section_ac_ding, + .section_ac_top .section_dnsm_ewm .section_ayd_ding, + .section_ac_top .section_dnsm_ewm .section_dnsm_ding, + .section_ac_top .section_dnsm_ewm .section_w3c_ding, + .section_ac_top .section_w3c_ewm .section_ac_ding, + .section_ac_top .section_w3c_ewm .section_ayd_ding, + .section_ac_top .section_w3c_ewm .section_dnsm_ding, + .section_ac_top .section_w3c_ewm .section_w3c_ding, + .section_ayd_top .section_ac_ewm .section_ac_ding, + .section_ayd_top .section_ac_ewm .section_ayd_ding, + .section_ayd_top .section_ac_ewm .section_dnsm_ding, + .section_ayd_top .section_ac_ewm .section_w3c_ding, + .section_ayd_top .section_ayd_ewm .section_ac_ding, + .section_ayd_top .section_ayd_ewm .section_ayd_ding, + .section_ayd_top .section_ayd_ewm .section_dnsm_ding, + .section_ayd_top .section_ayd_ewm .section_w3c_ding, + .section_ayd_top .section_dnsm_ewm .section_ac_ding, + .section_ayd_top .section_dnsm_ewm .section_ayd_ding, + .section_ayd_top .section_dnsm_ewm .section_dnsm_ding, + .section_ayd_top .section_dnsm_ewm .section_w3c_ding, + .section_ayd_top .section_w3c_ewm .section_ac_ding, + .section_ayd_top .section_w3c_ewm .section_ayd_ding, + .section_ayd_top .section_w3c_ewm .section_dnsm_ding, + .section_ayd_top .section_w3c_ewm .section_w3c_ding, + .section_dnsm_top .section_ac_ewm .section_ac_ding, + .section_dnsm_top .section_ac_ewm .section_ayd_ding, + .section_dnsm_top .section_ac_ewm .section_dnsm_ding, + .section_dnsm_top .section_ac_ewm .section_w3c_ding, + .section_dnsm_top .section_ayd_ewm .section_ac_ding, + .section_dnsm_top .section_ayd_ewm .section_ayd_ding, + .section_dnsm_top .section_ayd_ewm .section_dnsm_ding, + .section_dnsm_top .section_ayd_ewm .section_w3c_ding, + .section_dnsm_top .section_dnsm_ewm .section_ac_ding, + .section_dnsm_top .section_dnsm_ewm .section_ayd_ding, + .section_dnsm_top .section_dnsm_ewm .section_dnsm_ding, + .section_dnsm_top .section_dnsm_ewm .section_w3c_ding, + .section_dnsm_top .section_w3c_ewm .section_ac_ding, + .section_dnsm_top .section_w3c_ewm .section_ayd_ding, + .section_dnsm_top .section_w3c_ewm .section_dnsm_ding, + .section_dnsm_top .section_w3c_ewm .section_w3c_ding, + .section_w3c_top .section_ac_ewm .section_ac_ding, + .section_w3c_top .section_ac_ewm .section_ayd_ding, + .section_w3c_top .section_ac_ewm .section_dnsm_ding, + .section_w3c_top .section_ac_ewm .section_w3c_ding, + .section_w3c_top .section_ayd_ewm .section_ac_ding, + .section_w3c_top .section_ayd_ewm .section_ayd_ding, + .section_w3c_top .section_ayd_ewm .section_dnsm_ding, + .section_w3c_top .section_ayd_ewm .section_w3c_ding, + .section_w3c_top .section_dnsm_ewm .section_ac_ding, + .section_w3c_top .section_dnsm_ewm .section_ayd_ding, + .section_w3c_top .section_dnsm_ewm .section_dnsm_ding, + .section_w3c_top .section_dnsm_ewm .section_w3c_ding, + .section_w3c_top .section_w3c_ewm .section_ac_ding, + .section_w3c_top .section_w3c_ewm .section_ayd_ding, + .section_w3c_top .section_w3c_ewm .section_dnsm_ding, + .section_w3c_top .section_w3c_ewm .section_w3c_ding { + display: none; + position: absolute; + width: 105px; + height: 123px; + top: 38px; + left: -40px; + text-align: center; + padding-top: 10px; + background: white; + box-shadow: 0 1px 1px #999; } + .section_ac_top .section_ac_ewm .section_ac_ding p, + .section_ac_top .section_ac_ewm .section_ayd_ding p, + .section_ac_top .section_ac_ewm .section_dnsm_ding p, + .section_ac_top .section_ac_ewm .section_w3c_ding p, + .section_ac_top .section_ayd_ewm .section_ac_ding p, + .section_ac_top .section_ayd_ewm .section_ayd_ding p, + .section_ac_top .section_ayd_ewm .section_dnsm_ding p, + .section_ac_top .section_ayd_ewm .section_w3c_ding p, + .section_ac_top .section_dnsm_ewm .section_ac_ding p, + .section_ac_top .section_dnsm_ewm .section_ayd_ding p, + .section_ac_top .section_dnsm_ewm .section_dnsm_ding p, + .section_ac_top .section_dnsm_ewm .section_w3c_ding p, + .section_ac_top .section_w3c_ewm .section_ac_ding p, + .section_ac_top .section_w3c_ewm .section_ayd_ding p, + .section_ac_top .section_w3c_ewm .section_dnsm_ding p, + .section_ac_top .section_w3c_ewm .section_w3c_ding p, + .section_ayd_top .section_ac_ewm .section_ac_ding p, + .section_ayd_top .section_ac_ewm .section_ayd_ding p, + .section_ayd_top .section_ac_ewm .section_dnsm_ding p, + .section_ayd_top .section_ac_ewm .section_w3c_ding p, + .section_ayd_top .section_ayd_ewm .section_ac_ding p, + .section_ayd_top .section_ayd_ewm .section_ayd_ding p, + .section_ayd_top .section_ayd_ewm .section_dnsm_ding p, + .section_ayd_top .section_ayd_ewm .section_w3c_ding p, + .section_ayd_top .section_dnsm_ewm .section_ac_ding p, + .section_ayd_top .section_dnsm_ewm .section_ayd_ding p, + .section_ayd_top .section_dnsm_ewm .section_dnsm_ding p, + .section_ayd_top .section_dnsm_ewm .section_w3c_ding p, + .section_ayd_top .section_w3c_ewm .section_ac_ding p, + .section_ayd_top .section_w3c_ewm .section_ayd_ding p, + .section_ayd_top .section_w3c_ewm .section_dnsm_ding p, + .section_ayd_top .section_w3c_ewm .section_w3c_ding p, + .section_dnsm_top .section_ac_ewm .section_ac_ding p, + .section_dnsm_top .section_ac_ewm .section_ayd_ding p, + .section_dnsm_top .section_ac_ewm .section_dnsm_ding p, + .section_dnsm_top .section_ac_ewm .section_w3c_ding p, + .section_dnsm_top .section_ayd_ewm .section_ac_ding p, + .section_dnsm_top .section_ayd_ewm .section_ayd_ding p, + .section_dnsm_top .section_ayd_ewm .section_dnsm_ding p, + .section_dnsm_top .section_ayd_ewm .section_w3c_ding p, + .section_dnsm_top .section_dnsm_ewm .section_ac_ding p, + .section_dnsm_top .section_dnsm_ewm .section_ayd_ding p, + .section_dnsm_top .section_dnsm_ewm .section_dnsm_ding p, + .section_dnsm_top .section_dnsm_ewm .section_w3c_ding p, + .section_dnsm_top .section_w3c_ewm .section_ac_ding p, + .section_dnsm_top .section_w3c_ewm .section_ayd_ding p, + .section_dnsm_top .section_w3c_ewm .section_dnsm_ding p, + .section_dnsm_top .section_w3c_ewm .section_w3c_ding p, + .section_w3c_top .section_ac_ewm .section_ac_ding p, + .section_w3c_top .section_ac_ewm .section_ayd_ding p, + .section_w3c_top .section_ac_ewm .section_dnsm_ding p, + .section_w3c_top .section_ac_ewm .section_w3c_ding p, + .section_w3c_top .section_ayd_ewm .section_ac_ding p, + .section_w3c_top .section_ayd_ewm .section_ayd_ding p, + .section_w3c_top .section_ayd_ewm .section_dnsm_ding p, + .section_w3c_top .section_ayd_ewm .section_w3c_ding p, + .section_w3c_top .section_dnsm_ewm .section_ac_ding p, + .section_w3c_top .section_dnsm_ewm .section_ayd_ding p, + .section_w3c_top .section_dnsm_ewm .section_dnsm_ding p, + .section_w3c_top .section_dnsm_ewm .section_w3c_ding p, + .section_w3c_top .section_w3c_ewm .section_ac_ding p, + .section_w3c_top .section_w3c_ewm .section_ayd_ding p, + .section_w3c_top .section_w3c_ewm .section_dnsm_ding p, + .section_w3c_top .section_w3c_ewm .section_w3c_ding p { + font-size: 12px; } + .section_ac_top .section_ac_list, + .section_ac_top .section_ayd_list, + .section_ac_top .section_dnsm_list, + .section_ac_top .section_w3c_list, + .section_ayd_top .section_ac_list, + .section_ayd_top .section_ayd_list, + .section_ayd_top .section_dnsm_list, + .section_ayd_top .section_w3c_list, + .section_dnsm_top .section_ac_list, + .section_dnsm_top .section_ayd_list, + .section_dnsm_top .section_dnsm_list, + .section_dnsm_top .section_w3c_list, + .section_w3c_top .section_ac_list, + .section_w3c_top .section_ayd_list, + .section_w3c_top .section_dnsm_list, + .section_w3c_top .section_w3c_list { + float: right; } + .section_ac_top .section_ac_list li, + .section_ac_top .section_ayd_list li, + .section_ac_top .section_dnsm_list li, + .section_ac_top .section_w3c_list li, + .section_ayd_top .section_ac_list li, + .section_ayd_top .section_ayd_list li, + .section_ayd_top .section_dnsm_list li, + .section_ayd_top .section_w3c_list li, + .section_dnsm_top .section_ac_list li, + .section_dnsm_top .section_ayd_list li, + .section_dnsm_top .section_dnsm_list li, + .section_dnsm_top .section_w3c_list li, + .section_w3c_top .section_ac_list li, + .section_w3c_top .section_ayd_list li, + .section_w3c_top .section_dnsm_list li, + .section_w3c_top .section_w3c_list li { + float: left; + padding: 0 10px; + font-size: 12px; + height: 26px; + text-align: center; + line-height: 26px; + margin-left: 10px; } + .section_ac_top .section_ac_list li:hover, + .section_ac_top .section_ayd_list li:hover, + .section_ac_top .section_dnsm_list li:hover, + .section_ac_top .section_w3c_list li:hover, + .section_ayd_top .section_ac_list li:hover, + .section_ayd_top .section_ayd_list li:hover, + .section_ayd_top .section_dnsm_list li:hover, + .section_ayd_top .section_w3c_list li:hover, + .section_dnsm_top .section_ac_list li:hover, + .section_dnsm_top .section_ayd_list li:hover, + .section_dnsm_top .section_dnsm_list li:hover, + .section_dnsm_top .section_w3c_list li:hover, + .section_w3c_top .section_ac_list li:hover, + .section_w3c_top .section_ayd_list li:hover, + .section_w3c_top .section_dnsm_list li:hover, + .section_w3c_top .section_w3c_list li:hover { + border: 1px solid white !important; } + .section_ac_top .section_ac_list li a, + .section_ac_top .section_ayd_list li a, + .section_ac_top .section_dnsm_list li a, + .section_ac_top .section_w3c_list li a, + .section_ayd_top .section_ac_list li a, + .section_ayd_top .section_ayd_list li a, + .section_ayd_top .section_dnsm_list li a, + .section_ayd_top .section_w3c_list li a, + .section_dnsm_top .section_ac_list li a, + .section_dnsm_top .section_ayd_list li a, + .section_dnsm_top .section_dnsm_list li a, + .section_dnsm_top .section_w3c_list li a, + .section_w3c_top .section_ac_list li a, + .section_w3c_top .section_ayd_list li a, + .section_w3c_top .section_dnsm_list li a, + .section_w3c_top .section_w3c_list li a { + color: white; } + +.section_ac_main, +.section_ayd_main, +.section_dnsm_main, +.section_w3c_main { + background: white; + margin: 0 auto 30px; + width: 1190px; + height: 465px; + padding: 10px; } + .section_ac_main .section_ac_left, + .section_ac_main .section_ac_right, + .section_ac_main .section_ayd_left, + .section_ac_main .section_ayd_right, + .section_ac_main .section_dnsm_left, + .section_ac_main .section_dnsm_right, + .section_ac_main .section_w3c_left, + .section_ac_main .section_w3c_right, + .section_ayd_main .section_ac_left, + .section_ayd_main .section_ac_right, + .section_ayd_main .section_ayd_left, + .section_ayd_main .section_ayd_right, + .section_ayd_main .section_dnsm_left, + .section_ayd_main .section_dnsm_right, + .section_ayd_main .section_w3c_left, + .section_ayd_main .section_w3c_right, + .section_dnsm_main .section_ac_left, + .section_dnsm_main .section_ac_right, + .section_dnsm_main .section_ayd_left, + .section_dnsm_main .section_ayd_right, + .section_dnsm_main .section_dnsm_left, + .section_dnsm_main .section_dnsm_right, + .section_dnsm_main .section_w3c_left, + .section_dnsm_main .section_w3c_right, + .section_w3c_main .section_ac_left, + .section_w3c_main .section_ac_right, + .section_w3c_main .section_ayd_left, + .section_w3c_main .section_ayd_right, + .section_w3c_main .section_dnsm_left, + .section_w3c_main .section_dnsm_right, + .section_w3c_main .section_w3c_left, + .section_w3c_main .section_w3c_right { + margin-right: 15px; + float: left; + width: 570px; + height: 400px; } + .section_ac_main .section_ac_left .section_ac_er, + .section_ac_main .section_ac_left .section_ayd_er, + .section_ac_main .section_ac_left .section_w3c_er, + .section_ac_main .section_ac_left div:first-child, + .section_ac_main .section_ac_right .section_ac_er, + .section_ac_main .section_ac_right .section_ayd_er, + .section_ac_main .section_ac_right .section_w3c_er, + .section_ac_main .section_ac_right div:first-child, + .section_ac_main .section_ayd_left .section_ac_er, + .section_ac_main .section_ayd_left .section_ayd_er, + .section_ac_main .section_ayd_left .section_w3c_er, + .section_ac_main .section_ayd_left div:first-child, + .section_ac_main .section_ayd_right .section_ac_er, + .section_ac_main .section_ayd_right .section_ayd_er, + .section_ac_main .section_ayd_right .section_w3c_er, + .section_ac_main .section_ayd_right div:first-child, + .section_ac_main .section_dnsm_left .section_ac_er, + .section_ac_main .section_dnsm_left .section_ayd_er, + .section_ac_main .section_dnsm_left .section_w3c_er, + .section_ac_main .section_dnsm_left div:first-child, + .section_ac_main .section_dnsm_right .section_ac_er, + .section_ac_main .section_dnsm_right .section_ayd_er, + .section_ac_main .section_dnsm_right .section_w3c_er, + .section_ac_main .section_dnsm_right div:first-child, + .section_ac_main .section_w3c_left .section_ac_er, + .section_ac_main .section_w3c_left .section_ayd_er, + .section_ac_main .section_w3c_left .section_w3c_er, + .section_ac_main .section_w3c_left div:first-child, + .section_ac_main .section_w3c_right .section_ac_er, + .section_ac_main .section_w3c_right .section_ayd_er, + .section_ac_main .section_w3c_right .section_w3c_er, + .section_ac_main .section_w3c_right div:first-child, + .section_ayd_main .section_ac_left .section_ac_er, + .section_ayd_main .section_ac_left .section_ayd_er, + .section_ayd_main .section_ac_left .section_w3c_er, + .section_ayd_main .section_ac_left div:first-child, + .section_ayd_main .section_ac_right .section_ac_er, + .section_ayd_main .section_ac_right .section_ayd_er, + .section_ayd_main .section_ac_right .section_w3c_er, + .section_ayd_main .section_ac_right div:first-child, + .section_ayd_main .section_ayd_left .section_ac_er, + .section_ayd_main .section_ayd_left .section_ayd_er, + .section_ayd_main .section_ayd_left .section_w3c_er, + .section_ayd_main .section_ayd_left div:first-child, + .section_ayd_main .section_ayd_right .section_ac_er, + .section_ayd_main .section_ayd_right .section_ayd_er, + .section_ayd_main .section_ayd_right .section_w3c_er, + .section_ayd_main .section_ayd_right div:first-child, + .section_ayd_main .section_dnsm_left .section_ac_er, + .section_ayd_main .section_dnsm_left .section_ayd_er, + .section_ayd_main .section_dnsm_left .section_w3c_er, + .section_ayd_main .section_dnsm_left div:first-child, + .section_ayd_main .section_dnsm_right .section_ac_er, + .section_ayd_main .section_dnsm_right .section_ayd_er, + .section_ayd_main .section_dnsm_right .section_w3c_er, + .section_ayd_main .section_dnsm_right div:first-child, + .section_ayd_main .section_w3c_left .section_ac_er, + .section_ayd_main .section_w3c_left .section_ayd_er, + .section_ayd_main .section_w3c_left .section_w3c_er, + .section_ayd_main .section_w3c_left div:first-child, + .section_ayd_main .section_w3c_right .section_ac_er, + .section_ayd_main .section_w3c_right .section_ayd_er, + .section_ayd_main .section_w3c_right .section_w3c_er, + .section_ayd_main .section_w3c_right div:first-child, + .section_dnsm_main .section_ac_left .section_ac_er, + .section_dnsm_main .section_ac_left .section_ayd_er, + .section_dnsm_main .section_ac_left .section_w3c_er, + .section_dnsm_main .section_ac_left div:first-child, + .section_dnsm_main .section_ac_right .section_ac_er, + .section_dnsm_main .section_ac_right .section_ayd_er, + .section_dnsm_main .section_ac_right .section_w3c_er, + .section_dnsm_main .section_ac_right div:first-child, + .section_dnsm_main .section_ayd_left .section_ac_er, + .section_dnsm_main .section_ayd_left .section_ayd_er, + .section_dnsm_main .section_ayd_left .section_w3c_er, + .section_dnsm_main .section_ayd_left div:first-child, + .section_dnsm_main .section_ayd_right .section_ac_er, + .section_dnsm_main .section_ayd_right .section_ayd_er, + .section_dnsm_main .section_ayd_right .section_w3c_er, + .section_dnsm_main .section_ayd_right div:first-child, + .section_dnsm_main .section_dnsm_left .section_ac_er, + .section_dnsm_main .section_dnsm_left .section_ayd_er, + .section_dnsm_main .section_dnsm_left .section_w3c_er, + .section_dnsm_main .section_dnsm_left div:first-child, + .section_dnsm_main .section_dnsm_right .section_ac_er, + .section_dnsm_main .section_dnsm_right .section_ayd_er, + .section_dnsm_main .section_dnsm_right .section_w3c_er, + .section_dnsm_main .section_dnsm_right div:first-child, + .section_dnsm_main .section_w3c_left .section_ac_er, + .section_dnsm_main .section_w3c_left .section_ayd_er, + .section_dnsm_main .section_w3c_left .section_w3c_er, + .section_dnsm_main .section_w3c_left div:first-child, + .section_dnsm_main .section_w3c_right .section_ac_er, + .section_dnsm_main .section_w3c_right .section_ayd_er, + .section_dnsm_main .section_w3c_right .section_w3c_er, + .section_dnsm_main .section_w3c_right div:first-child, + .section_w3c_main .section_ac_left .section_ac_er, + .section_w3c_main .section_ac_left .section_ayd_er, + .section_w3c_main .section_ac_left .section_w3c_er, + .section_w3c_main .section_ac_left div:first-child, + .section_w3c_main .section_ac_right .section_ac_er, + .section_w3c_main .section_ac_right .section_ayd_er, + .section_w3c_main .section_ac_right .section_w3c_er, + .section_w3c_main .section_ac_right div:first-child, + .section_w3c_main .section_ayd_left .section_ac_er, + .section_w3c_main .section_ayd_left .section_ayd_er, + .section_w3c_main .section_ayd_left .section_w3c_er, + .section_w3c_main .section_ayd_left div:first-child, + .section_w3c_main .section_ayd_right .section_ac_er, + .section_w3c_main .section_ayd_right .section_ayd_er, + .section_w3c_main .section_ayd_right .section_w3c_er, + .section_w3c_main .section_ayd_right div:first-child, + .section_w3c_main .section_dnsm_left .section_ac_er, + .section_w3c_main .section_dnsm_left .section_ayd_er, + .section_w3c_main .section_dnsm_left .section_w3c_er, + .section_w3c_main .section_dnsm_left div:first-child, + .section_w3c_main .section_dnsm_right .section_ac_er, + .section_w3c_main .section_dnsm_right .section_ayd_er, + .section_w3c_main .section_dnsm_right .section_w3c_er, + .section_w3c_main .section_dnsm_right div:first-child, + .section_w3c_main .section_w3c_left .section_ac_er, + .section_w3c_main .section_w3c_left .section_ayd_er, + .section_w3c_main .section_w3c_left .section_w3c_er, + .section_w3c_main .section_w3c_left div:first-child, + .section_w3c_main .section_w3c_right .section_ac_er, + .section_w3c_main .section_w3c_right .section_ayd_er, + .section_w3c_main .section_w3c_right .section_w3c_er, + .section_w3c_main .section_w3c_right div:first-child { + float: left; + margin-right: 10px; + width: 183px; + overflow: hidden; + cursor: pointer; + position: relative; } + .section_ac_main .section_ac_left .section_ac_er img, + .section_ac_main .section_ac_left .section_ayd_er img, + .section_ac_main .section_ac_left .section_w3c_er img, + .section_ac_main .section_ac_left div:first-child img, + .section_ac_main .section_ac_right .section_ac_er img, + .section_ac_main .section_ac_right .section_ayd_er img, + .section_ac_main .section_ac_right .section_w3c_er img, + .section_ac_main .section_ac_right div:first-child img, + .section_ac_main .section_ayd_left .section_ac_er img, + .section_ac_main .section_ayd_left .section_ayd_er img, + .section_ac_main .section_ayd_left .section_w3c_er img, + .section_ac_main .section_ayd_left div:first-child img, + .section_ac_main .section_ayd_right .section_ac_er img, + .section_ac_main .section_ayd_right .section_ayd_er img, + .section_ac_main .section_ayd_right .section_w3c_er img, + .section_ac_main .section_ayd_right div:first-child img, + .section_ac_main .section_dnsm_left .section_ac_er img, + .section_ac_main .section_dnsm_left .section_ayd_er img, + .section_ac_main .section_dnsm_left .section_w3c_er img, + .section_ac_main .section_dnsm_left div:first-child img, + .section_ac_main .section_dnsm_right .section_ac_er img, + .section_ac_main .section_dnsm_right .section_ayd_er img, + .section_ac_main .section_dnsm_right .section_w3c_er img, + .section_ac_main .section_dnsm_right div:first-child img, + .section_ac_main .section_w3c_left .section_ac_er img, + .section_ac_main .section_w3c_left .section_ayd_er img, + .section_ac_main .section_w3c_left .section_w3c_er img, + .section_ac_main .section_w3c_left div:first-child img, + .section_ac_main .section_w3c_right .section_ac_er img, + .section_ac_main .section_w3c_right .section_ayd_er img, + .section_ac_main .section_w3c_right .section_w3c_er img, + .section_ac_main .section_w3c_right div:first-child img, + .section_ayd_main .section_ac_left .section_ac_er img, + .section_ayd_main .section_ac_left .section_ayd_er img, + .section_ayd_main .section_ac_left .section_w3c_er img, + .section_ayd_main .section_ac_left div:first-child img, + .section_ayd_main .section_ac_right .section_ac_er img, + .section_ayd_main .section_ac_right .section_ayd_er img, + .section_ayd_main .section_ac_right .section_w3c_er img, + .section_ayd_main .section_ac_right div:first-child img, + .section_ayd_main .section_ayd_left .section_ac_er img, + .section_ayd_main .section_ayd_left .section_ayd_er img, + .section_ayd_main .section_ayd_left .section_w3c_er img, + .section_ayd_main .section_ayd_left div:first-child img, + .section_ayd_main .section_ayd_right .section_ac_er img, + .section_ayd_main .section_ayd_right .section_ayd_er img, + .section_ayd_main .section_ayd_right .section_w3c_er img, + .section_ayd_main .section_ayd_right div:first-child img, + .section_ayd_main .section_dnsm_left .section_ac_er img, + .section_ayd_main .section_dnsm_left .section_ayd_er img, + .section_ayd_main .section_dnsm_left .section_w3c_er img, + .section_ayd_main .section_dnsm_left div:first-child img, + .section_ayd_main .section_dnsm_right .section_ac_er img, + .section_ayd_main .section_dnsm_right .section_ayd_er img, + .section_ayd_main .section_dnsm_right .section_w3c_er img, + .section_ayd_main .section_dnsm_right div:first-child img, + .section_ayd_main .section_w3c_left .section_ac_er img, + .section_ayd_main .section_w3c_left .section_ayd_er img, + .section_ayd_main .section_w3c_left .section_w3c_er img, + .section_ayd_main .section_w3c_left div:first-child img, + .section_ayd_main .section_w3c_right .section_ac_er img, + .section_ayd_main .section_w3c_right .section_ayd_er img, + .section_ayd_main .section_w3c_right .section_w3c_er img, + .section_ayd_main .section_w3c_right div:first-child img, + .section_dnsm_main .section_ac_left .section_ac_er img, + .section_dnsm_main .section_ac_left .section_ayd_er img, + .section_dnsm_main .section_ac_left .section_w3c_er img, + .section_dnsm_main .section_ac_left div:first-child img, + .section_dnsm_main .section_ac_right .section_ac_er img, + .section_dnsm_main .section_ac_right .section_ayd_er img, + .section_dnsm_main .section_ac_right .section_w3c_er img, + .section_dnsm_main .section_ac_right div:first-child img, + .section_dnsm_main .section_ayd_left .section_ac_er img, + .section_dnsm_main .section_ayd_left .section_ayd_er img, + .section_dnsm_main .section_ayd_left .section_w3c_er img, + .section_dnsm_main .section_ayd_left div:first-child img, + .section_dnsm_main .section_ayd_right .section_ac_er img, + .section_dnsm_main .section_ayd_right .section_ayd_er img, + .section_dnsm_main .section_ayd_right .section_w3c_er img, + .section_dnsm_main .section_ayd_right div:first-child img, + .section_dnsm_main .section_dnsm_left .section_ac_er img, + .section_dnsm_main .section_dnsm_left .section_ayd_er img, + .section_dnsm_main .section_dnsm_left .section_w3c_er img, + .section_dnsm_main .section_dnsm_left div:first-child img, + .section_dnsm_main .section_dnsm_right .section_ac_er img, + .section_dnsm_main .section_dnsm_right .section_ayd_er img, + .section_dnsm_main .section_dnsm_right .section_w3c_er img, + .section_dnsm_main .section_dnsm_right div:first-child img, + .section_dnsm_main .section_w3c_left .section_ac_er img, + .section_dnsm_main .section_w3c_left .section_ayd_er img, + .section_dnsm_main .section_w3c_left .section_w3c_er img, + .section_dnsm_main .section_w3c_left div:first-child img, + .section_dnsm_main .section_w3c_right .section_ac_er img, + .section_dnsm_main .section_w3c_right .section_ayd_er img, + .section_dnsm_main .section_w3c_right .section_w3c_er img, + .section_dnsm_main .section_w3c_right div:first-child img, + .section_w3c_main .section_ac_left .section_ac_er img, + .section_w3c_main .section_ac_left .section_ayd_er img, + .section_w3c_main .section_ac_left .section_w3c_er img, + .section_w3c_main .section_ac_left div:first-child img, + .section_w3c_main .section_ac_right .section_ac_er img, + .section_w3c_main .section_ac_right .section_ayd_er img, + .section_w3c_main .section_ac_right .section_w3c_er img, + .section_w3c_main .section_ac_right div:first-child img, + .section_w3c_main .section_ayd_left .section_ac_er img, + .section_w3c_main .section_ayd_left .section_ayd_er img, + .section_w3c_main .section_ayd_left .section_w3c_er img, + .section_w3c_main .section_ayd_left div:first-child img, + .section_w3c_main .section_ayd_right .section_ac_er img, + .section_w3c_main .section_ayd_right .section_ayd_er img, + .section_w3c_main .section_ayd_right .section_w3c_er img, + .section_w3c_main .section_ayd_right div:first-child img, + .section_w3c_main .section_dnsm_left .section_ac_er img, + .section_w3c_main .section_dnsm_left .section_ayd_er img, + .section_w3c_main .section_dnsm_left .section_w3c_er img, + .section_w3c_main .section_dnsm_left div:first-child img, + .section_w3c_main .section_dnsm_right .section_ac_er img, + .section_w3c_main .section_dnsm_right .section_ayd_er img, + .section_w3c_main .section_dnsm_right .section_w3c_er img, + .section_w3c_main .section_dnsm_right div:first-child img, + .section_w3c_main .section_w3c_left .section_ac_er img, + .section_w3c_main .section_w3c_left .section_ayd_er img, + .section_w3c_main .section_w3c_left .section_w3c_er img, + .section_w3c_main .section_w3c_left div:first-child img, + .section_w3c_main .section_w3c_right .section_ac_er img, + .section_w3c_main .section_w3c_right .section_ayd_er img, + .section_w3c_main .section_w3c_right .section_w3c_er img, + .section_w3c_main .section_w3c_right div:first-child img { + display: block; + position: relative; } + .section_ac_main .section_ac_left .section_ac_box, + .section_ac_main .section_ac_left .section_ayd_box, + .section_ac_main .section_ac_left .section_dnsm_box, + .section_ac_main .section_ac_left .section_w3c_box, + .section_ac_main .section_ac_right .section_ac_box, + .section_ac_main .section_ac_right .section_ayd_box, + .section_ac_main .section_ac_right .section_dnsm_box, + .section_ac_main .section_ac_right .section_w3c_box, + .section_ac_main .section_ayd_left .section_ac_box, + .section_ac_main .section_ayd_left .section_ayd_box, + .section_ac_main .section_ayd_left .section_dnsm_box, + .section_ac_main .section_ayd_left .section_w3c_box, + .section_ac_main .section_ayd_right .section_ac_box, + .section_ac_main .section_ayd_right .section_ayd_box, + .section_ac_main .section_ayd_right .section_dnsm_box, + .section_ac_main .section_ayd_right .section_w3c_box, + .section_ac_main .section_dnsm_left .section_ac_box, + .section_ac_main .section_dnsm_left .section_ayd_box, + .section_ac_main .section_dnsm_left .section_dnsm_box, + .section_ac_main .section_dnsm_left .section_w3c_box, + .section_ac_main .section_dnsm_right .section_ac_box, + .section_ac_main .section_dnsm_right .section_ayd_box, + .section_ac_main .section_dnsm_right .section_dnsm_box, + .section_ac_main .section_dnsm_right .section_w3c_box, + .section_ac_main .section_w3c_left .section_ac_box, + .section_ac_main .section_w3c_left .section_ayd_box, + .section_ac_main .section_w3c_left .section_dnsm_box, + .section_ac_main .section_w3c_left .section_w3c_box, + .section_ac_main .section_w3c_right .section_ac_box, + .section_ac_main .section_w3c_right .section_ayd_box, + .section_ac_main .section_w3c_right .section_dnsm_box, + .section_ac_main .section_w3c_right .section_w3c_box, + .section_ayd_main .section_ac_left .section_ac_box, + .section_ayd_main .section_ac_left .section_ayd_box, + .section_ayd_main .section_ac_left .section_dnsm_box, + .section_ayd_main .section_ac_left .section_w3c_box, + .section_ayd_main .section_ac_right .section_ac_box, + .section_ayd_main .section_ac_right .section_ayd_box, + .section_ayd_main .section_ac_right .section_dnsm_box, + .section_ayd_main .section_ac_right .section_w3c_box, + .section_ayd_main .section_ayd_left .section_ac_box, + .section_ayd_main .section_ayd_left .section_ayd_box, + .section_ayd_main .section_ayd_left .section_dnsm_box, + .section_ayd_main .section_ayd_left .section_w3c_box, + .section_ayd_main .section_ayd_right .section_ac_box, + .section_ayd_main .section_ayd_right .section_ayd_box, + .section_ayd_main .section_ayd_right .section_dnsm_box, + .section_ayd_main .section_ayd_right .section_w3c_box, + .section_ayd_main .section_dnsm_left .section_ac_box, + .section_ayd_main .section_dnsm_left .section_ayd_box, + .section_ayd_main .section_dnsm_left .section_dnsm_box, + .section_ayd_main .section_dnsm_left .section_w3c_box, + .section_ayd_main .section_dnsm_right .section_ac_box, + .section_ayd_main .section_dnsm_right .section_ayd_box, + .section_ayd_main .section_dnsm_right .section_dnsm_box, + .section_ayd_main .section_dnsm_right .section_w3c_box, + .section_ayd_main .section_w3c_left .section_ac_box, + .section_ayd_main .section_w3c_left .section_ayd_box, + .section_ayd_main .section_w3c_left .section_dnsm_box, + .section_ayd_main .section_w3c_left .section_w3c_box, + .section_ayd_main .section_w3c_right .section_ac_box, + .section_ayd_main .section_w3c_right .section_ayd_box, + .section_ayd_main .section_w3c_right .section_dnsm_box, + .section_ayd_main .section_w3c_right .section_w3c_box, + .section_dnsm_main .section_ac_left .section_ac_box, + .section_dnsm_main .section_ac_left .section_ayd_box, + .section_dnsm_main .section_ac_left .section_dnsm_box, + .section_dnsm_main .section_ac_left .section_w3c_box, + .section_dnsm_main .section_ac_right .section_ac_box, + .section_dnsm_main .section_ac_right .section_ayd_box, + .section_dnsm_main .section_ac_right .section_dnsm_box, + .section_dnsm_main .section_ac_right .section_w3c_box, + .section_dnsm_main .section_ayd_left .section_ac_box, + .section_dnsm_main .section_ayd_left .section_ayd_box, + .section_dnsm_main .section_ayd_left .section_dnsm_box, + .section_dnsm_main .section_ayd_left .section_w3c_box, + .section_dnsm_main .section_ayd_right .section_ac_box, + .section_dnsm_main .section_ayd_right .section_ayd_box, + .section_dnsm_main .section_ayd_right .section_dnsm_box, + .section_dnsm_main .section_ayd_right .section_w3c_box, + .section_dnsm_main .section_dnsm_left .section_ac_box, + .section_dnsm_main .section_dnsm_left .section_ayd_box, + .section_dnsm_main .section_dnsm_left .section_dnsm_box, + .section_dnsm_main .section_dnsm_left .section_w3c_box, + .section_dnsm_main .section_dnsm_right .section_ac_box, + .section_dnsm_main .section_dnsm_right .section_ayd_box, + .section_dnsm_main .section_dnsm_right .section_dnsm_box, + .section_dnsm_main .section_dnsm_right .section_w3c_box, + .section_dnsm_main .section_w3c_left .section_ac_box, + .section_dnsm_main .section_w3c_left .section_ayd_box, + .section_dnsm_main .section_w3c_left .section_dnsm_box, + .section_dnsm_main .section_w3c_left .section_w3c_box, + .section_dnsm_main .section_w3c_right .section_ac_box, + .section_dnsm_main .section_w3c_right .section_ayd_box, + .section_dnsm_main .section_w3c_right .section_dnsm_box, + .section_dnsm_main .section_w3c_right .section_w3c_box, + .section_w3c_main .section_ac_left .section_ac_box, + .section_w3c_main .section_ac_left .section_ayd_box, + .section_w3c_main .section_ac_left .section_dnsm_box, + .section_w3c_main .section_ac_left .section_w3c_box, + .section_w3c_main .section_ac_right .section_ac_box, + .section_w3c_main .section_ac_right .section_ayd_box, + .section_w3c_main .section_ac_right .section_dnsm_box, + .section_w3c_main .section_ac_right .section_w3c_box, + .section_w3c_main .section_ayd_left .section_ac_box, + .section_w3c_main .section_ayd_left .section_ayd_box, + .section_w3c_main .section_ayd_left .section_dnsm_box, + .section_w3c_main .section_ayd_left .section_w3c_box, + .section_w3c_main .section_ayd_right .section_ac_box, + .section_w3c_main .section_ayd_right .section_ayd_box, + .section_w3c_main .section_ayd_right .section_dnsm_box, + .section_w3c_main .section_ayd_right .section_w3c_box, + .section_w3c_main .section_dnsm_left .section_ac_box, + .section_w3c_main .section_dnsm_left .section_ayd_box, + .section_w3c_main .section_dnsm_left .section_dnsm_box, + .section_w3c_main .section_dnsm_left .section_w3c_box, + .section_w3c_main .section_dnsm_right .section_ac_box, + .section_w3c_main .section_dnsm_right .section_ayd_box, + .section_w3c_main .section_dnsm_right .section_dnsm_box, + .section_w3c_main .section_dnsm_right .section_w3c_box, + .section_w3c_main .section_w3c_left .section_ac_box, + .section_w3c_main .section_w3c_left .section_ayd_box, + .section_w3c_main .section_w3c_left .section_dnsm_box, + .section_w3c_main .section_w3c_left .section_w3c_box, + .section_w3c_main .section_w3c_right .section_ac_box, + .section_w3c_main .section_w3c_right .section_ayd_box, + .section_w3c_main .section_w3c_right .section_dnsm_box, + .section_w3c_main .section_w3c_right .section_w3c_box { + float: right; + width: 376px; } + .section_ac_main .section_ac_left .section_ac_box li, + .section_ac_main .section_ac_left .section_ayd_box li, + .section_ac_main .section_ac_left .section_dnsm_box li, + .section_ac_main .section_ac_left .section_w3c_box li, + .section_ac_main .section_ac_right .section_ac_box li, + .section_ac_main .section_ac_right .section_ayd_box li, + .section_ac_main .section_ac_right .section_dnsm_box li, + .section_ac_main .section_ac_right .section_w3c_box li, + .section_ac_main .section_ayd_left .section_ac_box li, + .section_ac_main .section_ayd_left .section_ayd_box li, + .section_ac_main .section_ayd_left .section_dnsm_box li, + .section_ac_main .section_ayd_left .section_w3c_box li, + .section_ac_main .section_ayd_right .section_ac_box li, + .section_ac_main .section_ayd_right .section_ayd_box li, + .section_ac_main .section_ayd_right .section_dnsm_box li, + .section_ac_main .section_ayd_right .section_w3c_box li, + .section_ac_main .section_dnsm_left .section_ac_box li, + .section_ac_main .section_dnsm_left .section_ayd_box li, + .section_ac_main .section_dnsm_left .section_dnsm_box li, + .section_ac_main .section_dnsm_left .section_w3c_box li, + .section_ac_main .section_dnsm_right .section_ac_box li, + .section_ac_main .section_dnsm_right .section_ayd_box li, + .section_ac_main .section_dnsm_right .section_dnsm_box li, + .section_ac_main .section_dnsm_right .section_w3c_box li, + .section_ac_main .section_w3c_left .section_ac_box li, + .section_ac_main .section_w3c_left .section_ayd_box li, + .section_ac_main .section_w3c_left .section_dnsm_box li, + .section_ac_main .section_w3c_left .section_w3c_box li, + .section_ac_main .section_w3c_right .section_ac_box li, + .section_ac_main .section_w3c_right .section_ayd_box li, + .section_ac_main .section_w3c_right .section_dnsm_box li, + .section_ac_main .section_w3c_right .section_w3c_box li, + .section_ayd_main .section_ac_left .section_ac_box li, + .section_ayd_main .section_ac_left .section_ayd_box li, + .section_ayd_main .section_ac_left .section_dnsm_box li, + .section_ayd_main .section_ac_left .section_w3c_box li, + .section_ayd_main .section_ac_right .section_ac_box li, + .section_ayd_main .section_ac_right .section_ayd_box li, + .section_ayd_main .section_ac_right .section_dnsm_box li, + .section_ayd_main .section_ac_right .section_w3c_box li, + .section_ayd_main .section_ayd_left .section_ac_box li, + .section_ayd_main .section_ayd_left .section_ayd_box li, + .section_ayd_main .section_ayd_left .section_dnsm_box li, + .section_ayd_main .section_ayd_left .section_w3c_box li, + .section_ayd_main .section_ayd_right .section_ac_box li, + .section_ayd_main .section_ayd_right .section_ayd_box li, + .section_ayd_main .section_ayd_right .section_dnsm_box li, + .section_ayd_main .section_ayd_right .section_w3c_box li, + .section_ayd_main .section_dnsm_left .section_ac_box li, + .section_ayd_main .section_dnsm_left .section_ayd_box li, + .section_ayd_main .section_dnsm_left .section_dnsm_box li, + .section_ayd_main .section_dnsm_left .section_w3c_box li, + .section_ayd_main .section_dnsm_right .section_ac_box li, + .section_ayd_main .section_dnsm_right .section_ayd_box li, + .section_ayd_main .section_dnsm_right .section_dnsm_box li, + .section_ayd_main .section_dnsm_right .section_w3c_box li, + .section_ayd_main .section_w3c_left .section_ac_box li, + .section_ayd_main .section_w3c_left .section_ayd_box li, + .section_ayd_main .section_w3c_left .section_dnsm_box li, + .section_ayd_main .section_w3c_left .section_w3c_box li, + .section_ayd_main .section_w3c_right .section_ac_box li, + .section_ayd_main .section_w3c_right .section_ayd_box li, + .section_ayd_main .section_w3c_right .section_dnsm_box li, + .section_ayd_main .section_w3c_right .section_w3c_box li, + .section_dnsm_main .section_ac_left .section_ac_box li, + .section_dnsm_main .section_ac_left .section_ayd_box li, + .section_dnsm_main .section_ac_left .section_dnsm_box li, + .section_dnsm_main .section_ac_left .section_w3c_box li, + .section_dnsm_main .section_ac_right .section_ac_box li, + .section_dnsm_main .section_ac_right .section_ayd_box li, + .section_dnsm_main .section_ac_right .section_dnsm_box li, + .section_dnsm_main .section_ac_right .section_w3c_box li, + .section_dnsm_main .section_ayd_left .section_ac_box li, + .section_dnsm_main .section_ayd_left .section_ayd_box li, + .section_dnsm_main .section_ayd_left .section_dnsm_box li, + .section_dnsm_main .section_ayd_left .section_w3c_box li, + .section_dnsm_main .section_ayd_right .section_ac_box li, + .section_dnsm_main .section_ayd_right .section_ayd_box li, + .section_dnsm_main .section_ayd_right .section_dnsm_box li, + .section_dnsm_main .section_ayd_right .section_w3c_box li, + .section_dnsm_main .section_dnsm_left .section_ac_box li, + .section_dnsm_main .section_dnsm_left .section_ayd_box li, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li, + .section_dnsm_main .section_dnsm_left .section_w3c_box li, + .section_dnsm_main .section_dnsm_right .section_ac_box li, + .section_dnsm_main .section_dnsm_right .section_ayd_box li, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li, + .section_dnsm_main .section_dnsm_right .section_w3c_box li, + .section_dnsm_main .section_w3c_left .section_ac_box li, + .section_dnsm_main .section_w3c_left .section_ayd_box li, + .section_dnsm_main .section_w3c_left .section_dnsm_box li, + .section_dnsm_main .section_w3c_left .section_w3c_box li, + .section_dnsm_main .section_w3c_right .section_ac_box li, + .section_dnsm_main .section_w3c_right .section_ayd_box li, + .section_dnsm_main .section_w3c_right .section_dnsm_box li, + .section_dnsm_main .section_w3c_right .section_w3c_box li, + .section_w3c_main .section_ac_left .section_ac_box li, + .section_w3c_main .section_ac_left .section_ayd_box li, + .section_w3c_main .section_ac_left .section_dnsm_box li, + .section_w3c_main .section_ac_left .section_w3c_box li, + .section_w3c_main .section_ac_right .section_ac_box li, + .section_w3c_main .section_ac_right .section_ayd_box li, + .section_w3c_main .section_ac_right .section_dnsm_box li, + .section_w3c_main .section_ac_right .section_w3c_box li, + .section_w3c_main .section_ayd_left .section_ac_box li, + .section_w3c_main .section_ayd_left .section_ayd_box li, + .section_w3c_main .section_ayd_left .section_dnsm_box li, + .section_w3c_main .section_ayd_left .section_w3c_box li, + .section_w3c_main .section_ayd_right .section_ac_box li, + .section_w3c_main .section_ayd_right .section_ayd_box li, + .section_w3c_main .section_ayd_right .section_dnsm_box li, + .section_w3c_main .section_ayd_right .section_w3c_box li, + .section_w3c_main .section_dnsm_left .section_ac_box li, + .section_w3c_main .section_dnsm_left .section_ayd_box li, + .section_w3c_main .section_dnsm_left .section_dnsm_box li, + .section_w3c_main .section_dnsm_left .section_w3c_box li, + .section_w3c_main .section_dnsm_right .section_ac_box li, + .section_w3c_main .section_dnsm_right .section_ayd_box li, + .section_w3c_main .section_dnsm_right .section_dnsm_box li, + .section_w3c_main .section_dnsm_right .section_w3c_box li, + .section_w3c_main .section_w3c_left .section_ac_box li, + .section_w3c_main .section_w3c_left .section_ayd_box li, + .section_w3c_main .section_w3c_left .section_dnsm_box li, + .section_w3c_main .section_w3c_left .section_w3c_box li, + .section_w3c_main .section_w3c_right .section_ac_box li, + .section_w3c_main .section_w3c_right .section_ayd_box li, + .section_w3c_main .section_w3c_right .section_dnsm_box li, + .section_w3c_main .section_w3c_right .section_w3c_box li { + width: 188px; + height: 130px; + float: left; } + .section_ac_main .section_ac_left .section_ac_box li a, + .section_ac_main .section_ac_left .section_ayd_box li a, + .section_ac_main .section_ac_left .section_dnsm_box li a, + .section_ac_main .section_ac_left .section_w3c_box li a, + .section_ac_main .section_ac_right .section_ac_box li a, + .section_ac_main .section_ac_right .section_ayd_box li a, + .section_ac_main .section_ac_right .section_dnsm_box li a, + .section_ac_main .section_ac_right .section_w3c_box li a, + .section_ac_main .section_ayd_left .section_ac_box li a, + .section_ac_main .section_ayd_left .section_ayd_box li a, + .section_ac_main .section_ayd_left .section_dnsm_box li a, + .section_ac_main .section_ayd_left .section_w3c_box li a, + .section_ac_main .section_ayd_right .section_ac_box li a, + .section_ac_main .section_ayd_right .section_ayd_box li a, + .section_ac_main .section_ayd_right .section_dnsm_box li a, + .section_ac_main .section_ayd_right .section_w3c_box li a, + .section_ac_main .section_dnsm_left .section_ac_box li a, + .section_ac_main .section_dnsm_left .section_ayd_box li a, + .section_ac_main .section_dnsm_left .section_dnsm_box li a, + .section_ac_main .section_dnsm_left .section_w3c_box li a, + .section_ac_main .section_dnsm_right .section_ac_box li a, + .section_ac_main .section_dnsm_right .section_ayd_box li a, + .section_ac_main .section_dnsm_right .section_dnsm_box li a, + .section_ac_main .section_dnsm_right .section_w3c_box li a, + .section_ac_main .section_w3c_left .section_ac_box li a, + .section_ac_main .section_w3c_left .section_ayd_box li a, + .section_ac_main .section_w3c_left .section_dnsm_box li a, + .section_ac_main .section_w3c_left .section_w3c_box li a, + .section_ac_main .section_w3c_right .section_ac_box li a, + .section_ac_main .section_w3c_right .section_ayd_box li a, + .section_ac_main .section_w3c_right .section_dnsm_box li a, + .section_ac_main .section_w3c_right .section_w3c_box li a, + .section_ayd_main .section_ac_left .section_ac_box li a, + .section_ayd_main .section_ac_left .section_ayd_box li a, + .section_ayd_main .section_ac_left .section_dnsm_box li a, + .section_ayd_main .section_ac_left .section_w3c_box li a, + .section_ayd_main .section_ac_right .section_ac_box li a, + .section_ayd_main .section_ac_right .section_ayd_box li a, + .section_ayd_main .section_ac_right .section_dnsm_box li a, + .section_ayd_main .section_ac_right .section_w3c_box li a, + .section_ayd_main .section_ayd_left .section_ac_box li a, + .section_ayd_main .section_ayd_left .section_ayd_box li a, + .section_ayd_main .section_ayd_left .section_dnsm_box li a, + .section_ayd_main .section_ayd_left .section_w3c_box li a, + .section_ayd_main .section_ayd_right .section_ac_box li a, + .section_ayd_main .section_ayd_right .section_ayd_box li a, + .section_ayd_main .section_ayd_right .section_dnsm_box li a, + .section_ayd_main .section_ayd_right .section_w3c_box li a, + .section_ayd_main .section_dnsm_left .section_ac_box li a, + .section_ayd_main .section_dnsm_left .section_ayd_box li a, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a, + .section_ayd_main .section_dnsm_left .section_w3c_box li a, + .section_ayd_main .section_dnsm_right .section_ac_box li a, + .section_ayd_main .section_dnsm_right .section_ayd_box li a, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a, + .section_ayd_main .section_dnsm_right .section_w3c_box li a, + .section_ayd_main .section_w3c_left .section_ac_box li a, + .section_ayd_main .section_w3c_left .section_ayd_box li a, + .section_ayd_main .section_w3c_left .section_dnsm_box li a, + .section_ayd_main .section_w3c_left .section_w3c_box li a, + .section_ayd_main .section_w3c_right .section_ac_box li a, + .section_ayd_main .section_w3c_right .section_ayd_box li a, + .section_ayd_main .section_w3c_right .section_dnsm_box li a, + .section_ayd_main .section_w3c_right .section_w3c_box li a, + .section_dnsm_main .section_ac_left .section_ac_box li a, + .section_dnsm_main .section_ac_left .section_ayd_box li a, + .section_dnsm_main .section_ac_left .section_dnsm_box li a, + .section_dnsm_main .section_ac_left .section_w3c_box li a, + .section_dnsm_main .section_ac_right .section_ac_box li a, + .section_dnsm_main .section_ac_right .section_ayd_box li a, + .section_dnsm_main .section_ac_right .section_dnsm_box li a, + .section_dnsm_main .section_ac_right .section_w3c_box li a, + .section_dnsm_main .section_ayd_left .section_ac_box li a, + .section_dnsm_main .section_ayd_left .section_ayd_box li a, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a, + .section_dnsm_main .section_ayd_left .section_w3c_box li a, + .section_dnsm_main .section_ayd_right .section_ac_box li a, + .section_dnsm_main .section_ayd_right .section_ayd_box li a, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a, + .section_dnsm_main .section_ayd_right .section_w3c_box li a, + .section_dnsm_main .section_dnsm_left .section_ac_box li a, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a, + .section_dnsm_main .section_dnsm_right .section_ac_box li a, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a, + .section_dnsm_main .section_w3c_left .section_ac_box li a, + .section_dnsm_main .section_w3c_left .section_ayd_box li a, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a, + .section_dnsm_main .section_w3c_left .section_w3c_box li a, + .section_dnsm_main .section_w3c_right .section_ac_box li a, + .section_dnsm_main .section_w3c_right .section_ayd_box li a, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a, + .section_dnsm_main .section_w3c_right .section_w3c_box li a, + .section_w3c_main .section_ac_left .section_ac_box li a, + .section_w3c_main .section_ac_left .section_ayd_box li a, + .section_w3c_main .section_ac_left .section_dnsm_box li a, + .section_w3c_main .section_ac_left .section_w3c_box li a, + .section_w3c_main .section_ac_right .section_ac_box li a, + .section_w3c_main .section_ac_right .section_ayd_box li a, + .section_w3c_main .section_ac_right .section_dnsm_box li a, + .section_w3c_main .section_ac_right .section_w3c_box li a, + .section_w3c_main .section_ayd_left .section_ac_box li a, + .section_w3c_main .section_ayd_left .section_ayd_box li a, + .section_w3c_main .section_ayd_left .section_dnsm_box li a, + .section_w3c_main .section_ayd_left .section_w3c_box li a, + .section_w3c_main .section_ayd_right .section_ac_box li a, + .section_w3c_main .section_ayd_right .section_ayd_box li a, + .section_w3c_main .section_ayd_right .section_dnsm_box li a, + .section_w3c_main .section_ayd_right .section_w3c_box li a, + .section_w3c_main .section_dnsm_left .section_ac_box li a, + .section_w3c_main .section_dnsm_left .section_ayd_box li a, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a, + .section_w3c_main .section_dnsm_left .section_w3c_box li a, + .section_w3c_main .section_dnsm_right .section_ac_box li a, + .section_w3c_main .section_dnsm_right .section_ayd_box li a, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a, + .section_w3c_main .section_dnsm_right .section_w3c_box li a, + .section_w3c_main .section_w3c_left .section_ac_box li a, + .section_w3c_main .section_w3c_left .section_ayd_box li a, + .section_w3c_main .section_w3c_left .section_dnsm_box li a, + .section_w3c_main .section_w3c_left .section_w3c_box li a, + .section_w3c_main .section_w3c_right .section_ac_box li a, + .section_w3c_main .section_w3c_right .section_ayd_box li a, + .section_w3c_main .section_w3c_right .section_dnsm_box li a, + .section_w3c_main .section_w3c_right .section_w3c_box li a { + display: inline-block; } + .section_ac_main .section_ac_left .section_ac_box li a .section_ac_txt, + .section_ac_main .section_ac_left .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_ac_left .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_ac_left .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_ac_left .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_ac_left .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_ac_left .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_ac_left .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_ac_right .section_ac_box li a .section_ac_txt, + .section_ac_main .section_ac_right .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_ac_right .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_ac_right .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_ac_right .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_ac_right .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_ac_right .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_ac_right .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ac_txt, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_ayd_left .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_left .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ac_txt, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_ayd_right .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_right .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ac_txt, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ac_txt, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ac_txt, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_w3c_left .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_left .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_w3c_txt, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ac_txt, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ayd_txt, + .section_ac_main .section_w3c_right .section_ac_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_right .section_ac_box li a .section_w3c_txt, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ac_txt, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ayd_txt, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_w3c_txt, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ac_txt, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ac_txt, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ayd_txt, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_ac_left .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_left .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_ac_right .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_right .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ac_txt, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ac_txt, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ac_txt, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ac_txt, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ayd_txt, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ac_txt, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ayd_txt, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_ac_left .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_left .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_ac_right .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_right .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ac_txt, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ac_txt, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ac_txt, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ac_txt, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ayd_txt, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_w3c_txt { + width: 56px; + float: left; + margin: 25px 0 0 25px; } + .section_ac_main .section_ac_left .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_ac_left .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_ac_left .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_left .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_left .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_left .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_ac_right .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_ac_right .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_ac_right .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_right .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_right .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_ac_right .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_left .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_right .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_left .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ac_txt p, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_right .section_ac_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ac_txt p, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ac_txt p, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_left .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_left .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_right .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_right .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ac_txt p, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ac_txt p, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_left .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_left .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_right .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_right .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ac_txt p, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p { + margin: 0; + font-size: 12px; } + .section_ac_main .section_ac_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:first-child, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:first-child, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:first-child, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:first-child, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:first-child { + width: 56px; + margin-bottom: 10px; + font-size: 14px; } + .section_ac_main .section_ac_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ac_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ac_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ac_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ac_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_w3c_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ac_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ayd_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_dnsm_txt p:nth-child(2), + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_w3c_txt p:nth-child(2) { + width: 50px; + color: #999; } + .section_ac_main .section_ac_left .section_ac_box li a .section_ac_tu, + .section_ac_main .section_ac_left .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_ac_left .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_ac_left .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_ac_left .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_ac_left .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_ac_left .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_ac_left .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_ac_right .section_ac_box li a .section_ac_tu, + .section_ac_main .section_ac_right .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_ac_right .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_ac_right .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_ac_right .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_ac_right .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_ac_right .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_ac_right .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ac_tu, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_ayd_left .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_left .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ac_tu, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_ayd_right .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_right .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ac_tu, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ac_tu, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ac_tu, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_w3c_left .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_left .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_w3c_tu, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ac_tu, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ayd_tu, + .section_ac_main .section_w3c_right .section_ac_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_right .section_ac_box li a .section_w3c_tu, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ac_tu, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ayd_tu, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_w3c_tu, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ac_tu, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ac_tu, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ayd_tu, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_ac_left .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_left .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_ac_right .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_right .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ac_tu, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ac_tu, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ac_tu, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ac_tu, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ayd_tu, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ac_tu, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ayd_tu, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_ac_left .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_left .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_ac_right .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_right .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ac_tu, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ac_tu, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ac_tu, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ac_tu, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ayd_tu, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_w3c_tu { + width: 105px; + height: 100px; + overflow: hidden; + margin-top: 25px; + padding-left: 5px; } + .section_ac_main .section_ac_left .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_ac_left .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_ac_left .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_left .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_ac_left .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_ac_left .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_left .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_left .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_ac_left .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_ac_left .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_left .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_ac_right .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_ac_right .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_ac_right .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_right .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_ac_right .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_ac_right .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_right .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_right .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_ac_right .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_ac_right .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_ac_right .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_ayd_left .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_left .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_left .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_left .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_left .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_ayd_right .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_right .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_right .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_right .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_ayd_right .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_left .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_right .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_w3c_left .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_left .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_left .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_left .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_left .section_w3c_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ac_tu img, + .section_ac_main .section_w3c_right .section_ac_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_right .section_ac_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_right .section_ac_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ac_tu img, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_right .section_ayd_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ac_tu img, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu img, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ac_tu img, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_ayd_tu img, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu img, + .section_ac_main .section_w3c_right .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_ac_left .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_left .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_left .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_left .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_left .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_left .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_ac_right .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_right .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_right .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_right .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_right .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_ac_right .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_left .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_left .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_left .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_right .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_right .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_ayd_right .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_left .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_right .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_left .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_left .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_left .section_w3c_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_right .section_ac_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_right .section_ayd_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu img, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ac_tu img, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_ayd_tu img, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu img, + .section_ayd_main .section_w3c_right .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_left .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_left .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_left .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_left .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_right .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_right .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_right .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ac_right .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_left .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_left .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_left .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_right .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_right .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_ayd_right .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_left .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_right .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_left .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_left .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_left .section_w3c_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_right .section_ac_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_right .section_ayd_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu img, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ac_tu img, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_ayd_tu img, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu img, + .section_dnsm_main .section_w3c_right .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_ac_left .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_left .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_left .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_left .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_left .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_left .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_ac_right .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_right .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_right .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_right .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_right .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_ac_right .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_left .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_left .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_left .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_left .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_right .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_right .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_right .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_ayd_right .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_left .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_left .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_left .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_left .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_right .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_right .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_right .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_dnsm_right .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_left .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_left .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_left .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_left .section_w3c_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_right .section_ac_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_right .section_ayd_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_right .section_dnsm_box li a .section_w3c_tu img, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ac_tu img, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_ayd_tu img, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_dnsm_tu img, + .section_w3c_main .section_w3c_right .section_w3c_box li a .section_w3c_tu img { + position: relative; } + .section_ac_main .section_ac_left .section_ac_box li:nth-child(1), + .section_ac_main .section_ac_left .section_ayd_box li:nth-child(1), + .section_ac_main .section_ac_left .section_dnsm_box li:nth-child(1), + .section_ac_main .section_ac_left .section_w3c_box li:nth-child(1), + .section_ac_main .section_ac_right .section_ac_box li:nth-child(1), + .section_ac_main .section_ac_right .section_ayd_box li:nth-child(1), + .section_ac_main .section_ac_right .section_dnsm_box li:nth-child(1), + .section_ac_main .section_ac_right .section_w3c_box li:nth-child(1), + .section_ac_main .section_ayd_left .section_ac_box li:nth-child(1), + .section_ac_main .section_ayd_left .section_ayd_box li:nth-child(1), + .section_ac_main .section_ayd_left .section_dnsm_box li:nth-child(1), + .section_ac_main .section_ayd_left .section_w3c_box li:nth-child(1), + .section_ac_main .section_ayd_right .section_ac_box li:nth-child(1), + .section_ac_main .section_ayd_right .section_ayd_box li:nth-child(1), + .section_ac_main .section_ayd_right .section_dnsm_box li:nth-child(1), + .section_ac_main .section_ayd_right .section_w3c_box li:nth-child(1), + .section_ac_main .section_dnsm_left .section_ac_box li:nth-child(1), + .section_ac_main .section_dnsm_left .section_ayd_box li:nth-child(1), + .section_ac_main .section_dnsm_left .section_dnsm_box li:nth-child(1), + .section_ac_main .section_dnsm_left .section_w3c_box li:nth-child(1), + .section_ac_main .section_dnsm_right .section_ac_box li:nth-child(1), + .section_ac_main .section_dnsm_right .section_ayd_box li:nth-child(1), + .section_ac_main .section_dnsm_right .section_dnsm_box li:nth-child(1), + .section_ac_main .section_dnsm_right .section_w3c_box li:nth-child(1), + .section_ac_main .section_w3c_left .section_ac_box li:nth-child(1), + .section_ac_main .section_w3c_left .section_ayd_box li:nth-child(1), + .section_ac_main .section_w3c_left .section_dnsm_box li:nth-child(1), + .section_ac_main .section_w3c_left .section_w3c_box li:nth-child(1), + .section_ac_main .section_w3c_right .section_ac_box li:nth-child(1), + .section_ac_main .section_w3c_right .section_ayd_box li:nth-child(1), + .section_ac_main .section_w3c_right .section_dnsm_box li:nth-child(1), + .section_ac_main .section_w3c_right .section_w3c_box li:nth-child(1), + .section_ayd_main .section_ac_left .section_ac_box li:nth-child(1), + .section_ayd_main .section_ac_left .section_ayd_box li:nth-child(1), + .section_ayd_main .section_ac_left .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_ac_left .section_w3c_box li:nth-child(1), + .section_ayd_main .section_ac_right .section_ac_box li:nth-child(1), + .section_ayd_main .section_ac_right .section_ayd_box li:nth-child(1), + .section_ayd_main .section_ac_right .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_ac_right .section_w3c_box li:nth-child(1), + .section_ayd_main .section_ayd_left .section_ac_box li:nth-child(1), + .section_ayd_main .section_ayd_left .section_ayd_box li:nth-child(1), + .section_ayd_main .section_ayd_left .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_ayd_left .section_w3c_box li:nth-child(1), + .section_ayd_main .section_ayd_right .section_ac_box li:nth-child(1), + .section_ayd_main .section_ayd_right .section_ayd_box li:nth-child(1), + .section_ayd_main .section_ayd_right .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_ayd_right .section_w3c_box li:nth-child(1), + .section_ayd_main .section_dnsm_left .section_ac_box li:nth-child(1), + .section_ayd_main .section_dnsm_left .section_ayd_box li:nth-child(1), + .section_ayd_main .section_dnsm_left .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_dnsm_left .section_w3c_box li:nth-child(1), + .section_ayd_main .section_dnsm_right .section_ac_box li:nth-child(1), + .section_ayd_main .section_dnsm_right .section_ayd_box li:nth-child(1), + .section_ayd_main .section_dnsm_right .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_dnsm_right .section_w3c_box li:nth-child(1), + .section_ayd_main .section_w3c_left .section_ac_box li:nth-child(1), + .section_ayd_main .section_w3c_left .section_ayd_box li:nth-child(1), + .section_ayd_main .section_w3c_left .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_w3c_left .section_w3c_box li:nth-child(1), + .section_ayd_main .section_w3c_right .section_ac_box li:nth-child(1), + .section_ayd_main .section_w3c_right .section_ayd_box li:nth-child(1), + .section_ayd_main .section_w3c_right .section_dnsm_box li:nth-child(1), + .section_ayd_main .section_w3c_right .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_ac_left .section_ac_box li:nth-child(1), + .section_dnsm_main .section_ac_left .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_ac_left .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_ac_left .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_ac_right .section_ac_box li:nth-child(1), + .section_dnsm_main .section_ac_right .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_ac_right .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_ac_right .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_ayd_left .section_ac_box li:nth-child(1), + .section_dnsm_main .section_ayd_left .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_ayd_left .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_ayd_left .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_ayd_right .section_ac_box li:nth-child(1), + .section_dnsm_main .section_ayd_right .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_ayd_right .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_ayd_right .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_dnsm_left .section_ac_box li:nth-child(1), + .section_dnsm_main .section_dnsm_left .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_dnsm_left .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_dnsm_right .section_ac_box li:nth-child(1), + .section_dnsm_main .section_dnsm_right .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_dnsm_right .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_w3c_left .section_ac_box li:nth-child(1), + .section_dnsm_main .section_w3c_left .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_w3c_left .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_w3c_left .section_w3c_box li:nth-child(1), + .section_dnsm_main .section_w3c_right .section_ac_box li:nth-child(1), + .section_dnsm_main .section_w3c_right .section_ayd_box li:nth-child(1), + .section_dnsm_main .section_w3c_right .section_dnsm_box li:nth-child(1), + .section_dnsm_main .section_w3c_right .section_w3c_box li:nth-child(1), + .section_w3c_main .section_ac_left .section_ac_box li:nth-child(1), + .section_w3c_main .section_ac_left .section_ayd_box li:nth-child(1), + .section_w3c_main .section_ac_left .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_ac_left .section_w3c_box li:nth-child(1), + .section_w3c_main .section_ac_right .section_ac_box li:nth-child(1), + .section_w3c_main .section_ac_right .section_ayd_box li:nth-child(1), + .section_w3c_main .section_ac_right .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_ac_right .section_w3c_box li:nth-child(1), + .section_w3c_main .section_ayd_left .section_ac_box li:nth-child(1), + .section_w3c_main .section_ayd_left .section_ayd_box li:nth-child(1), + .section_w3c_main .section_ayd_left .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_ayd_left .section_w3c_box li:nth-child(1), + .section_w3c_main .section_ayd_right .section_ac_box li:nth-child(1), + .section_w3c_main .section_ayd_right .section_ayd_box li:nth-child(1), + .section_w3c_main .section_ayd_right .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_ayd_right .section_w3c_box li:nth-child(1), + .section_w3c_main .section_dnsm_left .section_ac_box li:nth-child(1), + .section_w3c_main .section_dnsm_left .section_ayd_box li:nth-child(1), + .section_w3c_main .section_dnsm_left .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_dnsm_left .section_w3c_box li:nth-child(1), + .section_w3c_main .section_dnsm_right .section_ac_box li:nth-child(1), + .section_w3c_main .section_dnsm_right .section_ayd_box li:nth-child(1), + .section_w3c_main .section_dnsm_right .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_dnsm_right .section_w3c_box li:nth-child(1), + .section_w3c_main .section_w3c_left .section_ac_box li:nth-child(1), + .section_w3c_main .section_w3c_left .section_ayd_box li:nth-child(1), + .section_w3c_main .section_w3c_left .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_w3c_left .section_w3c_box li:nth-child(1), + .section_w3c_main .section_w3c_right .section_ac_box li:nth-child(1), + .section_w3c_main .section_w3c_right .section_ayd_box li:nth-child(1), + .section_w3c_main .section_w3c_right .section_dnsm_box li:nth-child(1), + .section_w3c_main .section_w3c_right .section_w3c_box li:nth-child(1) { + border-right: 1px solid #E6E6E6; + border-bottom: 1px solid #E6E6E6; } + .section_ac_main .section_ac_left .section_ac_box li:nth-child(2), + .section_ac_main .section_ac_left .section_ayd_box li:nth-child(2), + .section_ac_main .section_ac_left .section_dnsm_box li:nth-child(2), + .section_ac_main .section_ac_left .section_w3c_box li:nth-child(2), + .section_ac_main .section_ac_right .section_ac_box li:nth-child(2), + .section_ac_main .section_ac_right .section_ayd_box li:nth-child(2), + .section_ac_main .section_ac_right .section_dnsm_box li:nth-child(2), + .section_ac_main .section_ac_right .section_w3c_box li:nth-child(2), + .section_ac_main .section_ayd_left .section_ac_box li:nth-child(2), + .section_ac_main .section_ayd_left .section_ayd_box li:nth-child(2), + .section_ac_main .section_ayd_left .section_dnsm_box li:nth-child(2), + .section_ac_main .section_ayd_left .section_w3c_box li:nth-child(2), + .section_ac_main .section_ayd_right .section_ac_box li:nth-child(2), + .section_ac_main .section_ayd_right .section_ayd_box li:nth-child(2), + .section_ac_main .section_ayd_right .section_dnsm_box li:nth-child(2), + .section_ac_main .section_ayd_right .section_w3c_box li:nth-child(2), + .section_ac_main .section_dnsm_left .section_ac_box li:nth-child(2), + .section_ac_main .section_dnsm_left .section_ayd_box li:nth-child(2), + .section_ac_main .section_dnsm_left .section_dnsm_box li:nth-child(2), + .section_ac_main .section_dnsm_left .section_w3c_box li:nth-child(2), + .section_ac_main .section_dnsm_right .section_ac_box li:nth-child(2), + .section_ac_main .section_dnsm_right .section_ayd_box li:nth-child(2), + .section_ac_main .section_dnsm_right .section_dnsm_box li:nth-child(2), + .section_ac_main .section_dnsm_right .section_w3c_box li:nth-child(2), + .section_ac_main .section_w3c_left .section_ac_box li:nth-child(2), + .section_ac_main .section_w3c_left .section_ayd_box li:nth-child(2), + .section_ac_main .section_w3c_left .section_dnsm_box li:nth-child(2), + .section_ac_main .section_w3c_left .section_w3c_box li:nth-child(2), + .section_ac_main .section_w3c_right .section_ac_box li:nth-child(2), + .section_ac_main .section_w3c_right .section_ayd_box li:nth-child(2), + .section_ac_main .section_w3c_right .section_dnsm_box li:nth-child(2), + .section_ac_main .section_w3c_right .section_w3c_box li:nth-child(2), + .section_ayd_main .section_ac_left .section_ac_box li:nth-child(2), + .section_ayd_main .section_ac_left .section_ayd_box li:nth-child(2), + .section_ayd_main .section_ac_left .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_ac_left .section_w3c_box li:nth-child(2), + .section_ayd_main .section_ac_right .section_ac_box li:nth-child(2), + .section_ayd_main .section_ac_right .section_ayd_box li:nth-child(2), + .section_ayd_main .section_ac_right .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_ac_right .section_w3c_box li:nth-child(2), + .section_ayd_main .section_ayd_left .section_ac_box li:nth-child(2), + .section_ayd_main .section_ayd_left .section_ayd_box li:nth-child(2), + .section_ayd_main .section_ayd_left .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_ayd_left .section_w3c_box li:nth-child(2), + .section_ayd_main .section_ayd_right .section_ac_box li:nth-child(2), + .section_ayd_main .section_ayd_right .section_ayd_box li:nth-child(2), + .section_ayd_main .section_ayd_right .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_ayd_right .section_w3c_box li:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ac_box li:nth-child(2), + .section_ayd_main .section_dnsm_left .section_ayd_box li:nth-child(2), + .section_ayd_main .section_dnsm_left .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_dnsm_left .section_w3c_box li:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ac_box li:nth-child(2), + .section_ayd_main .section_dnsm_right .section_ayd_box li:nth-child(2), + .section_ayd_main .section_dnsm_right .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_dnsm_right .section_w3c_box li:nth-child(2), + .section_ayd_main .section_w3c_left .section_ac_box li:nth-child(2), + .section_ayd_main .section_w3c_left .section_ayd_box li:nth-child(2), + .section_ayd_main .section_w3c_left .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_w3c_left .section_w3c_box li:nth-child(2), + .section_ayd_main .section_w3c_right .section_ac_box li:nth-child(2), + .section_ayd_main .section_w3c_right .section_ayd_box li:nth-child(2), + .section_ayd_main .section_w3c_right .section_dnsm_box li:nth-child(2), + .section_ayd_main .section_w3c_right .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_ac_left .section_ac_box li:nth-child(2), + .section_dnsm_main .section_ac_left .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_ac_left .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_ac_left .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_ac_right .section_ac_box li:nth-child(2), + .section_dnsm_main .section_ac_right .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_ac_right .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_ac_right .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ac_box li:nth-child(2), + .section_dnsm_main .section_ayd_left .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_ayd_left .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_ayd_left .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ac_box li:nth-child(2), + .section_dnsm_main .section_ayd_right .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_ayd_right .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_ayd_right .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ac_box li:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_dnsm_left .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ac_box li:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_dnsm_right .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ac_box li:nth-child(2), + .section_dnsm_main .section_w3c_left .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_w3c_left .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_w3c_left .section_w3c_box li:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ac_box li:nth-child(2), + .section_dnsm_main .section_w3c_right .section_ayd_box li:nth-child(2), + .section_dnsm_main .section_w3c_right .section_dnsm_box li:nth-child(2), + .section_dnsm_main .section_w3c_right .section_w3c_box li:nth-child(2), + .section_w3c_main .section_ac_left .section_ac_box li:nth-child(2), + .section_w3c_main .section_ac_left .section_ayd_box li:nth-child(2), + .section_w3c_main .section_ac_left .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_ac_left .section_w3c_box li:nth-child(2), + .section_w3c_main .section_ac_right .section_ac_box li:nth-child(2), + .section_w3c_main .section_ac_right .section_ayd_box li:nth-child(2), + .section_w3c_main .section_ac_right .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_ac_right .section_w3c_box li:nth-child(2), + .section_w3c_main .section_ayd_left .section_ac_box li:nth-child(2), + .section_w3c_main .section_ayd_left .section_ayd_box li:nth-child(2), + .section_w3c_main .section_ayd_left .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_ayd_left .section_w3c_box li:nth-child(2), + .section_w3c_main .section_ayd_right .section_ac_box li:nth-child(2), + .section_w3c_main .section_ayd_right .section_ayd_box li:nth-child(2), + .section_w3c_main .section_ayd_right .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_ayd_right .section_w3c_box li:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ac_box li:nth-child(2), + .section_w3c_main .section_dnsm_left .section_ayd_box li:nth-child(2), + .section_w3c_main .section_dnsm_left .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_dnsm_left .section_w3c_box li:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ac_box li:nth-child(2), + .section_w3c_main .section_dnsm_right .section_ayd_box li:nth-child(2), + .section_w3c_main .section_dnsm_right .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_dnsm_right .section_w3c_box li:nth-child(2), + .section_w3c_main .section_w3c_left .section_ac_box li:nth-child(2), + .section_w3c_main .section_w3c_left .section_ayd_box li:nth-child(2), + .section_w3c_main .section_w3c_left .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_w3c_left .section_w3c_box li:nth-child(2), + .section_w3c_main .section_w3c_right .section_ac_box li:nth-child(2), + .section_w3c_main .section_w3c_right .section_ayd_box li:nth-child(2), + .section_w3c_main .section_w3c_right .section_dnsm_box li:nth-child(2), + .section_w3c_main .section_w3c_right .section_w3c_box li:nth-child(2) { + border-bottom: 1px solid #E6E6E6; } + .section_ac_main .section_ac_left .section_ac_box li:nth-child(3), + .section_ac_main .section_ac_left .section_ayd_box li:nth-child(3), + .section_ac_main .section_ac_left .section_dnsm_box li:nth-child(3), + .section_ac_main .section_ac_left .section_w3c_box li:nth-child(3), + .section_ac_main .section_ac_right .section_ac_box li:nth-child(3), + .section_ac_main .section_ac_right .section_ayd_box li:nth-child(3), + .section_ac_main .section_ac_right .section_dnsm_box li:nth-child(3), + .section_ac_main .section_ac_right .section_w3c_box li:nth-child(3), + .section_ac_main .section_ayd_left .section_ac_box li:nth-child(3), + .section_ac_main .section_ayd_left .section_ayd_box li:nth-child(3), + .section_ac_main .section_ayd_left .section_dnsm_box li:nth-child(3), + .section_ac_main .section_ayd_left .section_w3c_box li:nth-child(3), + .section_ac_main .section_ayd_right .section_ac_box li:nth-child(3), + .section_ac_main .section_ayd_right .section_ayd_box li:nth-child(3), + .section_ac_main .section_ayd_right .section_dnsm_box li:nth-child(3), + .section_ac_main .section_ayd_right .section_w3c_box li:nth-child(3), + .section_ac_main .section_dnsm_left .section_ac_box li:nth-child(3), + .section_ac_main .section_dnsm_left .section_ayd_box li:nth-child(3), + .section_ac_main .section_dnsm_left .section_dnsm_box li:nth-child(3), + .section_ac_main .section_dnsm_left .section_w3c_box li:nth-child(3), + .section_ac_main .section_dnsm_right .section_ac_box li:nth-child(3), + .section_ac_main .section_dnsm_right .section_ayd_box li:nth-child(3), + .section_ac_main .section_dnsm_right .section_dnsm_box li:nth-child(3), + .section_ac_main .section_dnsm_right .section_w3c_box li:nth-child(3), + .section_ac_main .section_w3c_left .section_ac_box li:nth-child(3), + .section_ac_main .section_w3c_left .section_ayd_box li:nth-child(3), + .section_ac_main .section_w3c_left .section_dnsm_box li:nth-child(3), + .section_ac_main .section_w3c_left .section_w3c_box li:nth-child(3), + .section_ac_main .section_w3c_right .section_ac_box li:nth-child(3), + .section_ac_main .section_w3c_right .section_ayd_box li:nth-child(3), + .section_ac_main .section_w3c_right .section_dnsm_box li:nth-child(3), + .section_ac_main .section_w3c_right .section_w3c_box li:nth-child(3), + .section_ayd_main .section_ac_left .section_ac_box li:nth-child(3), + .section_ayd_main .section_ac_left .section_ayd_box li:nth-child(3), + .section_ayd_main .section_ac_left .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_ac_left .section_w3c_box li:nth-child(3), + .section_ayd_main .section_ac_right .section_ac_box li:nth-child(3), + .section_ayd_main .section_ac_right .section_ayd_box li:nth-child(3), + .section_ayd_main .section_ac_right .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_ac_right .section_w3c_box li:nth-child(3), + .section_ayd_main .section_ayd_left .section_ac_box li:nth-child(3), + .section_ayd_main .section_ayd_left .section_ayd_box li:nth-child(3), + .section_ayd_main .section_ayd_left .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_ayd_left .section_w3c_box li:nth-child(3), + .section_ayd_main .section_ayd_right .section_ac_box li:nth-child(3), + .section_ayd_main .section_ayd_right .section_ayd_box li:nth-child(3), + .section_ayd_main .section_ayd_right .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_ayd_right .section_w3c_box li:nth-child(3), + .section_ayd_main .section_dnsm_left .section_ac_box li:nth-child(3), + .section_ayd_main .section_dnsm_left .section_ayd_box li:nth-child(3), + .section_ayd_main .section_dnsm_left .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_dnsm_left .section_w3c_box li:nth-child(3), + .section_ayd_main .section_dnsm_right .section_ac_box li:nth-child(3), + .section_ayd_main .section_dnsm_right .section_ayd_box li:nth-child(3), + .section_ayd_main .section_dnsm_right .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_dnsm_right .section_w3c_box li:nth-child(3), + .section_ayd_main .section_w3c_left .section_ac_box li:nth-child(3), + .section_ayd_main .section_w3c_left .section_ayd_box li:nth-child(3), + .section_ayd_main .section_w3c_left .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_w3c_left .section_w3c_box li:nth-child(3), + .section_ayd_main .section_w3c_right .section_ac_box li:nth-child(3), + .section_ayd_main .section_w3c_right .section_ayd_box li:nth-child(3), + .section_ayd_main .section_w3c_right .section_dnsm_box li:nth-child(3), + .section_ayd_main .section_w3c_right .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_ac_left .section_ac_box li:nth-child(3), + .section_dnsm_main .section_ac_left .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_ac_left .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_ac_left .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_ac_right .section_ac_box li:nth-child(3), + .section_dnsm_main .section_ac_right .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_ac_right .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_ac_right .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_ayd_left .section_ac_box li:nth-child(3), + .section_dnsm_main .section_ayd_left .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_ayd_left .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_ayd_left .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_ayd_right .section_ac_box li:nth-child(3), + .section_dnsm_main .section_ayd_right .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_ayd_right .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_ayd_right .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_dnsm_left .section_ac_box li:nth-child(3), + .section_dnsm_main .section_dnsm_left .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_dnsm_left .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_dnsm_left .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_dnsm_right .section_ac_box li:nth-child(3), + .section_dnsm_main .section_dnsm_right .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_dnsm_right .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_dnsm_right .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_w3c_left .section_ac_box li:nth-child(3), + .section_dnsm_main .section_w3c_left .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_w3c_left .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_w3c_left .section_w3c_box li:nth-child(3), + .section_dnsm_main .section_w3c_right .section_ac_box li:nth-child(3), + .section_dnsm_main .section_w3c_right .section_ayd_box li:nth-child(3), + .section_dnsm_main .section_w3c_right .section_dnsm_box li:nth-child(3), + .section_dnsm_main .section_w3c_right .section_w3c_box li:nth-child(3), + .section_w3c_main .section_ac_left .section_ac_box li:nth-child(3), + .section_w3c_main .section_ac_left .section_ayd_box li:nth-child(3), + .section_w3c_main .section_ac_left .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_ac_left .section_w3c_box li:nth-child(3), + .section_w3c_main .section_ac_right .section_ac_box li:nth-child(3), + .section_w3c_main .section_ac_right .section_ayd_box li:nth-child(3), + .section_w3c_main .section_ac_right .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_ac_right .section_w3c_box li:nth-child(3), + .section_w3c_main .section_ayd_left .section_ac_box li:nth-child(3), + .section_w3c_main .section_ayd_left .section_ayd_box li:nth-child(3), + .section_w3c_main .section_ayd_left .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_ayd_left .section_w3c_box li:nth-child(3), + .section_w3c_main .section_ayd_right .section_ac_box li:nth-child(3), + .section_w3c_main .section_ayd_right .section_ayd_box li:nth-child(3), + .section_w3c_main .section_ayd_right .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_ayd_right .section_w3c_box li:nth-child(3), + .section_w3c_main .section_dnsm_left .section_ac_box li:nth-child(3), + .section_w3c_main .section_dnsm_left .section_ayd_box li:nth-child(3), + .section_w3c_main .section_dnsm_left .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_dnsm_left .section_w3c_box li:nth-child(3), + .section_w3c_main .section_dnsm_right .section_ac_box li:nth-child(3), + .section_w3c_main .section_dnsm_right .section_ayd_box li:nth-child(3), + .section_w3c_main .section_dnsm_right .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_dnsm_right .section_w3c_box li:nth-child(3), + .section_w3c_main .section_w3c_left .section_ac_box li:nth-child(3), + .section_w3c_main .section_w3c_left .section_ayd_box li:nth-child(3), + .section_w3c_main .section_w3c_left .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_w3c_left .section_w3c_box li:nth-child(3), + .section_w3c_main .section_w3c_right .section_ac_box li:nth-child(3), + .section_w3c_main .section_w3c_right .section_ayd_box li:nth-child(3), + .section_w3c_main .section_w3c_right .section_dnsm_box li:nth-child(3), + .section_w3c_main .section_w3c_right .section_w3c_box li:nth-child(3) { + border-right: 1px solid #E6E6E6; } + .section_ac_main .section_ac_left .section_ac_di, + .section_ac_main .section_ac_left .section_ayd_di, + .section_ac_main .section_ac_left .section_dnsm_di, + .section_ac_main .section_ac_left .section_w3c_di, + .section_ac_main .section_ac_right .section_ac_di, + .section_ac_main .section_ac_right .section_ayd_di, + .section_ac_main .section_ac_right .section_dnsm_di, + .section_ac_main .section_ac_right .section_w3c_di, + .section_ac_main .section_ayd_left .section_ac_di, + .section_ac_main .section_ayd_left .section_ayd_di, + .section_ac_main .section_ayd_left .section_dnsm_di, + .section_ac_main .section_ayd_left .section_w3c_di, + .section_ac_main .section_ayd_right .section_ac_di, + .section_ac_main .section_ayd_right .section_ayd_di, + .section_ac_main .section_ayd_right .section_dnsm_di, + .section_ac_main .section_ayd_right .section_w3c_di, + .section_ac_main .section_dnsm_left .section_ac_di, + .section_ac_main .section_dnsm_left .section_ayd_di, + .section_ac_main .section_dnsm_left .section_dnsm_di, + .section_ac_main .section_dnsm_left .section_w3c_di, + .section_ac_main .section_dnsm_right .section_ac_di, + .section_ac_main .section_dnsm_right .section_ayd_di, + .section_ac_main .section_dnsm_right .section_dnsm_di, + .section_ac_main .section_dnsm_right .section_w3c_di, + .section_ac_main .section_w3c_left .section_ac_di, + .section_ac_main .section_w3c_left .section_ayd_di, + .section_ac_main .section_w3c_left .section_dnsm_di, + .section_ac_main .section_w3c_left .section_w3c_di, + .section_ac_main .section_w3c_right .section_ac_di, + .section_ac_main .section_w3c_right .section_ayd_di, + .section_ac_main .section_w3c_right .section_dnsm_di, + .section_ac_main .section_w3c_right .section_w3c_di, + .section_ayd_main .section_ac_left .section_ac_di, + .section_ayd_main .section_ac_left .section_ayd_di, + .section_ayd_main .section_ac_left .section_dnsm_di, + .section_ayd_main .section_ac_left .section_w3c_di, + .section_ayd_main .section_ac_right .section_ac_di, + .section_ayd_main .section_ac_right .section_ayd_di, + .section_ayd_main .section_ac_right .section_dnsm_di, + .section_ayd_main .section_ac_right .section_w3c_di, + .section_ayd_main .section_ayd_left .section_ac_di, + .section_ayd_main .section_ayd_left .section_ayd_di, + .section_ayd_main .section_ayd_left .section_dnsm_di, + .section_ayd_main .section_ayd_left .section_w3c_di, + .section_ayd_main .section_ayd_right .section_ac_di, + .section_ayd_main .section_ayd_right .section_ayd_di, + .section_ayd_main .section_ayd_right .section_dnsm_di, + .section_ayd_main .section_ayd_right .section_w3c_di, + .section_ayd_main .section_dnsm_left .section_ac_di, + .section_ayd_main .section_dnsm_left .section_ayd_di, + .section_ayd_main .section_dnsm_left .section_dnsm_di, + .section_ayd_main .section_dnsm_left .section_w3c_di, + .section_ayd_main .section_dnsm_right .section_ac_di, + .section_ayd_main .section_dnsm_right .section_ayd_di, + .section_ayd_main .section_dnsm_right .section_dnsm_di, + .section_ayd_main .section_dnsm_right .section_w3c_di, + .section_ayd_main .section_w3c_left .section_ac_di, + .section_ayd_main .section_w3c_left .section_ayd_di, + .section_ayd_main .section_w3c_left .section_dnsm_di, + .section_ayd_main .section_w3c_left .section_w3c_di, + .section_ayd_main .section_w3c_right .section_ac_di, + .section_ayd_main .section_w3c_right .section_ayd_di, + .section_ayd_main .section_w3c_right .section_dnsm_di, + .section_ayd_main .section_w3c_right .section_w3c_di, + .section_dnsm_main .section_ac_left .section_ac_di, + .section_dnsm_main .section_ac_left .section_ayd_di, + .section_dnsm_main .section_ac_left .section_dnsm_di, + .section_dnsm_main .section_ac_left .section_w3c_di, + .section_dnsm_main .section_ac_right .section_ac_di, + .section_dnsm_main .section_ac_right .section_ayd_di, + .section_dnsm_main .section_ac_right .section_dnsm_di, + .section_dnsm_main .section_ac_right .section_w3c_di, + .section_dnsm_main .section_ayd_left .section_ac_di, + .section_dnsm_main .section_ayd_left .section_ayd_di, + .section_dnsm_main .section_ayd_left .section_dnsm_di, + .section_dnsm_main .section_ayd_left .section_w3c_di, + .section_dnsm_main .section_ayd_right .section_ac_di, + .section_dnsm_main .section_ayd_right .section_ayd_di, + .section_dnsm_main .section_ayd_right .section_dnsm_di, + .section_dnsm_main .section_ayd_right .section_w3c_di, + .section_dnsm_main .section_dnsm_left .section_ac_di, + .section_dnsm_main .section_dnsm_left .section_ayd_di, + .section_dnsm_main .section_dnsm_left .section_dnsm_di, + .section_dnsm_main .section_dnsm_left .section_w3c_di, + .section_dnsm_main .section_dnsm_right .section_ac_di, + .section_dnsm_main .section_dnsm_right .section_ayd_di, + .section_dnsm_main .section_dnsm_right .section_dnsm_di, + .section_dnsm_main .section_dnsm_right .section_w3c_di, + .section_dnsm_main .section_w3c_left .section_ac_di, + .section_dnsm_main .section_w3c_left .section_ayd_di, + .section_dnsm_main .section_w3c_left .section_dnsm_di, + .section_dnsm_main .section_w3c_left .section_w3c_di, + .section_dnsm_main .section_w3c_right .section_ac_di, + .section_dnsm_main .section_w3c_right .section_ayd_di, + .section_dnsm_main .section_w3c_right .section_dnsm_di, + .section_dnsm_main .section_w3c_right .section_w3c_di, + .section_w3c_main .section_ac_left .section_ac_di, + .section_w3c_main .section_ac_left .section_ayd_di, + .section_w3c_main .section_ac_left .section_dnsm_di, + .section_w3c_main .section_ac_left .section_w3c_di, + .section_w3c_main .section_ac_right .section_ac_di, + .section_w3c_main .section_ac_right .section_ayd_di, + .section_w3c_main .section_ac_right .section_dnsm_di, + .section_w3c_main .section_ac_right .section_w3c_di, + .section_w3c_main .section_ayd_left .section_ac_di, + .section_w3c_main .section_ayd_left .section_ayd_di, + .section_w3c_main .section_ayd_left .section_dnsm_di, + .section_w3c_main .section_ayd_left .section_w3c_di, + .section_w3c_main .section_ayd_right .section_ac_di, + .section_w3c_main .section_ayd_right .section_ayd_di, + .section_w3c_main .section_ayd_right .section_dnsm_di, + .section_w3c_main .section_ayd_right .section_w3c_di, + .section_w3c_main .section_dnsm_left .section_ac_di, + .section_w3c_main .section_dnsm_left .section_ayd_di, + .section_w3c_main .section_dnsm_left .section_dnsm_di, + .section_w3c_main .section_dnsm_left .section_w3c_di, + .section_w3c_main .section_dnsm_right .section_ac_di, + .section_w3c_main .section_dnsm_right .section_ayd_di, + .section_w3c_main .section_dnsm_right .section_dnsm_di, + .section_w3c_main .section_dnsm_right .section_w3c_di, + .section_w3c_main .section_w3c_left .section_ac_di, + .section_w3c_main .section_w3c_left .section_ayd_di, + .section_w3c_main .section_w3c_left .section_dnsm_di, + .section_w3c_main .section_w3c_left .section_w3c_di, + .section_w3c_main .section_w3c_right .section_ac_di, + .section_w3c_main .section_w3c_right .section_ayd_di, + .section_w3c_main .section_w3c_right .section_dnsm_di, + .section_w3c_main .section_w3c_right .section_w3c_di { + height: 130px; + float: left; + padding-top: 10px; } + .section_ac_main .section_ac_left .section_ac_di a, + .section_ac_main .section_ac_left .section_ayd_di a, + .section_ac_main .section_ac_left .section_dnsm_di a, + .section_ac_main .section_ac_left .section_w3c_di a, + .section_ac_main .section_ac_right .section_ac_di a, + .section_ac_main .section_ac_right .section_ayd_di a, + .section_ac_main .section_ac_right .section_dnsm_di a, + .section_ac_main .section_ac_right .section_w3c_di a, + .section_ac_main .section_ayd_left .section_ac_di a, + .section_ac_main .section_ayd_left .section_ayd_di a, + .section_ac_main .section_ayd_left .section_dnsm_di a, + .section_ac_main .section_ayd_left .section_w3c_di a, + .section_ac_main .section_ayd_right .section_ac_di a, + .section_ac_main .section_ayd_right .section_ayd_di a, + .section_ac_main .section_ayd_right .section_dnsm_di a, + .section_ac_main .section_ayd_right .section_w3c_di a, + .section_ac_main .section_dnsm_left .section_ac_di a, + .section_ac_main .section_dnsm_left .section_ayd_di a, + .section_ac_main .section_dnsm_left .section_dnsm_di a, + .section_ac_main .section_dnsm_left .section_w3c_di a, + .section_ac_main .section_dnsm_right .section_ac_di a, + .section_ac_main .section_dnsm_right .section_ayd_di a, + .section_ac_main .section_dnsm_right .section_dnsm_di a, + .section_ac_main .section_dnsm_right .section_w3c_di a, + .section_ac_main .section_w3c_left .section_ac_di a, + .section_ac_main .section_w3c_left .section_ayd_di a, + .section_ac_main .section_w3c_left .section_dnsm_di a, + .section_ac_main .section_w3c_left .section_w3c_di a, + .section_ac_main .section_w3c_right .section_ac_di a, + .section_ac_main .section_w3c_right .section_ayd_di a, + .section_ac_main .section_w3c_right .section_dnsm_di a, + .section_ac_main .section_w3c_right .section_w3c_di a, + .section_ayd_main .section_ac_left .section_ac_di a, + .section_ayd_main .section_ac_left .section_ayd_di a, + .section_ayd_main .section_ac_left .section_dnsm_di a, + .section_ayd_main .section_ac_left .section_w3c_di a, + .section_ayd_main .section_ac_right .section_ac_di a, + .section_ayd_main .section_ac_right .section_ayd_di a, + .section_ayd_main .section_ac_right .section_dnsm_di a, + .section_ayd_main .section_ac_right .section_w3c_di a, + .section_ayd_main .section_ayd_left .section_ac_di a, + .section_ayd_main .section_ayd_left .section_ayd_di a, + .section_ayd_main .section_ayd_left .section_dnsm_di a, + .section_ayd_main .section_ayd_left .section_w3c_di a, + .section_ayd_main .section_ayd_right .section_ac_di a, + .section_ayd_main .section_ayd_right .section_ayd_di a, + .section_ayd_main .section_ayd_right .section_dnsm_di a, + .section_ayd_main .section_ayd_right .section_w3c_di a, + .section_ayd_main .section_dnsm_left .section_ac_di a, + .section_ayd_main .section_dnsm_left .section_ayd_di a, + .section_ayd_main .section_dnsm_left .section_dnsm_di a, + .section_ayd_main .section_dnsm_left .section_w3c_di a, + .section_ayd_main .section_dnsm_right .section_ac_di a, + .section_ayd_main .section_dnsm_right .section_ayd_di a, + .section_ayd_main .section_dnsm_right .section_dnsm_di a, + .section_ayd_main .section_dnsm_right .section_w3c_di a, + .section_ayd_main .section_w3c_left .section_ac_di a, + .section_ayd_main .section_w3c_left .section_ayd_di a, + .section_ayd_main .section_w3c_left .section_dnsm_di a, + .section_ayd_main .section_w3c_left .section_w3c_di a, + .section_ayd_main .section_w3c_right .section_ac_di a, + .section_ayd_main .section_w3c_right .section_ayd_di a, + .section_ayd_main .section_w3c_right .section_dnsm_di a, + .section_ayd_main .section_w3c_right .section_w3c_di a, + .section_dnsm_main .section_ac_left .section_ac_di a, + .section_dnsm_main .section_ac_left .section_ayd_di a, + .section_dnsm_main .section_ac_left .section_dnsm_di a, + .section_dnsm_main .section_ac_left .section_w3c_di a, + .section_dnsm_main .section_ac_right .section_ac_di a, + .section_dnsm_main .section_ac_right .section_ayd_di a, + .section_dnsm_main .section_ac_right .section_dnsm_di a, + .section_dnsm_main .section_ac_right .section_w3c_di a, + .section_dnsm_main .section_ayd_left .section_ac_di a, + .section_dnsm_main .section_ayd_left .section_ayd_di a, + .section_dnsm_main .section_ayd_left .section_dnsm_di a, + .section_dnsm_main .section_ayd_left .section_w3c_di a, + .section_dnsm_main .section_ayd_right .section_ac_di a, + .section_dnsm_main .section_ayd_right .section_ayd_di a, + .section_dnsm_main .section_ayd_right .section_dnsm_di a, + .section_dnsm_main .section_ayd_right .section_w3c_di a, + .section_dnsm_main .section_dnsm_left .section_ac_di a, + .section_dnsm_main .section_dnsm_left .section_ayd_di a, + .section_dnsm_main .section_dnsm_left .section_dnsm_di a, + .section_dnsm_main .section_dnsm_left .section_w3c_di a, + .section_dnsm_main .section_dnsm_right .section_ac_di a, + .section_dnsm_main .section_dnsm_right .section_ayd_di a, + .section_dnsm_main .section_dnsm_right .section_dnsm_di a, + .section_dnsm_main .section_dnsm_right .section_w3c_di a, + .section_dnsm_main .section_w3c_left .section_ac_di a, + .section_dnsm_main .section_w3c_left .section_ayd_di a, + .section_dnsm_main .section_w3c_left .section_dnsm_di a, + .section_dnsm_main .section_w3c_left .section_w3c_di a, + .section_dnsm_main .section_w3c_right .section_ac_di a, + .section_dnsm_main .section_w3c_right .section_ayd_di a, + .section_dnsm_main .section_w3c_right .section_dnsm_di a, + .section_dnsm_main .section_w3c_right .section_w3c_di a, + .section_w3c_main .section_ac_left .section_ac_di a, + .section_w3c_main .section_ac_left .section_ayd_di a, + .section_w3c_main .section_ac_left .section_dnsm_di a, + .section_w3c_main .section_ac_left .section_w3c_di a, + .section_w3c_main .section_ac_right .section_ac_di a, + .section_w3c_main .section_ac_right .section_ayd_di a, + .section_w3c_main .section_ac_right .section_dnsm_di a, + .section_w3c_main .section_ac_right .section_w3c_di a, + .section_w3c_main .section_ayd_left .section_ac_di a, + .section_w3c_main .section_ayd_left .section_ayd_di a, + .section_w3c_main .section_ayd_left .section_dnsm_di a, + .section_w3c_main .section_ayd_left .section_w3c_di a, + .section_w3c_main .section_ayd_right .section_ac_di a, + .section_w3c_main .section_ayd_right .section_ayd_di a, + .section_w3c_main .section_ayd_right .section_dnsm_di a, + .section_w3c_main .section_ayd_right .section_w3c_di a, + .section_w3c_main .section_dnsm_left .section_ac_di a, + .section_w3c_main .section_dnsm_left .section_ayd_di a, + .section_w3c_main .section_dnsm_left .section_dnsm_di a, + .section_w3c_main .section_dnsm_left .section_w3c_di a, + .section_w3c_main .section_dnsm_right .section_ac_di a, + .section_w3c_main .section_dnsm_right .section_ayd_di a, + .section_w3c_main .section_dnsm_right .section_dnsm_di a, + .section_w3c_main .section_dnsm_right .section_w3c_di a, + .section_w3c_main .section_w3c_left .section_ac_di a, + .section_w3c_main .section_w3c_left .section_ayd_di a, + .section_w3c_main .section_w3c_left .section_dnsm_di a, + .section_w3c_main .section_w3c_left .section_w3c_di a, + .section_w3c_main .section_w3c_right .section_ac_di a, + .section_w3c_main .section_w3c_right .section_ayd_di a, + .section_w3c_main .section_w3c_right .section_dnsm_di a, + .section_w3c_main .section_w3c_right .section_w3c_di a { + display: inline-block; + width: 183px; + height: 130px; + float: left; + margin-right: 10px; + overflow: hidden; } + .section_ac_main .section_ac_left .section_ac_di a img, + .section_ac_main .section_ac_left .section_ayd_di a img, + .section_ac_main .section_ac_left .section_dnsm_di a img, + .section_ac_main .section_ac_left .section_w3c_di a img, + .section_ac_main .section_ac_right .section_ac_di a img, + .section_ac_main .section_ac_right .section_ayd_di a img, + .section_ac_main .section_ac_right .section_dnsm_di a img, + .section_ac_main .section_ac_right .section_w3c_di a img, + .section_ac_main .section_ayd_left .section_ac_di a img, + .section_ac_main .section_ayd_left .section_ayd_di a img, + .section_ac_main .section_ayd_left .section_dnsm_di a img, + .section_ac_main .section_ayd_left .section_w3c_di a img, + .section_ac_main .section_ayd_right .section_ac_di a img, + .section_ac_main .section_ayd_right .section_ayd_di a img, + .section_ac_main .section_ayd_right .section_dnsm_di a img, + .section_ac_main .section_ayd_right .section_w3c_di a img, + .section_ac_main .section_dnsm_left .section_ac_di a img, + .section_ac_main .section_dnsm_left .section_ayd_di a img, + .section_ac_main .section_dnsm_left .section_dnsm_di a img, + .section_ac_main .section_dnsm_left .section_w3c_di a img, + .section_ac_main .section_dnsm_right .section_ac_di a img, + .section_ac_main .section_dnsm_right .section_ayd_di a img, + .section_ac_main .section_dnsm_right .section_dnsm_di a img, + .section_ac_main .section_dnsm_right .section_w3c_di a img, + .section_ac_main .section_w3c_left .section_ac_di a img, + .section_ac_main .section_w3c_left .section_ayd_di a img, + .section_ac_main .section_w3c_left .section_dnsm_di a img, + .section_ac_main .section_w3c_left .section_w3c_di a img, + .section_ac_main .section_w3c_right .section_ac_di a img, + .section_ac_main .section_w3c_right .section_ayd_di a img, + .section_ac_main .section_w3c_right .section_dnsm_di a img, + .section_ac_main .section_w3c_right .section_w3c_di a img, + .section_ayd_main .section_ac_left .section_ac_di a img, + .section_ayd_main .section_ac_left .section_ayd_di a img, + .section_ayd_main .section_ac_left .section_dnsm_di a img, + .section_ayd_main .section_ac_left .section_w3c_di a img, + .section_ayd_main .section_ac_right .section_ac_di a img, + .section_ayd_main .section_ac_right .section_ayd_di a img, + .section_ayd_main .section_ac_right .section_dnsm_di a img, + .section_ayd_main .section_ac_right .section_w3c_di a img, + .section_ayd_main .section_ayd_left .section_ac_di a img, + .section_ayd_main .section_ayd_left .section_ayd_di a img, + .section_ayd_main .section_ayd_left .section_dnsm_di a img, + .section_ayd_main .section_ayd_left .section_w3c_di a img, + .section_ayd_main .section_ayd_right .section_ac_di a img, + .section_ayd_main .section_ayd_right .section_ayd_di a img, + .section_ayd_main .section_ayd_right .section_dnsm_di a img, + .section_ayd_main .section_ayd_right .section_w3c_di a img, + .section_ayd_main .section_dnsm_left .section_ac_di a img, + .section_ayd_main .section_dnsm_left .section_ayd_di a img, + .section_ayd_main .section_dnsm_left .section_dnsm_di a img, + .section_ayd_main .section_dnsm_left .section_w3c_di a img, + .section_ayd_main .section_dnsm_right .section_ac_di a img, + .section_ayd_main .section_dnsm_right .section_ayd_di a img, + .section_ayd_main .section_dnsm_right .section_dnsm_di a img, + .section_ayd_main .section_dnsm_right .section_w3c_di a img, + .section_ayd_main .section_w3c_left .section_ac_di a img, + .section_ayd_main .section_w3c_left .section_ayd_di a img, + .section_ayd_main .section_w3c_left .section_dnsm_di a img, + .section_ayd_main .section_w3c_left .section_w3c_di a img, + .section_ayd_main .section_w3c_right .section_ac_di a img, + .section_ayd_main .section_w3c_right .section_ayd_di a img, + .section_ayd_main .section_w3c_right .section_dnsm_di a img, + .section_ayd_main .section_w3c_right .section_w3c_di a img, + .section_dnsm_main .section_ac_left .section_ac_di a img, + .section_dnsm_main .section_ac_left .section_ayd_di a img, + .section_dnsm_main .section_ac_left .section_dnsm_di a img, + .section_dnsm_main .section_ac_left .section_w3c_di a img, + .section_dnsm_main .section_ac_right .section_ac_di a img, + .section_dnsm_main .section_ac_right .section_ayd_di a img, + .section_dnsm_main .section_ac_right .section_dnsm_di a img, + .section_dnsm_main .section_ac_right .section_w3c_di a img, + .section_dnsm_main .section_ayd_left .section_ac_di a img, + .section_dnsm_main .section_ayd_left .section_ayd_di a img, + .section_dnsm_main .section_ayd_left .section_dnsm_di a img, + .section_dnsm_main .section_ayd_left .section_w3c_di a img, + .section_dnsm_main .section_ayd_right .section_ac_di a img, + .section_dnsm_main .section_ayd_right .section_ayd_di a img, + .section_dnsm_main .section_ayd_right .section_dnsm_di a img, + .section_dnsm_main .section_ayd_right .section_w3c_di a img, + .section_dnsm_main .section_dnsm_left .section_ac_di a img, + .section_dnsm_main .section_dnsm_left .section_ayd_di a img, + .section_dnsm_main .section_dnsm_left .section_dnsm_di a img, + .section_dnsm_main .section_dnsm_left .section_w3c_di a img, + .section_dnsm_main .section_dnsm_right .section_ac_di a img, + .section_dnsm_main .section_dnsm_right .section_ayd_di a img, + .section_dnsm_main .section_dnsm_right .section_dnsm_di a img, + .section_dnsm_main .section_dnsm_right .section_w3c_di a img, + .section_dnsm_main .section_w3c_left .section_ac_di a img, + .section_dnsm_main .section_w3c_left .section_ayd_di a img, + .section_dnsm_main .section_w3c_left .section_dnsm_di a img, + .section_dnsm_main .section_w3c_left .section_w3c_di a img, + .section_dnsm_main .section_w3c_right .section_ac_di a img, + .section_dnsm_main .section_w3c_right .section_ayd_di a img, + .section_dnsm_main .section_w3c_right .section_dnsm_di a img, + .section_dnsm_main .section_w3c_right .section_w3c_di a img, + .section_w3c_main .section_ac_left .section_ac_di a img, + .section_w3c_main .section_ac_left .section_ayd_di a img, + .section_w3c_main .section_ac_left .section_dnsm_di a img, + .section_w3c_main .section_ac_left .section_w3c_di a img, + .section_w3c_main .section_ac_right .section_ac_di a img, + .section_w3c_main .section_ac_right .section_ayd_di a img, + .section_w3c_main .section_ac_right .section_dnsm_di a img, + .section_w3c_main .section_ac_right .section_w3c_di a img, + .section_w3c_main .section_ayd_left .section_ac_di a img, + .section_w3c_main .section_ayd_left .section_ayd_di a img, + .section_w3c_main .section_ayd_left .section_dnsm_di a img, + .section_w3c_main .section_ayd_left .section_w3c_di a img, + .section_w3c_main .section_ayd_right .section_ac_di a img, + .section_w3c_main .section_ayd_right .section_ayd_di a img, + .section_w3c_main .section_ayd_right .section_dnsm_di a img, + .section_w3c_main .section_ayd_right .section_w3c_di a img, + .section_w3c_main .section_dnsm_left .section_ac_di a img, + .section_w3c_main .section_dnsm_left .section_ayd_di a img, + .section_w3c_main .section_dnsm_left .section_dnsm_di a img, + .section_w3c_main .section_dnsm_left .section_w3c_di a img, + .section_w3c_main .section_dnsm_right .section_ac_di a img, + .section_w3c_main .section_dnsm_right .section_ayd_di a img, + .section_w3c_main .section_dnsm_right .section_dnsm_di a img, + .section_w3c_main .section_dnsm_right .section_w3c_di a img, + .section_w3c_main .section_w3c_left .section_ac_di a img, + .section_w3c_main .section_w3c_left .section_ayd_di a img, + .section_w3c_main .section_w3c_left .section_dnsm_di a img, + .section_w3c_main .section_w3c_left .section_w3c_di a img, + .section_w3c_main .section_w3c_right .section_ac_di a img, + .section_w3c_main .section_w3c_right .section_ayd_di a img, + .section_w3c_main .section_w3c_right .section_dnsm_di a img, + .section_w3c_main .section_w3c_right .section_w3c_di a img { + position: relative; } + .section_ac_main .section_ac_left .section_ac_di a:last-child, + .section_ac_main .section_ac_left .section_ayd_di a:last-child, + .section_ac_main .section_ac_left .section_dnsm_di a:last-child, + .section_ac_main .section_ac_left .section_w3c_di a:last-child, + .section_ac_main .section_ac_right .section_ac_di a:last-child, + .section_ac_main .section_ac_right .section_ayd_di a:last-child, + .section_ac_main .section_ac_right .section_dnsm_di a:last-child, + .section_ac_main .section_ac_right .section_w3c_di a:last-child, + .section_ac_main .section_ayd_left .section_ac_di a:last-child, + .section_ac_main .section_ayd_left .section_ayd_di a:last-child, + .section_ac_main .section_ayd_left .section_dnsm_di a:last-child, + .section_ac_main .section_ayd_left .section_w3c_di a:last-child, + .section_ac_main .section_ayd_right .section_ac_di a:last-child, + .section_ac_main .section_ayd_right .section_ayd_di a:last-child, + .section_ac_main .section_ayd_right .section_dnsm_di a:last-child, + .section_ac_main .section_ayd_right .section_w3c_di a:last-child, + .section_ac_main .section_dnsm_left .section_ac_di a:last-child, + .section_ac_main .section_dnsm_left .section_ayd_di a:last-child, + .section_ac_main .section_dnsm_left .section_dnsm_di a:last-child, + .section_ac_main .section_dnsm_left .section_w3c_di a:last-child, + .section_ac_main .section_dnsm_right .section_ac_di a:last-child, + .section_ac_main .section_dnsm_right .section_ayd_di a:last-child, + .section_ac_main .section_dnsm_right .section_dnsm_di a:last-child, + .section_ac_main .section_dnsm_right .section_w3c_di a:last-child, + .section_ac_main .section_w3c_left .section_ac_di a:last-child, + .section_ac_main .section_w3c_left .section_ayd_di a:last-child, + .section_ac_main .section_w3c_left .section_dnsm_di a:last-child, + .section_ac_main .section_w3c_left .section_w3c_di a:last-child, + .section_ac_main .section_w3c_right .section_ac_di a:last-child, + .section_ac_main .section_w3c_right .section_ayd_di a:last-child, + .section_ac_main .section_w3c_right .section_dnsm_di a:last-child, + .section_ac_main .section_w3c_right .section_w3c_di a:last-child, + .section_ayd_main .section_ac_left .section_ac_di a:last-child, + .section_ayd_main .section_ac_left .section_ayd_di a:last-child, + .section_ayd_main .section_ac_left .section_dnsm_di a:last-child, + .section_ayd_main .section_ac_left .section_w3c_di a:last-child, + .section_ayd_main .section_ac_right .section_ac_di a:last-child, + .section_ayd_main .section_ac_right .section_ayd_di a:last-child, + .section_ayd_main .section_ac_right .section_dnsm_di a:last-child, + .section_ayd_main .section_ac_right .section_w3c_di a:last-child, + .section_ayd_main .section_ayd_left .section_ac_di a:last-child, + .section_ayd_main .section_ayd_left .section_ayd_di a:last-child, + .section_ayd_main .section_ayd_left .section_dnsm_di a:last-child, + .section_ayd_main .section_ayd_left .section_w3c_di a:last-child, + .section_ayd_main .section_ayd_right .section_ac_di a:last-child, + .section_ayd_main .section_ayd_right .section_ayd_di a:last-child, + .section_ayd_main .section_ayd_right .section_dnsm_di a:last-child, + .section_ayd_main .section_ayd_right .section_w3c_di a:last-child, + .section_ayd_main .section_dnsm_left .section_ac_di a:last-child, + .section_ayd_main .section_dnsm_left .section_ayd_di a:last-child, + .section_ayd_main .section_dnsm_left .section_dnsm_di a:last-child, + .section_ayd_main .section_dnsm_left .section_w3c_di a:last-child, + .section_ayd_main .section_dnsm_right .section_ac_di a:last-child, + .section_ayd_main .section_dnsm_right .section_ayd_di a:last-child, + .section_ayd_main .section_dnsm_right .section_dnsm_di a:last-child, + .section_ayd_main .section_dnsm_right .section_w3c_di a:last-child, + .section_ayd_main .section_w3c_left .section_ac_di a:last-child, + .section_ayd_main .section_w3c_left .section_ayd_di a:last-child, + .section_ayd_main .section_w3c_left .section_dnsm_di a:last-child, + .section_ayd_main .section_w3c_left .section_w3c_di a:last-child, + .section_ayd_main .section_w3c_right .section_ac_di a:last-child, + .section_ayd_main .section_w3c_right .section_ayd_di a:last-child, + .section_ayd_main .section_w3c_right .section_dnsm_di a:last-child, + .section_ayd_main .section_w3c_right .section_w3c_di a:last-child, + .section_dnsm_main .section_ac_left .section_ac_di a:last-child, + .section_dnsm_main .section_ac_left .section_ayd_di a:last-child, + .section_dnsm_main .section_ac_left .section_dnsm_di a:last-child, + .section_dnsm_main .section_ac_left .section_w3c_di a:last-child, + .section_dnsm_main .section_ac_right .section_ac_di a:last-child, + .section_dnsm_main .section_ac_right .section_ayd_di a:last-child, + .section_dnsm_main .section_ac_right .section_dnsm_di a:last-child, + .section_dnsm_main .section_ac_right .section_w3c_di a:last-child, + .section_dnsm_main .section_ayd_left .section_ac_di a:last-child, + .section_dnsm_main .section_ayd_left .section_ayd_di a:last-child, + .section_dnsm_main .section_ayd_left .section_dnsm_di a:last-child, + .section_dnsm_main .section_ayd_left .section_w3c_di a:last-child, + .section_dnsm_main .section_ayd_right .section_ac_di a:last-child, + .section_dnsm_main .section_ayd_right .section_ayd_di a:last-child, + .section_dnsm_main .section_ayd_right .section_dnsm_di a:last-child, + .section_dnsm_main .section_ayd_right .section_w3c_di a:last-child, + .section_dnsm_main .section_dnsm_left .section_ac_di a:last-child, + .section_dnsm_main .section_dnsm_left .section_ayd_di a:last-child, + .section_dnsm_main .section_dnsm_left .section_dnsm_di a:last-child, + .section_dnsm_main .section_dnsm_left .section_w3c_di a:last-child, + .section_dnsm_main .section_dnsm_right .section_ac_di a:last-child, + .section_dnsm_main .section_dnsm_right .section_ayd_di a:last-child, + .section_dnsm_main .section_dnsm_right .section_dnsm_di a:last-child, + .section_dnsm_main .section_dnsm_right .section_w3c_di a:last-child, + .section_dnsm_main .section_w3c_left .section_ac_di a:last-child, + .section_dnsm_main .section_w3c_left .section_ayd_di a:last-child, + .section_dnsm_main .section_w3c_left .section_dnsm_di a:last-child, + .section_dnsm_main .section_w3c_left .section_w3c_di a:last-child, + .section_dnsm_main .section_w3c_right .section_ac_di a:last-child, + .section_dnsm_main .section_w3c_right .section_ayd_di a:last-child, + .section_dnsm_main .section_w3c_right .section_dnsm_di a:last-child, + .section_dnsm_main .section_w3c_right .section_w3c_di a:last-child, + .section_w3c_main .section_ac_left .section_ac_di a:last-child, + .section_w3c_main .section_ac_left .section_ayd_di a:last-child, + .section_w3c_main .section_ac_left .section_dnsm_di a:last-child, + .section_w3c_main .section_ac_left .section_w3c_di a:last-child, + .section_w3c_main .section_ac_right .section_ac_di a:last-child, + .section_w3c_main .section_ac_right .section_ayd_di a:last-child, + .section_w3c_main .section_ac_right .section_dnsm_di a:last-child, + .section_w3c_main .section_ac_right .section_w3c_di a:last-child, + .section_w3c_main .section_ayd_left .section_ac_di a:last-child, + .section_w3c_main .section_ayd_left .section_ayd_di a:last-child, + .section_w3c_main .section_ayd_left .section_dnsm_di a:last-child, + .section_w3c_main .section_ayd_left .section_w3c_di a:last-child, + .section_w3c_main .section_ayd_right .section_ac_di a:last-child, + .section_w3c_main .section_ayd_right .section_ayd_di a:last-child, + .section_w3c_main .section_ayd_right .section_dnsm_di a:last-child, + .section_w3c_main .section_ayd_right .section_w3c_di a:last-child, + .section_w3c_main .section_dnsm_left .section_ac_di a:last-child, + .section_w3c_main .section_dnsm_left .section_ayd_di a:last-child, + .section_w3c_main .section_dnsm_left .section_dnsm_di a:last-child, + .section_w3c_main .section_dnsm_left .section_w3c_di a:last-child, + .section_w3c_main .section_dnsm_right .section_ac_di a:last-child, + .section_w3c_main .section_dnsm_right .section_ayd_di a:last-child, + .section_w3c_main .section_dnsm_right .section_dnsm_di a:last-child, + .section_w3c_main .section_dnsm_right .section_w3c_di a:last-child, + .section_w3c_main .section_w3c_left .section_ac_di a:last-child, + .section_w3c_main .section_w3c_left .section_ayd_di a:last-child, + .section_w3c_main .section_w3c_left .section_dnsm_di a:last-child, + .section_w3c_main .section_w3c_left .section_w3c_di a:last-child, + .section_w3c_main .section_w3c_right .section_ac_di a:last-child, + .section_w3c_main .section_w3c_right .section_ayd_di a:last-child, + .section_w3c_main .section_w3c_right .section_dnsm_di a:last-child, + .section_w3c_main .section_w3c_right .section_w3c_di a:last-child { + margin: 0; } + .section_ac_main .section_ac_right, + .section_ac_main .section_ayd_right, + .section_ac_main .section_dnsm_right, + .section_ac_main .section_w3c_right, + .section_ayd_main .section_ac_right, + .section_ayd_main .section_ayd_right, + .section_ayd_main .section_dnsm_right, + .section_ayd_main .section_w3c_right, + .section_dnsm_main .section_ac_right, + .section_dnsm_main .section_ayd_right, + .section_dnsm_main .section_dnsm_right, + .section_dnsm_main .section_w3c_right, + .section_w3c_main .section_ac_right, + .section_w3c_main .section_ayd_right, + .section_w3c_main .section_dnsm_right, + .section_w3c_main .section_w3c_right { + width: 585px; + margin: 0; + float: left; + border-left: 1px solid #E6E6E6; + padding-left: 15px; } + .section_ac_main .section_ac_gun, + .section_ac_main .section_ayd_gun, + .section_ac_main .section_dnsm_gun, + .section_ac_main .section_w3c_gun, + .section_ayd_main .section_ac_gun, + .section_ayd_main .section_ayd_gun, + .section_ayd_main .section_dnsm_gun, + .section_ayd_main .section_w3c_gun, + .section_dnsm_main .section_ac_gun, + .section_dnsm_main .section_ayd_gun, + .section_dnsm_main .section_dnsm_gun, + .section_dnsm_main .section_w3c_gun, + .section_w3c_main .section_ac_gun, + .section_w3c_main .section_ayd_gun, + .section_w3c_main .section_dnsm_gun, + .section_w3c_main .section_w3c_gun { + clear: both; + height: 45px; + position: relative; + padding-top: 10px; } + .section_ac_main .section_ac_gun .section_ac_xian, + .section_ac_main .section_ac_gun .section_ayd_xian, + .section_ac_main .section_ac_gun .section_dnsm_xian, + .section_ac_main .section_ac_gun .section_w3c_xian, + .section_ac_main .section_ayd_gun .section_ac_xian, + .section_ac_main .section_ayd_gun .section_ayd_xian, + .section_ac_main .section_ayd_gun .section_dnsm_xian, + .section_ac_main .section_ayd_gun .section_w3c_xian, + .section_ac_main .section_dnsm_gun .section_ac_xian, + .section_ac_main .section_dnsm_gun .section_ayd_xian, + .section_ac_main .section_dnsm_gun .section_dnsm_xian, + .section_ac_main .section_dnsm_gun .section_w3c_xian, + .section_ac_main .section_w3c_gun .section_ac_xian, + .section_ac_main .section_w3c_gun .section_ayd_xian, + .section_ac_main .section_w3c_gun .section_dnsm_xian, + .section_ac_main .section_w3c_gun .section_w3c_xian, + .section_ayd_main .section_ac_gun .section_ac_xian, + .section_ayd_main .section_ac_gun .section_ayd_xian, + .section_ayd_main .section_ac_gun .section_dnsm_xian, + .section_ayd_main .section_ac_gun .section_w3c_xian, + .section_ayd_main .section_ayd_gun .section_ac_xian, + .section_ayd_main .section_ayd_gun .section_ayd_xian, + .section_ayd_main .section_ayd_gun .section_dnsm_xian, + .section_ayd_main .section_ayd_gun .section_w3c_xian, + .section_ayd_main .section_dnsm_gun .section_ac_xian, + .section_ayd_main .section_dnsm_gun .section_ayd_xian, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian, + .section_ayd_main .section_dnsm_gun .section_w3c_xian, + .section_ayd_main .section_w3c_gun .section_ac_xian, + .section_ayd_main .section_w3c_gun .section_ayd_xian, + .section_ayd_main .section_w3c_gun .section_dnsm_xian, + .section_ayd_main .section_w3c_gun .section_w3c_xian, + .section_dnsm_main .section_ac_gun .section_ac_xian, + .section_dnsm_main .section_ac_gun .section_ayd_xian, + .section_dnsm_main .section_ac_gun .section_dnsm_xian, + .section_dnsm_main .section_ac_gun .section_w3c_xian, + .section_dnsm_main .section_ayd_gun .section_ac_xian, + .section_dnsm_main .section_ayd_gun .section_ayd_xian, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian, + .section_dnsm_main .section_ayd_gun .section_w3c_xian, + .section_dnsm_main .section_dnsm_gun .section_ac_xian, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian, + .section_dnsm_main .section_w3c_gun .section_ac_xian, + .section_dnsm_main .section_w3c_gun .section_ayd_xian, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian, + .section_dnsm_main .section_w3c_gun .section_w3c_xian, + .section_w3c_main .section_ac_gun .section_ac_xian, + .section_w3c_main .section_ac_gun .section_ayd_xian, + .section_w3c_main .section_ac_gun .section_dnsm_xian, + .section_w3c_main .section_ac_gun .section_w3c_xian, + .section_w3c_main .section_ayd_gun .section_ac_xian, + .section_w3c_main .section_ayd_gun .section_ayd_xian, + .section_w3c_main .section_ayd_gun .section_dnsm_xian, + .section_w3c_main .section_ayd_gun .section_w3c_xian, + .section_w3c_main .section_dnsm_gun .section_ac_xian, + .section_w3c_main .section_dnsm_gun .section_ayd_xian, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian, + .section_w3c_main .section_dnsm_gun .section_w3c_xian, + .section_w3c_main .section_w3c_gun .section_ac_xian, + .section_w3c_main .section_w3c_gun .section_ayd_xian, + .section_w3c_main .section_w3c_gun .section_dnsm_xian, + .section_w3c_main .section_w3c_gun .section_w3c_xian { + width: 1138px; + margin: 0 auto; + overflow: hidden; + height: 35px; + position: relative; } + .section_ac_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo { + display: none; + position: absolute; + width: 15px; + height: 35px; + background: white; + cursor: pointer; + z-index: 99; } + .section_ac_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_w3c_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ac_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ayd_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_dnsm_zuo, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_w3c_zuo { + left: -2px; + top: 0; + padding-top: 8px; } + .section_ac_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_ac_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_ayd_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_dnsm_main .section_w3c_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_ac_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_ayd_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_dnsm_gun .section_w3c_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_ac_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_ayd_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_dnsm_xian .section_w3c_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ac_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_ayd_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_dnsm_you, + .section_w3c_main .section_w3c_gun .section_w3c_xian .section_w3c_you { + width: 22px; + right: -9px; + top: 0; + padding-top: 7px; + padding-left: 4px; } + .section_ac_main .section_ac_gun .section_ac_xian ul, + .section_ac_main .section_ac_gun .section_ayd_xian ul, + .section_ac_main .section_ac_gun .section_dnsm_xian ul, + .section_ac_main .section_ac_gun .section_w3c_xian ul, + .section_ac_main .section_ayd_gun .section_ac_xian ul, + .section_ac_main .section_ayd_gun .section_ayd_xian ul, + .section_ac_main .section_ayd_gun .section_dnsm_xian ul, + .section_ac_main .section_ayd_gun .section_w3c_xian ul, + .section_ac_main .section_dnsm_gun .section_ac_xian ul, + .section_ac_main .section_dnsm_gun .section_ayd_xian ul, + .section_ac_main .section_dnsm_gun .section_dnsm_xian ul, + .section_ac_main .section_dnsm_gun .section_w3c_xian ul, + .section_ac_main .section_w3c_gun .section_ac_xian ul, + .section_ac_main .section_w3c_gun .section_ayd_xian ul, + .section_ac_main .section_w3c_gun .section_dnsm_xian ul, + .section_ac_main .section_w3c_gun .section_w3c_xian ul, + .section_ayd_main .section_ac_gun .section_ac_xian ul, + .section_ayd_main .section_ac_gun .section_ayd_xian ul, + .section_ayd_main .section_ac_gun .section_dnsm_xian ul, + .section_ayd_main .section_ac_gun .section_w3c_xian ul, + .section_ayd_main .section_ayd_gun .section_ac_xian ul, + .section_ayd_main .section_ayd_gun .section_ayd_xian ul, + .section_ayd_main .section_ayd_gun .section_dnsm_xian ul, + .section_ayd_main .section_ayd_gun .section_w3c_xian ul, + .section_ayd_main .section_dnsm_gun .section_ac_xian ul, + .section_ayd_main .section_dnsm_gun .section_ayd_xian ul, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian ul, + .section_ayd_main .section_dnsm_gun .section_w3c_xian ul, + .section_ayd_main .section_w3c_gun .section_ac_xian ul, + .section_ayd_main .section_w3c_gun .section_ayd_xian ul, + .section_ayd_main .section_w3c_gun .section_dnsm_xian ul, + .section_ayd_main .section_w3c_gun .section_w3c_xian ul, + .section_dnsm_main .section_ac_gun .section_ac_xian ul, + .section_dnsm_main .section_ac_gun .section_ayd_xian ul, + .section_dnsm_main .section_ac_gun .section_dnsm_xian ul, + .section_dnsm_main .section_ac_gun .section_w3c_xian ul, + .section_dnsm_main .section_ayd_gun .section_ac_xian ul, + .section_dnsm_main .section_ayd_gun .section_ayd_xian ul, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian ul, + .section_dnsm_main .section_ayd_gun .section_w3c_xian ul, + .section_dnsm_main .section_dnsm_gun .section_ac_xian ul, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian ul, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian ul, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian ul, + .section_dnsm_main .section_w3c_gun .section_ac_xian ul, + .section_dnsm_main .section_w3c_gun .section_ayd_xian ul, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian ul, + .section_dnsm_main .section_w3c_gun .section_w3c_xian ul, + .section_w3c_main .section_ac_gun .section_ac_xian ul, + .section_w3c_main .section_ac_gun .section_ayd_xian ul, + .section_w3c_main .section_ac_gun .section_dnsm_xian ul, + .section_w3c_main .section_ac_gun .section_w3c_xian ul, + .section_w3c_main .section_ayd_gun .section_ac_xian ul, + .section_w3c_main .section_ayd_gun .section_ayd_xian ul, + .section_w3c_main .section_ayd_gun .section_dnsm_xian ul, + .section_w3c_main .section_ayd_gun .section_w3c_xian ul, + .section_w3c_main .section_dnsm_gun .section_ac_xian ul, + .section_w3c_main .section_dnsm_gun .section_ayd_xian ul, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian ul, + .section_w3c_main .section_dnsm_gun .section_w3c_xian ul, + .section_w3c_main .section_w3c_gun .section_ac_xian ul, + .section_w3c_main .section_w3c_gun .section_ayd_xian ul, + .section_w3c_main .section_w3c_gun .section_dnsm_xian ul, + .section_w3c_main .section_w3c_gun .section_w3c_xian ul { + height: 35px; + width: 4560px; + position: absolute; + top: 0; + left: -2280px; } + .section_ac_main .section_ac_gun .section_ac_xian ul li, + .section_ac_main .section_ac_gun .section_ayd_xian ul li, + .section_ac_main .section_ac_gun .section_dnsm_xian ul li, + .section_ac_main .section_ac_gun .section_w3c_xian ul li, + .section_ac_main .section_ayd_gun .section_ac_xian ul li, + .section_ac_main .section_ayd_gun .section_ayd_xian ul li, + .section_ac_main .section_ayd_gun .section_dnsm_xian ul li, + .section_ac_main .section_ayd_gun .section_w3c_xian ul li, + .section_ac_main .section_dnsm_gun .section_ac_xian ul li, + .section_ac_main .section_dnsm_gun .section_ayd_xian ul li, + .section_ac_main .section_dnsm_gun .section_dnsm_xian ul li, + .section_ac_main .section_dnsm_gun .section_w3c_xian ul li, + .section_ac_main .section_w3c_gun .section_ac_xian ul li, + .section_ac_main .section_w3c_gun .section_ayd_xian ul li, + .section_ac_main .section_w3c_gun .section_dnsm_xian ul li, + .section_ac_main .section_w3c_gun .section_w3c_xian ul li, + .section_ayd_main .section_ac_gun .section_ac_xian ul li, + .section_ayd_main .section_ac_gun .section_ayd_xian ul li, + .section_ayd_main .section_ac_gun .section_dnsm_xian ul li, + .section_ayd_main .section_ac_gun .section_w3c_xian ul li, + .section_ayd_main .section_ayd_gun .section_ac_xian ul li, + .section_ayd_main .section_ayd_gun .section_ayd_xian ul li, + .section_ayd_main .section_ayd_gun .section_dnsm_xian ul li, + .section_ayd_main .section_ayd_gun .section_w3c_xian ul li, + .section_ayd_main .section_dnsm_gun .section_ac_xian ul li, + .section_ayd_main .section_dnsm_gun .section_ayd_xian ul li, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian ul li, + .section_ayd_main .section_dnsm_gun .section_w3c_xian ul li, + .section_ayd_main .section_w3c_gun .section_ac_xian ul li, + .section_ayd_main .section_w3c_gun .section_ayd_xian ul li, + .section_ayd_main .section_w3c_gun .section_dnsm_xian ul li, + .section_ayd_main .section_w3c_gun .section_w3c_xian ul li, + .section_dnsm_main .section_ac_gun .section_ac_xian ul li, + .section_dnsm_main .section_ac_gun .section_ayd_xian ul li, + .section_dnsm_main .section_ac_gun .section_dnsm_xian ul li, + .section_dnsm_main .section_ac_gun .section_w3c_xian ul li, + .section_dnsm_main .section_ayd_gun .section_ac_xian ul li, + .section_dnsm_main .section_ayd_gun .section_ayd_xian ul li, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian ul li, + .section_dnsm_main .section_ayd_gun .section_w3c_xian ul li, + .section_dnsm_main .section_dnsm_gun .section_ac_xian ul li, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian ul li, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian ul li, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian ul li, + .section_dnsm_main .section_w3c_gun .section_ac_xian ul li, + .section_dnsm_main .section_w3c_gun .section_ayd_xian ul li, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian ul li, + .section_dnsm_main .section_w3c_gun .section_w3c_xian ul li, + .section_w3c_main .section_ac_gun .section_ac_xian ul li, + .section_w3c_main .section_ac_gun .section_ayd_xian ul li, + .section_w3c_main .section_ac_gun .section_dnsm_xian ul li, + .section_w3c_main .section_ac_gun .section_w3c_xian ul li, + .section_w3c_main .section_ayd_gun .section_ac_xian ul li, + .section_w3c_main .section_ayd_gun .section_ayd_xian ul li, + .section_w3c_main .section_ayd_gun .section_dnsm_xian ul li, + .section_w3c_main .section_ayd_gun .section_w3c_xian ul li, + .section_w3c_main .section_dnsm_gun .section_ac_xian ul li, + .section_w3c_main .section_dnsm_gun .section_ayd_xian ul li, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian ul li, + .section_w3c_main .section_dnsm_gun .section_w3c_xian ul li, + .section_w3c_main .section_w3c_gun .section_ac_xian ul li, + .section_w3c_main .section_w3c_gun .section_ayd_xian ul li, + .section_w3c_main .section_w3c_gun .section_dnsm_xian ul li, + .section_w3c_main .section_w3c_gun .section_w3c_xian ul li { + margin-top: 7px; + height: 20px; + float: left; + width: 95px; + padding: 0 12px; + border-right: #DEDFE0 1px solid; } + .section_ac_main .section_ac_gun .section_ac_xian ul li a, + .section_ac_main .section_ac_gun .section_ayd_xian ul li a, + .section_ac_main .section_ac_gun .section_dnsm_xian ul li a, + .section_ac_main .section_ac_gun .section_w3c_xian ul li a, + .section_ac_main .section_ayd_gun .section_ac_xian ul li a, + .section_ac_main .section_ayd_gun .section_ayd_xian ul li a, + .section_ac_main .section_ayd_gun .section_dnsm_xian ul li a, + .section_ac_main .section_ayd_gun .section_w3c_xian ul li a, + .section_ac_main .section_dnsm_gun .section_ac_xian ul li a, + .section_ac_main .section_dnsm_gun .section_ayd_xian ul li a, + .section_ac_main .section_dnsm_gun .section_dnsm_xian ul li a, + .section_ac_main .section_dnsm_gun .section_w3c_xian ul li a, + .section_ac_main .section_w3c_gun .section_ac_xian ul li a, + .section_ac_main .section_w3c_gun .section_ayd_xian ul li a, + .section_ac_main .section_w3c_gun .section_dnsm_xian ul li a, + .section_ac_main .section_w3c_gun .section_w3c_xian ul li a, + .section_ayd_main .section_ac_gun .section_ac_xian ul li a, + .section_ayd_main .section_ac_gun .section_ayd_xian ul li a, + .section_ayd_main .section_ac_gun .section_dnsm_xian ul li a, + .section_ayd_main .section_ac_gun .section_w3c_xian ul li a, + .section_ayd_main .section_ayd_gun .section_ac_xian ul li a, + .section_ayd_main .section_ayd_gun .section_ayd_xian ul li a, + .section_ayd_main .section_ayd_gun .section_dnsm_xian ul li a, + .section_ayd_main .section_ayd_gun .section_w3c_xian ul li a, + .section_ayd_main .section_dnsm_gun .section_ac_xian ul li a, + .section_ayd_main .section_dnsm_gun .section_ayd_xian ul li a, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian ul li a, + .section_ayd_main .section_dnsm_gun .section_w3c_xian ul li a, + .section_ayd_main .section_w3c_gun .section_ac_xian ul li a, + .section_ayd_main .section_w3c_gun .section_ayd_xian ul li a, + .section_ayd_main .section_w3c_gun .section_dnsm_xian ul li a, + .section_ayd_main .section_w3c_gun .section_w3c_xian ul li a, + .section_dnsm_main .section_ac_gun .section_ac_xian ul li a, + .section_dnsm_main .section_ac_gun .section_ayd_xian ul li a, + .section_dnsm_main .section_ac_gun .section_dnsm_xian ul li a, + .section_dnsm_main .section_ac_gun .section_w3c_xian ul li a, + .section_dnsm_main .section_ayd_gun .section_ac_xian ul li a, + .section_dnsm_main .section_ayd_gun .section_ayd_xian ul li a, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian ul li a, + .section_dnsm_main .section_ayd_gun .section_w3c_xian ul li a, + .section_dnsm_main .section_dnsm_gun .section_ac_xian ul li a, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian ul li a, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian ul li a, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian ul li a, + .section_dnsm_main .section_w3c_gun .section_ac_xian ul li a, + .section_dnsm_main .section_w3c_gun .section_ayd_xian ul li a, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian ul li a, + .section_dnsm_main .section_w3c_gun .section_w3c_xian ul li a, + .section_w3c_main .section_ac_gun .section_ac_xian ul li a, + .section_w3c_main .section_ac_gun .section_ayd_xian ul li a, + .section_w3c_main .section_ac_gun .section_dnsm_xian ul li a, + .section_w3c_main .section_ac_gun .section_w3c_xian ul li a, + .section_w3c_main .section_ayd_gun .section_ac_xian ul li a, + .section_w3c_main .section_ayd_gun .section_ayd_xian ul li a, + .section_w3c_main .section_ayd_gun .section_dnsm_xian ul li a, + .section_w3c_main .section_ayd_gun .section_w3c_xian ul li a, + .section_w3c_main .section_dnsm_gun .section_ac_xian ul li a, + .section_w3c_main .section_dnsm_gun .section_ayd_xian ul li a, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian ul li a, + .section_w3c_main .section_dnsm_gun .section_w3c_xian ul li a, + .section_w3c_main .section_w3c_gun .section_ac_xian ul li a, + .section_w3c_main .section_w3c_gun .section_ayd_xian ul li a, + .section_w3c_main .section_w3c_gun .section_dnsm_xian ul li a, + .section_w3c_main .section_w3c_gun .section_w3c_xian ul li a { + display: inline-block; } + .section_ac_main .section_ac_gun .section_ac_xian ul li a img, + .section_ac_main .section_ac_gun .section_ayd_xian ul li a img, + .section_ac_main .section_ac_gun .section_dnsm_xian ul li a img, + .section_ac_main .section_ac_gun .section_w3c_xian ul li a img, + .section_ac_main .section_ayd_gun .section_ac_xian ul li a img, + .section_ac_main .section_ayd_gun .section_ayd_xian ul li a img, + .section_ac_main .section_ayd_gun .section_dnsm_xian ul li a img, + .section_ac_main .section_ayd_gun .section_w3c_xian ul li a img, + .section_ac_main .section_dnsm_gun .section_ac_xian ul li a img, + .section_ac_main .section_dnsm_gun .section_ayd_xian ul li a img, + .section_ac_main .section_dnsm_gun .section_dnsm_xian ul li a img, + .section_ac_main .section_dnsm_gun .section_w3c_xian ul li a img, + .section_ac_main .section_w3c_gun .section_ac_xian ul li a img, + .section_ac_main .section_w3c_gun .section_ayd_xian ul li a img, + .section_ac_main .section_w3c_gun .section_dnsm_xian ul li a img, + .section_ac_main .section_w3c_gun .section_w3c_xian ul li a img, + .section_ayd_main .section_ac_gun .section_ac_xian ul li a img, + .section_ayd_main .section_ac_gun .section_ayd_xian ul li a img, + .section_ayd_main .section_ac_gun .section_dnsm_xian ul li a img, + .section_ayd_main .section_ac_gun .section_w3c_xian ul li a img, + .section_ayd_main .section_ayd_gun .section_ac_xian ul li a img, + .section_ayd_main .section_ayd_gun .section_ayd_xian ul li a img, + .section_ayd_main .section_ayd_gun .section_dnsm_xian ul li a img, + .section_ayd_main .section_ayd_gun .section_w3c_xian ul li a img, + .section_ayd_main .section_dnsm_gun .section_ac_xian ul li a img, + .section_ayd_main .section_dnsm_gun .section_ayd_xian ul li a img, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian ul li a img, + .section_ayd_main .section_dnsm_gun .section_w3c_xian ul li a img, + .section_ayd_main .section_w3c_gun .section_ac_xian ul li a img, + .section_ayd_main .section_w3c_gun .section_ayd_xian ul li a img, + .section_ayd_main .section_w3c_gun .section_dnsm_xian ul li a img, + .section_ayd_main .section_w3c_gun .section_w3c_xian ul li a img, + .section_dnsm_main .section_ac_gun .section_ac_xian ul li a img, + .section_dnsm_main .section_ac_gun .section_ayd_xian ul li a img, + .section_dnsm_main .section_ac_gun .section_dnsm_xian ul li a img, + .section_dnsm_main .section_ac_gun .section_w3c_xian ul li a img, + .section_dnsm_main .section_ayd_gun .section_ac_xian ul li a img, + .section_dnsm_main .section_ayd_gun .section_ayd_xian ul li a img, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian ul li a img, + .section_dnsm_main .section_ayd_gun .section_w3c_xian ul li a img, + .section_dnsm_main .section_dnsm_gun .section_ac_xian ul li a img, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian ul li a img, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian ul li a img, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian ul li a img, + .section_dnsm_main .section_w3c_gun .section_ac_xian ul li a img, + .section_dnsm_main .section_w3c_gun .section_ayd_xian ul li a img, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian ul li a img, + .section_dnsm_main .section_w3c_gun .section_w3c_xian ul li a img, + .section_w3c_main .section_ac_gun .section_ac_xian ul li a img, + .section_w3c_main .section_ac_gun .section_ayd_xian ul li a img, + .section_w3c_main .section_ac_gun .section_dnsm_xian ul li a img, + .section_w3c_main .section_ac_gun .section_w3c_xian ul li a img, + .section_w3c_main .section_ayd_gun .section_ac_xian ul li a img, + .section_w3c_main .section_ayd_gun .section_ayd_xian ul li a img, + .section_w3c_main .section_ayd_gun .section_dnsm_xian ul li a img, + .section_w3c_main .section_ayd_gun .section_w3c_xian ul li a img, + .section_w3c_main .section_dnsm_gun .section_ac_xian ul li a img, + .section_w3c_main .section_dnsm_gun .section_ayd_xian ul li a img, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian ul li a img, + .section_w3c_main .section_dnsm_gun .section_w3c_xian ul li a img, + .section_w3c_main .section_w3c_gun .section_ac_xian ul li a img, + .section_w3c_main .section_w3c_gun .section_ayd_xian ul li a img, + .section_w3c_main .section_w3c_gun .section_dnsm_xian ul li a img, + .section_w3c_main .section_w3c_gun .section_w3c_xian ul li a img { + margin-top: -7px; } + .section_ac_main .section_ac_gun .section_ac_xian ul li a img:hover, + .section_ac_main .section_ac_gun .section_ayd_xian ul li a img:hover, + .section_ac_main .section_ac_gun .section_dnsm_xian ul li a img:hover, + .section_ac_main .section_ac_gun .section_w3c_xian ul li a img:hover, + .section_ac_main .section_ayd_gun .section_ac_xian ul li a img:hover, + .section_ac_main .section_ayd_gun .section_ayd_xian ul li a img:hover, + .section_ac_main .section_ayd_gun .section_dnsm_xian ul li a img:hover, + .section_ac_main .section_ayd_gun .section_w3c_xian ul li a img:hover, + .section_ac_main .section_dnsm_gun .section_ac_xian ul li a img:hover, + .section_ac_main .section_dnsm_gun .section_ayd_xian ul li a img:hover, + .section_ac_main .section_dnsm_gun .section_dnsm_xian ul li a img:hover, + .section_ac_main .section_dnsm_gun .section_w3c_xian ul li a img:hover, + .section_ac_main .section_w3c_gun .section_ac_xian ul li a img:hover, + .section_ac_main .section_w3c_gun .section_ayd_xian ul li a img:hover, + .section_ac_main .section_w3c_gun .section_dnsm_xian ul li a img:hover, + .section_ac_main .section_w3c_gun .section_w3c_xian ul li a img:hover, + .section_ayd_main .section_ac_gun .section_ac_xian ul li a img:hover, + .section_ayd_main .section_ac_gun .section_ayd_xian ul li a img:hover, + .section_ayd_main .section_ac_gun .section_dnsm_xian ul li a img:hover, + .section_ayd_main .section_ac_gun .section_w3c_xian ul li a img:hover, + .section_ayd_main .section_ayd_gun .section_ac_xian ul li a img:hover, + .section_ayd_main .section_ayd_gun .section_ayd_xian ul li a img:hover, + .section_ayd_main .section_ayd_gun .section_dnsm_xian ul li a img:hover, + .section_ayd_main .section_ayd_gun .section_w3c_xian ul li a img:hover, + .section_ayd_main .section_dnsm_gun .section_ac_xian ul li a img:hover, + .section_ayd_main .section_dnsm_gun .section_ayd_xian ul li a img:hover, + .section_ayd_main .section_dnsm_gun .section_dnsm_xian ul li a img:hover, + .section_ayd_main .section_dnsm_gun .section_w3c_xian ul li a img:hover, + .section_ayd_main .section_w3c_gun .section_ac_xian ul li a img:hover, + .section_ayd_main .section_w3c_gun .section_ayd_xian ul li a img:hover, + .section_ayd_main .section_w3c_gun .section_dnsm_xian ul li a img:hover, + .section_ayd_main .section_w3c_gun .section_w3c_xian ul li a img:hover, + .section_dnsm_main .section_ac_gun .section_ac_xian ul li a img:hover, + .section_dnsm_main .section_ac_gun .section_ayd_xian ul li a img:hover, + .section_dnsm_main .section_ac_gun .section_dnsm_xian ul li a img:hover, + .section_dnsm_main .section_ac_gun .section_w3c_xian ul li a img:hover, + .section_dnsm_main .section_ayd_gun .section_ac_xian ul li a img:hover, + .section_dnsm_main .section_ayd_gun .section_ayd_xian ul li a img:hover, + .section_dnsm_main .section_ayd_gun .section_dnsm_xian ul li a img:hover, + .section_dnsm_main .section_ayd_gun .section_w3c_xian ul li a img:hover, + .section_dnsm_main .section_dnsm_gun .section_ac_xian ul li a img:hover, + .section_dnsm_main .section_dnsm_gun .section_ayd_xian ul li a img:hover, + .section_dnsm_main .section_dnsm_gun .section_dnsm_xian ul li a img:hover, + .section_dnsm_main .section_dnsm_gun .section_w3c_xian ul li a img:hover, + .section_dnsm_main .section_w3c_gun .section_ac_xian ul li a img:hover, + .section_dnsm_main .section_w3c_gun .section_ayd_xian ul li a img:hover, + .section_dnsm_main .section_w3c_gun .section_dnsm_xian ul li a img:hover, + .section_dnsm_main .section_w3c_gun .section_w3c_xian ul li a img:hover, + .section_w3c_main .section_ac_gun .section_ac_xian ul li a img:hover, + .section_w3c_main .section_ac_gun .section_ayd_xian ul li a img:hover, + .section_w3c_main .section_ac_gun .section_dnsm_xian ul li a img:hover, + .section_w3c_main .section_ac_gun .section_w3c_xian ul li a img:hover, + .section_w3c_main .section_ayd_gun .section_ac_xian ul li a img:hover, + .section_w3c_main .section_ayd_gun .section_ayd_xian ul li a img:hover, + .section_w3c_main .section_ayd_gun .section_dnsm_xian ul li a img:hover, + .section_w3c_main .section_ayd_gun .section_w3c_xian ul li a img:hover, + .section_w3c_main .section_dnsm_gun .section_ac_xian ul li a img:hover, + .section_w3c_main .section_dnsm_gun .section_ayd_xian ul li a img:hover, + .section_w3c_main .section_dnsm_gun .section_dnsm_xian ul li a img:hover, + .section_w3c_main .section_dnsm_gun .section_w3c_xian ul li a img:hover, + .section_w3c_main .section_w3c_gun .section_ac_xian ul li a img:hover, + .section_w3c_main .section_w3c_gun .section_ayd_xian ul li a img:hover, + .section_w3c_main .section_w3c_gun .section_dnsm_xian ul li a img:hover, + .section_w3c_main .section_w3c_gun .section_w3c_xian ul li a img:hover { + opacity: 0.8; } + +.section_w3cayd { + overflow: hidden; + width: 1190px; + margin: 0 auto 30px; } + .section_w3cayd .section_ayd, + .section_w3cayd .section_w3c { + width: 590px; + float: left; + margin-right: 10px; } + .section_w3cayd .section_ayd .section_ayd_top, + .section_w3cayd .section_ayd .section_w3c_top, + .section_w3cayd .section_w3c .section_ayd_top, + .section_w3cayd .section_w3c .section_w3c_top { + width: 590px; + margin: 0; } + .section_w3cayd .section_ayd .section_ayd_main, + .section_w3cayd .section_ayd .section_w3c_main, + .section_w3cayd .section_w3c .section_ayd_main, + .section_w3cayd .section_w3c .section_w3c_main { + width: 590px; + margin: 0 10px 0 0; } + .section_w3cayd .section_ayd .section_ayd_main .section_ayd_gun .section_ayd_xian, + .section_w3cayd .section_ayd .section_ayd_main .section_ayd_gun .section_w3c_xian, + .section_w3cayd .section_ayd .section_ayd_main .section_w3c_gun .section_ayd_xian, + .section_w3cayd .section_ayd .section_ayd_main .section_w3c_gun .section_w3c_xian, + .section_w3cayd .section_ayd .section_w3c_main .section_ayd_gun .section_ayd_xian, + .section_w3cayd .section_ayd .section_w3c_main .section_ayd_gun .section_w3c_xian, + .section_w3cayd .section_ayd .section_w3c_main .section_w3c_gun .section_ayd_xian, + .section_w3cayd .section_ayd .section_w3c_main .section_w3c_gun .section_w3c_xian, + .section_w3cayd .section_w3c .section_ayd_main .section_ayd_gun .section_ayd_xian, + .section_w3cayd .section_w3c .section_ayd_main .section_ayd_gun .section_w3c_xian, + .section_w3cayd .section_w3c .section_ayd_main .section_w3c_gun .section_ayd_xian, + .section_w3cayd .section_w3c .section_ayd_main .section_w3c_gun .section_w3c_xian, + .section_w3cayd .section_w3c .section_w3c_main .section_ayd_gun .section_ayd_xian, + .section_w3cayd .section_w3c .section_w3c_main .section_ayd_gun .section_w3c_xian, + .section_w3cayd .section_w3c .section_w3c_main .section_w3c_gun .section_ayd_xian, + .section_w3cayd .section_w3c .section_w3c_main .section_w3c_gun .section_w3c_xian { + width: 570px; } + .section_w3cayd .section_ayd .section_ayd_main .section_ayd_gun .section_ayd_xian ul, + .section_w3cayd .section_ayd .section_ayd_main .section_ayd_gun .section_w3c_xian ul, + .section_w3cayd .section_ayd .section_ayd_main .section_w3c_gun .section_ayd_xian ul, + .section_w3cayd .section_ayd .section_ayd_main .section_w3c_gun .section_w3c_xian ul, + .section_w3cayd .section_ayd .section_w3c_main .section_ayd_gun .section_ayd_xian ul, + .section_w3cayd .section_ayd .section_w3c_main .section_ayd_gun .section_w3c_xian ul, + .section_w3cayd .section_ayd .section_w3c_main .section_w3c_gun .section_ayd_xian ul, + .section_w3cayd .section_ayd .section_w3c_main .section_w3c_gun .section_w3c_xian ul, + .section_w3cayd .section_w3c .section_ayd_main .section_ayd_gun .section_ayd_xian ul, + .section_w3cayd .section_w3c .section_ayd_main .section_ayd_gun .section_w3c_xian ul, + .section_w3cayd .section_w3c .section_ayd_main .section_w3c_gun .section_ayd_xian ul, + .section_w3cayd .section_w3c .section_ayd_main .section_w3c_gun .section_w3c_xian ul, + .section_w3cayd .section_w3c .section_w3c_main .section_ayd_gun .section_ayd_xian ul, + .section_w3cayd .section_w3c .section_w3c_main .section_ayd_gun .section_w3c_xian ul, + .section_w3cayd .section_w3c .section_w3c_main .section_w3c_gun .section_ayd_xian ul, + .section_w3cayd .section_w3c .section_w3c_main .section_w3c_gun .section_w3c_xian ul { + position: absolute; + width: 2280px; + left: -1140px; + top: 0; } + .section_w3cayd .section_ayd { + margin: 0; } + +.section_w3c_top { + background: #34A5A3; } + .section_w3c_top .section_w3c_ding { + border: 1px solid #34A5A3; } + .section_w3c_top .section_w3c_ding p { + color: #34A5A3; } + .section_w3c_top .section_w3c_list { + width: 316px; } + .section_w3c_top .section_w3c_list li { + background: #59B5B3; + border: 1px solid #6FCFCE; } + +.section_ayd_txt p:first-child, +.section_w3c_txt p:first-child { + color: #34A5A3; } + +.section_ayd_top { + background: #518A79; } + .section_ayd_top .section_ayd_ding { + border: 1px solid #518A79; } + .section_ayd_top .section_ayd_ding p { + color: #518A79; } + .section_ayd_top .section_ayd_list { + width: 364px; } + .section_ayd_top .section_ayd_list li { + background: #719F91; + border: 1px solid #79AA9E; } + +.section_ayd_txt p:first-child, +.section_w3c_txt p:first-child { + color: #518A79; } + +.section_myj_header { + width: 1190px; + height: 520px; + margin: 0 auto; } + .section_myj_header .section_myj_header_left { + float: left; + width: 590px; + overflow: hidden; } + .section_myj_header .section_myj_header_left .aibaobao .aibaobao_header { + height: 26px; + padding: 16px 20px 16px 25px; + background-color: #e16c46; } + .section_myj_header .section_myj_header_left .aibaobao .aibaobao_header .h3 { + float: left; + font-size: 22px; + color: #fff; + height: 26px; + line-height: 26px; + max-width: 100px; + font-weight: 400; + font-family: fzzhengheis-el-gbregular; + word-wrap: break-word; + word-break: break-all; + white-space: nowrap; + text-overflow: ellipsis; } + .section_myj_header .section_myj_header_left .aibaobao .aibaobao_header .ewma { + float: left; + position: relative; + height: 32px; + z-index: 10; + margin-left: 15px; + padding-top: 3px; } + .section_myj_header .section_myj_header_left .aibaobao .aibaobao_header .ewma .ewma_img { + width: 20px; + height: 20px; + background-image: url("../img/pt_qrcode@1x.png"); + cursor: pointer; } + .section_myj_header .section_myj_header_left .aibaobao .ul { + float: right; + max-width: 440px; + height: 28px; + text-align: right; + overflow: hidden; } + .section_myj_header .section_myj_header_left .aibaobao .ul a { + background-color: rgba(255, 255, 255, 0.2); + display: inline-block; + height: 24px; + color: #fff; + line-height: 24px; + padding: 0 10px; + font-size: 5px; + border: 1px solid #d0caca; + margin-left: 5px; + margin-bottom: 10px; + max-width: 100px; + overflow: hidden; + word-wrap: break-word; + word-break: break-all; + white-space: nowrap; + text-overflow: ellipsis; } + .section_myj_header .section_myj_header_left .aibaobao .ul a:hover { + color: #fff !important; + border-color: #fff !important; + border: 1px solid #fff; + cursor: pointer; } + .section_myj_header .section_myj_header_left .aibaobao_section { + padding: 10px; + background-color: #fff; + overflow: hidden; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_left { + cursor: pointer; + position: relative; + float: left; + width: 183px; + height: 260px; + overflow: hidden; + margin-right: 10px; + background-color: #f7f7f7; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_left .left_a { + background: #666; + position: relative; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_left .left_a .img { + display: block; + width: 193px; + height: 260px; + position: absolute; + transition: transform 0.5s; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_left .left_a .img:hover { + transform: translateX(-10px); + transition: transform 0.5s, -webkit-transform 0.5s, -moz-transform 0.5s; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth { + float: left; + width: 377px; + height: 261px; + position: relative; + overflow: hidden; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth .a2 { + border-right: 1px solid #ccc; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth .rigth_a1 { + position: relative; + float: left; + width: 188px; + height: 130px; + border-bottom: 1px solid #ccc; + cursor: pointer; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth .rigth_a1 .rigth_zi { + position: absolute; + top: 25px; + left: 25px; + font-size: 14px; + color: #E16C46; + max-width: 130px; + overflow: hidden; + word-wrap: break-word; + word-break: break-all; + white-space: nowrap; + text-overflow: ellipsis; + z-index: 1; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth .rigth_a1 .rigth_ti { + position: absolute; + top: 50px; + left: 25px; + font-size: 12px; + color: #666; + max-width: 50px; + z-index: 1; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth .rigth_a1 .rigth_img { + position: absolute; + bottom: 10px; + right: 5px; + display: block; + width: 100px; + height: 100px; + background-color: #f7f7f7; + transition: transform 0.5s; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_section_rigth .rigth_a1 .rigth_img:hover { + transform: translateX(-5px); + transition: transform 0.5s, -webkit-transform 0.5s, -moz-transform 0.5s; } + .section_myj_header .section_myj_header_left .aibaobao_section .section_more { + clear: both; + height: 130px; + overflow: hidden; + padding-top: 10px; } + .section_myj_header .section_myj_header_left .aibaobao_section .section_more .more_a { + float: left; + width: 183px; + height: 130px; + overflow: hidden; + margin-right: 7px; + background-color: #f7f7f7; } + .section_myj_header .section_myj_header_left .aibaobao_section .section_more .more_a .more_img { + display: block; + overflow: hidden; + width: 193px; + height: 130px; + cursor: pointer; + transition: transform 0.5s; } + .section_myj_header .section_myj_header_left .aibaobao_section .section_more .more_a .more_img:hover { + transform: translateX(-10px); + transition: transform 0.5s, -webkit-transform 0.5s, -moz-transform 0.5s; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt { + padding: 10px 0 0; + clear: both; + background-color: #fff; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .pt_loge { + width: 100%; + height: 35px; + overflow: hidden; + position: relative; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .pt_loge ul { + width: 2280px; + transform: translsateX(-570px); + transition-property: transform; + transition-duration: 0.6s; + position: absolute; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .pt_loge ul li { + float: left; + border-right: 1px solid #dedfe0; + padding: 0 12px; + height: 20px; + margin-top: 7px; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .pt_loge ul li a img { + display: block; + width: 70px; + height: 35px; + margin-top: -7px; + cursor: pointer; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .jiant { + position: relative; + display: none; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .jiant .left { + position: absolute; + top: 0; + left: 0; + height: 35px; + line-height: 35px; + color: #736b6f; + font-weight: 700; + background: #fff; + z-index: 2; + cursor: pointer; } + .section_myj_header .section_myj_header_left .aibaobao_section .aibaobao_pt .jiant .ringth { + position: absolute; + top: 0; + right: 0; + height: 35px; + line-height: 35px; + color: #736b6f; + font-weight: 700; + background: #fff; + z-index: 2; + cursor: pointer; } + .section_myj_header .rigth { + float: right; } + +.section_gts { + background: #F6F6F6; + width: 100%; + box-sizing: border-box; + margin: 0 auto; } + .section_gts * { + box-sizing: border-box; } + .section_gts .gts { + width: 1190px; + height: 100px; + margin: 0 auto; + text-align: center; + border: 1px solid #F6F6F6; + background: url("../img/xiazai1.png") repeat-x 0 center; } + .section_gts .gts span { + width: 178px; + height: 500px; + display: block; + margin: 30px auto; + background: #F6F6F6; + font-size: 25px; } + .section_gts ul { + overflow: hidden; + width: 1190px; + margin: 0 auto; } + .section_gts ul li { + width: 140px; + height: 190px; + float: left; + position: relative; + margin-right: 10px; + cursor: pointer; } + .section_gts ul li div { + width: 140px; + height: 80px; + position: absolute; + bottom: 0; + padding-top: 15px; } + .section_gts ul li div p { + text-align: center; + color: white; } + .section_gts ul li div p:first-child { + font-size: 20px; + margin-bottom: 5px; } + .section_gts ul li div p:last-child { + font-size: 12px; + font-weight: bold; } + .section_gts ul li:first-child { + background: url("../img/gts (8).png") no-repeat 0 0; } + .section_gts ul li:first-child div { + background: #997763; } + .section_gts ul li:nth-child(2) { + background: url("../img/gts (2).png") no-repeat 0 0; } + .section_gts ul li:nth-child(2) div { + background: #876D8E; } + .section_gts ul li:nth-child(3) { + background: url("../img/gts (6).png") no-repeat 0 0; } + .section_gts ul li:nth-child(3) div { + background: rgba(210, 78, 79, 0.8); } + .section_gts ul li:nth-child(4) { + background: url("../img/gts (3).png") no-repeat 0 0; } + .section_gts ul li:nth-child(4) div { + background: #DE745C; } + .section_gts ul li:nth-child(5) { + background: url("../img/gts (4).png") no-repeat 0 0; } + .section_gts ul li:nth-child(5) div { + background: #6C9BBD; } + .section_gts ul li:nth-child(6) { + background: url("../img/gts (1).png") no-repeat 0 0; } + .section_gts ul li:nth-child(6) div { + background: #D8C22F; } + .section_gts ul li:nth-child(7) { + background: url("../img/gts (7).png") no-repeat 0 0; } + .section_gts ul li:nth-child(7) div { + background: rgba(186, 102, 147, 0.9); } + .section_gts ul li:nth-child(8) { + margin-right: 0; + background: url("../img/gts (5).png") no-repeat 0 0; } + .section_gts ul li:nth-child(8) div { + background: #4BB482; } + +.section_gts_ol { + width: 100%; + height: 100px; + background: #E0E0E0; + margin-top: 30px; + position: relative; } + .section_gts_ol ol { + width: 1190px; + overflow: hidden; + margin: 0 auto; } + .section_gts_ol li { + width: 396px; + height: 100px; + float: left; + cursor: pointer; } + +.section_hmgg { + background: #F6F6F6; + width: 100%; + padding-bottom: 30px; + box-sizing: border-box; } + .section_hmgg * { + box-sizing: border-box; } + .section_hmgg .hmgg { + width: 1190px; + height: 100px; + margin: 0 auto; + text-align: center; + border: 1px solid #F6F6F6; + background: url("../img/xiazai1.png") repeat-x 0 center; } + .section_hmgg .hmgg span { + width: 178px; + height: 50px; + display: block; + margin: 30px auto; + background: #F6F6F6; + font-size: 25px; } + .section_hmgg ul { + overflow: hidden; + width: 1190px; + margin: 0 auto; } + .section_hmgg ul li { + width: 228px; + height: 315px; + background: white; + border: 1px solid white; + float: left; + margin-right: 10px; + margin-bottom: 10px; + padding: 5px; + cursor: pointer; } + .section_hmgg ul li p { + height: 36px; + font-size: 12px; + padding: 0 5px; + color: #666666; } + .section_hmgg ul li p:last-child { + height: 30px; + line-height: 30px; + color: red; } + .section_hmgg ul li img { + width: 100%; } + +.footer { + width: 100%; + background: #EAEAEA; + padding: 0 79.5px; + box-sizing: border-box; } + .footer * { + box-sizing: border-box; } + .footer .footer_top { + width: 1190px; + height: 103px; + border-bottom: 1px solid #DEDEDE; + padding-top: 32px; } + .footer .footer_top ul li { + width: 297px; + height: 42px; + float: left; + padding: 0 30px; } + .footer .footer_top ul li span { + width: 42px; + height: 42px; + display: block; + float: left; } + .footer .footer_top ul li h3 { + float: left; + height: 42px; + line-height: 42px; + color: #444444; } + .footer .footer_top ul li:first-child span { + background: url("../img/foot (2).png") no-repeat 0 0; } + .footer .footer_top ul li:nth-child(2) span { + background: url("../img/foot (2).png") no-repeat 0 -43px; } + .footer .footer_top ul li:nth-child(3) span { + background: url("../img/foot (2).png") no-repeat 0 -86px; } + .footer .footer_top ul li:nth-child(4) span { + background: url("../img/foot (2).png") no-repeat 0 -129px; } + .footer .footer_center { + height: 200px; + padding-top: 30px; + background: #EAEAEA; + border-bottom: 1px solid #DEDEDE; } + .footer .footer_center ol { + width: 198px; + float: left; } + .footer .footer_center ol li { + font-size: 12px; + line-height: 20px; } + .footer .footer_center ol li a { + text-decoration: none; + color: #727272; } + .footer .footer_center ol li:first-child { + font-weight: bold; + font-size: 14px; + line-height: 30px; + color: #6A7272; } + .footer .footer_center ol:last-child { + width: 200px; + height: 150px; + padding-left: 20px; + background: url("../img/foot (1).png") no-repeat 0 0; } + .footer .footer_center ol:last-child li:first-child { + text-align: center; + margin-bottom: 10px; } + .footer .footer_center ol:last-child li:nth-child(2) { + color: #727272; } + .footer .footer_center ol:last-child li:last-child { + text-align: right; } + .footer .footer_foot { + height: 300px; + background: #EAEAEA; + padding-top: 20px; } + .footer .footer_foot .footer_p { + height: 25px; + padding: 0 50px; } + .footer .footer_foot .footer_p a { + text-decoration: none; + color: #999999; + font-size: 12px; + float: left; + padding: 0 10px; } + .footer .footer_foot .footer_p span { + width: 1px; + height: 15px; + border: 1px solid #D4CDCD; + display: block; + float: left; } + .footer .footer_foot p:first-child a { + color: #666666; } + .footer .footer_foot p:nth-child(2) { + padding: 0 180px; } + .footer .footer_foot p:nth-child(3) { + padding: 0 140px; } + .footer .footer_foot p:nth-child(4) { + padding: 0 310px; } + .footer .footer_foot p:nth-child(5) { + padding: 0 480px; } + .footer .footer_foot ul { + padding: 0 270px; } + .footer .footer_foot ul li { + width: 103px; + height: 37px; + float: left; } + .footer .footer_foot ul li:first-child { + background: url("../img/foot (1).png") no-repeat 0 -145px; } + .footer .footer_foot ul li:nth-child(2) { + background: url("../img/foot (1).png") no-repeat -100px -145px; } + .footer .footer_foot ul li:nth-child(3) { + background: url("../img/foot (1).png") no-repeat 0 -181px; } + .footer .footer_foot ul li:nth-child(4) { + background: url("../img/foot (1).png") no-repeat -100px -181px; } + .footer .footer_foot ul li:nth-child(5) { + background: url("../img/foot (1).png") no-repeat 0 -215px; } + .footer .footer_foot ul li:nth-child(6) { + background: url("../img/foot (1).png") no-repeat -100px -215px; } + +/*# sourceMappingURL=GL.css.map */ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/css/swiper-3.4.2.min.css b/msb-mall/mall-producet/src/main/resources/static/index/css/swiper-3.4.2.min.css new file mode 100644 index 000000000..b222bea4d --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/css/swiper-3.4.2.min.css @@ -0,0 +1,15 @@ +/** + * Swiper 3.4.2 + * Most modern mobile touch slider and framework with hardware accelerated transitions + * + * http://www.idangero.us/swiper/ + * + * Copyright 2017, Vladimir Kharlampidi + * The iDangero.us + * http://www.idangero.us/ + * + * Licensed under MIT + * + * Released on: March 10, 2017 + */ +.swiper-container{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;z-index:1}.swiper-container-no-flexbox .swiper-slide{float:left}.swiper-container-vertical>.swiper-wrapper{-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate(0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.swiper-container-multirow>.swiper-wrapper{-webkit-box-lines:multiple;-moz-box-lines:multiple;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;-moz-transition-timing-function:ease-out;-ms-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-slide{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;width:100%;height:100%;position:relative}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start;-webkit-transition-property:-webkit-transform,height;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform,height}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-wp8-horizontal{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-wp8-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:27px;height:44px;margin-top:-22px;z-index:10;cursor:pointer;-moz-background-size:27px 44px;-webkit-background-size:27px 44px;background-size:27px 44px;background-position:center;background-repeat:no-repeat}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");left:10px;right:auto}.swiper-button-prev.swiper-button-black,.swiper-container-rtl .swiper-button-next.swiper-button-black{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E")}.swiper-button-prev.swiper-button-white,.swiper-container-rtl .swiper-button-next.swiper-button-white{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E")}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");right:10px;left:auto}.swiper-button-next.swiper-button-black,.swiper-container-rtl .swiper-button-prev.swiper-button-black{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E")}.swiper-button-next.swiper-button-white,.swiper-container-rtl .swiper-button-prev.swiper-button-white{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E")}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:.3s;-moz-transition:.3s;-o-transition:.3s;transition:.3s;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-container-horizontal>.swiper-pagination-bullets,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-moz-appearance:none;-ms-appearance:none;-webkit-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-white .swiper-pagination-bullet{background:#fff}.swiper-pagination-bullet-active{opacity:1;background:#007aff}.swiper-pagination-white .swiper-pagination-bullet-active{background:#fff}.swiper-pagination-black .swiper-pagination-bullet-active{background:#000}.swiper-container-vertical>.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-o-transform:translate(0,-50%);-ms-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.swiper-container-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:5px 0;display:block}.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 5px}.swiper-pagination-progress{background:rgba(0,0,0,.25);position:absolute}.swiper-pagination-progress .swiper-pagination-progressbar{background:#007aff;position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left top}.swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar{-webkit-transform-origin:right top;-moz-transform-origin:right top;-ms-transform-origin:right top;-o-transform-origin:right top;transform-origin:right top}.swiper-container-horizontal>.swiper-pagination-progress{width:100%;height:4px;left:0;top:0}.swiper-container-vertical>.swiper-pagination-progress{width:4px;height:100%;left:0;top:0}.swiper-pagination-progress.swiper-pagination-white{background:rgba(255,255,255,.5)}.swiper-pagination-progress.swiper-pagination-white .swiper-pagination-progressbar{background:#fff}.swiper-pagination-progress.swiper-pagination-black .swiper-pagination-progressbar{background:#000}.swiper-container-3d{-webkit-perspective:1200px;-moz-perspective:1200px;-o-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-cube-shadow,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-wrapper{-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear,right top,left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear,left bottom,left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-coverflow .swiper-wrapper,.swiper-container-flip .swiper-wrapper{-ms-perspective:1200px}.swiper-container-cube,.swiper-container-flip{overflow:visible}.swiper-container-cube .swiper-slide,.swiper-container-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-container-cube .swiper-slide .swiper-slide,.swiper-container-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active,.swiper-container-flip .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right,.swiper-container-cube .swiper-slide-shadow-top,.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-right,.swiper-container-flip .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-slide{visibility:hidden;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;width:100%;height:100%}.swiper-container-cube.swiper-container-rtl .swiper-slide{-webkit-transform-origin:100% 0;-moz-transform-origin:100% 0;-ms-transform-origin:100% 0;transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-next+.swiper-slide,.swiper-container-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0;width:100%;height:100%;background:#000;opacity:.6;-webkit-filter:blur(50px);filter:blur(50px);z-index:0}.swiper-container-fade.swiper-container-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;-moz-transition-timing-function:ease-out;-ms-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;-moz-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-zoom-container{width:100%;height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;text-align:center}.swiper-zoom-container>canvas,.swiper-zoom-container>img,.swiper-zoom-container>svg{max-width:100%;max-height:100%;object-fit:contain}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0,0,0,.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0,0,0,.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;-moz-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12,end) infinite;-moz-animation:swiper-preloader-spin 1s steps(12,end) infinite;animation:swiper-preloader-spin 1s steps(12,end) infinite}.swiper-lazy-preloader:after{display:block;content:"";width:100%;height:100%;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");background-position:50%;-webkit-background-size:100%;background-size:100%;background-repeat:no-repeat}.swiper-lazy-preloader-white:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/01.png b/msb-mall/mall-producet/src/main/resources/static/index/img/01.png new file mode 100644 index 000000000..bdedf938e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/01.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/022649c69d4df547861d434b3fba03e1.png b/msb-mall/mall-producet/src/main/resources/static/index/img/022649c69d4df547861d434b3fba03e1.png new file mode 100644 index 000000000..92eee84e6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/022649c69d4df547861d434b3fba03e1.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/1.png b/msb-mall/mall-producet/src/main/resources/static/index/img/1.png new file mode 100644 index 000000000..e95db0cf3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/1.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/55fbb8a6N64863ad3.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/55fbb8a6N64863ad3.jpg!q90.webp new file mode 100644 index 000000000..5aa3a6c89 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/55fbb8a6N64863ad3.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/56fc949bN303e2220.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/56fc949bN303e2220.jpg new file mode 100644 index 000000000..457d11b68 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/56fc949bN303e2220.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/57e8babbNe482d777.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/57e8babbNe482d777.jpg new file mode 100644 index 000000000..0709ca186 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/57e8babbNe482d777.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58004d6dN2927f0f7.png b/msb-mall/mall-producet/src/main/resources/static/index/img/58004d6dN2927f0f7.png new file mode 100644 index 000000000..cd3e930aa Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58004d6dN2927f0f7.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58171918N852b09d5.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/58171918N852b09d5.jpg!q90 new file mode 100644 index 000000000..40d2bfbe3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58171918N852b09d5.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58171aa5N1db78d3a.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58171aa5N1db78d3a.jpg new file mode 100644 index 000000000..85bd745c3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58171aa5N1db78d3a.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58171aaeNa037a265.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58171aaeNa037a265.jpg new file mode 100644 index 000000000..629eac305 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58171aaeNa037a265.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58174114N2c0891f0.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58174114N2c0891f0.jpg new file mode 100644 index 000000000..a32299dac Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58174114N2c0891f0.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5817413fN89413626.png b/msb-mall/mall-producet/src/main/resources/static/index/img/5817413fN89413626.png new file mode 100644 index 000000000..f2dc637ba Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5817413fN89413626.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58174160N8b476d06.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58174160N8b476d06.jpg new file mode 100644 index 000000000..6200d61a8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58174160N8b476d06.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58174176Na66a232a.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58174176Na66a232a.jpg new file mode 100644 index 000000000..25529bb27 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58174176Na66a232a.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58174253N404b51d3.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58174253N404b51d3.jpg new file mode 100644 index 000000000..99e16141d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58174253N404b51d3.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5819582cN75553c9d.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5819582cN75553c9d.jpg new file mode 100644 index 000000000..6776bdcd4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5819582cN75553c9d.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/582c1b70Nd6eebaf8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/582c1b70Nd6eebaf8.jpg new file mode 100644 index 000000000..d8d45d0d3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/582c1b70Nd6eebaf8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/582c1c53N04808535.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/582c1c53N04808535.jpg new file mode 100644 index 000000000..6e5dfa5c7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/582c1c53N04808535.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58414f7cN08bd0078.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58414f7cN08bd0078.jpg new file mode 100644 index 000000000..cff318a66 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58414f7cN08bd0078.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/584d546eN0d0ae158.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/584d546eN0d0ae158.jpg new file mode 100644 index 000000000..49a2d42ec Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/584d546eN0d0ae158.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/584d54ebN3849b669.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/584d54ebN3849b669.jpg new file mode 100644 index 000000000..d080184ca Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/584d54ebN3849b669.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5852299fN1840f35a.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5852299fN1840f35a.jpg!q90 new file mode 100644 index 000000000..1e92d8e27 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5852299fN1840f35a.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/585229bdNc20796ec.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/585229bdNc20796ec.jpg new file mode 100644 index 000000000..1e92d8e27 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/585229bdNc20796ec.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/585229bdNc20796ec.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/585229bdNc20796ec.jpg!q90 new file mode 100644 index 000000000..1e92d8e27 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/585229bdNc20796ec.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58522b1bN916da74b.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/58522b1bN916da74b.jpg!q90 new file mode 100644 index 000000000..af3ea9565 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58522b1bN916da74b.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58522b9dNf06d6f3d.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/58522b9dNf06d6f3d.jpg!q90 new file mode 100644 index 000000000..9e606f1d1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58522b9dNf06d6f3d.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/585265d0Ndd205e6e.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/585265d0Ndd205e6e.jpg new file mode 100644 index 000000000..56cea40fb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/585265d0Ndd205e6e.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/586dca91N13e0dbd9.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/586dca91N13e0dbd9.jpg new file mode 100644 index 000000000..e9c64edc2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/586dca91N13e0dbd9.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/586dcbf6Neaed8efb.png b/msb-mall/mall-producet/src/main/resources/static/index/img/586dcbf6Neaed8efb.png new file mode 100644 index 000000000..a05fb93b9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/586dcbf6Neaed8efb.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58be62b1N126a1f9f.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/58be62b1N126a1f9f.jpg!q90.webp new file mode 100644 index 000000000..99cf45c14 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58be62b1N126a1f9f.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58d87003Nd0adfd9c.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58d87003Nd0adfd9c.jpg new file mode 100644 index 000000000..2147f641f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58d87003Nd0adfd9c.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58de4423Ndcb46a1c.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58de4423Ndcb46a1c.jpg new file mode 100644 index 000000000..15892d210 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58de4423Ndcb46a1c.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58f6c652N9c0d4316.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58f6c652N9c0d4316.jpg new file mode 100644 index 000000000..5599284d9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58f6c652N9c0d4316.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/58ffffd8N892ce4a8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/58ffffd8N892ce4a8.jpg new file mode 100644 index 000000000..97410ead7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/58ffffd8N892ce4a8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59060d71N4d1a4658.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59060d71N4d1a4658.jpg new file mode 100644 index 000000000..48964f5c9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59060d71N4d1a4658.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe1cN166d2c52.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe1cN166d2c52.jpg!q90.webp.jpg new file mode 100644 index 000000000..1b9ee7cde Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe1cN166d2c52.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe24Nb8baeb70.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe24Nb8baeb70.jpg!q90.webp.jpg new file mode 100644 index 000000000..a087c1dab Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe24Nb8baeb70.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe2bN324c4010.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe2bN324c4010.jpg!q90.webp.jpg new file mode 100644 index 000000000..dc8118240 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/591ebe2bN324c4010.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5923f3b6N8690b3e7.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5923f3b6N8690b3e7.jpg!q90.webp new file mode 100644 index 000000000..5da518d75 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5923f3b6N8690b3e7.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59251deeN5daf7ec3.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/59251deeN5daf7ec3.jpg!q90 new file mode 100644 index 000000000..44c530d2f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59251deeN5daf7ec3.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5927ee7aN89f48ffd.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5927ee7aN89f48ffd.jpg new file mode 100644 index 000000000..d877ef55d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5927ee7aN89f48ffd.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5927ef42Nc91cffc7.jpg!cc_200x140 b/msb-mall/mall-producet/src/main/resources/static/index/img/5927ef42Nc91cffc7.jpg!cc_200x140 new file mode 100644 index 000000000..048376fa7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5927ef42Nc91cffc7.jpg!cc_200x140 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5928f908N45ec28e3.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5928f908N45ec28e3.jpg!q90.webp new file mode 100644 index 000000000..7cac60dc0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5928f908N45ec28e3.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/592935aaNf9c009fe.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/592935aaNf9c009fe.jpg!q90.webp new file mode 100644 index 000000000..da00299f5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/592935aaNf9c009fe.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/592e3193Nd62486d2.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/592e3193Nd62486d2.jpg!q90.webp new file mode 100644 index 000000000..daea60ec9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/592e3193Nd62486d2.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/592f6f19N8de94497.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/592f6f19N8de94497.jpg new file mode 100644 index 000000000..455987704 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/592f6f19N8de94497.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/592f74e2N139a9e22.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/592f74e2N139a9e22.jpg new file mode 100644 index 000000000..99076b302 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/592f74e2N139a9e22.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/592fb61bNa308c08f.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/592fb61bNa308c08f.jpg new file mode 100644 index 000000000..2e86b4f56 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/592fb61bNa308c08f.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/593ff4a3Nde9d79b0.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/593ff4a3Nde9d79b0.jpg new file mode 100644 index 000000000..efda93db3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/593ff4a3Nde9d79b0.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5941f7ddNc733d12f.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5941f7ddNc733d12f.jpg!q90.webp.jpg new file mode 100644 index 000000000..cb0bc8b1f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5941f7ddNc733d12f.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59437174N541210b1.jpg!q90 (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59437174N541210b1.jpg!q90 (1).webp new file mode 100644 index 000000000..02257847f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59437174N541210b1.jpg!q90 (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59437174N541210b1.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59437174N541210b1.jpg!q90.webp new file mode 100644 index 000000000..02257847f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59437174N541210b1.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5943d16aNa2b79d40.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5943d16aNa2b79d40.jpg!q90.webp.jpg new file mode 100644 index 000000000..e0deec949 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5943d16aNa2b79d40.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/594737f8Na6453e6e.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/594737f8Na6453e6e.jpg!q90.webp new file mode 100644 index 000000000..4ce7ae27a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/594737f8Na6453e6e.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5948b387N1e3bff83.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5948b387N1e3bff83.jpg!q90 new file mode 100644 index 000000000..6fc518d0c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5948b387N1e3bff83.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5948bb23N6da9eb71.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5948bb23N6da9eb71.jpg!q90 new file mode 100644 index 000000000..67b53785d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5948bb23N6da9eb71.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5949230eNc2fb7b61.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5949230eNc2fb7b61.jpg new file mode 100644 index 000000000..d760af1c8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5949230eNc2fb7b61.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5950ca4bN6ab3d2f8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5950ca4bN6ab3d2f8.jpg!q90 new file mode 100644 index 000000000..ab3fc3cf8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5950ca4bN6ab3d2f8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5950ca84N9509b283.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5950ca84N9509b283.jpg!q90 new file mode 100644 index 000000000..8410e4926 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5950ca84N9509b283.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5950cb54N467732a3.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5950cb54N467732a3.jpg!q90 new file mode 100644 index 000000000..5de1f8121 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5950cb54N467732a3.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5952193bN4b514c65.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5952193bN4b514c65.jpg new file mode 100644 index 000000000..f7b432f82 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5952193bN4b514c65.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5953202dN0dc196bf.jpg!q90.webp (1).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5953202dN0dc196bf.jpg!q90.webp (1).jpg new file mode 100644 index 000000000..cf216e03e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5953202dN0dc196bf.jpg!q90.webp (1).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5953202dN0dc196bf.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5953202dN0dc196bf.jpg!q90.webp.jpg new file mode 100644 index 000000000..cf216e03e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5953202dN0dc196bf.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/595493f7Nacab54de.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/595493f7Nacab54de.jpg!q90 new file mode 100644 index 000000000..551915e5b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/595493f7Nacab54de.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/595b0181N2a89a23d.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/595b0181N2a89a23d.jpg!q90.webp.jpg new file mode 100644 index 000000000..0fa7ec47e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/595b0181N2a89a23d.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5965c3ceN748ecfa7.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5965c3ceN748ecfa7.jpg new file mode 100644 index 000000000..d8e6cb83a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5965c3ceN748ecfa7.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59683495N4b2c0bee.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59683495N4b2c0bee.jpg new file mode 100644 index 000000000..49f9968db Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59683495N4b2c0bee.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/597944aeNd644dbd8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/597944aeNd644dbd8.jpg!q90 new file mode 100644 index 000000000..2ea474621 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/597944aeNd644dbd8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59805e0aNdbba0e5f.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59805e0aNdbba0e5f.jpg new file mode 100644 index 000000000..d1d96c25c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59805e0aNdbba0e5f.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59812ef4N34736f09.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59812ef4N34736f09.jpg new file mode 100644 index 000000000..ef96c5cbd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59812ef4N34736f09.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/598182d7Ne0cdb795.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/598182d7Ne0cdb795.jpg new file mode 100644 index 000000000..a3b9f6f25 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/598182d7Ne0cdb795.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/598ab6bfNf3d43817.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/598ab6bfNf3d43817.jpg new file mode 100644 index 000000000..424f21144 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/598ab6bfNf3d43817.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59a38d6eNe9adf934.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59a38d6eNe9adf934.jpg new file mode 100644 index 000000000..5b6b91b22 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59a38d6eNe9adf934.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59a51cafn0fec6121.png b/msb-mall/mall-producet/src/main/resources/static/index/img/59a51cafn0fec6121.png new file mode 100644 index 000000000..f1417a563 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59a51cafn0fec6121.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59ad341eN5a961eb2.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59ad341eN5a961eb2.jpg new file mode 100644 index 000000000..c5ae2b9f6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59ad341eN5a961eb2.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59b10968N0380c428.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59b10968N0380c428.jpg new file mode 100644 index 000000000..3ff255e13 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59b10968N0380c428.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59b26e7dN59707ce1.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/59b26e7dN59707ce1.jpg!q90 new file mode 100644 index 000000000..512119822 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59b26e7dN59707ce1.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59b6237aN5062a809.png!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59b6237aN5062a809.png!q90.webp.jpg new file mode 100644 index 000000000..3b1d13049 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59b6237aN5062a809.png!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59b6238cNbe9094c3.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59b6238cNbe9094c3.jpg!q90.webp.jpg new file mode 100644 index 000000000..f5b62b7dc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59b6238cNbe9094c3.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c1c15dNff3351e4.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/59c1c15dNff3351e4.jpg!q90 new file mode 100644 index 000000000..6bdb79756 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c1c15dNff3351e4.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c38e02N4512c64f.jpg!q90 (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59c38e02N4512c64f.jpg!q90 (1).webp new file mode 100644 index 000000000..56a8c8b95 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c38e02N4512c64f.jpg!q90 (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c38e02N4512c64f.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59c38e02N4512c64f.jpg!q90.webp new file mode 100644 index 000000000..56a8c8b95 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c38e02N4512c64f.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c4c8d8Ndb34ffd7.png!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59c4c8d8Ndb34ffd7.png!q90.webp.jpg new file mode 100644 index 000000000..ad4f5b069 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c4c8d8Ndb34ffd7.png!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c86372Neaaa522e.jpg!q90 (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59c86372Neaaa522e.jpg!q90 (1).webp new file mode 100644 index 000000000..5d3b40cc2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c86372Neaaa522e.jpg!q90 (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c86372Neaaa522e.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59c86372Neaaa522e.jpg!q90.webp new file mode 100644 index 000000000..5d3b40cc2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c86372Neaaa522e.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c869daN3b6aa827.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59c869daN3b6aa827.jpg new file mode 100644 index 000000000..b16e18db7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c869daN3b6aa827.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59c8be04Nbfb1adca.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59c8be04Nbfb1adca.jpg new file mode 100644 index 000000000..3c711be3d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59c8be04Nbfb1adca.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59dae84fN35ff9333.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59dae84fN35ff9333.jpg new file mode 100644 index 000000000..7c60c9aea Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59dae84fN35ff9333.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59dc9ab5N372deac1.png!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59dc9ab5N372deac1.png!q90.webp new file mode 100644 index 000000000..f6a86a76e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59dc9ab5N372deac1.png!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59dd8e33Nd0cb79df.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59dd8e33Nd0cb79df.jpg new file mode 100644 index 000000000..7e55895f9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59dd8e33Nd0cb79df.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59e56045N56ae92f1.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/59e56045N56ae92f1.jpg!q90 new file mode 100644 index 000000000..f2f914b41 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59e56045N56ae92f1.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59e5deffN82945fbf.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59e5deffN82945fbf.jpg new file mode 100644 index 000000000..a10867d20 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59e5deffN82945fbf.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59e96ce3N82a11ae2.png b/msb-mall/mall-producet/src/main/resources/static/index/img/59e96ce3N82a11ae2.png new file mode 100644 index 000000000..f0cc78af9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59e96ce3N82a11ae2.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59eab346N8cd17560.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59eab346N8cd17560.jpg new file mode 100644 index 000000000..249b6b9d8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59eab346N8cd17560.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59ed51ddN8eefe457.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/59ed51ddN8eefe457.jpg!q90 new file mode 100644 index 000000000..ed2375f0a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59ed51ddN8eefe457.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59f00874N1918c111.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59f00874N1918c111.jpg!q90.webp new file mode 100644 index 000000000..753e14353 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59f00874N1918c111.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59f814e7N34bad14a.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/59f814e7N34bad14a.jpg new file mode 100644 index 000000000..824f2b9db Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59f814e7N34bad14a.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/59fabed5N20e06cc3.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/59fabed5N20e06cc3.jpg!q90.webp new file mode 100644 index 000000000..a0d29a256 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/59fabed5N20e06cc3.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a017f04Ndbaecd9a.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a017f04Ndbaecd9a.jpg!q90.webp new file mode 100644 index 000000000..0e6d7d339 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a017f04Ndbaecd9a.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a017ffeN09d1ecc5.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a017ffeN09d1ecc5.jpg!q90.webp.jpg new file mode 100644 index 000000000..de50ba185 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a017ffeN09d1ecc5.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a01802bN92b4d865.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a01802bN92b4d865.jpg!q90.webp.jpg new file mode 100644 index 000000000..45b8a6eab Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a01802bN92b4d865.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a01805dN0bfd57b9.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a01805dN0bfd57b9.jpg!q90.webp.jpg new file mode 100644 index 000000000..656aa6f4e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a01805dN0bfd57b9.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a018083N3c20d3ba.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a018083N3c20d3ba.jpg!q90.webp.jpg new file mode 100644 index 000000000..8b287c02b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a018083N3c20d3ba.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a02d06cN1e37012f.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a02d06cN1e37012f.jpg!q90 new file mode 100644 index 000000000..ec6fe5880 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a02d06cN1e37012f.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0459f0N4fa7eca0.png!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0459f0N4fa7eca0.png!q90.webp new file mode 100644 index 000000000..30754c833 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0459f0N4fa7eca0.png!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a050212N96e12563.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a050212N96e12563.jpg new file mode 100644 index 000000000..b9c7bfe96 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a050212N96e12563.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0502a0Nf18e2c44.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0502a0Nf18e2c44.jpg!q90 new file mode 100644 index 000000000..6a16fb7b7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0502a0Nf18e2c44.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a06b7b4Nc879eca0.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a06b7b4Nc879eca0.jpg new file mode 100644 index 000000000..ea42fd3d1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a06b7b4Nc879eca0.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a07d37cN7b4b1828.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a07d37cN7b4b1828.jpg!q90.webp new file mode 100644 index 000000000..d738af650 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a07d37cN7b4b1828.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a086aadNdd4a2d3d.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a086aadNdd4a2d3d.jpg!q90 new file mode 100644 index 000000000..d5dfd36a8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a086aadNdd4a2d3d.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a086b2cN0353b2df.png!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a086b2cN0353b2df.png!q90 new file mode 100644 index 000000000..a90ded5a7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a086b2cN0353b2df.png!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a095387N0626036b.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a095387N0626036b.jpg!q90 new file mode 100644 index 000000000..7017126d9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a095387N0626036b.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a096cefN2295f4c5.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a096cefN2295f4c5.jpg new file mode 100644 index 000000000..67260d23b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a096cefN2295f4c5.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a097363Nf5fb64a6.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a097363Nf5fb64a6.jpg!q90 new file mode 100644 index 000000000..5f5ed0c7b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a097363Nf5fb64a6.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bae3dNd70d9115.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bae3dNd70d9115.jpg!q90 new file mode 100644 index 000000000..fb666743c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bae3dNd70d9115.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb299N382e74a9.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb299N382e74a9.jpg!q90.webp.jpg new file mode 100644 index 000000000..7559a1ebb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb299N382e74a9.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb29bN598fefa4.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb29bN598fefa4.jpg!q90.webp.jpg new file mode 100644 index 000000000..2ff5bad5e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb29bN598fefa4.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb2b1N68588d19.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb2b1N68588d19.jpg!q90.webp.jpg new file mode 100644 index 000000000..e27e5ba17 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb2b1N68588d19.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb2bcNc59b9ab7.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb2bcNc59b9ab7.jpg!q90.webp.jpg new file mode 100644 index 000000000..e83f12cea Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0bb2bcNc59b9ab7.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0be3d7N53b2eb31.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0be3d7N53b2eb31.jpg new file mode 100644 index 000000000..a70108e3e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0be3d7N53b2eb31.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0be40eN50f580c1.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0be40eN50f580c1.jpg new file mode 100644 index 000000000..469d05cbb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0be40eN50f580c1.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0c0f0aN31dfa288.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0c0f0aN31dfa288.jpg new file mode 100644 index 000000000..2974d9f41 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0c0f0aN31dfa288.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0ce692N1a6c1453.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0ce692N1a6c1453.jpg!q90 new file mode 100644 index 000000000..3b9f1badd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0ce692N1a6c1453.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0ced0cN5bb4e9aa.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0ced0cN5bb4e9aa.jpg new file mode 100644 index 000000000..087ef4de2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0ced0cN5bb4e9aa.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cee74N9801714c (1).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cee74N9801714c (1).jpg new file mode 100644 index 000000000..1da3a3e99 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cee74N9801714c (1).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cee74N9801714c.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cee74N9801714c.jpg new file mode 100644 index 000000000..1da3a3e99 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cee74N9801714c.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cf69eN35720550.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cf69eN35720550.jpg!q90 new file mode 100644 index 000000000..c98a7772f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cf69eN35720550.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cfffeNc95c4e70.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cfffeNc95c4e70.jpg!q90.webp.jpg new file mode 100644 index 000000000..ecd6a8301 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0cfffeNc95c4e70.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0d52f6N5bf1da85.png!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0d52f6N5bf1da85.png!q90.webp.jpg new file mode 100644 index 000000000..ddf52f5c3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0d52f6N5bf1da85.png!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e3ab4N84732c2b.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e3ab4N84732c2b.jpg!q90 new file mode 100644 index 000000000..70469fed5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e3ab4N84732c2b.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e3b55Nb7a711ca.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e3b55Nb7a711ca.jpg!q90.webp new file mode 100644 index 000000000..4e3ecac35 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e3b55Nb7a711ca.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e64f0N68973e71.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e64f0N68973e71.jpg!q90 new file mode 100644 index 000000000..13577e9a6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e64f0N68973e71.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e6f98N95468341.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e6f98N95468341.jpg!q90.webp new file mode 100644 index 000000000..404c4a211 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e6f98N95468341.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7859N41cb7d3d.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7859N41cb7d3d.jpg!q90.webp new file mode 100644 index 000000000..4138acd6f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7859N41cb7d3d.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e78afNae89c41c.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e78afNae89c41c.jpg!q90.webp new file mode 100644 index 000000000..4138acd6f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e78afNae89c41c.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e78f1N91fdc907.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e78f1N91fdc907.jpg!q90.webp new file mode 100644 index 000000000..6432c2f42 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e78f1N91fdc907.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7905N75694aea.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7905N75694aea.jpg!q90.webp new file mode 100644 index 000000000..6432c2f42 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7905N75694aea.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7927N92955da4.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7927N92955da4.jpg!q90.webp new file mode 100644 index 000000000..e049ea1b6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e7927N92955da4.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e794cNe723d8ea.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e794cNe723d8ea.jpg!q90.webp new file mode 100644 index 000000000..e049ea1b6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e794cNe723d8ea.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e96deN13f03769.png!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e96deN13f03769.png!q90.webp new file mode 100644 index 000000000..f7bde9fbd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e96deN13f03769.png!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9d5fNe8a30396.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9d5fNe8a30396.jpg!q90.webp new file mode 100644 index 000000000..dc22cd7e2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9d5fNe8a30396.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9d73Nc16f0a0d.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9d73Nc16f0a0d.jpg!q90.webp new file mode 100644 index 000000000..b57f516a5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9d73Nc16f0a0d.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e25N12c45d0d.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e25N12c45d0d.jpg!q90.webp new file mode 100644 index 000000000..2caabf59d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e25N12c45d0d.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e4eN3d592b05.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e4eN3d592b05.jpg!q90 new file mode 100644 index 000000000..1be0e798e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e4eN3d592b05.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e7aNef8577dd.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e7aNef8577dd.jpg!q90.webp new file mode 100644 index 000000000..19811b007 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a0e9e7aNef8577dd.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a102cdcN7e693898.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a102cdcN7e693898.jpg new file mode 100644 index 000000000..a9acfb5fd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a102cdcN7e693898.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a122dc9N5ecac6db.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a122dc9N5ecac6db.jpg!q90.webp new file mode 100644 index 000000000..66794019c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a122dc9N5ecac6db.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a122e02Nff6d7d36 (1).jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a122e02Nff6d7d36 (1).jpg!q90 new file mode 100644 index 000000000..95fa334fc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a122e02Nff6d7d36 (1).jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a122e02Nff6d7d36.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a122e02Nff6d7d36.jpg!q90 new file mode 100644 index 000000000..95fa334fc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a122e02Nff6d7d36.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1233b5Nb10b9cbc (1).jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1233b5Nb10b9cbc (1).jpg!q90 new file mode 100644 index 000000000..2b40efded Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1233b5Nb10b9cbc (1).jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1233b5Nb10b9cbc.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1233b5Nb10b9cbc.jpg!q90 new file mode 100644 index 000000000..2b40efded Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1233b5Nb10b9cbc.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a123702Nd17543ed.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a123702Nd17543ed.jpg!q90 new file mode 100644 index 000000000..9e66c9541 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a123702Nd17543ed.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a124b62Na95768ed.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a124b62Na95768ed.jpg!q90 new file mode 100644 index 000000000..b02ef59f0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a124b62Na95768ed.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1273dbN740798e9.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1273dbN740798e9.jpg!q90 new file mode 100644 index 000000000..4e99d643d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1273dbN740798e9.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1278e8Nb24df2b2.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1278e8Nb24df2b2.jpg!q90.webp new file mode 100644 index 000000000..7085ff4a0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1278e8Nb24df2b2.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1278f7N3e0b48e7.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1278f7N3e0b48e7.jpg!q90.webp new file mode 100644 index 000000000..19f89b024 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1278f7N3e0b48e7.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a12a25fN96769d3c.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a12a25fN96769d3c.jpg!q90 new file mode 100644 index 000000000..6c9d4f8b9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a12a25fN96769d3c.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a137d70N84bdb566.png!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a137d70N84bdb566.png!q90.webp new file mode 100644 index 000000000..751813963 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a137d70N84bdb566.png!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a138438N19d98566.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a138438N19d98566.jpg!q90 new file mode 100644 index 000000000..8eef74b3c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a138438N19d98566.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13bf0bNe1606e58.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13bf0bNe1606e58.jpg new file mode 100644 index 000000000..be5ab2086 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13bf0bNe1606e58.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13bf0bNe1606e58.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13bf0bNe1606e58.jpg!q90 new file mode 100644 index 000000000..be5ab2086 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13bf0bNe1606e58.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13c218N7c86dc71.jpg!cc_200x140 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13c218N7c86dc71.jpg!cc_200x140 new file mode 100644 index 000000000..d15e61b15 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13c218N7c86dc71.jpg!cc_200x140 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13c995N31b5dfd6.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13c995N31b5dfd6.jpg!q90.webp.jpg new file mode 100644 index 000000000..440cff32a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13c995N31b5dfd6.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13cf44N3b96a07f.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13cf44N3b96a07f.jpg!q90.webp new file mode 100644 index 000000000..c82d74df9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13cf44N3b96a07f.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13d2c3Nc1d73d88.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13d2c3Nc1d73d88.jpg new file mode 100644 index 000000000..f328ba9eb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13d2c3Nc1d73d88.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a13f30fN5ed4a260.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13f30fN5ed4a260.jpg!q90 new file mode 100644 index 000000000..752eaf9ca Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a13f30fN5ed4a260.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a14d244N753235ee.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a14d244N753235ee.jpg!q90 new file mode 100644 index 000000000..992f4185a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a14d244N753235ee.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a14d849Ne65b2700.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a14d849Ne65b2700.jpg!q90.webp new file mode 100644 index 000000000..e2bcea625 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a14d849Ne65b2700.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a14f104N35803b3a.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a14f104N35803b3a.jpg!q90.webp.jpg new file mode 100644 index 000000000..9970f2986 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a14f104N35803b3a.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1530ceN68e342c0.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1530ceN68e342c0.jpg!q90.webp new file mode 100644 index 000000000..a1e2721b1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1530ceN68e342c0.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a153c78N587b6883.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a153c78N587b6883.jpg new file mode 100644 index 000000000..6ec410cd6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a153c78N587b6883.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a153de2Nf8b4fd68.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a153de2Nf8b4fd68.jpg!q90 new file mode 100644 index 000000000..16b3ef7df Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a153de2Nf8b4fd68.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a154759N5385d5d6.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a154759N5385d5d6.jpg new file mode 100644 index 000000000..d212d24e8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a154759N5385d5d6.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a154759N5385d5d6.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a154759N5385d5d6.jpg!q90 new file mode 100644 index 000000000..d212d24e8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a154759N5385d5d6.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a154c8dN4135f0ca.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a154c8dN4135f0ca.jpg!q90 new file mode 100644 index 000000000..518415e14 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a154c8dN4135f0ca.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a15541bNb9c925af.jpg!cc_200x140 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a15541bNb9c925af.jpg!cc_200x140 new file mode 100644 index 000000000..bf3140624 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a15541bNb9c925af.jpg!cc_200x140 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a155909Nfaeaff7d.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155909Nfaeaff7d.jpg!q90 new file mode 100644 index 000000000..30b73ec13 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155909Nfaeaff7d.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a155996N3069562f.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155996N3069562f.jpg!q90.webp.jpg new file mode 100644 index 000000000..eec8e848f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155996N3069562f.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a155a78N9e390f90.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155a78N9e390f90.jpg!q90.webp.jpg new file mode 100644 index 000000000..0c0714df8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155a78N9e390f90.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a155b66N1533832a.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155b66N1533832a.jpg new file mode 100644 index 000000000..e9069d9fb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a155b66N1533832a.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a162e07N716d0432.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a162e07N716d0432.jpg!q90 new file mode 100644 index 000000000..0ba64d174 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a162e07N716d0432.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1634a4Neabf70d5.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1634a4Neabf70d5.jpg new file mode 100644 index 000000000..21b16e8b6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1634a4Neabf70d5.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1634c8N8d8d63d9.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1634c8N8d8d63d9.jpg new file mode 100644 index 000000000..e2f81c4df Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1634c8N8d8d63d9.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1635cfNafa92fcf.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1635cfNafa92fcf.jpg new file mode 100644 index 000000000..3eb8e5625 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1635cfNafa92fcf.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1645d7Nb450ea8f.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1645d7Nb450ea8f.jpg!q90 new file mode 100644 index 000000000..fd5dc488b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1645d7Nb450ea8f.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a166870N0df26ef0.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a166870N0df26ef0.jpg!q90 new file mode 100644 index 000000000..2afa71e1c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a166870N0df26ef0.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a16712eN5b12d2a1.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16712eN5b12d2a1.jpg!q90 new file mode 100644 index 000000000..9528e6712 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16712eN5b12d2a1.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a167313N21417853.jpg!q90.webp (1).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a167313N21417853.jpg!q90.webp (1).jpg new file mode 100644 index 000000000..1a1be0d7a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a167313N21417853.jpg!q90.webp (1).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a167313N21417853.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a167313N21417853.jpg!q90.webp.jpg new file mode 100644 index 000000000..1a1be0d7a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a167313N21417853.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a167906N51dddb51.png!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a167906N51dddb51.png!q90.webp new file mode 100644 index 000000000..4c8ceaff9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a167906N51dddb51.png!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a168352N61f45409.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a168352N61f45409.jpg!q90 new file mode 100644 index 000000000..3676552d9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a168352N61f45409.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1683e0N115c3304.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1683e0N115c3304.jpg!q90 new file mode 100644 index 000000000..7f14bf054 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1683e0N115c3304.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a168d1eN8d09a8b8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a168d1eN8d09a8b8.jpg!q90 new file mode 100644 index 000000000..9e90ba261 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a168d1eN8d09a8b8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a169857N4adcec76.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a169857N4adcec76.jpg!q90.webp.jpg new file mode 100644 index 000000000..a3ccef9f8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a169857N4adcec76.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a169882Nd454bf29.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a169882Nd454bf29.jpg!q90 new file mode 100644 index 000000000..73a31d663 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a169882Nd454bf29.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1698b7Nd63c86ed.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1698b7Nd63c86ed.jpg new file mode 100644 index 000000000..f184e471f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1698b7Nd63c86ed.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1698b7Nd63c86ed.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1698b7Nd63c86ed.jpg!q90 new file mode 100644 index 000000000..f184e471f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1698b7Nd63c86ed.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a1e9N0cdb8522.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a1e9N0cdb8522.jpg!q90.webp.jpg new file mode 100644 index 000000000..e07c752ca Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a1e9N0cdb8522.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a84fN6dc1786f.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a84fN6dc1786f.jpg!q90 new file mode 100644 index 000000000..8389eb3f8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a84fN6dc1786f.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a89bN7f527b23.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a89bN7f527b23.jpg!q90.webp.jpg new file mode 100644 index 000000000..d87b59871 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a89bN7f527b23.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a944N782483e8.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a944N782483e8.jpg!q90.webp.jpg new file mode 100644 index 000000000..9694fa228 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a944N782483e8.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a99fN4970f871.jpg!q90.webp.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a99fN4970f871.jpg!q90.webp.jpg new file mode 100644 index 000000000..c395f8884 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a16a99fN4970f871.jpg!q90.webp.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a176f84N5e5df987.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a176f84N5e5df987.jpg new file mode 100644 index 000000000..84863ff76 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a176f84N5e5df987.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a176f84N5e5df987.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a176f84N5e5df987.jpg!q90 new file mode 100644 index 000000000..84863ff76 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a176f84N5e5df987.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1775a6N2f1b3538.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1775a6N2f1b3538.jpg!q90 new file mode 100644 index 000000000..44e9abd2a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1775a6N2f1b3538.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177937N733d5884.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177937N733d5884.jpg!q90 new file mode 100644 index 000000000..9c5dacd63 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177937N733d5884.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177b5dNf48fe985.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177b5dNf48fe985.jpg new file mode 100644 index 000000000..408d05074 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177b5dNf48fe985.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177b92N9aef1a1a.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177b92N9aef1a1a.jpg new file mode 100644 index 000000000..8f4cb44ab Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177b92N9aef1a1a.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177bbdNc45996ee.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177bbdNc45996ee.jpg new file mode 100644 index 000000000..beb76b600 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177bbdNc45996ee.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177c43N7a83454e.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177c43N7a83454e.jpg!q90 new file mode 100644 index 000000000..f175fb9aa Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177c43N7a83454e.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177c9fNe57ff54f.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177c9fNe57ff54f.jpg!q90.webp new file mode 100644 index 000000000..7733991f0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177c9fNe57ff54f.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a177d99Nd0347bf1.jpg!cc_200x140 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177d99Nd0347bf1.jpg!cc_200x140 new file mode 100644 index 000000000..655530e06 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a177d99Nd0347bf1.jpg!cc_200x140 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a178024N81864411.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a178024N81864411.jpg!q90.webp new file mode 100644 index 000000000..8a3b09501 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a178024N81864411.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a178209Ne2b3ec28.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a178209Ne2b3ec28.jpg new file mode 100644 index 000000000..e597d5ffd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a178209Ne2b3ec28.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1783a8N7d7f6988.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1783a8N7d7f6988.jpg!q90 new file mode 100644 index 000000000..5cc4f445e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1783a8N7d7f6988.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a179689N6507744b.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a179689N6507744b.jpg new file mode 100644 index 000000000..9a5066cb1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a179689N6507744b.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17b2c2Na8f437b9.jpg!cc_200x140 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17b2c2Na8f437b9.jpg!cc_200x140 new file mode 100644 index 000000000..af4b70ec4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17b2c2Na8f437b9.jpg!cc_200x140 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17b56fNd535f5ec.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17b56fNd535f5ec.jpg!q90 new file mode 100644 index 000000000..af41f7ded Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17b56fNd535f5ec.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17c2c8N92fd685b.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17c2c8N92fd685b.jpg new file mode 100644 index 000000000..b4f77e9c0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17c2c8N92fd685b.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17c3feN9cd403e8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17c3feN9cd403e8.jpg!q90 new file mode 100644 index 000000000..d41e236b5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17c3feN9cd403e8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cc40N54dc1b08.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cc40N54dc1b08.jpg new file mode 100644 index 000000000..4e6552b00 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cc40N54dc1b08.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cd2aN6a99aad7.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cd2aN6a99aad7.jpg new file mode 100644 index 000000000..7457d99e9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cd2aN6a99aad7.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ced0Nc020e244 (1).jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ced0Nc020e244 (1).jpg!q90 new file mode 100644 index 000000000..c83e29edb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ced0Nc020e244 (1).jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ced0Nc020e244.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ced0Nc020e244.jpg!q90 new file mode 100644 index 000000000..c83e29edb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ced0Nc020e244.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf3fNf43c3ea8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf3fNf43c3ea8.jpg new file mode 100644 index 000000000..3bda7644c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf3fNf43c3ea8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf73Nf6d5c61a.jpg!q90 (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf73Nf6d5c61a.jpg!q90 (1).webp new file mode 100644 index 000000000..09f40d38a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf73Nf6d5c61a.jpg!q90 (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf73Nf6d5c61a.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf73Nf6d5c61a.jpg!q90.webp new file mode 100644 index 000000000..09f40d38a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17cf73Nf6d5c61a.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d1d0Nd648ae8b.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d1d0Nd648ae8b.jpg!q90 new file mode 100644 index 000000000..26c31eaf4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d1d0Nd648ae8b.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d1d2Nac4c7ead.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d1d2Nac4c7ead.jpg!q90 new file mode 100644 index 000000000..5e76f5cda Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d1d2Nac4c7ead.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d5e7N220f95a8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d5e7N220f95a8.jpg!q90 new file mode 100644 index 000000000..6d5196dc3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d5e7N220f95a8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d9ceN8e7db1de.png b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d9ceN8e7db1de.png new file mode 100644 index 000000000..677250b51 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17d9ceN8e7db1de.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0b1Nf83f3d99.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0b1Nf83f3d99.jpg new file mode 100644 index 000000000..41abd6062 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0b1Nf83f3d99.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0b1Nf83f3d99.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0b1Nf83f3d99.jpg!q90.webp new file mode 100644 index 000000000..41abd6062 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0b1Nf83f3d99.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0ecN6276dd8c.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0ecN6276dd8c.jpg!q90.webp new file mode 100644 index 000000000..318fd4960 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e0ecN6276dd8c.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e192Nc92f6872.jpg!q90 (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e192Nc92f6872.jpg!q90 (1).webp new file mode 100644 index 000000000..a34455399 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e192Nc92f6872.jpg!q90 (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e192Nc92f6872.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e192Nc92f6872.jpg!q90.webp new file mode 100644 index 000000000..a34455399 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e192Nc92f6872.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e385N091131b5.jpg!q90 (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e385N091131b5.jpg!q90 (1).webp new file mode 100644 index 000000000..efdf93947 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e385N091131b5.jpg!q90 (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e385N091131b5.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e385N091131b5.jpg!q90.webp new file mode 100644 index 000000000..efdf93947 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e385N091131b5.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3abNfc2ae745.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3abNfc2ae745.jpg!q90 new file mode 100644 index 000000000..f1ed66a9c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3abNfc2ae745.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3c1N8ff175c4.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3c1N8ff175c4.jpg!q90.webp new file mode 100644 index 000000000..7daba4985 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3c1N8ff175c4.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3e4N5d609546.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3e4N5d609546.jpg!q90.webp new file mode 100644 index 000000000..932feb93a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e3e4N5d609546.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e425N6bebc06e.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e425N6bebc06e.jpg!q90.webp new file mode 100644 index 000000000..efb0beeae Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e425N6bebc06e.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4a2N3e7d7612.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4a2N3e7d7612.jpg!q90 new file mode 100644 index 000000000..7fc4e4fe1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4a2N3e7d7612.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4cdN54235936.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4cdN54235936.jpg!q90.webp new file mode 100644 index 000000000..9fa8c80d6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4cdN54235936.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4e8Ne29c2aa0.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4e8Ne29c2aa0.jpg!q90.webp new file mode 100644 index 000000000..5e8824189 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4e8Ne29c2aa0.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4f5N540cb3d0.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4f5N540cb3d0.jpg!q90.webp new file mode 100644 index 000000000..2dfe2ed97 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4f5N540cb3d0.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4f5Nc289bcdd.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4f5Nc289bcdd.jpg!q90.webp new file mode 100644 index 000000000..8ee2c90b0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17e4f5Nc289bcdd.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ec77Nd92f9470.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ec77Nd92f9470.jpg!q90 new file mode 100644 index 000000000..db0963abb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17ec77Nd92f9470.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a17f8f5Nc7bae5ef.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17f8f5Nc7bae5ef.jpg!q90.webp new file mode 100644 index 000000000..47f1bb63c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a17f8f5Nc7bae5ef.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1845e6Nc80084d7.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1845e6Nc80084d7.jpg!q90.webp new file mode 100644 index 000000000..d5ce91538 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1845e6Nc80084d7.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a185679N232e0154.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a185679N232e0154.jpg new file mode 100644 index 000000000..1eebcb227 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a185679N232e0154.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1997ddN6ef79ca4.png b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1997ddN6ef79ca4.png new file mode 100644 index 000000000..3fe90c14b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1997ddN6ef79ca4.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1997f7Nc0bf5a6f.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1997f7Nc0bf5a6f.jpg new file mode 100644 index 000000000..a1bbdc17e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1997f7Nc0bf5a6f.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1a21dbN1f27e0e9.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1a21dbN1f27e0e9.jpg new file mode 100644 index 000000000..1e4b7afeb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1a21dbN1f27e0e9.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2a1N3c4258e8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2a1N3c4258e8.jpg new file mode 100644 index 000000000..1adbab529 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2a1N3c4258e8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2beN083922a3.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2beN083922a3.jpg new file mode 100644 index 000000000..b654da1d1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2beN083922a3.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2d3N254ce6eb.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2d3N254ce6eb.jpg new file mode 100644 index 000000000..4a4cfe545 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2d3N254ce6eb.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2ecNfae791f1.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2ecNfae791f1.jpg new file mode 100644 index 000000000..38583314a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab2ecNfae791f1.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab314Ne65b27b0.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab314Ne65b27b0.jpg new file mode 100644 index 000000000..c5c4160b4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab314Ne65b27b0.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab32bN2c6e8ebd.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab32bN2c6e8ebd.jpg new file mode 100644 index 000000000..173818dd4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1ab32bN2c6e8ebd.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b6757N8a831b02.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b6757N8a831b02.jpg!q90 new file mode 100644 index 000000000..9060b06ae Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b6757N8a831b02.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b677bNe5a0a902.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b677bNe5a0a902.jpg!q90 new file mode 100644 index 000000000..c16b13542 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b677bNe5a0a902.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b83c7Nded9c556.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b83c7Nded9c556.jpg!q90 new file mode 100644 index 000000000..e550437cf Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1b83c7Nded9c556.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1e5ce2N034ce344.png b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1e5ce2N034ce344.png new file mode 100644 index 000000000..5804b5ca1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1e5ce2N034ce344.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/5a1e5ceaNecb55079.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1e5ceaNecb55079.jpg new file mode 100644 index 000000000..5be2a0703 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/5a1e5ceaNecb55079.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash10.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash10.png new file mode 100644 index 000000000..94db52785 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash10.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash11.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash11.png new file mode 100644 index 000000000..6dbfa689e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash11.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash12.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash12.png new file mode 100644 index 000000000..ca033237d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash12.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash13.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash13.png new file mode 100644 index 000000000..5d035f9bd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash13.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash14.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash14.png new file mode 100644 index 000000000..1c9103801 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash14.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash6.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash6.png new file mode 100644 index 000000000..673c59218 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash6.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash7.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash7.png new file mode 100644 index 000000000..2f2e19691 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash7.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash9.png b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash9.png new file mode 100644 index 000000000..222922616 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/JD_ash9.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a1.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a1.jpg new file mode 100644 index 000000000..cffdd69f5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a1.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a10.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a10.jpg new file mode 100644 index 000000000..8f22129ab Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a10.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a11.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a11.jpg new file mode 100644 index 000000000..95907ab7f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a11.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a12.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a12.jpg new file mode 100644 index 000000000..2e0d034a7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a12.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a2.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a2.jpg new file mode 100644 index 000000000..5777b135f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a2.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a3.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a3.jpg new file mode 100644 index 000000000..1d16d03ba Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a3.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a4.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a4.jpg new file mode 100644 index 000000000..fd6f100fa Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a4.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a5.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a5.jpg new file mode 100644 index 000000000..2aae33a58 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a5.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a6.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a6.jpg new file mode 100644 index 000000000..d80bc3c58 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a6.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a7.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a7.jpg new file mode 100644 index 000000000..56de6669c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a7.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a8.jpg new file mode 100644 index 000000000..57adaa38f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/a9.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/a9.jpg new file mode 100644 index 000000000..acb3c5446 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/a9.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/baitiao.png b/msb-mall/mall-producet/src/main/resources/static/index/img/baitiao.png new file mode 100644 index 000000000..d4b742093 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/baitiao.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/blank.png b/msb-mall/mall-producet/src/main/resources/static/index/img/blank.png new file mode 100644 index 000000000..09484e45d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/blank.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/blue.png b/msb-mall/mall-producet/src/main/resources/static/index/img/blue.png new file mode 100644 index 000000000..583229520 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/blue.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/dianyingpiao.png b/msb-mall/mall-producet/src/main/resources/static/index/img/dianyingpiao.png new file mode 100644 index 000000000..11e1428cb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/dianyingpiao.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/ewm.png b/msb-mall/mall-producet/src/main/resources/static/index/img/ewm.png new file mode 100644 index 000000000..872733dcf Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/ewm.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/ewm1.png b/msb-mall/mall-producet/src/main/resources/static/index/img/ewm1.png new file mode 100644 index 000000000..872733dcf Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/ewm1.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/fa3f24a70d38bd439261cb7439e517a5.png b/msb-mall/mall-producet/src/main/resources/static/index/img/fa3f24a70d38bd439261cb7439e517a5.png new file mode 100644 index 000000000..f2696d944 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/fa3f24a70d38bd439261cb7439e517a5.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/foot (1).png b/msb-mall/mall-producet/src/main/resources/static/index/img/foot (1).png new file mode 100644 index 000000000..94d333672 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/foot (1).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/foot (2).png b/msb-mall/mall-producet/src/main/resources/static/index/img/foot (2).png new file mode 100644 index 000000000..2cef1f762 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/foot (2).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (1).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (1).jpg new file mode 100644 index 000000000..8f026a85c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (1).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (2).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (2).jpg new file mode 100644 index 000000000..4fa035b3d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (2).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (3).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (3).jpg new file mode 100644 index 000000000..c3d45ddef Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-center (3).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (1).webp new file mode 100644 index 000000000..290337659 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (10).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (10).webp new file mode 100644 index 000000000..ecf41db64 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (10).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (100).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (100).webp new file mode 100644 index 000000000..03766305d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (100).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (11).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (11).webp new file mode 100644 index 000000000..5351a51c5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (11).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (12).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (12).webp new file mode 100644 index 000000000..122d402e2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (12).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (13).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (13).webp new file mode 100644 index 000000000..db8c568f9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (13).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (14).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (14).webp new file mode 100644 index 000000000..473241f2b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (14).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (15).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (15).webp new file mode 100644 index 000000000..0fd337864 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (15).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (16).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (16).webp new file mode 100644 index 000000000..991d0e301 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (16).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (17).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (17).webp new file mode 100644 index 000000000..b9eddff2c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (17).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (18).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (18).webp new file mode 100644 index 000000000..ad414c9ba Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (18).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (19).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (19).webp new file mode 100644 index 000000000..f42284dee Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (19).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (2).webp new file mode 100644 index 000000000..160e2adad Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (20).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (20).webp new file mode 100644 index 000000000..203f18b4b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (20).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (21).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (21).webp new file mode 100644 index 000000000..27bc14858 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (21).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (22).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (22).webp new file mode 100644 index 000000000..94fe50c4d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (22).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (23).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (23).webp new file mode 100644 index 000000000..b28fe18c1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (23).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (24).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (24).webp new file mode 100644 index 000000000..3c4b1cef8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (24).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (25).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (25).webp new file mode 100644 index 000000000..894494e02 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (25).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (26).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (26).webp new file mode 100644 index 000000000..cdee15b20 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (26).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (27).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (27).webp new file mode 100644 index 000000000..ceab467f4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (27).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (28).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (28).webp new file mode 100644 index 000000000..d251dae81 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (28).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (29).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (29).webp new file mode 100644 index 000000000..d049af2ab Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (29).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (3).webp new file mode 100644 index 000000000..032f3d89b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (30).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (30).webp new file mode 100644 index 000000000..33bb6bf7c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (30).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (31).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (31).webp new file mode 100644 index 000000000..d78049fc4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (31).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (32).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (32).webp new file mode 100644 index 000000000..d468710aa Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (32).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (33).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (33).webp new file mode 100644 index 000000000..d41ba3aba Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (33).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (34).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (34).webp new file mode 100644 index 000000000..490b0dfab Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (34).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (35).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (35).webp new file mode 100644 index 000000000..1b4d0d859 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (35).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (36).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (36).webp new file mode 100644 index 000000000..9a8bc5f7e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (36).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (37).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (37).webp new file mode 100644 index 000000000..6e286bbc8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (37).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (38).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (38).webp new file mode 100644 index 000000000..7f7e8db76 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (38).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (39).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (39).webp new file mode 100644 index 000000000..9e00d0298 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (39).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (4).webp new file mode 100644 index 000000000..c53822b9c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (40).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (40).webp new file mode 100644 index 000000000..79b1d3b87 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (40).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (41).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (41).webp new file mode 100644 index 000000000..86123a452 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (41).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (42).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (42).webp new file mode 100644 index 000000000..66b88a671 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (42).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (43).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (43).webp new file mode 100644 index 000000000..12cb1bc5a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (43).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (44).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (44).webp new file mode 100644 index 000000000..c1d14b094 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (44).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (45).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (45).webp new file mode 100644 index 000000000..3ca3c01ba Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (45).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (46).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (46).webp new file mode 100644 index 000000000..44567ef95 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (46).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (47).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (47).webp new file mode 100644 index 000000000..6590804a9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (47).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (48).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (48).webp new file mode 100644 index 000000000..cee79f001 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (48).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (49).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (49).webp new file mode 100644 index 000000000..d17bb972d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (49).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (5).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (5).webp new file mode 100644 index 000000000..ad2019d31 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (5).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (50).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (50).webp new file mode 100644 index 000000000..27b1f5880 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (50).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (51).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (51).webp new file mode 100644 index 000000000..d720f75f9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (51).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (52).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (52).webp new file mode 100644 index 000000000..471d79a74 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (52).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (53).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (53).webp new file mode 100644 index 000000000..5e5040e9e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (53).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (54).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (54).webp new file mode 100644 index 000000000..b4a11ab86 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (54).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (55).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (55).webp new file mode 100644 index 000000000..a141b112b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (55).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (56).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (56).webp new file mode 100644 index 000000000..8e7ff0b61 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (56).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (57).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (57).webp new file mode 100644 index 000000000..d339a88f6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (57).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (58).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (58).webp new file mode 100644 index 000000000..afcc51d7e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (58).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (59).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (59).webp new file mode 100644 index 000000000..602d0cfa7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (59).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (6).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (6).webp new file mode 100644 index 000000000..b73b14fa1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (6).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (60).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (60).webp new file mode 100644 index 000000000..e235cd319 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (60).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (61).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (61).webp new file mode 100644 index 000000000..d7bf2db44 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (61).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (62).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (62).webp new file mode 100644 index 000000000..8bfcc4fde Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (62).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (63).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (63).webp new file mode 100644 index 000000000..8d33dcc80 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (63).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (64).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (64).webp new file mode 100644 index 000000000..8424be810 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (64).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (65).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (65).webp new file mode 100644 index 000000000..b8db144c8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (65).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (66).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (66).webp new file mode 100644 index 000000000..5b71663c8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (66).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (67).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (67).webp new file mode 100644 index 000000000..cb447d2fd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (67).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (68).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (68).webp new file mode 100644 index 000000000..427c36e96 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (68).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (69).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (69).webp new file mode 100644 index 000000000..400a48044 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (69).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (7).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (7).webp new file mode 100644 index 000000000..7a7d22552 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (7).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (70).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (70).webp new file mode 100644 index 000000000..dd1b76f08 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (70).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (71).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (71).webp new file mode 100644 index 000000000..f57f08589 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (71).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (72).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (72).webp new file mode 100644 index 000000000..b04af230e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (72).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (73).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (73).webp new file mode 100644 index 000000000..58e4b6e88 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (73).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (74).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (74).webp new file mode 100644 index 000000000..dbdaacb71 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (74).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (75).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (75).webp new file mode 100644 index 000000000..bbe5b83be Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (75).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (76).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (76).webp new file mode 100644 index 000000000..6646c4e36 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (76).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (77).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (77).webp new file mode 100644 index 000000000..4428e95c5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (77).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (78).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (78).webp new file mode 100644 index 000000000..e61ff72fc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (78).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (79).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (79).webp new file mode 100644 index 000000000..69d962f06 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (79).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (8).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (8).webp new file mode 100644 index 000000000..e4868d087 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (8).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (80).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (80).webp new file mode 100644 index 000000000..c89368751 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (80).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (81).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (81).webp new file mode 100644 index 000000000..e2e2d24f4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (81).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (82).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (82).webp new file mode 100644 index 000000000..a869bacbf Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (82).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (83).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (83).webp new file mode 100644 index 000000000..b33fe7a8a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (83).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (84).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (84).webp new file mode 100644 index 000000000..794c014bc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (84).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (85).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (85).webp new file mode 100644 index 000000000..fa86ab0d1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (85).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (86).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (86).webp new file mode 100644 index 000000000..ae6a36843 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (86).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (87).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (87).webp new file mode 100644 index 000000000..049d717a7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (87).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (88).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (88).webp new file mode 100644 index 000000000..503fb1dd7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (88).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (89).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (89).webp new file mode 100644 index 000000000..5c05e42ea Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (89).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (9).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (9).webp new file mode 100644 index 000000000..0b358c24a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (9).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (90).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (90).webp new file mode 100644 index 000000000..6c0382990 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (90).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (91).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (91).webp new file mode 100644 index 000000000..0d993ef34 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (91).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (92).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (92).webp new file mode 100644 index 000000000..bda73a1d3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (92).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (93).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (93).webp new file mode 100644 index 000000000..4c82ffe24 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (93).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (94).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (94).webp new file mode 100644 index 000000000..348e3b94c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (94).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (95).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (95).webp new file mode 100644 index 000000000..7f0223901 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (95).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (96).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (96).webp new file mode 100644 index 000000000..5f4f59670 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (96).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (97).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (97).webp new file mode 100644 index 000000000..6c567647b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (97).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (98).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (98).webp new file mode 100644 index 000000000..8425131f6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (98).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (99).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (99).webp new file mode 100644 index 000000000..19f971aad Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g-con (99).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g1.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g1.jpg new file mode 100644 index 000000000..9bc1c09de Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g1.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g10.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g10.jpg new file mode 100644 index 000000000..817695b66 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g10.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g11.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g11.jpg new file mode 100644 index 000000000..bc0d4850d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g11.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g12.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g12.jpg new file mode 100644 index 000000000..6c857d8e7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g12.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g13.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g13.jpg new file mode 100644 index 000000000..9a22f1b7a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g13.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g14.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g14.jpg new file mode 100644 index 000000000..78cd21a49 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g14.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g15.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g15.jpg new file mode 100644 index 000000000..0a87bbea2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g15.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g16.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g16.jpg new file mode 100644 index 000000000..75f896bfd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g16.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g17.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g17.jpg new file mode 100644 index 000000000..264ad96fe Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g17.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g18.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g18.jpg new file mode 100644 index 000000000..adf18fc20 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g18.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g19.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g19.jpg new file mode 100644 index 000000000..dcf022bfc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g19.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g2.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g2.jpg new file mode 100644 index 000000000..f0f0f9ae8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g2.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g20.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g20.jpg new file mode 100644 index 000000000..2f09723fb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g20.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g21.png b/msb-mall/mall-producet/src/main/resources/static/index/img/g21.png new file mode 100644 index 000000000..490c47a1a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g21.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g22.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g22.jpg new file mode 100644 index 000000000..bd647ca7a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g22.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g23.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g23.jpg new file mode 100644 index 000000000..8a2fa0f0c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g23.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g24.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g24.jpg new file mode 100644 index 000000000..34e475834 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g24.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g3.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g3.jpg new file mode 100644 index 000000000..44233d135 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g3.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g4.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g4.jpg new file mode 100644 index 000000000..cacd652e3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g4.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g5.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g5.jpg new file mode 100644 index 000000000..800209d95 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g5.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g6.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g6.jpg new file mode 100644 index 000000000..e5e08bd10 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g6.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g7.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g7.jpg new file mode 100644 index 000000000..88e2fbf6c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g7.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g8.jpg new file mode 100644 index 000000000..c5d0441ad Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/g9.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/g9.jpg new file mode 100644 index 000000000..f6887022c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/g9.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gouwuche.png b/msb-mall/mall-producet/src/main/resources/static/index/img/gouwuche.png new file mode 100644 index 000000000..fcb36e3e9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gouwuche.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/green.png b/msb-mall/mall-producet/src/main/resources/static/index/img/green.png new file mode 100644 index 000000000..713b73644 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/green.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (1).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (1).png new file mode 100644 index 000000000..9d6d1140f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (1).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (2).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (2).png new file mode 100644 index 000000000..980108d71 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (2).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (3).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (3).png new file mode 100644 index 000000000..6ff784015 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (3).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (4).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (4).png new file mode 100644 index 000000000..2a35732c5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (4).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (5).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (5).png new file mode 100644 index 000000000..5ca528b2e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (5).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (6).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (6).png new file mode 100644 index 000000000..70e830cfc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (6).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (7).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (7).png new file mode 100644 index 000000000..e6248ccd2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (7).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/gts (8).png b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (8).png new file mode 100644 index 000000000..7d0c9b231 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/gts (8).png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/huafei.png b/msb-mall/mall-producet/src/main/resources/static/index/img/huafei.png new file mode 100644 index 000000000..7b154399a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/huafei.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/huli.png b/msb-mall/mall-producet/src/main/resources/static/index/img/huli.png new file mode 100644 index 000000000..2da50cbb0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/huli.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/huochepiao.png b/msb-mall/mall-producet/src/main/resources/static/index/img/huochepiao.png new file mode 100644 index 000000000..7a9224e17 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/huochepiao.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_01.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_01.png new file mode 100644 index 000000000..823a58648 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_01.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_05.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_05.png new file mode 100644 index 000000000..c76e87ce6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_05.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_09.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_09.png new file mode 100644 index 000000000..7f09b988e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_09.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_12.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_12.png new file mode 100644 index 000000000..7f1318bc0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_12.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_15.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_15.png new file mode 100644 index 000000000..dc0fee055 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_15.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_21.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_21.png new file mode 100644 index 000000000..8daa73b46 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_21.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_25.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_25.png new file mode 100644 index 000000000..938c4eacc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_25.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_28.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_28.png new file mode 100644 index 000000000..a04ddeda4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_28.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/img_31.png b/msb-mall/mall-producet/src/main/resources/static/index/img/img_31.png new file mode 100644 index 000000000..0cf417697 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/img_31.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/jiayouka.png b/msb-mall/mall-producet/src/main/resources/static/index/img/jiayouka.png new file mode 100644 index 000000000..92cf453cc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/jiayouka.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/jipiao.png b/msb-mall/mall-producet/src/main/resources/static/index/img/jipiao.png new file mode 100644 index 000000000..3e00f5c87 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/jipiao.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/jiudian.png b/msb-mall/mall-producet/src/main/resources/static/index/img/jiudian.png new file mode 100644 index 000000000..af5ef8256 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/jiudian.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/left-active.png b/msb-mall/mall-producet/src/main/resources/static/index/img/left-active.png new file mode 100644 index 000000000..75494fdc8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/left-active.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/left.png b/msb-mall/mall-producet/src/main/resources/static/index/img/left.png new file mode 100644 index 000000000..21e4a16d1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/left.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/licai.png b/msb-mall/mall-producet/src/main/resources/static/index/img/licai.png new file mode 100644 index 000000000..4780eabe5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/licai.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lipinka.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lipinka.png new file mode 100644 index 000000000..2d7bc4d91 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lipinka.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/logo.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/logo.jpg new file mode 100644 index 000000000..d92411ea8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/logo.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/logo33.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/logo33.jpg new file mode 100644 index 000000000..d92411ea8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/logo33.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/logoggg.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/logoggg.jpg new file mode 100644 index 000000000..d92411ea8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/logoggg.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo.png new file mode 100644 index 000000000..4d97ef137 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo1.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo1.png new file mode 100644 index 000000000..53bb7ea4f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo1.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo2.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo2.png new file mode 100644 index 000000000..fdc3e0421 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo2.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo3.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo3.png new file mode 100644 index 000000000..2830c5ae7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo3.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo4.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo4.png new file mode 100644 index 000000000..f8d95bd2a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo4.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo5.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo5.png new file mode 100644 index 000000000..48b801783 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo5.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo6.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo6.png new file mode 100644 index 000000000..8432fbc0b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo6.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo7.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo7.png new file mode 100644 index 000000000..0b68add6d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo7.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo8.png b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo8.png new file mode 100644 index 000000000..bb2e67732 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/lunbo8.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n1.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n1.jpg!q90 new file mode 100644 index 000000000..64c233d14 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n1.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n10.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n10.webp new file mode 100644 index 000000000..8eb8d1bf9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n10.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n11.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n11.webp new file mode 100644 index 000000000..88b4f2d29 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n11.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n12.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n12.webp new file mode 100644 index 000000000..1a47853a2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n12.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n13.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n13.webp new file mode 100644 index 000000000..0ddbc944d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n13.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n14.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n14.jpg!q90 new file mode 100644 index 000000000..f5c567e83 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n14.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n15.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n15.jpg!q90 new file mode 100644 index 000000000..5fea2ee9e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n15.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n16.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n16.jpg!q90 new file mode 100644 index 000000000..7ffc826e3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n16.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n2.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n2.webp new file mode 100644 index 000000000..b9da1efc9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n2.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n3.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n3.webp new file mode 100644 index 000000000..124a792de Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n3.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n4.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n4.webp new file mode 100644 index 000000000..38e2c708a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n4.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n5.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/n5.webp new file mode 100644 index 000000000..75a0eec83 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n5.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n6.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n6.jpg!q90 new file mode 100644 index 000000000..70ec82c1e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n6.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n7.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n7.jpg!q90 new file mode 100644 index 000000000..325b18b3d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n7.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n8.jpg!q90 new file mode 100644 index 000000000..c9bf49c58 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/n9.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/n9.jpg!q90 new file mode 100644 index 000000000..313a10e2f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/n9.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/no_login.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/no_login.jpg new file mode 100644 index 000000000..21c6aa594 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/no_login.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/pt_qrcode@1x.png b/msb-mall/mall-producet/src/main/resources/static/index/img/pt_qrcode@1x.png new file mode 100644 index 000000000..872733dcf Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/pt_qrcode@1x.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/qianbao.png b/msb-mall/mall-producet/src/main/resources/static/index/img/qianbao.png new file mode 100644 index 000000000..09c2f2974 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/qianbao.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/qiyegou.png b/msb-mall/mall-producet/src/main/resources/static/index/img/qiyegou.png new file mode 100644 index 000000000..890d115dc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/qiyegou.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/rBEhU1NY5kQIAAAAAAIuB0gUCK0AAMZvAAdP2oAAi4f269.jpg!q90.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/rBEhU1NY5kQIAAAAAAIuB0gUCK0AAMZvAAdP2oAAi4f269.jpg!q90.webp new file mode 100644 index 000000000..02ca0d2a2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/rBEhU1NY5kQIAAAAAAIuB0gUCK0AAMZvAAdP2oAAi4f269.jpg!q90.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/right-active.png b/msb-mall/mall-producet/src/main/resources/static/index/img/right-active.png new file mode 100644 index 000000000..4c2efe5b5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/right-active.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/right.png b/msb-mall/mall-producet/src/main/resources/static/index/img/right.png new file mode 100644 index 000000000..942b6c6be Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/right.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s1.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s1.jpg!q90 new file mode 100644 index 000000000..8fe6e0e0b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s1.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s10.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s10.jpg!q90 new file mode 100644 index 000000000..9003980b7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s10.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s11.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/s11.webp new file mode 100644 index 000000000..9bf39fd6d Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s11.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s13.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/s13.webp new file mode 100644 index 000000000..9024ef5f4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s13.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s14.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s14.jpg!q90 new file mode 100644 index 000000000..fbcd880dd Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s14.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s15.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s15.jpg!q90 new file mode 100644 index 000000000..68fbe5422 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s15.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s16.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s16.jpg!q90 new file mode 100644 index 000000000..11ad7cb73 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s16.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s2.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/s2.webp new file mode 100644 index 000000000..2a1f0fbd2 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s2.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s3.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/s3.webp new file mode 100644 index 000000000..de14ce868 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s3.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s4.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/s4.webp new file mode 100644 index 000000000..3f516df63 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s4.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s5.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/s5.webp new file mode 100644 index 000000000..b7adc4032 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s5.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s6.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s6.jpg!q90 new file mode 100644 index 000000000..433ba7802 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s6.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s7.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s7.jpg!q90 new file mode 100644 index 000000000..99b3b5827 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s7.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s8.jpg!q90 new file mode 100644 index 000000000..90802405c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/s9.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/s9.jpg!q90 new file mode 100644 index 000000000..65bf7bc1b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/s9.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/saved_resource b/msb-mall/mall-producet/src/main/resources/static/index/img/saved_resource new file mode 100644 index 000000000..da29a7196 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/img/saved_resource @@ -0,0 +1,2 @@ +/* toolbar-1.0.0 common.css Date:2017-08-24 19:35:01 */ +@charset "UTF-8";.jdm-tbar-panel-header .close-panel,.jdm-tbar-panel-header i,.jdm-toolbar-tab .tab-ico,.jdm-toolbar-tab .tab-tip,.jdm-toolbar-tabs .tabs-tip .ico{display:inline-block;background-image:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/toolbars.png);_background-image:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/toolbars-png8.png);background-repeat:no-repeat}.i-face-fd,.i-face-jk{display:inline-block;background-image:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/jdm-toolbar-face.png);_background-image:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/jdm-toolbar-face-png8.png);background-repeat:no-repeat}.i-loading{display:inline-block;width:32px;height:32px;background-image:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/loading.gif);background-repeat:no-repeat}.i-face-fd{width:113px;height:35px;background-position:0 0}.i-face-jk{width:113px;height:35px;background-position:0 -50px}.error-img{display:inline-block;width:144px;height:48px;background:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/error-img.jpg) no-repeat 50% 50%}.jdm-tbar-tipbox .tip-inner{padding:6px 5px;border:1px solid #edd28b;background:#fffdee;text-align:center}.jdm-tbar-tipbox .tip-text{display:inline-block;line-height:20px;vertical-align:middle;color:#333}.jdm-tbar-tipbox .tip-btn{display:inline-block;height:20px;line-height:20px;padding:0 5px;margin-left:5px;color:#fff;vertical-align:middle;background:#c81623}.jdm-tbar-login{display:none}.jdm-tbar-tipbox2{text-align:center}.jdm-tbar-tipbox2 .tip-face{overflow:hidden}.jdm-tbar-tipbox2 .tip-text{line-height:20px}.jdm-tbar-tipbox2 .tip-text a{color:#c81623}.jdm-toolbar-wrap{position:fixed;_position:absolute;top:0;right:0;z-index:9990;width:0;height:100%}.jdm-toolbar-wrap a{text-decoration:none}.jdm-toolbar{position:absolute;right:0;top:0;width:0;height:100%;border-right:6px solid #7a6e6e;-webkit-transition:right .3s ease-in-out 0s;-moz-transition:right .3s ease-in-out 0s;transition:right .3s ease-in-out 0s}.z-jdm-toolbar-open .jdm-toolbar{right:270px}.z-jdm-toolbar-open .jdm-toolbar-panels{_display:block}.jdm-toolbar-panels{position:absolute;left:6px;_left:6px;top:0;width:270px;height:100%;z-index:2;background:#eceaea;_display:none}.jdm-toolbar-panel{width:270px;height:100%;position:absolute;background:#eceaea;visible:hidden}.jdm-tbar-panel-header{position:relative;width:270px;height:40px;line-height:40px;background:#eceaea}.jdm-tbar-panel-header i{margin-right:4px;margin-left:10px;vertical-align:top}.jdm-tbar-panel-header .title{display:inline-block;height:40px;color:#5e5050;font:16px/40px "微软雅黑"}.jdm-tbar-panel-header .title em{display:inline-block;vertical-align:top}.jdm-tbar-panel-header .close-panel{width:12px;height:12px;background-position:0 -250px;position:absolute;right:8px;top:16px;cursor:pointer;-webkit-transition:transform .2s ease-out 0s;-moz-transition:transform .2s ease-out 0s;transition:transform .2s ease-out 0s}.jdm-tbar-panel-header .close-panel:hover{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);transform:rotate(180deg)}.jdm-tbar-panel-main{position:relative}.jdm-tbar-panel-content{width:270px;overflow-y:auto;overflow-x:hidden;position:relative}.jdm-tbar-panel-content .jdm-tbar-tipbox2{width:270px;position:absolute;left:0;top:50%;margin-top:-60px}.jdm-tbar-panel-content::-webkit-scrollbar{width:5px}.jdm-tbar-panel-content::-webkit-scrollbar-track{-webkit-border-radius:6px;border-radius:6px;background-color:transparent}.jdm-tbar-panel-content::-webkit-scrollbar-thumb{-webkit-border-radius:6px;border-radius:6px;background:#7b6f6f}.jdm-toolbar-header{position:absolute;top:0;right:-6px}.jdm-toolbar-tabs{position:absolute;top:50%;left:-29px;width:35px;margin-top:-61px}.jdm-toolbar-tabs .tabs-tip{position:absolute;top:0;right:35px;height:35px;line-height:35px;white-space:nowrap;border-radius:5px;background:#c81623;color:#fff;padding:0 10px;padding-left:30px}.jdm-toolbar-tabs .tabs-tip .ico{width:15px;height:12px;background-position:-98px -162px;position:absolute;top:13px;left:10px}.jdm-toolbar-tabs .tabs-tip b{width:0;height:0;line-height:0;font-size:0;border:transparent 6px dashed;border-left:6px solid #c81623;position:absolute;right:-12px;top:12px;z-index:20}.jdm-toolbar-footer{position:absolute;bottom:-1px;width:100%;left:-29px}.jdm-toolbar-footer .jdm-toolbar-tab .tab-text{width:50px}.jdm-toolbar-footer .z-jdm-tbar-tab-hover .tab-text{left:-48px}.jdm-toolbar-tab{position:relative;width:35px;height:35px;margin-bottom:1px;cursor:pointer;background-color:#7a6e6e;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.jdm-toolbar-tab .tab-ico{width:34px;height:35px;margin-left:1px;position:relative;z-index:2;background-color:#7a6e6e;_display:block}.jdm-toolbar-tab .tab-text{width:62px;height:35px;line-height:35px;color:#fff;text-align:center;font-family:"微软雅黑";position:absolute;z-index:1;left:35px;top:0;background-color:#7a6e6e;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;-webkit-transition:left .3s ease-in-out .1s;-moz-transition:left .3s ease-in-out .1s;transition:left .3s ease-in-out .1s;_display:none}.jdm-toolbar-tab .tab-sub{position:absolute;z-index:3;right:2px;top:-5px;height:11px;padding:1px 2px;border:1px solid #b61d1d;overflow:hidden;color:#fff;font:11px/11px verdana;text-align:center;min-width:11px;_width:20px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;background-color:#cc6060;background-image:-moz-linear-gradient(top,#cc6060,#b61d1d);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#cc6060),color-stop(1,#b61d1d));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cc6060', endColorstr='#b61d1d', GradientType='0');-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cc6060', endColorstr='#b61d1d');background-image:linear-gradient(to bottom,#cc6060 0,#b61d1d 100%)}.jdm-toolbar-tab .tab-tip{position:absolute;top:8px;right:10px;width:6px;height:6px;background-position:-150px -150px;z-index:999}.jdm-tbar-tab-hall .tab-ico{background-position:-189px -203px}.jdm-tbar-tab-jdvip .tab-ico{background-position:-88px -175px}.jdm-tbar-tab-cart .tab-ico{background-position:-50px 0}.jdm-tbar-tab-follow .tab-ico{background-position:-50px -50px}.jdm-tbar-tab-history .tab-ico{background-position:-50px -100px}.z-jdm-tbar-tab-hover,.z-jdm-tbar-tab-hover .tab-ico{background-color:#c81623}.z-jdm-tbar-tab-hover .tab-text{left:-60px;background-color:#c81623;_display:block}.z-jdm-tbar-tab-hover .tab-sub{color:#c81623;background-color:#fff;background-image:-moz-linear-gradient(top,#fff,#fff);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(1,#fff));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ffffff', GradientType='0');-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ffffff');background-image:linear-gradient(to bottom,#fff 0,#fff 100%);-webkit-box-shadow:1px 1px 3px rgba(0,0,0,.3);-moz-box-shadow:1px 1px 3px rgba(0,0,0,.3);box-shadow:1px 1px 3px rgba(0,0,0,.3);text-shadow:1px 0 1px rgba(0,0,0,.3)}.z-jdm-tbar-tab-hover .tab-tip{display:none}.z-jdm-tbar-tab-selected,.z-jdm-tbar-tab-selected .tab-ico{background-color:#c81623}.z-jdm-tbar-tab-selected .tab-text{display:none}.z-jdm-tbar-tab-selected .tab-sub{color:#c81623;background-color:#fff;background-image:-moz-linear-gradient(top,#fff,#fff);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(1,#fff));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ffffff', GradientType='0');-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ffffff');background-image:linear-gradient(to bottom,#fff 0,#fff 100%);-webkit-box-shadow:1px 1px 3px rgba(0,0,0,.3);-moz-box-shadow:1px 1px 3px rgba(0,0,0,.3);box-shadow:1px 1px 3px rgba(0,0,0,.3);text-shadow:1px 0 1px rgba(0,0,0,.3)}.z-jdm-tbar-tab-selected .tab-tip{display:none}.jdm-tbar-tab-jimi .tab-ico{background-position:-50px -150px}.jdm-tbar-panel-jimi .jdm-tbar-panel-header i{width:18px;height:19px;margin-top:10px;background-position:0 -150px}.jdm-tbar-panel-jimi .jdm-tbar-panel-content{overflow:hidden}.jdm-tbar-panel-jdvip .jdm-tbar-panel-header i{width:18px;height:19px;margin-top:10px;background-position:-94px -211px}.jdm-tbar-tab-coupon .tab-ico{background-position:-190px -100px}.jdm-tbar-panel-coupon .jdm-tbar-panel-header i{width:18px;height:13px;margin-top:14px;background-position:-150px -100px}.jdm-tbar-panel-coupon .jdm-tbar-panel-content{overflow:hidden}.jdm-tbar-tab-message .tab-ico{background-position:-190px -150px}.jdm-tbar-tab-top .tab-ico{background-position:-50px -250px}.jdm-tbar-tab-feedback .tab-ico{background-position:-50px -300px}@-webkit-keyframes toolbar-scaleIn{from{opacity:.7;-webkit-transform:translateX(270px);-moz-transform:translateX(270px);transform:translateX(270px)}to{-webkit-transform:translateX(0px);-moz-transform:translateX(0px);transform:translateX(0px)}}@-ms-keyframes toolbar-scaleIn{from{opacity:.7;-webkit-transform:translateX(270px);-moz-transform:translateX(270px);transform:translateX(270px)}to{-webkit-transform:translateX(0px);-moz-transform:translateX(0px);transform:translateX(0px)}}@-moz-keyframes toolbar-scaleIn{from{opacity:.7;-webkit-transform:translateX(270px);-moz-transform:translateX(270px);transform:translateX(270px)}to{-webkit-transform:translateX(0px);-moz-transform:translateX(0px);transform:translateX(0px)}}@keyframes toolbar-scaleIn{from{opacity:.7;-webkit-transform:translateX(270px);-moz-transform:translateX(270px);transform:translateX(270px)}to{-webkit-transform:translateX(0px);-moz-transform:translateX(0px);transform:translateX(0px)}}@-webkit-keyframes toolbar-scaleOut{to{opacity:.5;-webkit-transform:scale(0.7) translateX(270px);-moz-transform:scale(0.7) translateX(270px);transform:scale(0.7) translateX(270px)}}@-ms-keyframes toolbar-scaleOut{to{opacity:.5;-webkit-transform:scale(0.7) translateX(270px);-moz-transform:scale(0.7) translateX(270px);transform:scale(0.7) translateX(270px)}}@-moz-keyframes toolbar-scaleOut{to{opacity:.5;-webkit-transform:scale(0.7) translateX(270px);-moz-transform:scale(0.7) translateX(270px);transform:scale(0.7) translateX(270px)}}@keyframes toolbar-scaleOut{to{opacity:.5;-webkit-transform:scale(0.7) translateX(270px);-moz-transform:scale(0.7) translateX(270px);transform:scale(0.7) translateX(270px)}}.toolbar-animate-in{-webkit-animation:toolbar-scaleIn .35s ease-in-out;-moz-animation:toolbar-scaleIn .35s ease-in-out;animation:toolbar-scaleIn .35s ease-in-out}.toolbar-animate-out{-webkit-animation:toolbar-scaleOut .35s ease-in;-moz-animation:toolbar-scaleOut .35s ease-in;animation:toolbar-scaleOut .35s ease-in}.jdm-tbar-panel-ad .jdm-tbar-panel-content{overflow:hidden}.poptip{position:absolute;top:3px;right:45px;height:30px;line-height:30px;border-radius:2px;box-shadow:1px 1px 8px #ddd;padding:0 18px 0 32px;background-color:#fff}.poptip i.giftMsg{position:absolute;left:10px;top:5px;width:15px;height:19px;background:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/giftBubble.png) no-repeat left top;margin-right:8px;overflow:hidden}.poptip b.giftTxt{min-width:115px;text-align:center;height:30px;line-height:30px;font-size:12px;font-weight:400;overflow:hidden;padding-right:3px;white-space:nowrap}.poptip em.giftClose{position:absolute;right:10px;top:10px;width:9px;height:19px;background:url(//static.360buyimg.com/devfe/toolbar/1.0.0/css/i/giftBubble.png) no-repeat -23px -5px;overflow:hidden;cursor:pointer}.poptip-arrow{position:absolute;overflow:hidden;font-style:normal;font-family:simsun;font-size:12px}.poptip-arrow em,.poptip-arrow i{position:absolute;left:0;top:-7px;font-style:normal}.poptip-arrow em{color:rgba(211,211,211,.3)}.poptip-arrow i{color:#fff;text-shadow:none}.poptip-arrow-right{height:14px;width:7px;top:14px;margin-top:-6px;right:-6px}.poptip-arrow-right em{left:-4px}.poptip-arrow-right i{left:-5px} diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/saved_resource(1) b/msb-mall/mall-producet/src/main/resources/static/index/img/saved_resource(1) new file mode 100644 index 000000000..106336323 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/img/saved_resource(1) @@ -0,0 +1,8 @@ +/* jdf- jquery-1.6.4.js Date:2014-03-20 17:05:52 */ +!function(a,b){function k(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(j,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}function l(a){for(var b in a)if("toJSON"!==b)return!1;return!0}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);!i||"queue"!==d&&f.data(a,g,b,!0)||"mark"!==d&&f.data(a,h,b,!0)||setTimeout(function(){f.data(a,g,b,!0)||f.data(a,h,b,!0)||(f.removeData(a,e,!0),i.resolve())},0)}function C(){return!1}function D(){return!0}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function L(a){var b,c,d,e,g,h,i,j,k,m,n,o,p=[],q=[],r=f._data(this,"events");if(a.liveFired!==this&&r&&r.live&&!a.target.disabled&&(!a.button||"click"!==a.type)){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ij;j++)for(m=e[j],i=0;ij&&(e=p[j],!(c&&e.level>c))&&(a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments),o!==!1&&!a.isPropagationStopped()||(c=e.level,o===!1&&(b=!1),!a.isImmediatePropagationStopped()));j++);return b}}function M(a,b){return(a&&"*"!==a?a+".":"")+b.replace(y,"`").replace(z,"&")}function U(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function V(a,b,c){if(b=b||0,f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a){return a===b===c});if("string"==typeof b){var d=f.grep(a,function(a){return 1===a.nodeType});if(Q.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a){return f.inArray(a,b)>=0===c})}function fb(a){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function gb(a,b){if(1===b.nodeType&&f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;if(e=e[c]=f.extend({},d),g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;j>i;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function hb(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?b.outerHTML=a.outerHTML:"input"!==c||"checkbox"!==a.type&&"radio"!==a.type?"option"===c?b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando))}function ib(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function jb(a){("checkbox"===a.type||"radio"===a.type)&&(a.defaultChecked=a.checked)}function kb(a){f.nodeName(a,"input")?jb(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),jb)}function lb(a,b){b.src?f.ajax({"url":b.src,"async":!1,"dataType":"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(db,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function yb(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?tb:ub;return d>0?("border"!==c&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),"margin"===c?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0}),d+"px"):(d=vb(a,b,b),(0>d||null==d)&&(d=a.style[b]||0),d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,"padding"!==c&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),"margin"===c&&(d+=parseFloat(f.css(a,c+this))||0)}),d+"px")}function Vb(a){return function(b,c){if("string"!=typeof b&&(c=b,b="*"),f.isFunction(c))for(var h,i,j,d=b.toLowerCase().split(Lb),e=0,g=d.length;g>e;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}function Wb(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;for(var l,h=a[f],i=0,j=h?h.length:0,k=a===Pb;j>i&&(k||!l);i++)l=h[i](c,d,e),"string"==typeof l&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=Wb(a,c,d,e,l,g)));return!k&&l||g["*"]||(l=Wb(a,c,d,e,"*",g)),l}function Xb(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function Yb(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||Ab.test(a)?d(a,e):Yb(a+"["+("object"==typeof e||f.isArray(e)?b:"")+"]",e,c,d)});else if(c||null==b||"object"!=typeof b)d(a,b);else for(var e in b)Yb(a+"["+e+"]",b[e],c,d)}function Zb(a,c,d){var h,i,j,k,e=a.contents,f=a.dataTypes,g=a.responseFields;for(i in g)i in d&&(c[g[i]]=d[i]);for(;"*"===f[0];)f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}return j?(j!==f[0]&&f.unshift(j),d[j]):void 0}function $b(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var g,h,j,l,m,n,o,p,d=a.dataTypes,e={},i=d.length,k=d[0];for(g=1;i>g;g++){if(1===g)for(h in a.converters)"string"==typeof h&&(e[h.toLowerCase()]=a.converters[h]);if(l=k,k=d[g],"*"===k)k=l;else if("*"!==l&&l!==k){if(m=l+" "+k,n=e[m]||e["* "+k],!n){p=b;for(o in e)if(j=o.split(" "),(j[0]===l||"*"===j[0])&&(p=e[j[1]+" "+k])){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}n||p||f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ec(){try{return new a.XMLHttpRequest}catch(b){}}function fc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function oc(){return setTimeout(pc,0),nc=f.now()}function pc(){nc=b}function qc(a,b){var c={};return f.each(mc.concat.apply([],mc.slice(0,b)),function(){c[this]=a}),c}function rc(a){if(!gc[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove(),("none"===e||""===e)&&(hc||(hc=c.createElement("iframe"),hc.frameBorder=hc.width=hc.height=0),b.appendChild(hc),ic&&hc.createElement||(ic=(hc.contentWindow||hc.contentDocument).document,ic.write(("CSS1Compat"===c.compatMode?"":"")+""),ic.close()),d=ic.createElement(a),ic.body.appendChild(d),e=f.css(d,"display"),b.removeChild(hc)),gc[a]=e}return gc[a]}function uc(a){return f.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){return void setTimeout(K,1)}e.ready()}}var h,A,B,C,e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/gi,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};return e.fn=e.prototype={"constructor":e,"init":function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!d&&c.body)return this.context=c,this[0]=c.body,this.selector=a,this.length=1,this;if("string"==typeof a){if(g="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:i.exec(a),!g||!g[1]&&d)return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a);if(g[1])return d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes),e.merge(this,a);if(h=c.getElementById(g[2]),h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}return this.context=c,this.selector=a,this}return e.isFunction(a)?f.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),e.makeArray(a,this))},"selector":"","jquery":"1.6.4","length":0,"size":function(){return this.length},"toArray":function(){return G.call(this,0)},"get":function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},"pushStack":function(a,b,c){var d=this.constructor();return e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,"find"===b?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},"each":function(a,b){return e.each(this,a,b)},"ready":function(a){return e.bindReady(),B.done(a),this},"eq":function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},"first":function(){return this.eq(0)},"last":function(){return this.eq(-1)},"slice":function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},"map":function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},"end":function(){return this.prevObject||this.constructor(null)},"push":F,"sort":[].sort,"splice":[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;for("boolean"==typeof i&&(l=i,i=arguments[1]||{},j=2),"object"==typeof i||e.isFunction(i)||(i={}),k===j&&(i=this,--j);k>j;j++)if(null!=(a=arguments[j]))for(c in a)d=i[c],f=a[c],i!==f&&(l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f));return i},e.extend({"noConflict":function(b){return a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f),e},"isReady":!1,"readyWait":1,"holdReady":function(a){a?e.readyWait++:e.ready(!0)},"ready":function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);if(e.isReady=!0,a!==!0&&--e.readyWait>0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},"bindReady":function(){if(!B){if(B=e._Deferred(),"complete"===c.readyState)return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=null==a.frameElement}catch(d){}c.documentElement.doScroll&&b&&K()}}},"isFunction":function(a){return"function"===e.type(a)},"isArray":Array.isArray||function(a){return"array"===e.type(a)},"isWindow":function(a){return a&&"object"==typeof a&&"setInterval"in a},"isNaN":function(a){return null==a||!m.test(a)||isNaN(a)},"type":function(a){return null==a?String(a):J[D.call(a)]||"object"},"isPlainObject":function(a){if(!a||"object"!==e.type(a)||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},"isEmptyObject":function(a){for(var b in a)return!1;return!0},"error":function(a){throw a},"parseJSON":function(b){return"string"==typeof b&&b?(b=e.trim(b),a.JSON&&a.JSON.parse?a.JSON.parse(b):o.test(b.replace(p,"@").replace(q,"]").replace(r,""))?new Function("return "+b)():void e.error("Invalid JSON: "+b)):null},"parseXML":function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}return d&&d.documentElement&&!d.getElementsByTagName("parsererror").length||e.error("Invalid XML: "+c),d},"noop":function(){},"globalEval":function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},"camelCase":function(a){return a.replace(x,"ms-").replace(w,y)},"nodeName":function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},"each":function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d)if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;h>g&&c.apply(a[g++],d)!==!1;);else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;h>g&&c.call(a[g],g,a[g++])!==!1;);return a},"trim":H?function(a){return null==a?"":H.call(a)}:function(a){return null==a?"":a.toString().replace(k,"").replace(l,"")},"makeArray":function(a,b){var c=b||[];if(null!=a){var d=e.type(a);null==a.length||"string"===d||"function"===d||"regexp"===d||e.isWindow(a)?F.call(c,a):e.merge(c,a)}return c},"inArray":function(a,b){if(!b)return-1;if(I)return I.call(b,a);for(var c=0,d=b.length;d>c;c++)if(b[c]===a)return c;return-1},"merge":function(a,c){var d=a.length,e=0;if("number"==typeof c.length)for(var f=c.length;f>e;e++)a[d++]=c[e];else for(;c[e]!==b;)a[d++]=c[e++];return a.length=d,a},"grep":function(a,b,c){var e,d=[];c=!!c;for(var f=0,g=a.length;g>f;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},"map":function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&"number"==typeof j&&(j>0&&a[0]&&a[j-1]||0===j||e.isArray(a));if(k)for(;j>i;i++)f=c(a[i],i,d),null!=f&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),null!=f&&(h[h.length]=f);return h.concat.apply([],h)},"guid":1,"proxy":function(a,c){if("string"==typeof c){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};return g.guid=a.guid=a.guid||g.guid||e.guid++,g},"access":function(a,c,d,f,g,h){var i=a.length;if("object"==typeof c){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;i>k;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},"now":function(){return(new Date).getTime()},"uaMatch":function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{"browser":b[1]||"","version":b[2]||"0"}},"sub":function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(c,d){return d&&d instanceof e&&!(d instanceof a)&&(d=a(d)),e.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},"browser":{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test("\xa0")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){"complete"===c.readyState&&(c.detachEvent("onreadystatechange",C),e.ready())}),e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({"_Deferred":function(){var b,c,d,a=[],e={"done":function(){if(!d){var g,h,i,j,k,c=arguments;for(b&&(k=b,b=0),g=0,h=c.length;h>g;g++)i=c[g],j=f.type(i),"array"===j?e.done.apply(e,i):"function"===j&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},"resolveWith":function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{for(;a[0];)a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},"resolve":function(){return e.resolveWith(this,arguments),this},"isResolved":function(){return!(!c&&!b)},"cancel":function(){return d=1,a=[],this}};return e},"Deferred":function(a){var d,b=f._Deferred(),c=f._Deferred();return f.extend(b,{"then":function(a,c){return b.done(a).fail(c),this},"always":function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},"fail":c.done,"rejectWith":c.resolveWith,"reject":c.resolve,"isRejected":c.isResolved,"pipe":function(a,c){return f.Deferred(function(d){f.each({"done":[a,"resolve"],"fail":[c,"reject"]},function(a,c){var h,e=c[0],g=c[1];b[a](f.isFunction(e)?function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g+"With"](this===b?d:this,[h])}:d[g])})}).promise()},"promise":function(a){if(null==a){if(d)return d;d=a={}}for(var c=g.length;c--;)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b),b},"when":function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=1>=d&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;d>c;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var d,e,g,h,i,j,k,l,m,n,o,p,q,s,t,u,a=c.createElement("div"),b=c.documentElement;if(a.setAttribute("className","t"),a.innerHTML="
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0],!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={"leadingWhitespace":3===a.firstChild.nodeType,"tbody":!a.getElementsByTagName("tbody").length,"htmlSerialize":!!a.getElementsByTagName("link").length,"style":/top/.test(e.getAttribute("style")),"hrefNormalized":"/a"===e.getAttribute("href"),"opacity":/^0.55$/.test(e.style.opacity),"cssFloat":!!e.style.cssFloat,"checkOn":"on"===i.value,"optSelected":h.selected,"getSetAttribute":"t"!==a.className,"submitBubbles":!0,"changeBubbles":!0,"focusinBubbles":!1,"deleteExpando":!0,"noCloneEvent":!0,"inlineBlockNeedsLayout":!1,"shrinkWrapBlocks":!1,"reliableMarginRight":!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue="t"===i.value,i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={"visibility":"hidden","width":0,"height":0,"border":0,"margin":0,"background":"none"},m&&f.extend(p,{"position":"absolute","left":"-1000px","top":"-1000px"});for(t in p)o.style[t]=p[t];if(o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=2===a.offsetWidth,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=2===a.offsetWidth,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=2!==a.offsetWidth),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=0===q[0].offsetHeight,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&0===q[0].offsetHeight,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=0===(parseInt((c.defaultView.getComputedStyle(j,null)||{"marginRight":0}).marginRight,10)||0)),o.innerHTML="",n.removeChild(o),a.attachEvent)for(t in{"submit":1,"change":1,"focusin":1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u="function"==typeof a[s]),k[t+"Bubbles"]=u;return o=l=g=h=m=j=a=i=null,k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({"cache":{},"uuid":0,"expando":"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),"noData":{"embed":!0,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","applet":!0},"hasData":function(a){return a=a.nodeType?f.cache[a[f.expando]]:a[f.expando],!!a&&!l(a)},"data":function(a,c,d,e){if(f.acceptData(a)){var g,h,i=f.expando,j="string"==typeof c,k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if(!(!m||e&&m&&l[m]&&!l[m][i])||!j||d!==b)return m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop)),("object"==typeof c||"function"==typeof c)&&(e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c)),g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d),"events"!==c||g[c]?(j?(h=g[c],null==h&&(h=g[f.camelCase(c)])):h=g,h):g[i]&&g[i].events}},"removeData":function(a,b,c){if(f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(h[i]&&!(b&&(d=c?h[i][e]:h[i],d&&(d[b]||(b=f.camelCase(b)),delete d[b],!l(d)))||c&&(delete h[i][e],!l(h[i])))){var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}}},"_data":function(a,b,c){return f.data(a,b,c,!0)},"acceptData":function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return!(b===!0||a.getAttribute("classid")!==b)}return!0}}),f.fn.extend({"data":function(a,c){var d=null;if("undefined"==typeof a){if(this.length&&(d=f.data(this[0]),1===this[0].nodeType))for(var g,e=this[0].attributes,h=0,i=e.length;i>h;h++)g=e[h].name,0===g.indexOf("data-")&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]));return d}if("object"==typeof a)return this.each(function(){f.data(this,a)});var j=a.split(".");return j[1]=j[1]?"."+j[1]:"",c===b?(d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d)),d===b&&j[1]?this.data(j[0]):d):this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},"removeData":function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({"_mark":function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},"_unmark":function(a,c,d){if(a!==!0&&(d=c,c=a,a=!1),c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},"queue":function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);return d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d)),e||[]}},"dequeue":function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift();"inprogress"===d&&(d=c.shift()),d&&("fx"===b&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({"queue":function(a,c){return"string"!=typeof a&&(c=a,a="fx"),c===b?f.queue(this[0],a):this.each(function(){var b=f.queue(this,a,c);"fx"===a&&"inprogress"!==b[0]&&f.dequeue(this,a)})},"dequeue":function(a){return this.each(function(){f.dequeue(this,a)})},"delay":function(a,b){return a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},"clearQueue":function(a){return this.queue(a||"fx",[])},"promise":function(a,c){function m(){--h||d.resolveWith(e,[e])}"string"!=typeof a&&(c=a,a=b),a=a||"fx";for(var l,d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark";g--;)(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))&&(h++,l.done(m));return m(),d.promise()}});var u,v,n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;f.fn.extend({"attr":function(a,b){return f.access(this,a,b,!0,f.attr)},"removeAttr":function(a){return this.each(function(){f.removeAttr(this,a)})},"prop":function(a,b){return f.access(this,a,b,!0,f.prop)},"removeProp":function(a){return a=f.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},"addClass":function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&"string"==typeof a)for(b=a.split(o),c=0,d=this.length;d>c;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){for(g=" "+e.className+" ",h=0,i=b.length;i>h;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}else e.className=a;return this},"removeClass":function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&"string"==typeof a||a===b)for(c=(a||"").split(o),d=0,e=this.length;e>d;d++)if(g=this[d],1===g.nodeType&&g.className)if(a){for(h=(" "+g.className+" ").replace(n," "),i=0,j=c.length;j>i;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className="";return this},"toggleClass":function(a,b){var c=typeof a,d="boolean"==typeof b;return this.each(f.isFunction(a)?function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c)for(var e,g=0,h=f(this),i=b,j=a.split(o);e=j[g++];)i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e);else("undefined"===c||"boolean"===c)&&(this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||"")})},"hasClass":function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},"val":function(a){var c,d,e=this[0];if(!arguments.length)return e?(c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type],c&&"get"in c&&(d=c.get(e,"value"))!==b?d:(d=e.value,"string"==typeof d?d.replace(p,""):null==d?"":d)):b;var g=f.isFunction(a);return this.each(function(d){var h,e=f(this);1===this.nodeType&&(h=g?a.call(this,d,e.val()):a,null==h?h="":"number"==typeof h?h+="":f.isArray(h)&&(h=f.map(h,function(a){return null==a?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type],c&&"set"in c&&c.set(this,h,"value")!==b||(this.value=h))})}}),f.extend({"valHooks":{"option":{"get":function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},"select":{"get":function(a){var b,c=a.selectedIndex,d=[],e=a.options,g="select-one"===a.type;if(0>c)return null;for(var h=g?c:0,i=g?c+1:e.length;i>h;h++){var j=e[h];if(!(!j.selected||(f.support.optDisabled?j.disabled:null!==j.getAttribute("disabled"))||j.parentNode.disabled&&f.nodeName(j.parentNode,"optgroup"))){if(b=f(j).val(),g)return b;d.push(b)}}return g&&!d.length&&e.length?f(e[c]).val():d},"set":function(a,b){var c=f.makeArray(b);return f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},"attrFn":{"val":!0,"css":!0,"html":!0,"text":!0,"data":!0,"width":!0,"height":!0,"offset":!0},"attrFix":{"tabindex":"tabIndex"},"attr":function(a,c,d,e){var g=a.nodeType;if(!a||3===g||8===g||2===g)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=1!==g||!f.isXMLDoc(a);return j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u))),d!==b?null===d?(f.removeAttr(a,c),b):i&&"set"in i&&j&&(h=i.set(a,d,c))!==b?h:(a.setAttribute(c,""+d),d):i&&"get"in i&&j&&null!==(h=i.get(a,c))?h:(h=a.getAttribute(c),null===h?b:h)},"removeAttr":function(a,b){var c;1===a.nodeType&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},"attrHooks":{"type":{"set":function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&"radio"===b&&f.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},"value":{"get":function(a,b){return u&&f.nodeName(a,"button")?u.get(a,b):b in a?a.value:null},"set":function(a,b,c){return u&&f.nodeName(a,"button")?u.set(a,b,c):void(a.value=b)}}},"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(a,c,d){var e=a.nodeType;if(!a||3===e||8===e||2===e)return b;var g,h,i=1!==e||!f.isXMLDoc(a);return i&&(c=f.propFix[c]||c,h=f.propHooks[c]),d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&null!==(g=h.get(a,c))?g:a[c]},"propHooks":{"tabIndex":{"get":function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={"get":function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},"set":function(a,b,c){var d;return b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},f.support.getSetAttribute||(u=f.valHooks.button={"get":function(a,c){var d;return d=a.getAttributeNode(c),d&&""!==d.nodeValue?d.nodeValue:b},"set":function(a,b,d){var e=a.getAttributeNode(d);return e||(e=c.createAttribute(d),a.setAttributeNode(e)),e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{"set":function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{"get":function(a){var d=a.getAttribute(c,2);return null===d?b:d}})}),f.support.style||(f.attrHooks.style={"get":function(a){return a.style.cssText.toLowerCase()||b},"set":function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{"get":function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={"get":function(a){return null===a.getAttribute("value")?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{"set":function(a,b){return f.isArray(b)?a.checked=f.inArray(f(a).val(),b)>=0:void 0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={"add":function(a,c,d,e){if(3!==a.nodeType&&8!==a.nodeType){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(i){var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return"undefined"==typeof f||a&&f.event.triggered===a.type?b:f.event.handle.apply(k.elem,arguments)}),k.elem=a,c=c.split(" ");for(var l,n,m=0;l=c[m++];){h=g?f.extend({},g):{"handler":d,"data":e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};o||(o=j[l]=[],p.setup&&p.setup.call(a,e,n,k)!==!1||(a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k))),p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}}},"global":{},"remove":function(a,c,d,e){if(3!==a.nodeType&&8!==a.nodeType){d===!1&&(d=C);var g,h,j,l,m,n,o,p,q,r,k=0,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(s&&t)if(c&&c.type&&(d=c.handler,c=c.type),!c||"string"==typeof c&&"."===c.charAt(0)){c=c||"";for(h in t)f.event.remove(a,h+c)}else{for(c=c.split(" ");h=c[k++];)if(r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h])if(d){for(o=f.event.special[h]||{},j=e||0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort()),e&&!f.event.customEvent[h]||f.event.global[h]){if(c="object"==typeof c?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"),(g||!e)&&(c.preventDefault(),c.stopPropagation()),!e)return void f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});if(3!==e.nodeType&&8!==e.nodeType){c.result=b,c.target=e,d=null!=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if(!(o._default&&o._default.call(e.ownerDocument,c)!==!1||"click"===h&&f.nodeName(e,"a")||!f.acceptData(e))){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}}},"handle":function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;i>h;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);if(k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation())),c.isImmediatePropagationStopped())break}}return c.result},"props":"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),"fix":function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var g,e=this.props.length;e;)g=this.props[--e],a[g]=d[g];if(a.target||(a.target=a.srcElement||c),3===a.target.nodeType&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),null==a.pageX&&null!=a.clientX){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}return null!=a.which||null==a.charCode&&null==a.keyCode||(a.which=null!=a.charCode?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),a.which||a.button===b||(a.which=1&a.button?1:2&a.button?3:4&a.button?2:0),a},"guid":1e8,"proxy":f.proxy,"special":{"ready":{"setup":f.bindReady,"teardown":f.noop},"live":{"add":function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{"handler":L,"guid":a.handler.guid}))},"remove":function(a){f.event.remove(this,M(a.origType,a.selector),a)}},"beforeunload":{"setup":function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},"teardown":function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){return this.preventDefault?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),void(this[f.expando]=!0)):new f.Event(a,b)},f.Event.prototype={"preventDefault":function(){this.isDefaultPrevented=D;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},"stopPropagation":function(){this.isPropagationStopped=D;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},"stopImmediatePropagation":function(){this.isImmediatePropagationStopped=D,this.stopPropagation()},"isDefaultPrevented":C,"isPropagationStopped":C,"isImmediatePropagationStopped":C};var E=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};if(f.each({"mouseenter":"mouseover","mouseleave":"mouseout"},function(a,b){f.event.special[a]={"setup":function(c){f.event.add(this,b,c&&c.selector?F:E,a)},"teardown":function(a){f.event.remove(this,b,a&&a.selector?F:E)}}}),f.support.submitBubbles||(f.event.special.submit={"setup":function(){return f.nodeName(this,"form")?!1:(f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";"submit"!==c&&"image"!==c||!f(b).closest("form").length||J("submit",this,arguments)}),void f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";"text"!==c&&"password"!==c||!f(b).closest("form").length||13!==a.keyCode||J("submit",this,arguments)}))},"teardown":function(){f.event.remove(this,".specialSubmit")}}),!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;return"radio"===b||"checkbox"===b?c=a.checked:"select-multiple"===b?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex),c},I=function(a){var d,e,c=a.target;x.test(c.nodeName)&&!c.readOnly&&(d=f._data(c,"_change_data"),e=H(c),("focusout"!==a.type||"radio"!==c.type)&&f._data(c,"_change_data",e),d!==b&&e!==d&&(null!=d||e)&&(a.type="change",a.liveFired=b,f.event.trigger(a,arguments[1],c)))};f.event.special.change={"filters":{"focusout":I,"beforedeactivate":I,"click":function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";("radio"===c||"checkbox"===c||f.nodeName(b,"select"))&&I.call(this,a)},"keydown":function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(13===a.keyCode&&!f.nodeName(b,"textarea")||32===a.keyCode&&("checkbox"===c||"radio"===c)||"select-multiple"===c)&&I.call(this,a)},"beforeactivate":function(a){var b=a.target;f._data(b,"_change_data",H(b))}},"setup":function(){if("file"===this.type)return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},"teardown":function(){return f.event.remove(this,".specialChange"),x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({"focus":"focusin","blur":"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={"setup":function(){0===d++&&c.addEventListener(a,e,!0)},"teardown":function(){0===--d&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if("object"==typeof a){for(var h in a)this[c](h,d,a[h],e);return this}if((2===arguments.length||d===!1)&&(e=d,d=b),"one"===c?(g=function(a){return f(this).unbind(a,g),e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e,"unload"===a&&"one"!==c)this.one(a,d,e);else for(var i=0,j=this.length;j>i;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({"unbind":function(a,b){if("object"!=typeof a||a.preventDefault)for(var d=0,e=this.length;e>d;d++)f.event.remove(this[d],a,b);else for(var c in a)this.unbind(c,a[c]);return this},"delegate":function(a,b,c,d){return this.live(b,c,d,a)},"undelegate":function(a,b,c){return 0===arguments.length?this.unbind("live"):this.die(b,null,c,a)},"trigger":function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},"triggerHandler":function(a,b){return this[0]?f.event.trigger(a,b,this[0],!0):void 0},"toggle":function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;return f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};for(e.guid=c;dp;p++)f.event.add(n[p],"live."+M(h,m),{"data":d,"selector":m,"handler":e,"origType":h,"origHandler":e,"preType":l});else n.unbind("live."+M(h,m),e);else a.push("mouseenter"+k,"mouseleave"+k);return this}}),f.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".split(" "),function(a,b){f.fn[b]=function(a,c){return null==c&&(c=a,a=null),arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function t(a,b,c,d,e,f){for(var g=0,h=d.length;h>g;g++){var i=d[g];if(i){var j=!1;for(i=i[a];i;){if(i.sizcache===c){j=d[i.sizset];break}if(1!==i.nodeType||f||(i.sizcache=c,i.sizset=g),i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}function u(a,b,c,d,e,f){for(var g=0,h=d.length;h>g;g++){var i=d[g];if(i){var j=!1;for(i=i[a];i;){if(i.sizcache===c){j=d[i.sizset];break}if(1===i.nodeType)if(f||(i.sizcache=c,i.sizset=g),"string"!=typeof b){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){return h=!1,0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(1!==d.nodeType&&9!==d.nodeType)return[];if(!b||"string"!=typeof b)return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do if(a.exec(""),i=a.exec(y),i&&(y=i[3],x.push(i[1]),i[2])){o=i[3];break}while(i);if(x.length>1&&m.exec(b))if(2===x.length&&l.relative[x[0]])j=v(x[0]+x[1],d);else for(j=l.relative[x[0]]?[d]:k(x.shift(),d);x.length;)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j);else if(!g&&x.length>1&&9===d.nodeType&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]),d)for(q=g?{"expr":x.pop(),"set":p(g)}:k.find(x.pop(),1!==x.length||"~"!==x[0]&&"+"!==x[0]||!d.parentNode?d:d.parentNode,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;x.length;)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",null==s&&(s=d),l.relative[r](n,s,w);else n=x=[];if(n||(n=j),n||k.error(r||b),"[object Array]"===e.call(n))if(u)if(d&&1===d.nodeType)for(t=0;null!=n[t];t++)n[t]&&(n[t]===!0||1===n[t].nodeType&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;null!=n[t];t++)n[t]&&1===n[t].nodeType&&f.push(j[t]);else f.push.apply(f,n);else p(n,f);return o&&(k(o,h,f,g),k.uniqueSort(f)),f};k.uniqueSort=function(a){if(r&&(g=h,a.sort(r),g))for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;f>e;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];if(g.splice(1,1),"\\"!==j.substr(j.length-1)&&(g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c),null!=d)){a=a.replace(l.match[h],"");break}}}return d||(d="undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]),{"set":d,"expr":a}},k.filter=function(a,c,d,e){for(var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);a&&c.length;){for(var n in l.filter)if(null!=(f=l.leftMatch[n].exec(a))&&f[2]){var o,p,q=l.filter[n],r=f[1];if(g=!1,f.splice(1,1),"\\"===r.substr(r.length-1))continue;if(j===i&&(i=[]),l.preFilter[n])if(f=l.preFilter[n](f,j,d,i,e,m)){if(f===!0)continue}else g=o=!0;if(f)for(var s=0;null!=(p=j[s]);s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&null!=o?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){if(d||(j=i),a=a.replace(l.match[n],""),!g)return[];break}}if(a===h){if(null!=g)break;k.error(a)}h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.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(a){return a.getAttribute("href")},"type":function(a){return a.getAttribute("type")}},"relative":{"+":function(a,b){var c="string"==typeof b,d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var h,f=0,g=a.length;g>f;f++)if(h=a[f]){for(;(h=h.previousSibling)&&1!==h.nodeType;);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d="string"==typeof b,e=0,f=a.length;if(d&&!j.test(b)){for(b=b.toLowerCase();f>e;e++)if(c=a[e]){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}else{for(;f>e;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;"string"!=typeof b||j.test(b)||(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;"string"!=typeof b||j.test(b)||(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},"find":{"ID":function(a,b,c){if("undefined"!=typeof b.getElementById&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},"NAME":function(a,b){if("undefined"!=typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;f>e;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return 0===c.length?null:c}},"TAG":function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a[1]):void 0}},"preFilter":{"CLASS":function(a,b,c,d,e,f){if(a=" "+a[1].replace(i,"")+" ",f)return a;for(var h,g=0;null!=(h=b[g]);g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},"ID":function(a){return a[1].replace(i,"")},"TAG":function(a){return a[1].replace(i,"").toLowerCase()},"CHILD":function(a){if("nth"===a[1]){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);return a[0]=d++,a},"ATTR":function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");return!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),"~="===a[2]&&(a[4]=" "+a[4]+" "),a},"PSEUDO":function(b,c,d,e,f){if("not"===b[1]){if(!((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))){var g=k.filter(b[3],c,d,!0^f);return d||e.push.apply(e,g),!1}b[3]=k(b[3],null,null,c)}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},"POS":function(a){return a.unshift(!0),a}},"filters":{"enabled":function(a){return a.disabled===!1&&"hidden"!==a.type},"disabled":function(a){return a.disabled===!0},"checked":function(a){return a.checked===!0},"selected":function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},"parent":function(a){return!!a.firstChild},"empty":function(a){return!a.firstChild},"has":function(a,b,c){return!!k(c[3],a).length},"header":function(a){return/h\d/i.test(a.nodeName)},"text":function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},"radio":function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},"checkbox":function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},"file":function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},"password":function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},"submit":function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},"image":function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},"reset":function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},"button":function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},"input":function(a){return/input|select|textarea|button/i.test(a.nodeName)},"focus":function(a){return a===a.ownerDocument.activeElement}},"setFilters":{"first":function(a,b){return 0===b},"last":function(a,b,c,d){return b===d.length-1},"even":function(a,b){return b%2===0},"odd":function(a,b){return b%2===1},"lt":function(a,b,c){return bc[3]-0},"nth":function(a,b,c){return c[3]-0===b},"eq":function(a,b,c){return c[3]-0===b}},"filter":{"PSEUDO":function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if("not"===e){for(var g=b[3],h=0,i=g.length;i>h;h++)if(g[h]===a)return!1;return!0}k.error(e)},"CHILD":function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":for(;d=d.previousSibling;)if(1===d.nodeType)return!1;if("first"===c)return!0;d=a;case"last":for(;d=d.nextSibling;)if(1===d.nodeType)return!1;return!0;case"nth":var e=b[2],f=b[3];if(1===e&&0===f)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)1===d.nodeType&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return 0===e?0===j:j%e===0&&j/e>=0}},"ID":function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},"TAG":function(a,b){return"*"===b&&1===a.nodeType||a.nodeName.toLowerCase()===b},"CLASS":function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},"ATTR":function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return null==d?"!="===f:"="===f?e===g:"*="===f?e.indexOf(g)>=0:"~="===f?(" "+e+" ").indexOf(g)>=0:g?"!="===f?e!==g:"^="===f?0===e.indexOf(g):"$="===f?e.substr(e.length-g.length)===g:"|="===f?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},"POS":function(a,b,c,d){var e=b[2],f=l.setFilters[e];return f?f(a,c,b,d):void 0}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){return a=Array.prototype.slice.call(a,0),b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if("[object Array]"===e.call(a))Array.prototype.push.apply(d,a);else if("number"==typeof a.length)for(var f=a.length;f>c;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){return a===b?(g=!0,0):a.compareDocumentPosition&&b.compareDocumentPosition?4&a.compareDocumentPosition(b)?-1:1:a.compareDocumentPosition?-1:1}:(r=function(a,b){if(a===b)return g=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;for(;j;)e.unshift(j),j=j.parentNode;for(j=i;j;)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;c>k&&d>k;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;for(var d=a.nextSibling;d;){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){for(var c,b="",d=0;a[d];d++)c=a[d],3===c.nodeType||4===c.nodeType?b+=c.nodeValue:8!==c.nodeType&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if("undefined"!=typeof c.getElementById&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||"undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&"undefined"!=typeof a.firstChild.getAttribute&&"#"!==a.firstChild.getAttribute("href")&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&!function(){var a=k,b=c.createElement("div"),d="__sizzle__";if(b.innerHTML="

",!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){k=function(b,e,f,g){if(e=e||c,!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(1===e.nodeType||9===e.nodeType)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(9===e.nodeType){if("body"===b&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(1===e.nodeType&&"object"!==e.nodeName.toLowerCase()){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){if(c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&11!==a.document.nodeType)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
",a.getElementsByClassName&&0!==a.getElementsByClassName("e").length&&(a.lastChild.className="e",1!==a.getElementsByClassName("e").length&&(l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){return"undefined"==typeof b.getElementsByClassName||c?void 0:b.getElementsByClassName(a[1])},a=null))}(),k.contains=c.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?function(a,b){return!!(16&a.compareDocumentPosition(b))}:function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?"HTML"!==b.nodeName:!1};var v=function(a,b){for(var c,d=[],e="",f=b.nodeType?[b]:b;c=l.match.PSEUDO.exec(a);)e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;h>g;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={"children":!0,"contents":!0,"next":!0,"prev":!0};f.fn.extend({"find":function(a){var c,d,b=this;if("string"!=typeof a)return f(a).filter(function(){for(c=0,d=b.length;d>c;c++)if(f.contains(b[c],this))return!0});var g,h,i,e=this.pushStack("","find",a);for(c=0,d=this.length;d>c;c++)if(g=e.length,f.find(a,this[c],e),c>0)for(h=g;hi;i++)if(e[i]===e[h]){e.splice(h--,1);break}return e},"has":function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;c>a;a++)if(f.contains(this,b[a]))return!0})},"not":function(a){return this.pushStack(V(this,a,!1),"not",a)},"filter":function(a){return this.pushStack(V(this,a,!0),"filter",a)},"is":function(a){return!!a&&("string"==typeof a?f.filter(a,this).length>0:this.filter(a).length>0)},"closest":function(a,b){var d,e,c=[],g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;e>d;d++)i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i);for(;g&&g.ownerDocument&&g!==b;){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({"selector":i,"elem":g,"level":k});g=g.parentNode,k++}}return c}var l=S.test(a)||"string"!=typeof a?f(a,b||this.context):0;for(d=0,e=this.length;e>d;d++)for(g=this[d];g;){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}if(g=g.parentNode,!g||!g.ownerDocument||g===b||11===g.nodeType)break}return c=c.length>1?f.unique(c):c,this.pushStack(c,"closest",a)},"index":function(a){return a?"string"==typeof a?f.inArray(this[0],f(a)):f.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},"add":function(a,b){var c="string"==typeof a?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},"andSelf":function(){return this.add(this.prevObject)}}),f.each({"parent":function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},"parents":function(a){return f.dir(a,"parentNode")},"parentsUntil":function(a,b,c){return f.dir(a,"parentNode",c)},"next":function(a){return f.nth(a,2,"nextSibling")},"prev":function(a){return f.nth(a,2,"previousSibling")},"nextAll":function(a){return f.dir(a,"nextSibling")},"prevAll":function(a){return f.dir(a,"previousSibling")},"nextUntil":function(a,b,c){return f.dir(a,"nextSibling",c)},"prevUntil":function(a,b,c){return f.dir(a,"previousSibling",c)},"siblings":function(a){return f.sibling(a.parentNode.firstChild,a)},"children":function(a){return f.sibling(a.firstChild)},"contents":function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);return N.test(a)||(d=c),d&&"string"==typeof d&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse()),this.pushStack(e,a,g.join(","))}}),f.extend({"filter":function(a,b,c){return c&&(a=":not("+a+")"),1===b.length?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},"dir":function(a,c,d){for(var e=[],g=a[c];g&&9!==g.nodeType&&(d===b||1!==g.nodeType||!f(g).is(d));)1===g.nodeType&&e.push(g),g=g[c];return e},"nth":function(a,b,c){b=b||1;for(var e=0;a&&(1!==a.nodeType||++e!==b);a=a[c]);return a},"sibling":function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/<([\w:]+)/,$=/",""],"legend":[1,"
","
"],"thead":[1,"","
"],"tr":[2,"","
"],"td":[3,"","
"],"col":[2,"","
"],"area":[1,"",""],"_default":[0,"",""]};eb.optgroup=eb.option,eb.tbody=eb.tfoot=eb.colgroup=eb.caption=eb.thead,eb.th=eb.td,f.support.htmlSerialize||(eb._default=[1,"div
","
"]),f.fn.extend({"text":function(a){return f.isFunction(a)?this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))}):"object"!=typeof a&&a!==b?this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a)):f.text(this)},"wrapAll":function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},"wrapInner":function(a){return this.each(f.isFunction(a)?function(b){f(this).wrapInner(a.call(this,b))}:function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},"wrap":function(a){return this.each(function(){f(this).wrapAll(a)})},"unwrap":function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},"append":function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.appendChild(a)})},"prepend":function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.insertBefore(a,this.firstChild)})},"before":function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);return a.push.apply(a,this.toArray()),this.pushStack(a,"before",arguments)}},"after":function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);return a.push.apply(a,f(arguments[0]).toArray()),a}},"remove":function(a,b){for(var d,c=0;null!=(d=this[c]);c++)(!a||f.filter(a,[d]).length)&&(b||1!==d.nodeType||(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d));return this},"empty":function(){for(var b,a=0;null!=(b=this[a]);a++)for(1===b.nodeType&&f.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},"clone":function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return f.clone(this,a,b)})},"html":function(a){if(a===b)return this[0]&&1===this[0].nodeType?this[0].innerHTML.replace(W,""):null;if("string"!=typeof a||ab.test(a)||!f.support.leadingWhitespace&&X.test(a)||eb[(Z.exec(a)||["",""])[1].toLowerCase()])f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;d>c;c++)1===this[c].nodeType&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}return this},"replaceWith":function(a){return this[0]&&this[0].parentNode?f.isFunction(a)?this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))}):("string"!=typeof a&&(a=f(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})):this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},"detach":function(a){return this.remove(a,!0)},"domManip":function(a,c,d){var e,g,h,i,j=a[0],k=[]; +if(!f.support.checkClone&&3===arguments.length&&"string"==typeof j&&bb.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){if(i=j&&j.parentNode,e=f.support.parentNode&&i&&11===i.nodeType&&i.childNodes.length===this.length?{"fragment":i}:f.buildFragment(a,this,k),h=e.fragment,g=1===h.childNodes.length?h=h.firstChild:h.firstChild){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;m>l;l++)d.call(c?fb(this[l],g):this[l],e.cacheable||m>1&&n>l?f.clone(h,!0,!0):h)}k.length&&f.each(k,lb)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;return b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),1===a.length&&"string"==typeof a[0]&&a[0].length<512&&i===c&&"<"===a[0].charAt(0)&&!ab.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&1!==h&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1),{"fragment":e,"cacheable":g}},f.fragments={},f.each({"appendTo":"append","prependTo":"prepend","insertBefore":"before","insertAfter":"after","replaceAll":"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=1===this.length&&this[0].parentNode;if(g&&11===g.nodeType&&1===g.childNodes.length&&1===e.length)return e[b](this[0]),this;for(var h=0,i=e.length;i>h;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({"clone":function(a,b,c){var e,g,h,d=a.cloneNode(!0);if(!(f.support.noCloneEvent&&f.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||f.isXMLDoc(a)))for(hb(a,d),e=ib(a),g=ib(d),h=0;e[h];++h)g[h]&&hb(e[h],g[h]);if(b&&(gb(a,d),c))for(e=ib(a),g=ib(d),h=0;e[h];++h)gb(e[h],g[h]);return e=g=null,d},"clean":function(a,b,d,e){var g;b=b||c,"undefined"==typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var i,k,h=[],j=0;null!=(k=a[j]);j++)if("number"==typeof k&&(k+=""),k){if("string"==typeof k)if(_.test(k)){k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=eb[l]||eb._default,n=m[0],o=b.createElement("div");for(o.innerHTML=m[1]+k+m[2];n--;)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q="table"!==l||p?""!==m[1]||p?[]:o.childNodes:o.firstChild&&o.firstChild.childNodes;for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}else k=b.createTextNode(k);var r;if(!f.support.appendChecked)if(k[0]&&"number"==typeof(r=k.length))for(i=0;r>i;i++)kb(k[i]);else kb(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d)for(g=function(a){return!a.type||cb.test(a.type)},j=0;h[j];j++)if(!e||!f.nodeName(h[j],"script")||h[j].type&&"text/javascript"!==h[j].type.toLowerCase()){if(1===h[j].nodeType){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}else e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);return h},"cleanData":function(a){for(var b,c,j,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando,i=0;null!=(j=a[i]);i++)if((!j.nodeName||!f.noData[j.nodeName.toLowerCase()])&&(c=j[f.expando])){if(b=d[c]&&d[c][e],b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}});var vb,wb,xb,mb=/alpha\([^)]*\)/i,nb=/opacity=([^)]*)/,ob=/([A-Z]|^ms)/g,pb=/^-?\d+(?:px)?$/i,qb=/^-?\d/,rb=/^([\-+])=([\-+.\de]+)/,sb={"position":"absolute","visibility":"hidden","display":"block"},tb=["Left","Right"],ub=["Top","Bottom"];f.fn.css=function(a,c){return 2===arguments.length&&c===b?this:f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({"cssHooks":{"opacity":{"get":function(a,b){if(b){var c=vb(a,"opacity","opacity");return""===c?"1":c}return a.style.opacity}}},"cssNumber":{"fillOpacity":!0,"fontWeight":!0,"lineHeight":!0,"opacity":!0,"orphans":!0,"widows":!0,"zIndex":!0,"zoom":!0},"cssProps":{"float":f.support.cssFloat?"cssFloat":"styleFloat"},"style":function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];if(c=f.cssProps[i]||i,d===b)return k&&"get"in k&&(g=k.get(a,!1,e))!==b?g:j[c];if(h=typeof d,"string"===h&&(g=rb.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number"),!(null==d||"number"===h&&isNaN(d)||("number"!==h||f.cssNumber[i]||(d+="px"),k&&"set"in k&&(d=k.set(a,d))===b)))try{j[c]=d}catch(l){}}},"css":function(a,c,d){var e,g;return c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,"cssFloat"===c&&(c="float"),g&&"get"in g&&(e=g.get(a,!0,d))!==b?e:vb?vb(a,c):void 0},"swap":function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={"get":function(a,c,d){var e;return c?0!==a.offsetWidth?yb(a,b,d):(f.swap(a,sb,function(){e=yb(a,b,d)}),e):void 0},"set":function(a,b){return pb.test(b)?(b=parseFloat(b),b>=0?b+"px":void 0):b}}}),f.support.opacity||(f.cssHooks.opacity={"get":function(a,b){return nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},"set":function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+100*b+")",g=d&&d.filter||c.filter||"";c.zoom=1,b>=1&&""===f.trim(g.replace(mb,""))&&(c.removeAttribute("filter"),d&&!d.filter)||(c.filter=mb.test(g)?g.replace(mb,e):g+" "+e)}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={"get":function(a,b){var c;return f.swap(a,{"display":"inline-block"},function(){c=b?vb(a,"margin-right","marginRight"):a.style.marginRight}),c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(wb=function(a,c){var d,e,g;return c=c.replace(ob,"-$1").toLowerCase(),(e=a.ownerDocument.defaultView)?((g=e.getComputedStyle(a,null))&&(d=g.getPropertyValue(c),""!==d||f.contains(a.ownerDocument.documentElement,a)||(d=f.style(a,c))),d):b}),c.documentElement.currentStyle&&(xb=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;return!pb.test(d)&&qb.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left="fontSize"===b?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e)),""===d?"auto":d}),vb=wb||xb,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return 0===b&&0===c||!f.support.reliableHiddenOffsets&&"none"===(a.style.display||f.css(a,"display"))},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var Rb,Sb,zb=/%20/g,Ab=/\[\]$/,Bb=/\r?\n/g,Cb=/#.*$/,Db=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Eb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Fb=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib=/\?/,Jb=/)<[^<]*)*<\/script>/gi,Kb=/^(?:select|textarea)/i,Lb=/\s+/,Mb=/([?&])_=[^&]*/,Nb=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Ob=f.fn.load,Pb={},Qb={},Tb=["*/"]+["*"];try{Rb=e.href}catch(Ub){Rb=c.createElement("a"),Rb.href="",Rb=Rb.href}Sb=Nb.exec(Rb.toLowerCase())||[],f.fn.extend({"load":function(a,c,d){if("string"!=typeof a&&Ob)return Ob.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):"object"==typeof c&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;return f.ajax({"url":a,"type":h,"dataType":"html","data":c,"complete":function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(Jb,"")).find(g):c)),d&&i.each(d,[c,b,a])}}),this},"serialize":function(){return f.param(this.serializeArray())},"serializeArray":function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Kb.test(this.nodeName)||Eb.test(this.type))}).map(function(a,b){var c=f(this).val();return null==c?null:f.isArray(c)?f.map(c,function(a){return{"name":b.name,"value":a.replace(Bb,"\r\n")}}):{"name":b.name,"value":c.replace(Bb,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){return f.isFunction(d)&&(g=g||e,e=d,d=b),f.ajax({"type":c,"url":a,"data":d,"success":e,"dataType":g})}}),f.extend({"getScript":function(a,c){return f.get(a,b,c,"script")},"getJSON":function(a,b,c){return f.get(a,b,c,"json")},"ajaxSetup":function(a,b){return b?Xb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),Xb(a,b),a},"ajaxSettings":{"url":Rb,"isLocal":Fb.test(Sb[1]),"global":!0,"type":"GET","contentType":"application/x-www-form-urlencoded","processData":!0,"async":!0,"accepts":{"xml":"application/xml, text/xml","html":"text/html","text":"text/plain","json":"application/json, text/javascript","*":Tb},"contents":{"xml":/xml/,"html":/html/,"json":/json/},"responseFields":{"xml":"responseXML","text":"responseText"},"converters":{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},"flatOptions":{"context":!0,"url":!0}},"ajaxPrefilter":Vb(Pb),"ajaxTransport":Vb(Qb),"ajax":function(a,c){function w(a,c,l,m){if(2!==s){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,y,z,w=c,x=l?Zb(d,v,l):b;if(a>=200&&300>a||304===a)if(d.ifModified&&((y=v.getResponseHeader("Last-Modified"))&&(f.lastModified[k]=y),(z=v.getResponseHeader("Etag"))&&(f.etag[k]=z)),304===a)w="notmodified",o=!0;else try{r=$b(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}else u=w,(!w||a)&&(w="error",0>a&&(a=0));v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}"object"==typeof a&&(c=a,a=b),c=c||{};var k,n,o,p,q,r,t,u,d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},l={},m={},s=0,v={"readyState":0,"setRequestHeader":function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},"getAllResponseHeaders":function(){return 2===s?n:null},"getResponseHeader":function(a){var c;if(2===s){if(!o)for(o={};c=Db.exec(n);)o[c[1].toLowerCase()]=c[2];c=o[a.toLowerCase()]}return c===b?null:c},"overrideMimeType":function(a){return s||(d.mimeType=a),this},"abort":function(a){return a=a||"abort",p&&p.abort(a),w(0,a),this}};if(h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(2>s)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(Cb,"").replace(Hb,Sb[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(Lb),null==d.crossDomain&&(r=Nb.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==Sb[1]&&r[2]==Sb[2]&&(r[3]||("http:"===r[1]?80:443))==(Sb[3]||("http:"===Sb[1]?80:443)))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=f.param(d.data,d.traditional)),Wb(Pb,d,c,v),2===s)return!1;if(t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!Gb.test(d.type),t&&0===f.active++&&f.event.trigger("ajaxStart"),!d.hasContent&&(d.data&&(d.url+=(Ib.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url,d.cache===!1)){var x=f.now(),y=d.url.replace(Mb,"$1_="+x);d.url=y+(y===d.url?(Ib.test(d.url)?"&":"?")+"_="+x:"")}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Tb+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||2===s))return v.abort(),!1;for(u in{"success":1,"error":1,"complete":1})v[u](d[u]);if(p=Wb(Qb,d,c,v)){v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){2>s?w(-1,z):f.error(z)}}else w(-1,"No Transport");return v},"param":function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=f.ajaxSettings.traditional),f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)Yb(g,a[g],c,e);return d.join("&").replace(zb,"+")}}),f.extend({"active":0,"lastModified":{},"etag":{}});var ac=(f.now(),/(\=)\?(&|$)|\?\?/i);f.ajaxSetup({"jsonp":"callback","jsonpCallback":function(){return"jQuery"+Math.floor(1e7*Math.random())}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e="application/x-www-form-urlencoded"===b.contentType&&"string"==typeof b.data;if("jsonp"===b.dataTypes[0]||b.jsonp!==!1&&(ac.test(b.url)||e&&ac.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";return b.jsonp!==!1&&(j=j.replace(ac,l),b.url===j&&(e&&(k=k.replace(ac,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){return g||f.error(h+" was not called"),g[0]},b.dataTypes[0]="json","script"}}),f.ajaxSetup({"accepts":{"script":"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},"contents":{"script":/javascript|ecmascript/},"converters":{"text script":function(a){return f.globalEval(a),a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{"send":function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){(c||!d.readyState||/loaded|complete/.test(d.readyState))&&(d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success"))},e.insertBefore(d,e.firstChild)},"abort":function(){d&&d.onload(0,1)}}}});var dc,bc=a.ActiveXObject?function(){for(var a in dc)dc[a](0,1)}:!1,cc=0;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ec()||fc()}:ec,function(a){f.extend(f.support,{"ajax":!!a,"cors":!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{"send":function(e,g){var i,j,h=c.xhr();if(c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async),c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||4===h.readyState))if(d=b,i&&(h.onreadystatechange=f.noop,bc&&delete dc[i]),e)4!==h.readyState&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}j||!c.isLocal||c.crossDomain?1223===j&&(j=204):j=m.text?200:404}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},c.async&&4!==h.readyState?(i=++cc,bc&&(dc||(dc={},f(a).unload(bc)),dc[i]=d),h.onreadystatechange=d):d()},"abort":function(){d&&d(0,1)}}}});var hc,ic,lc,nc,gc={},jc=/^(?:toggle|show|hide)$/,kc=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,mc=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];f.fn.extend({"show":function(a,b,c){var d,e;if(a||0===a)return this.animate(qc("show",3),a,b,c);for(var g=0,h=this.length;h>g;g++)d=this[g],d.style&&(e=d.style.display,f._data(d,"olddisplay")||"none"!==e||(e=d.style.display=""),""===e&&"none"===f.css(d,"display")&&f._data(d,"olddisplay",rc(d.nodeName)));for(g=0;h>g;g++)d=this[g],d.style&&(e=d.style.display,(""===e||"none"===e)&&(d.style.display=f._data(d,"olddisplay")||""));return this},"hide":function(a,b,c){if(a||0===a)return this.animate(qc("hide",3),a,b,c);for(var d=0,e=this.length;e>d;d++)if(this[d].style){var g=f.css(this[d],"display");"none"===g||f._data(this[d],"olddisplay")||f._data(this[d],"olddisplay",g)}for(d=0;e>d;d++)this[d].style&&(this[d].style.display="none");return this},"_toggle":f.fn.toggle,"toggle":function(a,b,c){var d="boolean"==typeof a;return f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(qc("toggle",3),a,b,c),this},"fadeTo":function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({"opacity":b},a,c,d)},"animate":function(a,b,c,d){var e=f.speed(b,c,d);return f.isEmptyObject(a)?this.each(e.complete,[!1]):(a=f.extend({},a),this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var g,h,i,j,k,l,m,n,o,b=f.extend({},e),c=1===this.nodeType,d=c&&f(this).is(":hidden");b.animatedProperties={};for(i in a){if(g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing","hide"===h&&d||"show"===h&&!d)return b.complete.call(this);!c||"height"!==g&&"width"!==g||(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===f.css(this,"display")&&"none"===f.css(this,"float")&&(f.support.inlineBlockNeedsLayout?(j=rc(this.nodeName),"inline"===j?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}null!=b.overflow&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],jc.test(h)?k["toggle"===h?d?"show":"hide":h]():(l=kc.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),"px"!==o&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=("-="===l[1]?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0}))},"stop":function(a,b){return a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;for(b||f._unmark(!0,this);c--;)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue(),this}}),f.each({"slideDown":qc("show",1),"slideUp":qc("hide",1),"slideToggle":qc("toggle",1),"fadeIn":{"opacity":"show"},"fadeOut":{"opacity":"hide"},"fadeToggle":{"opacity":"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({"speed":function(a,b,c){var d=a&&"object"==typeof a?f.extend({},a):{"complete":c||!c&&b||f.isFunction(a)&&a,"duration":a,"easing":c&&b||b&&!f.isFunction(b)&&b};return d.duration=f.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)},d},"easing":{"linear":function(a,b,c,d){return c+d*a},"swing":function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},"timers":[],"fx":function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={"update":function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},"cur":function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?b&&"auto"!==b?b:0:a},"custom":function(a,b,c){function g(a){return d.step(a)}var d=this,e=f.fx;this.startTime=nc||oc(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!lc&&(lc=setInterval(e.tick,e.interval))},"show":function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur()),f(this.elem).show()},"hide":function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},"step":function(a){var g,h,b=nc||oc(),c=!0,d=this.elem,e=this.options;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){if(null==e.overflow||f.support.shrinkWrapBlocks||f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide(),e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}return 1/0==e.duration?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},f.extend(f.fx,{"tick":function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{"position":"absolute","top":0,"left":0,"margin":0,"border":0,"width":"1px","height":"1px","visibility":"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=5!==e.offsetTop,this.doesAddBorderForTableAndCells=5===h.offsetTop,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=20===e.offsetTop||15===e.offsetTop,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=-5===e.offsetTop,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},"bodyOffset":function(a){var b=a.offsetTop,c=a.offsetLeft;return f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0),{"top":b,"left":c}},"setOffset":function(a,b,c){var d=f.css(a,"position");"static"===d&&(a.style.position="relative");var m,n,e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=("absolute"===d||"fixed"===d)&&f.inArray("auto",[h,i])>-1,k={},l={};j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),null!=b.top&&(k.top=b.top-g.top+m),null!=b.left&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({"position":function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=tc.test(b[0].nodeName)?{"top":0,"left":0}:b.offset();return c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0,{"top":c.top-d.top,"left":c.left-d.left}},"offsetParent":function(){return this.map(function(){for(var a=this.offsetParent||c.body;a&&!tc.test(a.nodeName)&&"static"===f.css(a,"position");)a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;return c===b?(e=this[0])?(g=uc(e),g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]):null:this.each(function(){g=uc(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return null==a?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return"CSS1Compat"===e.document.compatMode&&g||h&&h["client"+c]||g}if(9===e.nodeType)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,"string"==typeof a?a:a+"px")}}),a.jQuery=a.$=f}(window); +/* jdf-2.0.0/ ui.js Date:2017-10-26 17:09:35 */ +!function(a,b){!function(){var a=navigator.userAgent.toLowerCase();"undefined"==typeof b.browser?b.browser={version:(a.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(a),opera:/opera/.test(a),msie:/msie/.test(a)&&!/opera/.test(a)||/trident/.test(a),mozilla:/mozilla/.test(a)&&!/(compatible|webkit)/.test(a)}:(b.browser.webkit||(b.browser.webkit=/webkit/.test(a)),b.browser.mozilla&&(b.browser.msie=/trident/.test(a))),b.extend(b.browser,function(){{var a=navigator.userAgent;navigator.appVersion}return{mobile:!!a.match(/AppleWebKit.*Mobile.*/),ios:!!a.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:a.indexOf("Android")>-1||a.indexOf("Linux")>-1,iPhone:a.indexOf("iPhone")>-1,iPad:a.indexOf("iPad")>-1,webApp:-1==a.indexOf("Safari")}}()),b.browser.isMobile=function(a){return function(){return a}}(b.browser.mobile||b.browser.ios||b.browser.android),b.each([6,7,8,9,10,11,12],function(a,c){b.browser["isIE"+c]=function(a){return function(){return a}}(!(!b.browser.msie||b.browser.version!=c))})}(),b.page=b.extend(b.page||{},{document:"BackCompat"==document.compatMode?document.body:document.documentElement,doc:function(){return this.document},clientWidth:function(){return this.document.clientWidth},clientHeight:function(){return this.document.clientHeight},docWidth:function(){return Math.max(this.document.clientWidth,this.document.scrollWidth)},docHeight:function(){return Math.max(this.document.clientHeight,this.document.scrollHeight)}}),"undefined"==typeof b.contains&&(b.contains=function(a,b){return a.compareDocumentPosition?!!(16&a.compareDocumentPosition(b)):a!==b&&a.contains(b)}),b.T={throttle:function(a,c,d){var e=-1;return 1>c?function(){b.T.call(null,d,-1);try{a.apply(this,arguments)}catch(c){console.error(c)}}:function(){var f=arguments;var g=this;clearTimeout(e),e=setTimeout(function(){clearTimeout(e);try{a.apply(g,f)}catch(b){console.error(b)}},c),b.T.call(null,d,e)}},call:function(a,c){var e=1;var f=this;var g=a;b.isFunction(a)||(f=a,g=c,e=2),b.isFunction(g)&&g.apply(f,[].slice.call(arguments,e))},apply:function(a,c,d){var e=a;var f=c;var g=d;b.isFunction(a)&&(e=this,f=a,g=c),b.isFunction(f)&&f.apply(e,[].concat(g))},tpl:function(){var a={};return function(b,c,d){var e="string"==typeof d?d:b;var f="boolean"==typeof d?d:!0;var g=a[e]||new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return f&&(a[e]=g),c?g(c):g}}(),isBlank:function(a){var c=arguments;if(c.length>1){for(var d=0,e=c.length;e>d;d++)if(arguments.callee(c[d]))return!0;return!1}return"undefined"===String(a)||"null"===String(a)||("string"==typeof a?""===b.trim(a):!1)||b.isEmptyObject(a)},search:function(){var a={};var c="_@separating@_";return b.each(location.search.substring(1).split("&"),function(d,e){if(e=e.replace(/\%20/g,"").replace("=",c).split(c),e[0])if("isdebug"==e[0]&&e[1]){var f={};b.each(e[1].replace(/^\-/,"").split("-"),function(a,b){b&&(f[b]=!0)}),a[e[0]]=f}else a[e[0]]=e[1]}),function(c,d){if(!c)return a;if(!b.isPlainObject(c)&&null==d)return a[c];if("isdebug"==c)return!(!a[c]||!a[c][d]);var e=arguments.callee;if(b.isPlainObject(c)){var f=!0;var g=0==d;return b.each(c,function(a,b){var c=e(a,b);return g&&c?(f=!0,!1):g||c?void 0:f=!1}),f}return!(!a[c]||a[c]!=d)}}(),getAllUI:function(a){var c=[];return b.each(JDFUI.classes(),function(b){c=c.concat(JDFUI[b].get(a))}),c}},b.tpl=b.T.tpl,b.T.defer=b.T.throttle}(window,jQuery),function(a){if(a.browser.isMobile()){var c,b={};function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}var g,f=750;function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.target)),c&&clearTimeout(c),b.x1=e.pageX,b.y1=e.pageY,k>0&&250>=k&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.pageX,b.y2=a.pageY}).bind("touchend",function(){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}}($),function(a,b,c){if(!b)return!1;var d=a.JDFUI;if(d&&"2.0.0"==d.version&&"JDF"==d.author||(d=function(){function d(){}"undefined"==typeof console&&(a.console={info:d,log:d,warn:d,error:d});var e=-1;var f={id:-1,uuid:null,guid:-1,name:null,version:"2.0.0",el:null,selector:null,eventNamespace:null,options:{isAutoInit:!0,hasCssLink:!1,baseVersion:"1.0.0",cssLinkVersion:"1.0.0"},constructor:function(){},init:d,cache:function(){},show:function(){this.el.show()},hide:function(){this.el.hide()}};var g={isAdvanced:!0,initCount:0,_:{},event:{},isAlive:!0,options:{SSCode:0,SSKeys:null,hasCssLink:!1,onReady:d,onDestroy:d},on:function(){},one:function(){},off:function(){},trigger:function(){},eventHandler:function(){},delegate:function(){},call:function(a){if(b.isFunction(a)){var d=[].slice.call(arguments,1);a.apply(this,d)}},unbindEvent:d,loadAllEls:d,destroy:d};var h=["id","guid","name","eventNamespace","selector","cache"];var i="abort,blur,change,click,dblclick,drag,dragend,dragenter,dragleave,dragover,dragstart,drop,durationchange,focus,input,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,mousewheel,scroll,select,submit,wheel".split(",");var j=/\b(\w)/g;var k=/El$/;var l=/Evt$/;var m=/\btimer\b|Timer$/;var n=/\binterval\b|Interval$/;var o=/^on[A-Z]/;var p=/\w\#\w/;var q=/^(author|version|define|all|classes|helper|loadRootUI|gc)$/;var r=/\w+#$/;var s=/#\w*/;var t="data-options";var u="data-opt-";var v="ui-on-event";var w=/^(el|selector|hover)$/;var x=/^on|callback|complete$/;var y=/\s+/g;var z=/^static_/;var A=/^(create|get|all|forEach)$/;var B={};var C={};var D={create:function(a,c,d){var f=C[c];var g=b(a);if(!f)return null;var h=V(f.options||{},g);var i=b.extend(!0,{},f,{options:h},{options:d,guid:e+1,id:f.id+1});i.el=g,i.selector=g.selector=a.selector,i.eventNamespace=".ui-"+c+"-"+i.id;var j=i.options;if("1.0.0"==j.baseVersion)O(i);else{var k=M(c,g,j);if(!k)return!1;if(k!==!0)return k.selector=a.selector,k.init(d),k.cache("origin_options",b.extend(i.cache("origin_options"),d)),k;H.createClass(i),i.cache("origin_options",d),N(i)}return B[c].push(i),W(c),C[c].id++,e++,K(i),i},register:function(a,c){var d=C[c.uuid];if(d)return!1;var e=this.getClasses(c.extend);var h={};return c.isAdvanced&&(h=g),e.length?d=b.extend.apply(b,[!0,{},f,h].concat(e).concat([c])):(_(c.uuid,c),d=b.extend(!0,{},f,h,c)),C[c.uuid]=d,d.name=a,B[c.uuid]=[],!0},getClasses:function(a){var c=[];var d=null;var e=[];return a?(b.isArray(a)?e=a:e.push(a),b.each(e,function(a,b){if(d=C[b],!d)throw new Error(b+" is not exist!");c.push(d)}),c):c}};var E={author:"JDF",version:"2.0.0",define:I("define",function(a,c){if(!a||!c||"string"!=typeof a||q.test(a)||!b.isPlainObject(c))return!1;c.options=c.options||{},c.options.baseVersion=c.options.baseVersion||"1.0.0";var d={};return b.each(c,function(a,b){if(z.test(a)){var e=a.substring(7);c[e]&&console.warn('static method "'+a+'" will be overwrite "'+e+'" method! '),c[e]=d[e]=b,delete c[a]}}),r.test(a)?(a=a.replace(s,""),c.isAdvanced=!0,c.options.baseVersion="2.0.0"):c.isAdvanced=!1,c.uuid=a+(c.isAdvanced?2:1),E[c.uuid]?E[c.uuid]:D.register(a,c)?(E[c.uuid]=Z(C[c.uuid],d),E[a]||(E[a]=E[c.uuid]),X(a),Y(a),E[c.uuid]):!1}),all:I("all",function(){return b.extend(!0,{},B)}),classes:I("classes",function(){return b.extend(!0,{},C)}),helper:I("helper",function(a){if("object"!=typeof seajs)return console.warn("require seajs.js!"),!1;var c=["jdf/2.0.0/ui/helper/1.0.0/helper.js"];b.each(C,function(a,b){b.isAdvanced&&c.push("jdf/"+b.options.baseVersion+"/ui/"+b.name+"/"+b.options.cssLinkVersion+"/helper.js")}),c.length&&seajs.use(c,function(c){b.T.call(c,a,B)})}),loadRootUI:I("loadRootUI",function(){var a="data-root-ui";var c="data-root-ui-url";var d="data-root-install";var e=[];var f=b("["+a+"]["+d+'!="done"]');return f.each(function(){var d=b(this);var f=d.attr(a);var g=d.attr(c);return!g&&q.test(f)?!0:void e.push(g||"jdf/2.0.0/ui/"+f+"/1.0.0/"+f+".js")}),e.length?void seajs.use(e,function(){f.each(function(){var e=b(this);var f=e.attr(a);var g=E[f+"2"];if(!g||!e.attr(c)&&q.test(f))return!0;var h=g({el:e,isAutoInit:!1});return h?(h.on("ready",function(){e.attr(d,"done")}),void h.init()):!0})}):!1}),gc:I("gc",function(){var a=F.list;return a.length?(b.each(a,function(a,c){delete c.data,delete c.event,delete c.eventIDs,b.each(c.instance,function(a){delete c.instance[a]}),delete c.instance}),F.list=[],!0):!1})};var F={list:[],push:function(a){this.list.push(a),this.clear()},clear:b.T.throttle(function(){E.gc()},3e3)};function G(a,b){this.name=a,this.ui=b}G.createClass=function(a,c){var d=new G(a,c);b.each(["create","get","forEach"],function(a,b){c[b]=I(b,function(){return d[b].apply(d,arguments)})}),c.all=B[a]},G.prototype.create=function(a,c,d){var e=this.name;var f=[];var g=a.selector;return b.each(a,function(a,b){b.selector=g+":eq("+a+")",f.push(D.create(b,e,c))}),1==d?this:1==f.length?f.pop():f},G.prototype.get=function(a){var c=this.name;var d=[];return a instanceof b&&b.each(a,function(a,e){e=b(e).get(0),b.each(B[c],function(a,b){e==b.el.get(0)&&d.push(b)})}),d.length&&b.each(d[0],function(a,c){b.isFunction(c)&&!A.test(a)&&(d[a]=function(){var c=arguments;return b.each(d,function(){this[a].apply(this,c)}),d})}),d},G.prototype.forEach=function(a){if(b.isFunction(a)){var c=B[this.name];for(var d=c.length-1;d>=0;d--)a.call(c[d],d,c[d])}return this.ui};function H(a){var b=this;b.data={},b.event={},b.eventIDs={},b.instance=a}H.createClass=function(a){var c=new H(a);b.each(["on","one","off","trigger","eventHandler","delegate"],function(b,d){a[d]=I(d,function(){return c[d].apply(c,arguments),a})}),a.cache=I("cache",function(){return c.cache.apply(c,arguments)});var e=b.isFunction(a.unbindEvent)?a.unbindEvent:d;a.unbindEvent=I("unbindEvent",function(){return c.unbindEvent.apply(c,arguments),e.apply(a,arguments),a});var f=b.isFunction(a.loadAllEls)?a.loadAllEls:d;a.loadAllEls=I("loadAllEls",function(){return c.loadAllEls.apply(c,arguments),f.apply(a,arguments),a});var g=b.isFunction(a.destroy)?a.destroy:d;a.destroy=I("destroy",function(){return g.apply(a,arguments),b.T.call(a,a.options.onDestroy),c.destroy.apply(c,arguments),a})},H.prototype.cache=function(a,b){var d=this;if(a)return b===c?d.data[a]:null!==b?d.data[a]=b:void delete d.data[a]},H.prototype.on=function(a,c){if(a&&b.isFunction(c)){var d=this;if(a=a.toLowerCase(),p.test(a)){var e=a.split("#");if(d.eventIDs[a])return d.off(a,d.eventIDs[a]),d.on(a,c),!1;d.eventIDs[a]=c,a=e[0]}d.event[a]=(d.event[a]||[]).concat([c])}},H.prototype.one=function(a,c){if(a&&b.isFunction(c)){var d=this;a=a.toLowerCase(),d.on(a,function(){return c.apply(this,arguments),d.off(a,arguments.callee),v})}},H.prototype.off=function(a,c){if(a||b.isFunction(c)){var d=this;if(a=a.toLowerCase(),p.test(a)){var e=a.split("#");if(!d.eventIDs[a])return!1;c=d.eventIDs[a],delete d.eventIDs[a],a=e[0]}else b.each(d.eventIDs,function(b){0==b.indexOf(a+"#")&&delete d.eventIDs[b]});var f=d.event[a]||[];if(b.isFunction(c)){for(var g=f.length-1,h=null;g>=0;g--)if(h=f[g],f[g]==c){f.splice(g,1);break}}else f=[];d.event[a]=f}},H.prototype.trigger=function(a,c){if(a){var d=this;var e=d.instance;if(a=a.toLowerCase(),d.event[a]){c=[].slice.call(arguments,1);for(var f=0;f0){var f=E[a].get(c);if(f.length){if(d.SSKeys){var g=L(d,d.SSKeys);var h=[];if(g&&b.each(f,function(a,b){L(b.cache("options"),d.SSKeys)==g&&h.push(b)}),!h.length)return!0;f=h}switch(e%2!=0&&console.warn(c,c.selector+" has been bind "+a+" component!",f),e){case 1:break;case 2:return f[0];case 3:return!1}}}return!0}function N(a){a.cache("options",b.extend({},a.options,!0)),Q(a),T(a),U(a)}function O(a){a.cache("options",b.extend({},a.options,!0)),b.each(a.options,function(c,d){x.test(c.toLowerCase())&&b.isFunction(a.options[c])&&(a.options[c]=function(a){var c=[a];var d=function(){var a=this;var d=arguments;b.each(c,function(b,c){c.apply(a,d)})};return d.callbacks=c,d.add=function(a){d.callbacks.push(a)},d}(d))})}function P(){var a=this;var c=a.options;var d=a.cache("options");var e;var f={};b.each([].slice.call(arguments,0),function(g,h){e?(c[e]=f[e]=d[e]=h,e=null):b.isPlainObject(h)?(f=h,b.extend(d,f),b.extend(a.options,f)):e=String(h).replace(y,"")}),a.cache("options",d),a.cache("origin_options",b.extend(a.cache("origin_options"),f)),b.each(f,function(b,c){R(a,b,c)})}function Q(a){b.each(a.options,function(b,c){R(a,b,c)})}function R(a,b,c){if((l.test(b)||"evt"==b)&&c)a.options[b]=S(a,c);else if(o.test(b)){var d=b.substring(2);a.on(d+"#__id_"+a.id,c),a.options[b]=I(b,function(){var b=[].slice.call(arguments);b.unshift(d),a.trigger.apply(null,b)})}}function S(a,b){return b+a.eventNamespace}function T(a){var c={};b.each(i,function(b,d){c[d]=S(a,d)}),a.event=c}function U(a){var c=a.init;a.init=I("init",function(){var d={};return a.unbindEvent(),a.initCount++,arguments.length&&P.apply(a,arguments),a.loadAllEls(),$(a),b.isFunction(c)&&(d=c.apply(a,arguments),d===!1)?void 0:(b.T.call(a,a.options.onReady,d),a)})}function V(c,d){var e=d.attr(t);var f=null;var g,h=d[0].attributes;var i=9;if(e&&e.length>2)try{f=a.eval("("+e+")")}catch(j){}return f||(f={}),h&&h.length&&b.each(h,function(a,d){0==d.name.indexOf(u)&&d.name.length>i&&(g=d.name.substring(i).toLocaleLowerCase(),b.each(c,function(a){a.toLocaleLowerCase()==g&&(f[a]=d.value)}))}),f}function W(a,c){c=Math.max(c||0,B[a].length);for(var d=0;c>d;d++)delete E[a][d];b.each(B[a],function(b,c){E[a][b]=c})}function X(a){return b.fn[a]?(b.T.search("isdebug",1)&&console.warn('$.fn["'+a+'"] is exist!'),!1):void(b.fn[a]=function(b,c){return E[a].create(this,b,c)})}function Y(a){var c="get"+a.replace(j,function(a){return a.toUpperCase()});return b.fn[c]?(b.T.search("isdebug",1)&&console.warn("$.fn["+c+"] is exist!"),!1):void(b.fn[c]=function(){return E[a].get(this)})}function Z(a,c){var d=a.uuid;function e(c){return c?(c.el instanceof b||(c.el=b(c.el?c.el:"body")),E[d].create(c.el,c)):a}return G.createClass(d,e),b.each(a,function(a,c){b.isFunction(c)&&!A.test(a)&&(e.all[a]=function(){var b=arguments;return e.forEach(function(){this[a].apply(this,b)}),e.all})}),b.each(c||[],function(a,b){e[a]=b}),e}function $(a){b.T.search("isdebug",1)&&E.helper(function(){var c=this;c&&b.T.call(c.test,a)})}function _(a,d){b.each(h,function(b,e){d[e]!==c&&console.error("SyntaxError: "+a+"."+e+" is a reserved identifier")})}return a.JDFUI=E,b(function(){E.loadRootUI()}),E}()),"function"==typeof define&&define("//misc.360buyimg.com/jdf/2.0.0/ui/ui/1.0.0/ui.js",[],function(){return d}),!b.ui&&(b.ui=d,a.seajs&&b.isPlainObject(seajs.data)&&b.isArray(seajs.data.preload))){var e=seajs.data.preload;for(var f=e.length-1;f>=0;f--)-1!=e[f].indexOf("//misc.360buyimg.com/jdf/1.0.0/ui/ui/1.0.0/ui.js")&&e.splice(f,1);seajs.data.preload=e}}(window,jQuery); +!function(e,t){function r(e){return function(t){return{}.toString.call(t)=="[object "+e+"]"}}function n(){return T++}function i(e){return e.match(k)[0]}function a(e){for(e=e.replace(N,"/");e.match(D);)e=e.replace(D,"/");return e=e.replace(F,"$1/")}function o(e){var t=e.length-1,r=e.charAt(t);return"#"===r?e.substring(0,t):".js"===e.substring(t-2)||e.indexOf("?")>0||".css"===e.substring(t-3)||"/"===r?e:e+".js"}function s(e){var t=_.alias;return t&&w(t[e])?t[e]:e}function c(e){var t,r=_.paths;return r&&(t=e.match(q))&&w(r[t[1]])&&(e=r[t[1]]+t[2]),e}function u(e){var t=_.vars;return t&&e.indexOf("{")>-1&&(e=e.replace(U,function(e,r){return w(t[r])?t[r]:e})),e}function l(e){var t=_.map,r=e;if(t)for(var n=0,i=t.length;i>n;n++){var a=t[n];if(r=x(a)?a(e)||e:e.replace(a[0],a[1]),r!==e)break}return r}function f(e,t){var r,n=e.charAt(0);if(O.test(e))r=e;else if("."===n)r=a((t?i(t):_.cwd)+e);else if("/"===n){var o=_.cwd.match(I);r=o?o[0]+e.substring(1):e}else r=_.base+e;return 0===r.indexOf("//")&&(r=("https:"==location.protocol?"https:":"http:")+r),r}function h(e,t){if(!e)return"";e=s(e),e=c(e),e=u(e),e=o(e);var r=f(e,t);return r=l(r)}function d(e){return e.hasAttribute?e.src:e.getAttribute("src",4)}function p(e,t,r){var n=H.test(e),i=R.createElement(n?"link":"script");if(r){var a=x(r)?r(e):r;a&&(i.charset=a)}m(i,t,n,e),n?(i.rel="stylesheet",i.href=e):(i.async=!0,i.src=e),K=i,V?B.insertBefore(i,V):B.appendChild(i),K=null}function m(e,r,n,i){function a(){e.onload=e.onerror=e.onreadystatechange=null,n||_.debug||B.removeChild(e),e=null,r()}var o="onload"in e;return!n||!P&&o?(o?(e.onload=a,e.onerror=function(){S("error",{uri:i,node:e}),a()}):e.onreadystatechange=function(){/loaded|complete/.test(e.readyState)&&a()},t):(setTimeout(function(){g(e,r)},1),t)}function g(e,t){var r,n=e.sheet;if(P)n&&(r=!0);else if(n)try{n.cssRules&&(r=!0)}catch(i){"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout(function(){r?t():g(e,t)},20)}function v(){if(K)return K;if(Y&&"interactive"===Y.readyState)return Y;for(var e=B.getElementsByTagName("script"),t=e.length-1;t>=0;t--){var r=e[t];if("interactive"===r.readyState)return Y=r}}function y(e){var t=[];return e.replace(W,"").replace(z,function(e,r,n){n&&t.push(n)}),t}function b(e,t){this.uri=e,this.dependencies=t||[],this.exports=null,this.status=0,this._waitings={},this._remain=0}if(!e.seajs){var E=e.seajs={version:"2.2.0"},_=E.data={},A=r("Object"),w=r("String"),j=Array.isArray||r("Array"),x=r("Function"),T=0,C=_.events={};E.on=function(e,t){var r=C[e]||(C[e]=[]);return r.push(t),E},E.off=function(e,t){if(!e&&!t)return C=_.events={},E;var r=C[e];if(r)if(t)for(var n=r.length-1;n>=0;n--)r[n]===t&&r.splice(n,1);else delete C[e];return E};var S=E.emit=function(e,t){var r,n=C[e];if(n)for(n=n.slice();r=n.shift();)r(t);return E},k=/[^?#]*\//,N=/\/\.\//g,D=/\/[^\/]+\/\.\.\//,F=/([^:\/])\/\//g,q=/^([^\/:]+)(\/.+)$/,U=/{([^{]+)}/g,O=/^\/\/.|:\//,I=/^.*?\/\/.*?\//,R=document,M=i(R.URL),G=R.scripts,L=R.getElementById("seajsnode")||G[G.length-1],$=i(d(L)||M);E.resolve=h;var K,Y,B=R.getElementsByTagName("head")[0]||R.documentElement,V=B.getElementsByTagName("base")[0],H=/\.css(?:\?|$)/i,P=+navigator.userAgent.replace(/.*AppleWebKit\/(\d+)\..*/,"$1")<536;E.request=p;var X,z=/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\/\*[\S\s]*?\*\/|\/(?:\\\/|[^\/\r\n])+\/(?=[^\/])|\/\/.*|\.\s*require|(?:^|[^$])\brequire\s*\(\s*(["'])(.+?)\1\s*\)/g,W=/\\\\/g,J=E.cache={},Q={},Z={},ee={},te=b.STATUS={FETCHING:1,SAVED:2,LOADING:3,LOADED:4,EXECUTING:5,EXECUTED:6};b.prototype.resolve=function(){for(var e=this,t=e.dependencies,r=[],n=0,i=t.length;i>n;n++)r[n]=b.resolve(t[n],e.uri);return r},b.prototype.load=function(){var e=this;if(!(e.status>=te.LOADING)){e.status=te.LOADING;var r=e.resolve();S("load",r);for(var n,i=e._remain=r.length,a=0;i>a;a++)n=b.get(r[a]),n.statusa;a++)n=J[r[a]],n.status=te.EXECUTING)return r.exports;r.status=te.EXECUTING;var i=r.uri;e.resolve=function(e){return b.resolve(e,i)},e.async=function(t,r){return b.use(t,r,i+"_async_"+n()),e};var a=r.factory,o=x(a)?a(e,r.exports={},r):a;return o===t&&(o=r.exports),delete r.factory,r.exports=o,r.status=te.EXECUTED,S("exec",r),o},b.resolve=function(e,t){var r={id:e,refUri:t};return S("resolve",r),r.uri||E.resolve(r.id,t)},b.define=function(e,r,n){var i=arguments.length;1===i?(n=e,e=t):2===i&&(n=r,j(e)?(r=e,e=t):r=t),!j(r)&&x(n)&&(r=y(""+n));var a={id:e,uri:b.resolve(e),deps:r,factory:n};if(!a.uri&&R.attachEvent){var o=v();o&&(a.uri=o.src)}S("define",a),a.uri?b.save(a.uri,a):X=a},b.save=function(e,t){var r=b.get(e);r.statusa;a++)t[a]=J[n[a]].exec();r&&r.apply(e,t),delete i.callback},i.load()},b.preload=function(e){var t=_.preload,r=t.length;r?b.use(t,function(){t.splice(0,r),b.preload(e)},_.cwd+"_preload_"+n()):e()},E.use=function(e,t){return b.preload(function(){b.use(e,t,_.cwd+"_use_"+n())}),E},b.define.cmd={},e.define=b.define,E.Module=b,_.fetchedList=Z,_.cid=n,E.require=function(e){var t=b.get(b.resolve(e));return t.statust)){g.comboSyntax&&(y=g.comboSyntax),g.comboMaxLength&&(b=g.comboMaxLength),d=g.comboExcludes;for(var n=[],i=0;t>i;i++){var a=e[i];if(!v[a]){var s=p.get(a);s.status1&&o(r(n))}}function t(e){e.requestUri=v[e.uri]||e.uri}function r(e){return i(n(e))}function n(e){for(var t={__KEYS:[]},r=0,n=e.length;n>r;r++)for(var i=e[r].replace("://","__").split("/"),a=t,o=0,s=i.length;s>o;o++){var c=i[o];a[c]||(a[c]={__KEYS:[]},a.__KEYS.push(c)),a=a[c]}return t}function i(e){for(var t=[],r=e.__KEYS,n=0,i=r.length;i>n;n++){for(var o=r[n],s=o,c=e[o],u=c.__KEYS;1===u.length;)s+="/"+u[0],c=c[u[0]],u=c.__KEYS;u.length&&t.push([s.replace("__","://"),a(c)])}return t}function a(e){for(var t=[],r=e.__KEYS,n=0,i=r.length;i>n;n++){var o=r[n],s=a(e[o]),c=s.length;if(c)for(var u=0;c>u;u++)t.push(o+"/"+s[u]);else t.push(o)}return t}function o(e){for(var t=0,r=e.length;r>t;t++)for(var n=e[t],i=n[0]+"/",a=u(n[1]),o=0,c=a.length;c>o;o++)s(i,a[o]);return v}function s(e,t){var r=e+y[0]+t.join(y[1]),n=r.length>b;if(t.length>1&&n){var i=c(t,b-(e+y[0]).length);s(e,i[0]),s(e,i[1])}else{if(n)throw new Error("The combo url is too long: "+r);for(var a=0,o=t.length;o>a;a++)v[e+t[a]]=r}}function c(e,t){for(var r=y[1],n=e[0],i=1,a=e.length;a>i;i++)if(n+=r+e[i],n.length>t)return[e.splice(0,i),e]}function u(e){for(var t=[],r={},n=0,i=e.length;i>n;n++){var a=e[n],o=l(a);o&&(r[o]||(r[o]=[])).push(a)}for(var s in r)r.hasOwnProperty(s)&&t.push(r[s]);return t}function l(e){var t=e.lastIndexOf(".");return t>=0?e.substring(t):""}function f(e){return d?d.test?d.test(e):d(e):void 0}function h(e){var t=g.comboSyntax||["??",","],r=t[0],n=t[1];return r&&e.indexOf(r)>0||n&&e.indexOf(n)>0}var d,p=seajs.Module,m=p.STATUS.FETCHING,g=seajs.data,v=g.comboHash={},y=["??",","],b=2e3;if(seajs.on("load",e),seajs.on("fetch",t),g.test){var E=seajs.test||(seajs.test={});E.uris2paths=r,E.paths2hash=o}define("seajs/seajs-combo/1.0.1/seajs-combo",[],{})}(),!function(e){e.pageConfig=e.pageConfig||{};var t=e.pageConfig;t.isdebug=function(){var e,t,r=location.search,n=[],i={};return r.replace(/isdebug=((?:-\d+)*)/,function(r,a){for(n=a.split("-"),e=n.length,t=0;ti[a][0]&&n<=i[a][1])return e[a]},t.insertStyles=function(e,t){var r=document,n=r.getElementsByTagName("head"),i=r.createElement("style"),a=r.createElement("link");if(/\.css$/.test(t))a.rel="stylesheet",a.type="text/css",a.href=t,a.id=e,n.length?n[0].appendChild(a):r.documentElement.appendChild(a);else{if(i.setAttribute("type","text/css"),i.id=e,i.styleSheet)i.styleSheet.cssText=t;else{var o=r.createTextNode(t);i.appendChild(o)}n.length&&n[0].appendChild(i)}},t.isRetina=!!function(){if(e.devicePixelRatio>1||e.matchMedia&&e.matchMedia("(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx)").matches)return!0}(),t.processImageUrl=function(e,r,n){return e?/\.gif/.test(e)?e:e.replace(/^http(s?):/,"").replace(/!q\d{0,2}(\.jpg|\.webp)?/,"").replace(/(360buyimg\.com\/[^\/]+)\/([^\/]+)/,function(e,i,a){var o=a.replace(/s\d+x\d+_([\s\S]+)/,function(e,t){return t});return[i,"/s",t.isRetina?r:n,"_",o].join("")}):""},t.clipImage=function(e,t){if(!e)return"";if(/\.gif/.test(e))return e;var r="",e=e.replace(/!cc_\d+x\d+/,"").replace(/(!q\d{0,2}.(jpg|jpeg|png|bmp|webp))/,function(e,t){return r=t,""});return e+"!cc_"+t+r},t.replaceMImageUrl=function(e,r){return e?e.replace(/^http(s?):/,"").replace(/\/\/m.360buyimg.com\//,function(){return t.getImageDomain(r)}):""},t.getHashProbability=function(e,t){var r=function(e){for(var t=0,r=0;r>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(r=t),n=0;n>>0;if("[object Function]"!=Object.prototype.toString.call(e))throw new TypeError(e+" is not a function");for(t&&(r=t),n=new Array(o),i=0;i&"'\x00]/g,e.encMap={"<":"<",">":">","&":"&",'"':""","'":"'"},e.encode=function(t){return(null==t?"":""+t).replace(e.encReg,function(t){return e.encMap[t]||""})},e.arg="o",e.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}",e}),function(e){"use strict";function t(e){var t=!1,r=e.split("?")[1];if(r)if(r=r.split("#")[0]){r=r.split("&");for(var n=0,o=r.length;n0&&e>=0&&e<=n&&t>0?"s"+this.getRank()+"="+t:""},getScreenSection:function(){var e=document.documentElement.clientWidth;return e>=1190?68:e>=990?69:70},getScreenRatio:function(){var e=window.screen.width,t=window.screen.height,r={51:{width:800,height:600},52:{width:960,height:640},53:{width:1024,height:768},54:{width:1136,height:640},55:{width:1152,height:864},56:{width:1280,height:768},57:{width:1280,height:800},58:{width:1280,height:960},59:{width:1280,height:1024},60:{width:1366,height:768},61:{width:1440,height:900},62:{width:1600,height:1024},63:{width:1600,height:1200},64:{width:1920,height:1080},65:{width:1920,height:1200},66:{width:2560,height:1440},67:{width:2560,height:1600}};for(var n in r)if(e===r[n].width&&t===r[n].height)return n},getBrowser:function(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/rv:([\d.]+)\) like gecko/))?t.ie=e[1]:(e=r.match(/msie ([\d.]+)/))?t.ie=e[1]:(e=r.match(/firefox\/([\d.]+)/))?t.firefox=e[1]:(e=r.match(/metasr/))?t.sougou=!0:(e=r.match(/qqbrowser/))?t.qq=!0:(e=r.match(/version\/([\d.]+).*safari/))?t.safari=e[1]:(e=r.match(/chrome\/([\d.]+)/))?t.chrome=e[1]:(e=r.match(/opera.([\d.]+)/))?t.opera=e[1]:(e=r.match(/ipad/))?t.ipad=!0:0,t.chrome?11:t.firefox?12:t.safari?13:t.opera?14:t.ie?"6.0"===t.ie?15:"7.0"===t.ie?16:"8.0"===t.ie?17:"9.0"===t.ie?18:"10.0"===t.ie?19:"11.0"===t.ie?20:21:t.sougou?22:t.qq?23:t.ipad?24:25},getBaseData:function(){var e=window._REPORT_,t=e&&e.START,r=[];if(e&&t){var n=e.CSS,o=e.FS,i=e.JS,a=e.DOM;n&&r.push("s72="+(n.getTime()-t.getTime())),o&&r.push("s73="+(o.getTime()-t.getTime())),i&&r.push("s74="+(i.getTime()-t.getTime())),a&&r.push("s75="+(a.getTime()-t.getTime())),r.push("s76="+((new Date).getTime()-t.getTime()))}return r.join("&")},getRetina:function(){return window.devicePixelRatio>1||window.matchMedia&&window.matchMedia("(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx)").matches?"s71=1":""},processRetina:function(){var e=this.getRetina();e&&this.processCore(e)},getSystem:function(){var e=navigator.userAgent.toLowerCase();if(e.indexOf("macintosh")!==-1||e.indexOf("mac os x")!==-1)return 6;if(e.indexOf("linux")!==-1)return 7;var t={"nt 5.1":1,"nt 5.2":1,"nt 6.0":2,"nt 6.1":3,"nt 6.2":4,"nt 6.3":4,"nt 6.4":5,"nt 10.0":5};for(var r in t)if(e.indexOf(r)!==-1)return t[r];return 8},_getErrorInfo:function(e){var t=[];t.push("s"+this.getSystem()+"=1"),t.push("s"+this.getBrowser()+"=1"),t.push("s30=1");var r=this.getDownloadSpeed();return r>0&&t.push("s"+this.getRank()+"="+r),t.push("s"+(50+e)+"=1"),t.join("&")},processBackup:function(e){this.pBackupId&&this.processCore(this._getErrorInfo(e),this.pBackupId)},processHidedFloor:function(e){this.pFloorId&&this.processCore(this._getErrorInfo(e),this.pFloorId)},processTempl:function(e){this.pTemplId&&this.processCore(this._getErrorInfo(e),this.pTemplId)},processSpeed:function(){var e=this.getSpeedInfo();e&&this.processCore(e)},processJsError:function(){var e=window,t=window.pageConfig||{},r=Math.floor(100*Math.random()),n=t&&t.O2_ERROR_REPORT;void 0!==n&&"number"==typeof n||(n=100),n>0&&r>=0&&r<=n&&$(e).bind("error.o2report",function(t,r,n,o,i){var a="";if(o=o||e.event&&e.event.errorCharacter||0,i&&i.stack)t=i.stack.toString();else if(arguments.callee){for(var s=[t],c=arguments.callee.caller,u=3;c&&--u>0&&(s.push(c.toString()),c!==c.caller);)c=c.caller;t=s.join(",")}if(a=JSON.stringify(t)+(r?";URL:"+r:"")+(n?";Line:"+n:"")+(o?";Column:"+o:""),e.lastErrMsg){if(e.lastErrMsg.indexOf(t)>-1)return;e.lastErrMsg+="|"+t}else e.lastErrMsg=t;setTimeout(function(){a=encodeURIComponent(a);var e=new Image;e.src="//wq.jd.com/webmonitor/collect/badjs.json?Content="+a+"&t="+Math.random()},1e3)})},_firstReport:!1,processAllData:function(){if(!this._firstReport){this._firstReport=!0;var e=this.getSpeedInfo(),t=this.getRetina();if(t||e){var r=this.getBaseData(),n=this.getBrowser(),o=this.getScreenRatio(),i=this.getSystem(),a=[];a.push("s"+i+"=1"),a.push("s"+n+"=1"),a.push("s30=1"),e&&a.push(e),o&&a.push("s"+o+"=1"),a.push("s"+this.getScreenSection()+"=1"),t&&a.push(t),r&&a.push(r),this.processCore(a.join("&"))}}},image:null,processCore:function(e,t){var r=t||this.pid;this.image=new Image,this.image.src="//fd.3.cn/cesu/r?pid="+r+"&"+e+"&_="+(new Date).getTime()},debug:function(e){"undefined"!=typeof console.log&&console.log(e)},pid:0,pFloorId:0,pBackupId:0,pTemplId:0,init:function(e,t,r,n){var o=this;return e?(o.pid=e,o.pFloorId=r,o.pBackupId=t,o.pTemplId=n,$(window).bind("load.o2report",function(){o.processAllData()}),void o.processJsError()):void o.debug("pageId must be provided!")}};"function"==typeof define&&(define.amd||define.cmd)?define("report",function(){return e}):window.o2Report=e}(),define("ajax_setup",function(e){var t=e("store");!function(){function e(e,r){var n=r.times,o=e.timeout,i=null;return function(a,s,c){function u(e){e.isBackup&&(e.cache=!0,_.eventCenter.trigger(l.jsonpCallback+":backup",e.url)),l.data=l.__data||{},$.extend(l,{url:l.originalUrl,forceStore:!1},e),$.ajax(l).retry({times:e.times,timeout:r.timeout,statusCodes:r.statusCodes,backup:r.backup}).pipe(p.resolve,p.reject)}function f(){var e=t.get(l.storeKey);e?u({forceStore:!0,times:0}):p.rejectWith(this,arguments)}var l=this,p=new $.Deferred,h=e.getResponseHeader("Retry-After");return i&&clearTimeout(i),l.forceBackup&&(n=0),n>0&&(!e.statusCodes||$.inArray(a.status,e.statusCodes)>-1)?(h&&(o=isNaN(h)?new Date(h).getTime()-$.now():1e3*parseInt(h,10),(isNaN(o)||o<0)&&(o=e.timeout)),void 0!==o&&n!==r.times?i=setTimeout(function(){u({times:n-1})},o):u({times:n-1})):0===n&&(r.backup&&r.backup.length?u({url:r.backup.shift(),times:0,isBackup:!0}):f()),p}}$.ajaxPrefilter(function(r,n,o){function i(e){var n=r.needStore,o=r.storeKey,i=r.storeCheck;if(n=!!n&&t.enabled){var a=t.get(o);if(!a||!i(a)){if("string"==typeof e)try{e=JSON.parse(e)}catch(s){e={}}t.set(o,e)}}}var a=$.Deferred();return o.done(function(e){var t=r.dataCheck;$.isFunction(t)&&!t(e)?(n.url=n.backup,n.dataCheck=null,n.forceBackup=!0,a.rejectWith(n,arguments)):(i(e),a.resolveWith(n,arguments))}),o.fail(a.reject),o.retry=function(t){return t.timeout&&(this.timeout=t.timeout),t.statusCodes&&(this.statusCodes=t.statusCodes),t.backup&&($.isArray(t.backup)?t.backup=Array.prototype.slice.call(t.backup):t.backup=[t.backup]),this.pipe(null,e(this,t))},a.promise(o)}),$.ajaxTransport("+script",function(e){var r=e.needStore,n=e.storeKey,o=e.storeCheck,i=e.dataType,a=e.forceStore;if(r=!!r&&t.enabled){var s=t.get(n);if(s&&(o(s)||a))return{send:function(t,r){var n={};n[i]=e.jsonpCallback+"("+JSON.stringify(s)+")",r(200,"success",n,"")},abort:function(){_.console.log("abort ajax transport for local cache")}}}})}()}),define("load_async",["ajax_setup"],function(e){return e("ajax_setup"),function(e){e=$.extend({url:"",params:{},timeout:3e3,times:2,backup:null,needStore:!1,storeSign:null,cache:!1,dataCheck:null,dataType:"jsonp",type:"get",scriptCharset:"UTF-8"},e);var t=function(e){var t=e;return/forcebot/i.test(location.href)&&(t=$.extend({forceBot:1},t)),t};return $.ajax({type:e.type,url:e.url,scriptCharset:e.scriptCharset,originalUrl:e.url,data:t(e.params),__data:t(e.params),dataType:e.dataType,jsonp:"callback",jsonpCallback:e.jsonpCallback,cache:e.cache,timeout:e.timeout,dataCheck:e.dataCheck,storeKey:e.url,needStore:e.needStore,storeCheck:function(t){return!!t&&t.version&&t.version===e.storeSign}}).retry({timeout:e.timeout,times:e.times,backup:e.backup}).then(function(t){if(t&&(t.__uri=e.url),e.params&&e.params.__trigger){var r=e.jsonpCallback+":end";_.eventCenter.trigger(r,t)}},function(t){_.console.log(e.url),_.console.log("请求接口和兜底都失败了")})}});var o2=o2||{};o2.detect={browser:function(){var ua=navigator.userAgent.toLowerCase(),opera=window.opera,result={engine:0,system:0,browser:0,version:0},systemList={},ieBrowserList={},engineList={},i;systemList={macintosh:ua.indexOf("macintosh")>-1,windows:ua.indexOf("windows")>-1,linux:ua.indexOf("linux")>-1,android:ua.indexOf("android")>-1,ipad:ua.indexOf("ipad")>-1,iphone:ua.indexOf("iphone")>-1};ieBrowserList={ie6:!window.XMLHttpRequest||engineList.quirk,ie7:/msie 7/i.test(ua),ie8:document.documentMode==8,ie9:document.documentMode==9,ie10:document.documentMode==10,ie11:document.documentMode==11};engineList={ie:/msie/i.test(ua),quirk:document.compatMode=="BackCompat",webkit:ua.indexOf(" applewebkit/")>-1,opera:(!!opera&&opera.version),gecko:navigator.product=="Gecko"&&!engineList.webkit&&!engineList.opera};if(engineList.ie){for(i in ieBrowserList){if(ieBrowserList[i]){result.engine="ie";result.browser=i;result.version=/msie 7/i.test(ua)?7:document.documentMode;getSystem();return result}}}if(engineList.webkit){if(ua.indexOf("safari")>-1){if(ua.indexOf("chrome")>-1){result.browser="chrome";result.version="latest"}else{result.browser="safari";result.version=parseInt(ua.match(/ applewebkit\/(\d+)/)[1])}}else{result.browser="webkit";result.version="unknown"}result.engine="webkit";getSystem();return result}if(engineList.opera){result.engine="opera";result.browser="opera";result.version=parseInt(opera.version());getSystem();return result}if(engineList.gecko){if(ua.indexOf("firefox")>-1){result.browser="firefox";result.version=ua.match(/rv:(\d+)/)[1]}else{result.browser="unknown";result.version="unknown"}result.engine="gecko";getSystem();return result}return result;function getSystem(){var i;for(i in systemList){if(systemList[i]){result.system=i}}}},css3test:function(prop){var div=document.createElement("div"),vendors="Khtml Ms O Moz Webkit".split(" "),len=vendors.length-1;if(prop in div.style){return true}prop=prop.replace(/^[a-z]/,function(val){return val.toUpperCase()});len=vendors.length-1;while(len>=0){if(vendors[len]+prop in div.style){return true}len--}return false}};o2.init=function(){var browser=o2.detect.browser();var cssTest=o2.detect.css3test("transition")?("csstransitions"):("no-csstransitions");cssTest=o2.detect.css3test("animation")?(cssTest+" cssanimations"):(cssTest+" no-cssanimations");var classList=[];classList.push(cssTest,browser.engine,browser.browser,browser.version);$("html").addClass(classList.join(" o2_"))};o2.init();window.tplVersion={"1212_tpl":"ce7dcd7cd0beacb2",elevator_tpl:"062a40dffff4da26",enjoy_tpl:"dbbad68b028c083d",entry_tpl:"bfcb1c8b01a6cbf7",fbt_tpl:"ea41592a66180fdd",floor_coupon_tpl:"8198458161adcff3",floor_ract_tpl:"1afcfd3285d2c615",mod_footer_tpl:"ed352685dd2b1e04",more_tpl:"e1e35c66d6e6ea7d",portal_tpl:"34aaa4dcb9071c09",rec_tpl:"9c90c9d5f91d5f9f",seckill_tpl:"9d8cbe81ca10a3f0"}; +define("conf",function(require,exports,module){"use strict";var e="//www.3.cn/bup",o="//storage.jd.com/1824f478e60ec503/",t=("//misc.360buyimg.com/mtd/pc/index/2.0.0"+"/home/","//f.3.cn/index-floor-material?argv="),n="//www.3.cn/index/bak/material_",a="//ai.jd.com",r=a+"/index_new.php?",i="//ch.jd.com",s="//diviner.jd.com/diviner",l="//yuding.jd.com",c="app=Seckill&action=pcIndexMiaoShaArea",d="app=Newuser&action=isNewuser",f="app=Discovergoods&action=getDiscZdmGoodsListForIndex",u="app=ABdata&action=ABData&key=BtestData",_=pageConfig.dataLoadTimeout||3e3,p={PRICE:"//p.3.cn/prices/mgets",TIMEOUT:_,DOMAINS:{BACKUP_PC:e,BACKUP2:o,INDEX_FLOOR:t,BACKUP_FLOOR:n,AI:a,AI_JD:r,CH_JD:i,BI:s},BLANKIMG:"//misc.360buyimg.com/mtd/pc/common/img/blank.png",SWF_PLAYER:"//misc.360buyimg.com/mtd/pc/index/2.0.0"+"/home/images/JDLiveVideo.swf",CLSTAG_PREFIX:"h|keycount|2016|",URLS:{LOGIN:"//passport.jd.com",REGIST:"//reg.jd.com",HOME:"//home.jd.com",LOGOUT:"//passport.jd.com/uc/login?ltype=logout",VIP:"//vip.jd.com",XINREN:"//xinren.jd.com/?channel=99",MIAOSHA:"//miaosha.jd.com",FIND:"//fxhh.jd.com",TOP:"//top.jd.com",PLUS:"//plus.jd.com",PLUSSALE:"//sale.jd.com/act/Xno3MQRklCIm.html"},INTERFACE:{MYJD_GETHOMECOUNT:"//minijd.jd.com/getHomeCount",MYJD_GETMYJDANSWERCOUNT:"//question.jd.com/myjd/getMyJdAnswerCount.action",MYJD_REDUCEPRODUCTCOUNT:"//follow-soa.jd.com/rpc/product/queryForReduceProductCount.action?sysName=misc",MYJD_GETCOUPONCOUNT:"//quan.jd.com/getcouponcount.action",MYJD_MSGCENTER:"//joycenter.jd.com/msgCenter/init.action",MYJD_QUERYBT:"//btshow.jd.com/ious/queryBT.do?sourceType=137",MYJD_ISCOMPANY:"//corp.jd.com/publicSoa/userInfo/getUserLevel",FOCUS8:"//x.jd.com/focus",LOGIN_SERVICE:"//passport.jd.com/loginservice.aspx?method=Login",USER_NAME:"//passport.jd.com/new/helloService.ashx",USER_INFO:"//passport.jd.com/user/petName/getUserInfoForMiniJd.action",USER_SPOINT:"//f.3.cn/bi/export/get",NEW_USER:r+d,CATE:"//dc.3.cn/category/get",CATE_A:"//dc.3.cn/category/get",CATE_A_BACKUP_PC:"//storage.jd.com/1824f478e60ec503/7cf4cd46f2.js",CATE_B:r+u,CATE_B_BACKUP_PC:e+"/index_new.php?"+u,FOCUS:"//f.3.cn/bi/focus_aggr/get",FOCUS_BACKUP:"//www.3.cn/index/home_bak/focus_aggr",FOCUS_BACKUP2:"//storage.jd.com/1824f478e60ec503/b5c6371f95.js",FOCUS_BOTTOM_REC:"//f.3.cn/bi/recm_material/get",FOCUS_BOTTOM_REC_ERR_LOG:"//mercury.jd.com/log.gif?t=rec.619066&v=src=rec$errorcode=",SECKILL:r+c,SECKILL_BACKUP_PC:e+"/index_new.php?"+c,FIND:r+f,FIND_BACKUP_PC:e+"/index_new.php?"+f,FIND_BACKUP2:"//storage.jd.com/1824f478e60ec503/e50dd6de62.js",BRAND:t+"aggr",BRAND_BACKUP2:"//storage.jd.com/1824f478e60ec503/beae1e4fb3.js",SUP:"//f.3.cn/bi/album/get",SUP_BACKUP:"//www.3.cn/index/home_bak/album",SUP_BACKUP2:"//storage.jd.com/1824f478e60ec503/22951a18dc.js",TOP:{RANK_LIST:i+"/homecate2",RANK_LIST_BACKUP_PC:e+"/homecate2",RANK_LIST_BACKUP2:"//storage.jd.com/1824f478e60ec503/2dead3b5ed.js",HOT_SALE:i+"/homepro",HOT_SALE_BACKUP_PC:e+"/homepro"},COUPON:"//f.3.cn/bi/info/get",COUPON_BACKUP:"//www.3.cn/index/home_bak/info",MORE:s+"?p=610009",MORE_BACKUP:"//storage.jd.com/1824f478e60ec503/f5ec9b9ffa.js",MORE_ERR_LOG:"//mercury.jd.com/log.gif?t=rec.610009&v=src=rec$errorcode=",USER_IP_INFO:a+"/jdip/useripinfo.php?type=jd2015",HOT_WORDS:a+"/index/hotWords.php",PRESALE:a+"/index/preSale.php",YUDING_PRESALE_INFO:l+"/presaleInfo/getPresaleInfo.action",QRCODE:"//qrimg.jd.com/",COMPANY:"//f.3.cn/index-floor?argv=company",COMPANY_BACKUP:"//www.3.cn/index/bak/company",NEWPEOPLE:"//f.3.cn/index-floor?argv=npeople",NEWPEOPLE_BACKUP:"//www.3.cn/index/bak/npeople"}},g="//f.3.cn/index-floor?argv=",h="//www.3.cn/index/bak/",m="//f.3.cn/index-floor?argv=focus";return p.DOMAINS.NEW_INDEX_FLOOR=p.DOMAINS.INDEX_FLOOR,p.DOMAINS.NEW_BACKUP_FLOOR=p.DOMAINS.BACKUP_FLOOR,pageConfig.useBi||(p.DOMAINS.INDEX_FLOOR=g,p.DOMAINS.BACKUP_FLOOR=h,p.INTERFACE.FOCUS=m),p}),seajs.use(["conf"],function(e){var o=window;o.pageConfig=window.pageConfig||{};var t=o.pageConfig;t.o2JSConfig={useTplInJs:!0,tplPathRule:function(e){return "//misc.360buyimg.com/mtd/pc/index/2.0.0"+"/home/"+e+".min.js"},sourcePathRule:function(o){return e.DOMAINS.INDEX_FLOOR+o},backupPathRule:function(o){return e.DOMAINS.BACKUP_FLOOR+o}},t.clstagPrefix="h|keycount|2016|",t.sendClog=function(e){if(e.length){var o=[],n={},a=t.clog;e.each(function(e){var t=$(this).attr("fclog");n[t]||(n[t]=!0,o.push(t))}),a&&a.logDomain&&o.length>0&&((new Image).src=a.logDomain+o.join("||")+"&v="+a.logV)}},!function(){var o=[e.URLS.PLUS,"您可享钻石特惠,开通PLUS>"],n=[e.URLS.PLUS,"您可享金牌特惠,开通PLUS>"],a=[e.URLS.PLUS,"您可享银牌特惠,开通PLUS>"],r=[e.URLS.PLUS,"您可享钻石特惠,续费PLUS>"],i=[e.URLS.PLUS,"您可享金牌特惠,续费PLUS>"],s=[e.URLS.PLUS,"您可享银牌特惠,续费PLUS>"],l=[e.URLS.PLUS,"试用PLUS会员领免运费券>"],c=[e.URLS.PLUS,"试用PLUS会员享更多特权 购买"],d=[e.URLS.PLUS,"购买PLUS会员尊享顶级特权>"],f=[e.URLS.PLUS,"PLUS专享商品每周更新>"],u=[e.URLS.PLUS,"续费PLUS会员尊享顶级特权 续费"],_=[e.URLS.PLUSSALE,"PLUS专享商品每周更新>"],p=10 in t.isdebug?(new Date).getTime():new Date(t.timestamp).getTime();t.testStart&&t.testEnd&&pnew Date(t.testStart).getTime()&&(l=[e.URLS.PLUS,"购买PLUS会员尊享顶级特权>"],c=[e.URLS.PLUS,"购买PLUS会员尊享顶级特权>"]),t.plusMap=[[l,c,d,_,u],[l,c,d,_,u],[a,a,a,s,s],[n,n,n,i,i],[o,o,o,r,r],[l,c,d,f,u],[l,c,d,f,u]]}(),!function(){var e=["ad_groupName","ad_groupId","ad_num","ad_name","ad_id","ad_desc","ad_biclk","pd_groupName","pd_groupId","pd_name","pd_id","pd_biclk"];t.generateBiLog=function(o){var t,o=o||{},n=o.ext_columns||o,a=!$.grep(e,function(e,o){if(!(e in n))return!0}).length;return a?(t=$.toJSON(n),' data-log="'+encodeURIComponent(t)+'" '):""}}(),t.cutString=function(e,o,t){for(var n=e.length,a=0,r=0,i=[];ao){t&&i.push(t);break}i.push(e[a])}return i.join("")}}),seajs.config({paths:{HOME_BASE:"//misc.360buyimg.com/mtd/pc/index/2.0.0"+"/home",O2_COMPONENT:"mtd/pc/components"},alias:{"home/widget/head":"HOME_BASE/head.min.js","home/widget/head_areamini":"HOME_BASE/head_areamini.min.js","home/widget/head_myjd":"HOME_BASE/head_myjd.min.js","home/widget/head_setUserinfo":"HOME_BASE/head_setUserInfo.min.js","home/widget/head_shoppingcart":"HOME_BASE/head_shoppingcart.min.js","home/widget/cate":"HOME_BASE/cate.min.js","home/widget/slider":"HOME_BASE/slider.min.js","home/widget/userinfo":"HOME_BASE/userinfo.min.js","home/widget/news":"HOME_BASE/news.min.js","home/widget/service":"HOME_BASE/service.min.js","home/widget/mobile_pop":"//nfa.jd.com/loadFa.action?aid=0_0_8762","home/widget/patch":"HOME_BASE/patch.min.js","home/widget/scroller":"HOME_BASE/scroller.min.js","home/widget/newpeople":"HOME_BASE/newpeople.min.js","home/widget/company":"HOME_BASE/company.min.js","home/widget/fbt":"HOME_BASE/fbt.min.js","home/widget/top":"HOME_BASE/top.min.js","home/widget/sup":"HOME_BASE/sup.min.js","home/widget/seckill":"HOME_BASE/seckill.min.js","home/widget/coupon":"HOME_BASE/floor_coupon.min.js","home/widget/entry":"HOME_BASE/entry.min.js","home/widget/portal":"HOME_BASE/portal.min.js","home/widget/elevator":"HOME_BASE/elevator.min.js","home/widget/more":"HOME_BASE/more.min.js",logger:"HOME_BASE/logger.min.js","home/videojs":"HOME_BASE/video.min.js","home/swfobject":"HOME_BASE/swfobject.min.js",logger:"HOME_BASE/logger.min.js"}}),seajs.use(["O2_COMPONENT/carousel/1.0.0/carousel.js","O2_COMPONENT/util/1.0.0/util.js","O2_COMPONENT/tab/1.0.0/tab.js","O2_COMPONENT/lazyload/2.0.0/lazyload.js","home/widget/head","home/widget/cate","home/widget/slider","home/widget/userinfo","home/widget/news","home/widget/service","report","logger","home/widget/patch","home/widget/elevator"],function(e,o,t,n,a,r,i,s,l,c,d,f,u){d.init(222,223,224,260),$.each(["jsonCallBackenjoy","jsonCallBackcoupons","jsonCallBackbanner_1","jsonCallBackbanner_2","jsonCallBackbanner_3","jsonCallBackbanner_4","jsonCallBackentry","jsonCallBackspecial_2","jsonCallBackbasic_1","jsonCallBackbasic_2","jsonCallBackbasic_3","jsonCallBackbasic_4","jsonCallBackbasic_5","jsonCallBackbasic_6","jsonCallBackbasic_7","jsonCallBackbasic_8","jsonpCallbackUserIpInfo","jsonpCallbackEnjoyBiAct","jsonpCallbackEnjoyBiShop","jsonpCallbackFindGood","jsonpCallbackAggr","jsonpCallbackTopRank","jsonpCallbackTopHotsale1","jsonpCallbackTopHotsale2","jsonpCallbackTopHotsale3","jsonpCallbackTopHotsale4","jsonpCallbackTopHotsale5","jsonpCallbackMoreGood","jsonpCallbackSeckill","jsonpCallbackFocus","jsonpCallbackFocusBottomRec","jsonpCallbackIsNewuser","jsonpCallbackRequestUserInfo","jsonpCallbackPreloadSk","getCategoryCallback","jsonpCallbackHelloService","jsonpCallbackIsLogin","jsonpCallbackMorePreSale","jsonpCallbackSup","jsonCallBackHotWords","jsonpCallbackFocus8"],function(e,o){window[o]=$.noop,_.eventCenter.on(o+":backup",function(){d.processBackup(e+1)})}),a.init(),new r({$el:$(".J_cate")}),new i({$el:$(".J_slider")}),new s({$el:$(".J_user")}),new l({$el:$(".J_news")}),$(window).one("load.home2016",function(){_.eventCenter.trigger("home:load")}),new u,!function(){var e=$("#J_service"),o=$(".J_tab_head",e),t=$(".J_tab_content",e),n=$(".J_service_pop_close",e);new c({container:e,head:o,content:t,close:n,expandClass:"service_expand",activeClass:"service_frame_on",data:[{isIframe:!0,url:"//chongzhi.jd.com/jdhome-czindex.html"},{url:"virtuals/squares/1.0/js/jipiao.js"},{url:"//misc.360buyimg.com/virtuals/squares/1.0/js/hotel.js"},{url:"virtuals/squares/1.0/js/game.js"}]})}()}),define("logger",function(){var e=function(e){var o=this;_.Events.call(o),this._logQueue=[],this.opts=$.extend({afterLoad:1e3,delay:100,className:".J_log"},e),$(function(){setTimeout(function(){o.canLog=!0,o._logQueue.length&&o.trigger("fill")},o.opts.afterLoad)}),o._bind()};return $.extend(e.prototype,new _.Events),e.prototype._bind=function(){var e=this,o=!1;e.on("empty",function(){o=!1,clearTimeout(e.timer)}),e.on("fill",function(){!o&&this.canLog&&(o=!0,e._log())}),$(document.body).delegate(e.opts.className,"click",function(o){var t=$(o.currentTarget),n=t.attr("data-log");n&&(logData=$.parseJSON(decodeURIComponent(n)),e.logBi("clk",logData))})},e.prototype._log=function(){var e=this,o=this._logQueue.shift();if(!o)return this.trigger("empty");var t={rept:o[2],ad_groupName:o[3],ad_groupId:o[4],ad_num:o[5],ad_name:o[6],ad_id:o[7],ad_desc:o[8],ad_biclk:o[9],pd_groupName:o[10],pd_groupId:o[11],pd_name:o[12],pd_id:o[13],pd_biclk:o[14]};o[15]&&(t.link=o[15]),"impr"==o[2]?window.expLogJSON.call(window,o[0],o[1],$.toJSON(t)):window.log.apply(window,o),e.timer=setTimeout(function(){e._log()},e.opts.delay)},e.prototype.logBi=function(e,o){var t="clk"===e?this.logNow:this.log,n=["pc_homepage","bi",e,o.ad_groupName,o.ad_groupId,o.ad_num,o.ad_name,o.ad_id,o.ad_desc,o.ad_biclk,o.pd_groupName,o.pd_groupId,o.pd_name,o.pd_id,o.pd_biclk];o.url&&n.push(o.url),t.apply(this,n)},e.prototype.logArea=function(e){var o=$(this.opts.className,e),t=this;o.each(function(e,o){var n,a=$(o).attr("data-log");a&&(n=$.parseJSON(decodeURIComponent(a)),t.logBi("impr",n))})},e.prototype.log=function(){var e=Array.prototype.slice.call(arguments);this._logQueue.push(e),this.trigger("fill")},e.prototype.logNow=function(){var e=this,o=Array.prototype.slice.call(arguments);e._logQueue.unshift(o),e.trigger("fill")},new e}),define("floor_process",function(require){function e(){var e=(d.before,d.after,$("body"));["seckill:after","enjoy:before","enjoy:after","fbt:after","coupon_lazy:after","rec_1:before","rec_1:after","entry_1:before","entry_1:after","rec_2:before","rec_2:after","portal_1:before","portal_1:after","portal_2:before","portal_2:after","portal_3:before","portal_3:after","portal_4:before","portal_4:after","rec_3:before","rec_3:after","portal_5:before","portal_5:after","portal_6:before","portal_6:after","portal_7:before","portal_7:after","portal_8:before","portal_8:after","portal_9:before","portal_9:after","entry_2:before","entry_2:after","rec_4:before","rec_4:after","more:after","lift:after"].forEach(function(o,t){var o=o.split(":"),n=o[0],a=o[1];e.delegate("#"+n,"render:"+a,d[a][n])})}var o=(require("conf"),require("load_async"),require("logger")),t=window.pageConfig,n=t.FN_GetRandomData,a=t.processImageUrl,r=t.replaceMImageUrl,i=function(e){return function(o,t,a){var r=t.data;r=r||{},r.staticLogTag=e;var i=r.list||[];return i=i.map(function(e){return $.isArray(e)&&e.length?n(e):e}),i=$.grep(i,function(e){return e}),i.length?(r.list=i,void a()):a(!1)}},s=function(e,o,i,s){return function(l,c,d){var f=c.data;f=f||{};var u=f.list||[],_=f.live||[];return!u.length||"享品质"==e&&!_.length?d(!1):(f.staticLogTag=s,f.title=e,f.list=u.map(function(e){return $.isArray(e)&&e.length?n(e):e}),f.list.forEach(function(e,t){if(e){var n=a(e.imgUrl,o,i);e.imgUrl=r(n,t)}}),_.forEach(function(e,o){var n=a(e.indexImage,"780x700","390x350");e.indexImage=r(n,o),!!t.disablePlayer!=!!t.isdebug[15]&&(e.status=4)}),void d())}},l=function(e,o){return function(t,n,a){var r=n.data;r=n.data||{};var i=r.cols||[];return i.length?(e&&(r.title=e),r.staticLogTag=o,void a()):a(!1)}},c=function(e,o,n){var r=o.data||{},i=10 in t.isdebug;i&&(r.enable=!0,r.enableFix=!0);var s=r.enable,l=r.enableFix;if(!s&&!l)return $("#enjoy").hide();if(l&&($("#footer").css({paddingBottom:120}),$.each(r.fixed.list,function(e,o){o.imgUrl=a(o.imgUrl,"256x92","128x46")})),s){if(!$.isArray(r.act))return n(!1);if(r.act.length<10)return n(!1);if(!$.isArray(r.shop))return n(!1);if(r.shop.length<4)return n(!1);$.each(r.act,function(e,o){o.imgUrl=a(o.imgUrl,"380x420","190x210")}),$.each(r.shop,function(e,o){o.imgUrl=a(o.imgUrl,"480x210","240x105")})}else r.act=[],r.shop=[],$("#enjoy").css({height:0,overflow:"hidden",marginBottom:"0"});n()},d={before:{enjoy:c,rec_1:i(18),entry_1:s("享品质","800x340","400x170",19),rec_2:i(21),portal_1:l("爱生活",[22,23]),portal_2:l(null,[24,25]),portal_3:l(null,[26]),portal_4:l(null,[27,28]),rec_3:i(29),portal_5:l(null,[30]),portal_6:l(null,[31,32]),portal_7:l(null,[33,34]),portal_8:l(null,[35,37,37]),portal_9:l(null,[36,45]),entry_2:s("购特色","280x380","140x190",38),rec_4:i(39)},after:{seckill:function(e,o,t){seajs.use("home/widget/seckill",function(e){new e({$el:$("#seckill"),domStr:o.dom,next:t})})},enjoy:function(e,t,n){if(o.logArea($("#enjoy")),t.data.enableFix===!0){var a=$(window);a.bind("scroll",function(){var e=$("#enjoy"),o=!1,t=!1,n=function(){if(!o){o=!0,setTimeout(function(){o=!1},200);var n=a.scrollTop();if(n>935){if(t)return;t=!0,e.addClass("enjoyfix")}else{if(!t)return;t=!1,e.removeClass("enjoyfix")}}};return n(),n}())}},fbt:function(e,o,t){seajs.use("home/widget/fbt",function(e){new e({$el:$("#fbt"),domStr:o.dom,next:t})})},coupon_lazy:function(e,o,t){seajs.use("home/widget/coupon",function(e){new e({$el:$("#coupon_lazy"),tpl:o.dom,next:t})})},entry_1:function(e,t){seajs.use("home/widget/entry",function(e){new e({$el:$("#entry_1"),data:t.data})}),o.logArea($("#entry_1"))},portal_1:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_1")}),o.logArea($("#portal_1"))})},portal_2:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_2")}),o.logArea($("#portal_2"))})},portal_3:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_3")}),o.logArea($("#portal_3"))})},portal_4:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_4")}),o.logArea($("#portal_4"))})},portal_5:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_5")}),o.logArea($("#portal_5"))})},portal_6:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_6")}),o.logArea($("#portal_6"))})},portal_7:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_7")}),o.logArea($("#portal_7"))})},portal_8:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_8")}),o.logArea($("#portal_8"))})},portal_9:function(){seajs.use("home/widget/portal",function(e){new e({$el:$("#portal_9")}),o.logArea($("#portal_9"))})},entry_2:function(e,t){o.logArea($("#entry_2"))},more:function(e,o,t){seajs.use("home/widget/more",function(e){new e({$el:$("#more"),domStr:o.dom,next:t})})},lift:function(){seajs.use("home/widget/elevator",function(e){new e({$el:$("#lift")})})},rec_1:function(){o.logArea($("#rec_1"))},rec_2:function(){o.logArea($("#rec_2"))},rec_3:function(){o.logArea($("#rec_3"))},rec_4:function(){o.logArea($("#rec_4"))}}};return t.reportFloorHideHash={seckill:19,fbt:1,coupon_lazy:2,rec_1:3,entry_1:4,rec_2:5,portal_1:6,portal_2:7,portal_3:8,portal_4:9,rec_3:10,portal_5:11,portal_6:12,portal_7:13,portal_8:14,entry_2:15,rec_4:16,more:17,footer:18},{render:d,bind:e}}),seajs.use(["floor_process","store","conf","load_async"],function(e,o,t,n){"use strict";var a,r=window,i=$(r),s=$("html"),l=i.width(),c=i.height();i.bind("resize.home",function(){var e=function(){var e=i.width()>=1190;e?s.removeClass("o2_mini").addClass("o2_wide root61"):s.removeClass("o2_wide root61").addClass("o2_mini"),r.pageConfig.wideVersion!==e&&(_.eventCenter.trigger("render:floorChange"),r.pageConfig.wideVersion=e),_.eventCenter.trigger("home:resize",e)},o=i.width(),t=i.height();l==o&&c==t||(window.clearTimeout(a),a=window.setTimeout(e,100)),l=o,c=t}),e.bind(),_.eventCenter.on("home:load",function(){o.enabled&&o.clearByReg("jd_home_2015")});var d={};pageConfig.login=function(){return d._loginDefer||(d._loginDefer=new $.Deferred,n({url:t.INTERFACE.LOGIN_SERVICE,timeout:1e3,jsonpCallback:"jsonpLogin",dataCheck:function(e){if(e&&e.Identity&&e.Identity.IsAuthenticated)return!0}}).then(function(e){d._loginDefer.resolve({isLogin:!0,nick:e.Identity.Unick,name:e.Identity.Name})},function(){d._loginDefer.resolve({isLogin:!1})})),d._loginDefer},pageConfig.userinfo=function(){return d._userinfoDefer||(d._userinfoDefer=new $.Deferred,pageConfig.login().then(function(e){e.isLogin?n({url:t.INTERFACE.USER_INFO,timeout:1e3,jsonpCallback:"jsonpUserinfo"}).then(function(e){e.isCompany=7===e.userLevel,d._userinfoDefer.resolve(e)},function(){d._userinfoDefer.resolve({})}):d._userinfoDefer.resolve({})})),d._userinfoDefer},pageConfig.company=function(){return d._companyDefer||(d._companyDefer=new $.Deferred,pageConfig.login().then(function(e){return e.isLogin?void n({url:t.INTERFACE.MYJD_ISCOMPANY,params:{pin:pageConfig.user.pin},dataType:"jsonp",jsonpCallback:"jsonpIsCompany",dataCheck:function(e){if(e&&e.success&&e.userLevel)return!0}}).then(function(e){var o=!1;"90"===e.userLevel&&(o=!0),d._companyDefer.resolve({isCompany:o})},function(){d._companyDefer.resolve({isCompany:!1})}):d._companyDefer.resolve({isCompany:!1})})),d._companyDefer},pageConfig.load=function(){return d._loadDefer||(d._loadDefer=new $.Deferred,_.eventCenter.on("home:load",d._loadDefer.resolve)),d._loadDefer},pageConfig.newUser=function(){var e=new $.Deferred;return n({url:t.INTERFACE.NEW_USER,timeout:1e3,jsonpCallback:"jsonpCallbackIsNewuser",dataCheck:function(e){return!(!e||"10000"!==e.STATE||!e.isNew)}}).then(function(){pageConfig.isNewUser=!0,e.resolve({isNew:!0})}).fail(function(){pageConfig.isNewUser=!1,e.resolve({isNew:!1})}),e},_.eventCenter.on("home:load",function(){pageConfig.enableEnjoy||$.when(pageConfig.userinfo(),pageConfig.newUser()).then(function(e,o){e.isCompany?seajs.use("home/widget/company",function(e){e.init()}):o.isNew&&(_.eventCenter.trigger("render:userinfo"),seajs.use("home/widget/newpeople",function(e){e.init()}))})})}),seajs.use(["conf","store","o2tpl","o2console","load_async","report","mtd/pc/components/lazyload/2.0.0/lazyload.js"],function(e,o,t,n,a,r,i){"use strict";var s=window.pageConfig,l=_.Class.extend({statics:{CONTROL:"o2Control",RENDER_BEFORE:"render:before",RENDER_AFTER:"render:after"},construct:function(e){this.conf=$.extend({cls:"J_lazyload",scrollEvent:"scroll.lazydata",resizeEvent:"resize.lazydata",timer:{autoLoad:3e3}},e),this.conf.lazyEvents=this.conf.scrollEvent+" "+this.conf.resizeEvent,this.init()},init:function(){this.w=window,this.$w=$(window),this.$b=$("body");var e=$("html"),o=s.o2AppName||"";""!==o&&e.addClass(o),n.consoleConfigFunc(),this.isChrome=e.hasClass("o2_chrome"),this.isIE=!!this.w.ActiveXObject||navigator.userAgent.indexOf("Trident")>0,this.o2JSConfig=s?s.o2JSConfig:{},this.imageLazyload=s.imageLazyload,this.resourceLoader=null,this.loadingData={},this.tplDefer={},this.insertedStyles={},this.renderedFloor={},this.floorResult={},this.isAutoRendered=!1,this.lazyFloorCount=0,this.initFloor(),this.floorsInfo=this.getFloorsInfo($(".J_f")),this.lazyLoadFloor(),this.bind(),this.events=$._data($("body").get(0),"events")},initFloor:function(){var e=this,o=$("."+e.conf.cls);e.lazyFloorCount=o.length},bind:function(){var e=this,o=e.$w,n=(e.w,{quality:90,webpQuality:90,delay:20,threshold:1e3});this.isIE&&(n.delay=60,n.threshold=500),this.imageLazyload||(n.source="nolazyload"),$("body").o2lazyload(n).bind("render",this.conf.cls,function(o,n,a){var r,i=$(o.target),s=i.attr("id"),c=e.floorsInfo[s],d=c.custom,f=c.source,u=$('[type="text/template"]',i),p=n.data||{},g="";if(!(s in e.renderedFloor)){n.dom=n.dom||u.html(),r=n.dom;try{if(e.floorResult[s]={result:n},d){if(a)return i.trigger(l.RENDER_AFTER,[n,function(){_.eventCenter.trigger("lazyload:DOMUpdate",i),i.removeClass("mod_lazyload"),e.sendClog(i)}])}else e.renderedFloor[s]=!0;if(f&&(!p||$.isEmptyObject(p)))throw new Error("Loaded no data.");if(a)return u.remove(),g=t(r,p),i.append(g),i.trigger(l.RENDER_AFTER,n),_.eventCenter.trigger("lazyload:DOMUpdate",i),void e.sendClog(i);if(!d)return u.remove(),g=t(r,p),e.floorResult[s].html=g,void i.attr("data-hidden",!0)}catch(o){e.hideFloor(s,i),_.console.log(o)}}}),_.eventCenter.on("render:floorChange",function(){e.floorChange=!0,e.windowLoaded&&o.trigger(e.conf.resizeEvent)}),o.one("load.render",function(){e.windowLoaded=!0,e.preloadOffset=e.isIE?500:800,e.startLoadTimer=setTimeout(function(){o.trigger(e.conf.resizeEvent)},20)})},lazyLoadFloor:function(){var e=this,o=e.$w,t=(e.w,$(document)),n=e.conf,a=null,r=e.isAutoRendered?20:e.isIE?200:100;e.preloadOffset=0;var i=e.floorsInfo;o.bind(n.lazyEvents,function(l){e.isScrolling=!0,e.startLoadTimer&&clearTimeout(e.startLoadTimer),e.autoLoadTimer&&clearTimeout(e.autoLoadTimer),a&&clearTimeout(a),e.resourceLoader&&e.resourceLoader.pause(),a=setTimeout(function(){e.isScrolling=!1,e.floorChange&&(i=e.getFloorsInfo($(".J_f")),e.floorChange=!1);var a,r,l,c=t.scrollTop(),d=o.height(),f=c+d+e.preloadOffset;for(a in i)r=i[a],l=r.$el,(r.force||r.top<=f&&r.top>=c-r.height)&&l.hasClass(n.cls)&&(l.attr("data-hidden")?e.renderHidden(a):e.load(a,!0));s.idleTimeLoad&&(e.autoLoadTimer=setTimeout($.proxy(e.autoLoad,e),3e3))},r)})},hideFloor:function(e,o){o.height(0).hide(),r.processHidedFloor(s.reportFloorHideHash[e]),_.eventCenter.trigger("render:floorChange",e),_.console.log(e+"加载失败!")},getFloorsInfo:function(e){var o={};return e.each(function(e,t){var n=$(t),a=n.attr("id"),r=n.data("rel"),i=$("#"+r),s=n.offset().top;r&&i.length&&(s=i.offset().top),o[a]={$el:n,top:s,height:n.outerHeight(!0),force:!!n.data("forcerender"),tpl:n.data("tpl"),source:n.data("source"),backup:n.data("backup"),backup2:n.data("backup2"),custom:!!n.data("custom"),hidden:!1}}),o},sendClog:function(e){var o=e.find("[fclog]");o.length&&setTimeout(function(){s.sendClog(o)},200)},_loadTpl:function(o,t){var n,i=this,l=this.floorsInfo[o],c=l.$el,d=c.html(),f=l.tpl,u=this.w.tplVersion;if(f&&u)if(this.tplDefer[f])n=this.tplDefer[f];else{var _=!0,p="jsonCallBack_"+f,g=this.o2JSConfig.tplPathRule(f),h=u[f],m=s.tplLoadTimeout||e.TIMEOUT||4e3;n=a({url:g,jsonpCallback:p,params:{__trigger:!0},needStore:_,storeSign:h,timeout:m,backup:null,cache:!0}),this.tplDefer[f]=n}else n=d;return n.always&&n.fail(function(){c.removeClass(i.conf.cls).removeClass("mod_lazyload"),i.hideFloor(o,c),r.processTempl(s.reportFloorHideHash[o])}),n},_loadData:function(o,t){var n,r=this,i=this.floorsInfo[o],l=i.$el,c=i.source,d=i.backup,f=i.backup2;if(c)if(this.loadingData[o])n=new $.Deferred,n.reject();else{this.loadingData[o]=!0;var u=c.split(":"),_=u[0],p=u[1],g=e.DOMAINS.INDEX_FLOOR+p,h=[e.DOMAINS.BACKUP_FLOOR+d],m=encodeURIComponent("jsonCallBack"+p),C="cms"==_,w=this.w.sourceVersion&&this.w.sourceVersion[p],j=s.dataLoadTimeout||e.TIMEOUT||4e3,E={pin:s.user.pin,uuid:s.user.uuid};s.disableStore===!0&&(C=!1),s.useBi||(E={}),f&&h.push(e.DOMAINS.BACKUP2+f+".js"),n=a({url:g,backup:h,jsonpCallback:m,params:E,needStore:C,storeSign:w,timeout:j,cache:!1,dataCheck:function(e){if(e&&e.data)return!0}}),n.done(function(){r.loadingData[o]=!1}).fail(function(){r.loadingData[o]=!1,l.removeClass(r.conf.cls).removeClass("mod_lazyload"),r.hideFloor(o,l)})}else this.loadingData[o]=!1,n={};return n},load:function(e,o){var t=this;$.when(this._loadTpl(e,o),this._loadData(e,o)).then(function(n,a){var r=$.isArray(n)?n[0]:n,i=$.isArray(a)?a[0]:{data:a},s={};$.extend(s,i),t.triggerRender(e,r,s,o)})},autoLoad:function(){var e=this,o=e.conf,t=e.getFloorsInfo($("."+o.cls));if(!e.isScrolling){for(var n in t){var a=t[n],r=a.$el;r.attr("data-hidden")||e.load(n,!1)}setTimeout(function(){var o=$("body").find('img[data-lazy-img!="done"]'),t=[];o.each(function(){var e=$(this).attr("data-lazy-img");"string"==typeof e&&e.indexOf("//")>=0&&t.push({type:"image",uri:e})}),e.resourceLoader?(e.resourceLoader.clear(),e.resourceLoader.load(t),e.isAutoRendered=!0):seajs.use("O2_COMPONENT/resourceLoader/1.0.0/resourceLoader.js",function(o){e.resourceLoader=o,e.resourceLoader.load(t),e.isAutoRendered=!0})},2e3)}},renderHidden:function(e){var o=this.floorsInfo[e],t=o.$el,n=this.floorResult[e],a=$(n.html);t.removeClass(this.conf.cls).removeClass("mod_lazyload").append(a),o.hidden=!1,t.trigger(l.RENDER_AFTER,n.result).removeAttr("data-hidden"),_.eventCenter.trigger("lazyload:DOMUpdate",t)},triggerRender:function(e,o,t,n){var a,r,i=this,c=this.floorsInfo[e],d=c.$el,f=c.custom,u=c.tpl,_=this.events,p=_[l.RENDER_BEFORE];o instanceof Object&&($.extend(t,o),o.style&&!i.insertedStyles[u]&&(s.insertStyles(u,o.style),i.insertedStyles[u]=!0)),d.hasClass(this.conf.cls)&&(a=!!$.grep(p,function(e,o){if($(e.selector).is(d))return!0}).length,n&&d.removeClass(this.conf.cls),r=function(o){return o===!1?i.hideFloor(e,d):(t.data=arguments[0]||t.data,!f&&n&&d.removeClass("mod_lazyload"),void d.trigger("render",[t,n]))},a?d.trigger(l.RENDER_BEFORE,[t,r]):r())}});new l}); \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_header.png b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_header.png new file mode 100644 index 000000000..5bd7dfda9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_header.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list(2).jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list(2).jpg new file mode 100644 index 000000000..407e69292 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list(2).jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list.jpg new file mode 100644 index 000000000..7b941f71a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayia.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayia.jpg new file mode 100644 index 000000000..6f7ba0520 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayia.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayib.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayib.jpg new file mode 100644 index 000000000..d392a57bc Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayib.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayic.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayic.jpg new file mode 100644 index 000000000..345558897 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_dayic.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejia.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejia.jpg new file mode 100644 index 000000000..407e69292 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejia.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejib.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejib.jpg new file mode 100644 index 000000000..ac3e1a527 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejib.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejic.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejic.jpg new file mode 100644 index 000000000..aa37205e4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_kejic.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijiana.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijiana.jpg new file mode 100644 index 000000000..cf945e97f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijiana.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijianb.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijianb.jpg new file mode 100644 index 000000000..716e1f152 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijianb.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijianc.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijianc.jpg new file mode 100644 index 000000000..20409bbb5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_peijianc.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujia.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujia.jpg new file mode 100644 index 000000000..df3b6fe48 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujia.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujib.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujib.jpg new file mode 100644 index 000000000..2fc1179eb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujib.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujic.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujic.jpg new file mode 100644 index 000000000..ae42e71e1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_shoujic.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezia.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezia.jpg new file mode 100644 index 000000000..1db24f599 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezia.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezib.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezib.jpg new file mode 100644 index 000000000..2eee1e4c8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezib.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezic.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezic.jpg new file mode 100644 index 000000000..5b9353b3a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiezic.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyia.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyia.jpg new file mode 100644 index 000000000..66ac19f0f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyia.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyib.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyib.jpg new file mode 100644 index 000000000..ca680f149 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyib.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyic.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyic.jpg new file mode 100644 index 000000000..824f2b9db Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_center_list_xiyic.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list1.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list1.webp new file mode 100644 index 000000000..7b73d18d7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list1.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list2.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list2.webp new file mode 100644 index 000000000..e24a62fd4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list2.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list3.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list3.webp new file mode 100644 index 000000000..aac46b643 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list3.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list4.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list4.webp new file mode 100644 index 000000000..01058677e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list4.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list5.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list5.webp new file mode 100644 index 000000000..201834950 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list5.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list6.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list6.webp new file mode 100644 index 000000000..120836e3a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_left_list6.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol(1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol(1).webp new file mode 100644 index 000000000..f02726a94 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol(1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol(2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol(2).webp new file mode 100644 index 000000000..f6feaebb4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol(2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (1).webp new file mode 100644 index 000000000..3ec76e07a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (2).webp new file mode 100644 index 000000000..d738af650 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (3).webp new file mode 100644 index 000000000..e2bcea625 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (4).webp new file mode 100644 index 000000000..753e14353 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (5).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (5).webp new file mode 100644 index 000000000..fba33adf1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (5).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (6).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (6).webp new file mode 100644 index 000000000..e68aaab84 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_baijiu (6).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (1).webp new file mode 100644 index 000000000..9c4b5de18 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (2).webp new file mode 100644 index 000000000..6846b2ae1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (3).webp new file mode 100644 index 000000000..cd80b7b3a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (4).webp new file mode 100644 index 000000000..cf01e135a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (5).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (5).webp new file mode 100644 index 000000000..593c1732f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (5).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (6).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (6).webp new file mode 100644 index 000000000..32c3ef006 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_lingshi (6).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (1).webp new file mode 100644 index 000000000..b3ef1a836 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (2).webp new file mode 100644 index 000000000..3157529bf Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (3).webp new file mode 100644 index 000000000..c880c7f64 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (4).webp new file mode 100644 index 000000000..865a3e5a6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (5).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (5).webp new file mode 100644 index 000000000..82cbbfc47 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (5).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (6).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (6).webp new file mode 100644 index 000000000..1ba2c8be3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_mian (6).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (1).webp new file mode 100644 index 000000000..763547a16 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (10).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (10).webp new file mode 100644 index 000000000..643662a18 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (10).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (11).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (11).webp new file mode 100644 index 000000000..2c708ba02 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (11).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (12).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (12).webp new file mode 100644 index 000000000..6ad2ca613 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (12).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (2).webp new file mode 100644 index 000000000..248d7a22a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (3).webp new file mode 100644 index 000000000..6a158bffa Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (4).webp new file mode 100644 index 000000000..819599954 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (5).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (5).webp new file mode 100644 index 000000000..1cedc35d5 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (5).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (6).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (6).webp new file mode 100644 index 000000000..16b50db95 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (6).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (7).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (7).webp new file mode 100644 index 000000000..b56ca4231 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (7).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (8).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (8).webp new file mode 100644 index 000000000..dc2902476 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (8).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (9).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (9).webp new file mode 100644 index 000000000..8a4de8791 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_find_right_list_ul_ol_naifen (9).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (1).webp new file mode 100644 index 000000000..6e2395f9e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (2).webp new file mode 100644 index 000000000..8d99ea08c Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (3).webp new file mode 100644 index 000000000..af3ea9565 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_img (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (1).webp new file mode 100644 index 000000000..cc1898709 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (2).webp new file mode 100644 index 000000000..7085ff4a0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (3).webp new file mode 100644 index 000000000..7f94e3b47 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (4).webp new file mode 100644 index 000000000..5aa3a6c89 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_left_list_img (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_header_img.png b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_header_img.png new file mode 100644 index 000000000..40065e1ff Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_header_img.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (1).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (1).webp new file mode 100644 index 000000000..27d3fd1e6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (1).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (2).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (2).webp new file mode 100644 index 000000000..16023a06f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (2).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (3).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (3).webp new file mode 100644 index 000000000..48a86e4a1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (3).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (4).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (4).webp new file mode 100644 index 000000000..ad4101f1f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (4).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (5).webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (5).webp new file mode 100644 index 000000000..3179dcad3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list (5).webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list.webp new file mode 100644 index 000000000..48a86e4a1 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_ling_right_list.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second.png b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second.png new file mode 100644 index 000000000..660f81182 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_header_background.png b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_header_background.png new file mode 100644 index 000000000..2edd6f6e0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_header_background.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img1.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img1.jpg new file mode 100644 index 000000000..b3e35aea8 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img1.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img10.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img10.jpg new file mode 100644 index 000000000..cb612d094 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img10.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img11.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img11.jpg new file mode 100644 index 000000000..8f312292e Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img11.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img12.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img12.jpg new file mode 100644 index 000000000..5bbdd74ef Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img12.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img2.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img2.jpg new file mode 100644 index 000000000..5bc3249b4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img2.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img3.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img3.jpg new file mode 100644 index 000000000..13c7a1898 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img3.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img4.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img4.jpg new file mode 100644 index 000000000..32705c14b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img4.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img5.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img5.jpg new file mode 100644 index 000000000..7053f143f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img5.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img6.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img6.jpg new file mode 100644 index 000000000..1767908d3 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img6.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img7.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img7.jpg new file mode 100644 index 000000000..96db417b0 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img7.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img8.jpg new file mode 100644 index 000000000..b2e094cb9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img9.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img9.jpg new file mode 100644 index 000000000..e8cb73d4f Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_img9.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_right_img.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_right_img.jpg new file mode 100644 index 000000000..2c5b853db Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_right_img.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_right_img.png b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_right_img.png new file mode 100644 index 000000000..755af11c7 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/section_second_list_right_img.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/shi.png b/msb-mall/mall-producet/src/main/resources/static/index/img/shi.png new file mode 100644 index 000000000..268e46e87 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/shi.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/skygreen.png b/msb-mall/mall-producet/src/main/resources/static/index/img/skygreen.png new file mode 100644 index 000000000..1ffd01f38 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/skygreen.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/sprite_entrylive@1x.png b/msb-mall/mall-producet/src/main/resources/static/index/img/sprite_entrylive@1x.png new file mode 100644 index 000000000..353b8ee3b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/sprite_entrylive@1x.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/sprite_fs@1x.png b/msb-mall/mall-producet/src/main/resources/static/index/img/sprite_fs@1x.png new file mode 100644 index 000000000..0be22f011 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/sprite_fs@1x.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/taoxin.png b/msb-mall/mall-producet/src/main/resources/static/index/img/taoxin.png new file mode 100644 index 000000000..021a27d1b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/taoxin.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/touxiang.png b/msb-mall/mall-producet/src/main/resources/static/index/img/touxiang.png new file mode 100644 index 000000000..4b3a06b26 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/touxiang.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w1.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/w1.jpg!q90 new file mode 100644 index 000000000..6a365e831 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w1.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w2.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/w2.webp new file mode 100644 index 000000000..36cc516b4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w2.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w3.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/w3.webp new file mode 100644 index 000000000..209644888 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w3.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w4.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/w4.webp new file mode 100644 index 000000000..bf42eb77b Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w4.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w5.webp b/msb-mall/mall-producet/src/main/resources/static/index/img/w5.webp new file mode 100644 index 000000000..b07aed7be Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w5.webp differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w6.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/w6.jpg!q90 new file mode 100644 index 000000000..7021a2a91 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w6.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w7.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/w7.jpg!q90 new file mode 100644 index 000000000..91c1ea294 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w7.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/w8.jpg!q90 b/msb-mall/mall-producet/src/main/resources/static/index/img/w8.jpg!q90 new file mode 100644 index 000000000..f499a6ac6 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/w8.jpg!q90 differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg1.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg1.jpg new file mode 100644 index 000000000..4b4a043ed Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg1.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg10.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg10.jpg new file mode 100644 index 000000000..0c13f9d17 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg10.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg11.png b/msb-mall/mall-producet/src/main/resources/static/index/img/wg11.png new file mode 100644 index 000000000..4dfa533d4 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg11.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg12.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg12.jpg new file mode 100644 index 000000000..5996c38a9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg12.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg2.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg2.jpg new file mode 100644 index 000000000..db06ca63a Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg2.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg3.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg3.jpg new file mode 100644 index 000000000..3a1049f86 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg3.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg4.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg4.jpg new file mode 100644 index 000000000..914b091af Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg4.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg5.png b/msb-mall/mall-producet/src/main/resources/static/index/img/wg5.png new file mode 100644 index 000000000..fcfe6e5e9 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg5.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg6.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg6.jpg new file mode 100644 index 000000000..bbc8f8fee Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg6.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg7.png b/msb-mall/mall-producet/src/main/resources/static/index/img/wg7.png new file mode 100644 index 000000000..aa633bfbb Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg7.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg8.jpg b/msb-mall/mall-producet/src/main/resources/static/index/img/wg8.jpg new file mode 100644 index 000000000..1a667f5ff Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg8.jpg differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wg9.png b/msb-mall/mall-producet/src/main/resources/static/index/img/wg9.png new file mode 100644 index 000000000..7de88bc86 Binary files /dev/null and b/msb-mall/mall-producet/src/main/resources/static/index/img/wg9.png differ diff --git a/msb-mall/mall-producet/src/main/resources/static/index/img/wl.js.下载 b/msb-mall/mall-producet/src/main/resources/static/index/img/wl.js.下载 new file mode 100644 index 000000000..cb62bdc1e --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/img/wl.js.下载 @@ -0,0 +1 @@ +/*Thu Nov 23 2017 09:43:28*/function setCookieMills(a,b,c){var d=new Date;d.setTime(d.getTime()+c);var e=window.document.domain.indexOf("360buy")>=0?".360buy.com":".jd.com";document.cookie=a+"="+escape(b)+";expires="+d.toGMTString()+";path=/;domain="+e}function getCookie(a){var b=document.cookie.match(new RegExp("(^| )"+a+"=([^;]*)(;|$)"));return null!=b?unescape(b[2]):null}function deleteCookie(a){var b=getCookie(a);null!=b&&setCookieMills(a,"",-1)}function seClick(a,b,c){var d="seWids"+a,e=getCookie(d);if(null!=e){var f=e.toString().indexOf(c);f<0&&(e=e+","+c)}else e=c;setCookieMills(d,e,864e5),privateLogWLJS(2,2,b,c)}function appendJSONCookie(cookieName,key,wid,Mills){var ns=eval("("+getCookie(cookieName)+")");null!=ns&&""!=ns||(ns=new Object),null==ns[key]&&(ns[key]="");var pos=ns[key].indexOf(wid);pos<0&&(ns[key]=ns[key]+","+wid),setCookieMills(cookieName,$.toJSON(ns),Mills)}function reBook(a,b,c){var d="_rtbook",e=b.toString().split("#")[0];appendJSONCookie(d,a,e,864e5),privateLogWLJS(3,a,e,c)}function fe(a,b,c){privateLogWLJS("f",a,b,c)}function reClick2012(a,b,c){var d="reHome2012",e=b.toString().split("#")[0];appendJSONCookie(d,a,e,864e5),privateLogWLJS(3,a,e,c)}function reClickCube(a,b){var c="_rdCube";appendJSONCookie(c,"p"+a,b,864e5)}function mark(a,b){privateLogWLJS(1,b,a)}function isMeta(a){if(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)return!0;var b=a.which,c=a.button;return b||void 0===c?2===b||2===c:1&!c&&2&!c&&4&c}function HashMap(){this.values=new Object}function RecommendTrans(recName,tag,logtype){for(var cookieNames=recName.split(","),i=0;i0){var k=f[j].toString().split("#")[0];SucInfoMethod.Contains(k)&&(e?(privateLogWLJS(d,c,b.concat(".o"),g,h,i,k+":"+SucInfoMethod.GetSkuNum(k)),privateLogWLJS("4","R"+b.concat(".o"),g,h,i,k,SucInfoMethod.GetSkuNum(k))):privateLogWLJS(d,c+b,g,h,i,k,SucInfoMethod.GetSkuNum(k)))}}function isChecked(){return SucInfo_OrderId=window.SucInfo_OrderId||JA.util.getParameter(document.location.href,"suc_orderid")||void 0,SucInfo_OrderType=window.SucInfo_OrderType||JA.util.getParameter(document.location.href,"suc_ordertype")||void 0,SucInfo_OrderDetail=window.SucInfo_OrderDetail||decodeURIComponent(JA.util.getParameter(document.location.href,"suc_sku"))||void 0,SucInfo_OrderId&&SucInfo_OrderDetail}function funLoad(){var a=getCookie("pin");null!=a&&a.length>0&&setCookieMills("rpin",a,2592e5)}function Clublog(){var a=this.location.pathname.toLowerCase(),b=this.location.hostname.toLowerCase();a.indexOf("/cart.html",0)>=0||a.indexOf("shoppingcart",0)>=0?privateLogWLJS("R2&Page","Show"):a.indexOf("user_home",0)>=0?privateLogWLJS("R3&Page","Show"):a.indexOf("initcart.html",0)>=0||a.indexOf("addtocart.html",0)>=0||a.indexOf("initcart.aspx",0)>=0?privateLogWLJS("R4R5&Page","Show"):a.indexOf("normal/list.action",0)>=0||a.indexOf("orderlist.aspx",0)>=0?privateLogWLJS("DDR&Page","Show"):"home.360buy.com"==b&&"/"==a&&privateLogWLJS("R3&Page","Show")}function getHistory(){var a=decodeURIComponent(escape(getCookie("pin"))),b=getCookie("_ghis"),c=window.document.location.host.toLowerCase().indexOf("360buy.com")>=0?"360buy":"jd";if(null==b&&null!=a){var d="//gh."+c+".com/BuyHistory.aspx?mid="+encodeURIComponent(a);$.ajax({url:d,type:"GET",dataType:"jsonp",success:function(a){var b=a.SSkus,c=a.UserInsterest;b.toString().length>0&&setCookieMills("_ghis",b.toString().substring(0,51)),c.toString().length>0&&setCookieMills("_ghit",c)}})}}function privateLogWLJS(a,b){var c=Array.prototype.slice.call(arguments);c=c&&c.slice(2),JA&&JA.tracker.ngloader("other.000000",{t1:a,t2:b,p0:encodeURIComponent(JA.util.join(c))})}function log(a,b){var c=Array.prototype.slice.call(arguments),d=c;c=c&&c.slice(2),JA&&JA.tracker.ngloader("other.000000",{t1:a,t2:b,p0:encodeURIComponent(JA.util.join(c))}),JA&&JA.tracker.isCanPrey()&&JA&&JA.tracker.ngloader("other.000000",{t1:"logservice_check",t2:"wl",p0:encodeURIComponent(JA.util.join(d))})}function logJSON(a,b,c){return!!JA&&void JA.tracker.ngloaderJSON("other.000000",{t1:a,t2:b,p0:c},"toWarriors")}function expLogJSON(a,b,c){return!!JA&&void JA.tracker.ngloaderJSON("exp_log.100000",{t1:a,t2:b,p0:c},"toWarriors")}!function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};$.toJSON="object"==typeof JSON&&JSON.stringify?JSON.stringify:function(a){if(null===a)return"null";var b=typeof a;if("undefined"!==b){if("number"===b||"boolean"===b)return""+a;if("string"===b)return $.quoteString(a);if("object"===b){if("function"==typeof a.toJSON)return $.toJSON(a.toJSON());if(a.constructor===Date){var c=a.getUTCMonth()+1,d=a.getUTCDate(),e=a.getUTCFullYear(),f=a.getUTCHours(),g=a.getUTCMinutes(),h=a.getUTCSeconds(),i=a.getUTCMilliseconds();return c<10&&(c="0"+c),d<10&&(d="0"+d),f<10&&(f="0"+f),g<10&&(g="0"+g),h<10&&(h="0"+h),i<100&&(i="0"+i),i<10&&(i="0"+i),'"'+e+"-"+c+"-"+d+"T"+f+":"+g+":"+h+"."+i+'Z"'}if(a.constructor===Array){for(var j=[],k=0;k500&&(b=a.indexOf("?"),b&&(a=a.substring(0,b))),a}function c(a){return a.pageX?a.pageX:a.clientX?a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft):-1}function d(a){return a.pageY?a.pageY:a.clientY?a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop):-1}function e(){if(!l){var a=document.domain.indexOf("jd.com")>=0?document.getElementsByClassName("w"):"";l=a&&a.length>0?a[a.length-1].offsetWidth:window.screen.width>=1210?1210:990}return document.body.clientWidth>l?Math.round((document.body.clientWidth-l)/2):0}function f(a,b){var c=Array.prototype.slice.call(arguments);c=c&&c.slice(2),JA&&JA.tracker.ngloader("magic.000001",{t1:a,t2:b,p0:encodeURIComponent(JA.util.join(c))})}var g=function(a){for(var b="",c="";a&&1==a.nodeType;a=a.parentNode){if(c="",a.parentNode)for(var d=a.parentNode.childNodes,e=0,f=0,g=d.length;e1?"["+f+"]":"")}b="/"+a.tagName.toLowerCase()+c+b}return b},h=function(a){for(var b="",c="";a&&1==a.nodeType;a=a.parentNode){if(""!==a.id){b='//*[@id="'+a.id+'"]'+b;break}if(c="",a.parentNode)for(var d=a.parentNode.childNodes,e=0,f=0,g=d.length;e1?"["+f+"]":"")}b="/"+a.tagName.toLowerCase()+c+b}return b},i=function(a){var b=!0,c=a.children;return c.length>0&&(b=!1),b},j=function(b){var c=!1;if(b&&b.tagName){var d=b.tagName.toLowerCase();c=!("html"===d||"body"===d||b.id&&"tol_selected_xelemts_area"===b.id||b.parentElement&&b.parentElement.id&&"tol_selected_xelemts_area"===b.parentElement.id)&&(!!a(b)||("a"===d||i(b)))}return c},k="";document.getElementsByClassName||(document.getElementsByClassName=function(a){for(var b=document.getElementsByTagName("*"),c=[],d=0;d0&&(b.x=parseInt(b.x-b.offsetLeft)),b},n=function(a){try{var c=a.target||a.srcElement;if(j(c)){for(var d=m(a),e=c,l=c.tagName.toLowerCase(),n=h(c)||"-",o=c.parentNode?h(c.parentNode):"-",p=c.parentNode?g(c.parentNode)+"/":"-",q=g(c)||"-",r=q?q.split("/").length:1,s=e.tagName.toLowerCase();"a"!=s&&(e=e.parentNode,e&&"BODY"!=e.nodeName);)s=e.tagName.toLowerCase();var t="-",u="-";if(k)var v=k.split("|"),t=v[2],u=v[3];var w=e&&e.href?b(e.href):"-",x=c.innerText.substring(.2)||"-",y=c.src?b(c.src):"-";"a"!==l||i(c)||(x="-"),f("magictree","X",encodeURIComponent(n),encodeURIComponent(o),encodeURIComponent(p),r,d.x+"x"+d.y,d.scrollWidth+"x"+d.scrollHeight,d.offsetLeft,t,u,encodeURIComponent(w),encodeURIComponent(x),encodeURIComponent(y))}}catch(a){privateLogWLJS("ERROR","AT_xpathReport",encodeURIComponent(a))}},o=function(a,b){var c=b||document.location.href,d=new RegExp("(?:^|&|[?]|[/])"+a+"=([^&]*)"),e=d.exec(c);return e?decodeURIComponent(e[1]):null},p=function(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,b.charset="UTF-8",document.getElementsByTagName("head")[0].appendChild(b)},q=function(a){var b=document.createElement("link");b.type="text/css",b.rel="stylesheet",b.href=a,document.getElementsByTagName("head")[0].appendChild(b)},r=o("typepar");if(!r||"query"!==r&&"apply"!==r)document.onclick=function(a){if(a=a||event,(a.clientX||a.clientY||a.pageX||a.pageY)&&(a.offsetX||a.offsetY)){try{n(a)}catch(a){privateLogWLJS("ERROR","AT_Document_Onclick")}for(var b=document,c=window,d=tag=a.srcElement||a.target,e=$(tag).attr("clstag"),f=$(tag).attr("href"),g="";!e&&(tag=tag.parentNode,tag&&"BODY"!=tag.nodeName);)e=$(tag).attr("clstag"),f||(f=$(tag).attr("href"),d=tag);if(e){var h=e.split("|"),i=h[1],j=h[2],k=h[3];if("keycount"===i&&JA){var l=JA.util.Nt();f?(JA.tracker.aloading(j,k,["Q",f]),JA.tracker.ngloader("other.000000",{t1:j,t2:k,p0:JA.util.join(["Q",f]),cb:l.jdcb})):(JA.tracker.aloading(j,k,["Q"]),JA.tracker.ngloader("other.000000",{t1:j,t2:k,p0:JA.util.join(["Q"]),cb:l.jdcb})),g=j+"|"+k,f&&/^(http:\/\/|https:\/\/|\/\/).*/.test(f)&&"_blank"!==$(d).attr("target")&&!isMeta(a)&&(a.preventDefault?a.preventDefault():a.returnValue=!1,setTimeout(function(){var a=b.createElement("a");a.href=f,a.target="_self",b.body.appendChild(a),"undefined"!=typeof a.click?a.click():c.location.href=f,b.body.removeChild(a)},200))}}var m=this.location.hostname.toLowerCase();if(/(sale|mall|jmall|pop).(jd|360buy).(com|hk)/.test(m)||c.ja_heat_map){var o=0,p=0,q=c.screen.width>=1210&&"item.jd.com"==m?1210:990,r=b.body.clientWidth>q?Math.round((b.body.clientWidth-q)/2):0;a.pageX||a.pageY?(o=a.pageX,p=a.pageY):(o=a.clientX+b.body.scrollLeft-b.body.clientLeft,p=a.clientY+b.body.scrollTop-b.body.clientTop),privateLogWLJS("d","c",g||"-",o+"x"+p,b.body.scrollWidth+"x"+b.body.scrollHeight,r)}}};else try{q("//magicforest.jd.com/x.css"),p("//magicforest.jd.com/tol.min.js")}catch(a){privateLogWLJS("ERROR","AT_loadCSS_OR_loadJS")}}(),HashMap.prototype.Set=function(a,b){this.values[a]=b},HashMap.prototype.Get=function(a){return this.values[a]},HashMap.prototype.Contains=function(a){return this.values.hasOwnProperty(a)},HashMap.prototype.Remove=function(a){delete this.values[a]};var SucInfoMethod={Init:function(){this.orderDetailMap=new HashMap,this.rSM=new HashMap;for(var a=SucInfo_OrderDetail.toString().split(","),b=0;b1&&(this.s=b),arguments.length>2&&(this.v=c)}HashMap.prototype.Set=function(a,b){this.values[a]=b},HashMap.prototype.Get=function(a){return this.values[a]},HashMap.prototype.Contains=function(a){return this.values.hasOwnProperty(a)},HashMap.prototype.Remove=function(a){delete this.values[a]},SortedHashMap.prototype.Add=function(a,b){this.ContainsKey(a)&&this.Remove(a),this.a.push(b),this.a.sort(this.IComparer);for(var c=0;c=b&&this.a.splice(b-1,1),this.a.unshift(a)},SortedHashMap.prototype.Get=function(a){return this.a[this.h.Get(a)]},SortedHashMap.prototype.Count=function(){return this.a.length},SortedHashMap.prototype.Remove=function(a){if(this.h.Contains(a)){var b=this.h.Get(a);this.a.splice(b,1),this.h.Remove(a)}},SortedHashMap.prototype.ContainsKey=function(a){return this.h.Contains(a)},SortedHashMap.prototype.Clear=function(){this.a=new Array,this.h=new HashMap},SortedHashMap.prototype.GetJson=function(){return $.toJSON(this.a)},ThirdType.prototype.Increase=function(){this.v=this.v+2},ThirdType.prototype.Decrease=function(){this.v=this.v-1},ThirdType.prototype.SetSku=function(a){this.s=a},Ttracker={IComparer:function(a,b){return b.v-a.v},IGetKey:function(a){return a.t},isbook:function(a){return a>1e7&&a<2e7},trace:function(){if("object"==typeof pageConfig&&"object"==typeof pageConfig.product){var a=pageConfig.product.cat instanceof Array&&pageConfig.product.cat[2];if(a){var b=$("#name").attr("PshowSkuid")||pageConfig.product.skuid;this.view(a,b),this.viewtypewid()}}},viewtypewid:function(){var a=Ttracker.util.Vv("typewid");a&&Ttracker.util.Wv("typewid","",-63072e6)},viewhisotry:function(t,s,cname){var nview={t:t,s:s},bookmap=new SortedHashMap(this.IComparer,this.IGetKey),bview=Ttracker.util.Vv(cname);if(bview)try{if(bview.indexOf(".")>0)for(var viewarray=bview.split("|"),j=viewarray.length-1;j>=0;j--){var book=viewarray[j].split(".");bookmap.Insert({t:Number(book[0]),s:Number(book[1])},8)}else{var bviews=eval("("+bview+")");if(bviews.length>0&&void 0!=bviews[0].d)Ttracker.util.Wv(cname,"",-63072e6);else for(var i=bviews.length-1;i>=0;i--)bookmap.Insert(bviews[i],8)}}catch(a){Ttracker.util.Wv(cname,"",-63072e6)}bookmap.Insert(nview,8);for(var cvalue="",k=0,klen=bookmap.a.length;k0)for(var ratearray=vrate.split("|"),j=ratearray.length-1;j>=0;j--){var tw=ratearray[j].split("."),tv=Number(tw[2]||0),tid=Number(tw[0]);tv=t===tid?tv:tv-1,sitesortmap.Add(Number(tw[0]),{t:Number(tw[0]),s:Number(tw[1]),v:tv},8)}else{var vrates=eval("("+vrate+")");if(vrates.length>0&&void 0!=vrates[0].d)Ttracker.util.Wv(cname,"",-63072e6);else for(var i=0;i8){var del=sitesortmap.a[sitesortmap.Count()-1];sitesortmap.Remove(del.t)}for(var cvalue="",k=0,klen=sitesortmap.a.length;k=0?".360buy.com":".jd.com";a=a+"="+b+"; path=/; ",c&&(a+="expires="+new Date((new Date).getTime()+c).toGMTString()+"; "),a+="domain="+d+";",document.cookie=a},Vv:function(a){for(var b=[],c=document.cookie.split(";"),a=RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$"),d=0;d=0?"360buy.com":"jd.com";this.set(s,b),this.set(r,da()),this.set(t,Math.round((new Date).getTime()/1e3)),this.set(u,15552e6),this.set(v,1296e6),this.set(w,18e5),this.set(C,fa());var c=ia();this.set(D,c.name),this.set(E,c.version),this.set(F,ja());var d=ea();this.set(G,d.D),this.set(H,d.C),this.set(I,d.language),this.set(J,d.javaEnabled),this.set(K,d.characterSet),this.set(Q,aa),this.set(V,(new Date).getTime());var e=n.util.Vv("pin");this.set(Y,e[j]?e[0]:"-");var g,h="";(g=n.util.Vv("pinId"))&&g[j]&&(h=g[0]),this.set(Z,h||"-")},aa=["i.easou.com:q","m.baidu.com:word","m.sm.cn:q","m.so.com:q","wap.sogou.com:keyword","m.sogou.com:keyword","page.roboo.com:q","ask.com:q","baidu:word","baidu:wd","bing:q","easou:q","google:q","roboo:word","roboo:q","sm.cn:q","so.com:q","sogou:keyword","sogou:query","yahoo:p","yandex:text","yicha:key"],ba=function(){return Math.round((new Date).getTime()/1e3)},ca=function(){return(new Date).getTime()+""+parseInt(2147483647*Math.random())},da=function(){return ha(c.domain)},ea=function(){var a={},d=b.navigator,e=b.screen;return a.D=e?e.width+"x"+e.height:"-",a.C=e?e.colorDepth+"-bit":"-",a.language=(d&&(d.language||d.browserLanguage)||"-")[l](),a.javaEnabled=d&&d.javaEnabled()?1:0,a.characterSet=c.characterSet||c.charset||"-",a},fa=function(){var a,b,c,d;if(c="ShockwaveFlash",(a=(a=window.navigator)?a.plugins:f)&&a[j]>0)for(b=0;b-1&&(d=c.description[i]("Shockwave Flash ")[1]);else{c=c+"."+c;try{b=new ActiveXObject(c+".7"),d=b.GetVariable("$version")}catch(a){}if(!d)try{b=new ActiveXObject(c+".6"),d="WIN 6,0,21,0",b.AllowScriptAccess="always",d=b.GetVariable("$version")}catch(a){}if(!d)try{b=new ActiveXObject(c),d=b.GetVariable("$version")}catch(a){}d&&(d=d[i](" ")[1][i](","),d=d[0]+"."+d[1]+" r"+d[2])}var e=n.util.Vv("_r2");a=d?d+(e[j]>0?"_"+e[0]:""):"-";var g=n.util.Vv("limgs");return a+=g[j]>0?"_"+g[0]:""},ga=function(a){return f==a||"-"==a||""==a},ha=function(a){var b,c=1,d=0;if(!ga(a))for(c=0,b=a[j]-1;b>=0;b--)d=a.charCodeAt(b),c=(c<<6&268435455)+d+(d<<14),d=266338304&c,c=0!=d?c^d>>21:c;return c},ia=function(){var a={name:"other",version:"0"},b=navigator.userAgent.toLowerCase();browserRegExp={se360:/360se/,se360_2x:/qihu/,ie:/msie[ ]([\w.]+)/,firefox:/firefox[|\/]([\w.]+)/,chrome:/chrome[|\/]([\w.]+)/,safari:/version[|\/]([\w.]+)(\s\w.+)?\s?safari/,opera:/opera[|\/]([\w.]+)/};for(var c in browserRegExp){var d=browserRegExp[c].exec(b);if(d){a.name=c,a.version=d[1]||"0";break}}return a},ja=function(){var a=/(win|android|linux|nokia|ipad|iphone|ipod|mac|sunos|solaris)/.exec(navigator.platform.toLowerCase());return null==a?"other":a[0]},ka=function(){for(var a="",b=["jwotest_product","jwotest_list","jwotest_cart","jwotest_orderinfo","jwotest_homepage","jwotest_other1","jwotest_other2","jwotest_other3"],c=0,d=b.length;c0?b[0][i]("."):null;a.set(q,d&&!ga(d[1])?d[1]:ca()),a.set(L,d?d[2]:a.get(t)),a.set(M,d?d[3]:a.get(t)),a.set(N,d?d[4]:a.get(t)),a.set(O,d?d[5]:1);var e=n.util.Vv("__jdv"),f=e[j]>0?e[0][i]("|"):null;a.set(R,f?f[1]:"direct"),a.set(S,f?f[2]:"-"),a.set(T,f?f[3]:"none"),a.set(U,f?f[4]:"-");var g=n.util.Vv("__jdb"),h=g[j]>0?g[0][i]("."):null,k=h&&4==h.length?1:0;a.set(P,h?h[0+k]:0),a.set(W,ka()||"-");var l=JA.util.Vv("clickid"),m=l[j]&&l[0];return a.set(X,m),!0},ma=function(){var a=n.util.Vv("__jdb"),b=a[j]>0?a[0][i]("."):null;return b&&1==b.length?1*b[0]:b&&4==b.length?1*b[1]:0},na=function(a){var b=c.location.search,d=c.referrer,e=a.get(s),f=n.util.getParameter(b,"utm_source"),h=[],m=a.get(R),o=a.get(S),p=a.get(T),q=0==n.util.Vv("__jdb")[j],r=!1;if(f){var t=n.util.getParameter(b,"utm_campaign"),u=n.util.getParameter(b,"utm_medium"),v=n.util.getParameter(b,"utm_term");h[g](f),h[g](t||"-"),h[g](u||"-"),h[g](v||"not set"),a.set(U,h[3]),r=!0}else{var w=d&&d[i]("/")[2],x=!1;if(w&&w[k](e)<0){for(var y=a.get(Q),z=0;z-1&&d[k]((A[1]+"=")[l]())>-1){var B=n.util.getParameter(d,A[1]);h[g](A[0]),h[g]("-"),h[g]("organic"),h[g](B||"not set"),a.set(U,h[3]),x=!0;break}}x||(w[k]("zol.com.cn")>-1?(h[g]("zol.com.cn"),h[g]("-"),h[g]("cpc"),h[g]("not set")):(h[g](w),h[g]("-"),h[g]("referral"),h[g]("-")))}}var C=h[j]>0&&(h[0]!==m||h[1]!==o||h[2]!==p)&&"referral"!==h[2];return q||!q&&C?(a.set(R,h[0]||a.get(R)),a.set(S,h[1]||a.get(S)),a.set(T,h[2]||a.get(T)),a.set(U,h[3]||a.get(U)),ua(a)):qa(a),C||r},oa=function(a,b){var c=b.split(".");a.set(L,c[2]),a.set(M,c[4]),a.set(N,ba()),a.m(O),a.set(P,1)},pa=function(a){var b=a.get(t);a.set(q,ca()),a.set(L,b),a.set(M,b),a.set(N,b),a.set(O,1),a.set(P,1)},qa=function(a){a.m(P)},ra=function(a){return[a.get(r),a.get(q)||"-",a.get(L)||"-",a.get(M)||"-",a.get(N)||"-",a.get(O)||1][h](".")},sa=function(a){return[a.get(r),a.get(P)||1,a.get(q)+"|"+a.get(O)||1,a.get(N)||a.get(t)][h](".")},ta=function(a){return[a.get(r),a.get(R)||c.domain,a.get(S)||"(direct)",a.get(T)||"direct",a.get(U)||"-",(new Date).getTime()][h]("|")},ua=function(a){var b=n.util.Vv("__jda");0==b.length?pa(a):oa(a,b[0])},va=new _,wa=function(){this.a={},this.add=function(a,b){this.a[a]=b},this.get=function(a){return this.a[a]},this.toString=function(){return this.a[h]("&")}},xa=function(a,b){b.add("jdac",a.get(p)),b.add("jduid",a.get(q)),b.add("jdsid",a.get(q)+"|"+a.get(O)),b.add("jdje",a.get(J)),b.add("jdsc",a.get(H)),b.add("jdsr",a.get(G)),b.add("jdul",a.get(I)),b.add("jdcs",a.get(K)),b.add("jddt",a.get(y)||"-"),b.add("jdmr",d(a.get(A))),b.add("jdhn",a.get(x)||"-"),b.add("jdfl",a.get(C)),b.add("jdos",a.get(F)),b.add("jdbr",a.get(D)),b.add("jdbv",a.get(E)),b.add("jdwb",a.get(L)),b.add("jdxb",a.get(M)),b.add("jdyb",a.get(N)),b.add("jdzb",a.get(O)),b.add("jdcb",a.get(P)),b.add("jdusc",a.get(R)||"direct"),b.add("jducp",a.get(S)||"-"),b.add("jdumd",a.get(T)||"-"),b.add("jduct",a.get(U)||"-"),b.add("jdlt","object"!=typeof jdpts?0:void 0==jdpts._st?0:a.get(V)-jdpts._st),b.add("jdtad",a.get(W)),b.add("jdak",a.get(X)),b.add("pinid",a.get(Z))},ya=function(a,b,c,e){b.add("jdac",a.get(p)),b.add("jduid",a.get(q)),b.add("jdsid",a.get(q)+"|"+a.get(O)),b.add("jdje","-"),b.add("jdsc","-"),b.add("jdsr","-"),b.add("jdul","-"),b.add("jdcs","-"),b.add("jddt","-"),b.add("jdmr",d(a.get(A))),b.add("jdhn","-"),b.add("jdfl","-"),b.add("jdos","-"),b.add("jdbr","-"),b.add("jdbv","-"),b.add("jdwb","-"),b.add("jdxb","-"),b.add("jdyb","-"),b.add("jdzb",a.get(O)),b.add("jdcb",e?ma()+e:a.get(P)),b.add("jdusc","-"),b.add("jducp","-"),b.add("jdumd","-"),b.add("jduct","-"),b.add("jdlt",0),b.add("jdtad",c),b.add("jdak",a.get(X)),b.add("pinid",a.get(Z))},za=function(){la(va);var a=na(va),b=n.util.Vv("__jdv"),c=new wa,d=va.get(s);return xa(va,c),n.util.Wv("__jda",ra(va),d,va.get(u)),n.util.Wv("__jdb",sa(va),d,va.get(w)),n.util.Wv("__jdc",va.get(r),d),!a&&b.length||n.util.Wv("__jdv",ta(va),d,va.get(v)),n.util.Wv("clickid","0",d,-846e5),c.a},Aa=function(){var a=new wa;return xa(va,a),a.a},Ba=function(a,b){var c=new wa;return ya(va,c,a,b),c.a},Ca=function(a){var b=document.createElement("img");return b.width=1,b.height=1,b.src=a,b},Da=function(a){var b=Ca(a);b.onload=b.onerror=function(){b.onload=null,b.onerror=null}};n.util.Nt=Aa,n.tracker={sendOld:function(a,b,c,d){return},sendNew:function(a,b){var e=Aa(),f=("https:"==document.location.protocol?"https://mercury":"http://mercury")+".jd.com/log.gif?t="+a+"&m="+va.get(p)+"&pin="+d(va.get(Y))+"&uid="+e.jduid+"&sid="+e.jdsid+(e.jdak?"&cul="+document.location.href+d("&clickid="+e.jdak):"")+"&v="+d(b)+"&ref="+d(c.referrer)+"&rm="+(new Date).getTime();Da(f)},sendToWarriors:function(a,b){var e=Aa(),f=("https:"==document.location.protocol?"https://warriors":"http://warriors")+".jd.com/log.gif?t="+a+"&m="+va.get(p)+"&pin="+d(va.get(Y))+"&uid="+e.jduid+"&sid="+e.jdsid+(e.jdak?"&cul="+document.location.href+d("&clickid="+e.jdak):"")+"&v="+d(b)+"&ref="+d(c.referrer)+"&rm="+(new Date).getTime();Da(f)},ngloader:function(a,b){var c=Aa(),d={je:c.jdje,sc:c.jdsc,sr:c.jdsr,ul:c.jdul,cs:c.jdcs,dt:c.jddt,hn:c.jdhn,fl:c.jdfl,os:c.jdos,br:c.jdbr,bv:c.jdbv,wb:c.jdwb,xb:c.jdxb,yb:c.jdyb,zb:c.jdzb,cb:c.jdcb,usc:c.jdusc,ucp:c.jducp,umd:c.jdumd,uct:c.jduct,ct:(new Date).getTime(),lt:c.jdlt,tad:c.jdtad};this.ngaloader(a,d,b)},ngaloader:function(a,b,c){var d="";for(var e in b)d+=e+"="+b[e]+"$";if(c)for(var e in c)d+=e+"="+c[e]+"$";d+="pinid="+va.get(Z)+"$";try{d+="jdv="+(n.util.Vv("__jdv")[0]||"")+"$"}catch(a){}d+="dataver="+m+"$";var f=n.util.Vv("unpl");f.length>0&&(d+="unpl="+f[0]+"$"),d=d.substring(0,d.length-1),this.sendNew(a,d)},ngloaderJSON:function(a,b,c){var d=Aa();b.pinid=va.get(Z),b.je=d.jdje,b.sc=d.jdsc,b.sr=d.jdsr,b.ul=d.jdul,b.cs=d.jdcs,b.dt=d.jddt,b.hn=d.jdhn,b.fl=d.jdfl,b.os=d.jdos,b.br=d.jdbr,b.bv=d.jdbv,b.wb=d.jdwb,b.xb=d.jdxb,b.yb=d.jdyb,b.zb=d.jdzb,b.cb=d.jdcb,b.usc=d.jdusc,b.ucp=d.jducp,b.umd=d.jdumd,b.uct=d.jduct,b.ct=(new Date).getTime(),b.lt=d.jdlt,b.tad=d.jdtad;try{b.jdv=n.util.Vv("__jdv")[0]||""}catch(a){}b.dataver=m,c&&"toWarriors"==c?this.sendToWarriors(a,$.toJSON(b)):this.sendNew(a,$.toJSON(b))},bloading:function(a,b,c){var d=za();this.loading(a,b,d,c);var e={je:d.jdje,sc:d.jdsc,sr:d.jdsr,ul:d.jdul,cs:d.jdcs,dt:d.jddt,hn:d.jdhn,fl:d.jdfl,os:d.jdos,br:d.jdbr,bv:d.jdbv,wb:d.jdwb,xb:d.jdxb,yb:d.jdyb,zb:d.jdzb,cb:d.jdcb,usc:d.jdusc,ucp:d.jducp,umd:d.jdumd,uct:d.jduct,lt:d.jdlt,ct:c,tad:d.jdtad};this.ngaloader("www.100000",e),d.jduid%1e3===1&&this.ngloader("jsver.000000",{jsfile:"wl",jsver:"20141223"})},loading:function(a,b,c,d){this.sendOld(a,b,c,JA.util.join(d))},aloading:function(a,b,c){var d=Aa();this.loading(a,b,d,c)},aloadingJSON:function(a,b,c){var d=Aa();this.sendOld(a,b,d,$.toJSON(c))},adshow:function(a){var b=Ba(a);this.loading("AD","IM",b,"")},adclick:function(a){var b=Ba(a,1);this.loading("AD","CL",b,"")},isCanPrey:function(){var a=getCookie("__jda");if(a){var b=a.split(".");if(b.length>1){var c=b[1],d=b[1].length;return c=c.substr(d-1,d),"2"==c}}return!1},isDegrade:function(a,b){function c(a){var b=n.util.Vv("__jda")[0];if(b){var c=b.split(".");if(c.length>1){var d=c[1],e=c[1].length;return d=parseInt(d.substr(e-1,e)),d>=a}}}var d={"magic.000001":2,"other.000000":2},e=new Date(2017,5,16).getTime(),f=new Date(2017,5,20).getTime(),g=(new Date).getTime();if(g>=e&&g"); + var panelol=$("
    "); + var ctgnumArray = ctgnums.split(","); + $.each(ctgnumArray,function (i,ctg1Id) { + var ctg2list= ctgall[ctg1Id]; + $.each(ctg2list,function (i,ctg2) { + var cata2link=$(""+ctg2.name+" >"); + + + console.log(cata2link.html()); + var li=$("
  1. "); + var ctg3List=ctg2["catalog3List"]; + var len=0; + $.each(ctg3List,function (i,ctg3) { + var cata3link = $("" + ctg3.name + ""); + li.append(cata3link); + len=len+1+ctg3.name.length; + }); + if(len>=46&&len<92){ + li.attr("style","height: 60px;"); + }else if(len>=92){ + li.attr("style","height: 90px;"); + } + panelol.append(cata2link).append(li); + + }); + + }); + panel.append(panelol); + $(this).after(panel); + $(this).parent().addClass("header_li2"); + console.log($(".header_main_left").html()); + } + }); + }); +}); \ No newline at end of file diff --git a/msb-mall/mall-producet/src/main/resources/static/index/js/header.js b/msb-mall/mall-producet/src/main/resources/static/index/js/header.js new file mode 100644 index 000000000..c7a50b849 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/js/header.js @@ -0,0 +1,172 @@ +$(".header_banner1").hover(function() { + $(".header_banner1_div").stop(true).animate({ + width:"990px" + },500) +}, function() { + $(".header_banner1_div").stop(true).animate({ + width:"0" + },300) +}) +$(".head p").on("click", function() { + $(".head").fadeOut(500) +}) +$(".header_banner1_div p").on("click", function() { + $(".header_banner1_div").stop(true).animate({ + width:"0" + },200) +}) +$(".header_ol a").hover(function() { + $(this).css({ + color: "#c81623" + }) +}, function() { + $(this).css({ + color: "#999" + }) + $(".aaa").css({ + color: "#111" + }) +}) +//轮播图 +var swiper1 = new Swiper(".swiper1", { + loop: true, + autoplay: 2000, + effect: 'fade', + fade: { + crossFade: false, + }, + pagination: ".swiper-pagination", + paginationClickable: true, + prevButton: '.swiper-button-prev', + nextButton: '.swiper-button-next', + autoplayDisableOnInteraction: false, +}) + +//货品分类 +$('.header_main_left>ul>li').hover(function() { + $(this).css({ + background: "#989898" + }).find('.header_main_left_main').stop(true).fadeIn(300) +}, function() { + $(this).css({ + background: "#6e6568" + }).find(".header_main_left_a").css({ + color: "#fff" + }) + $(this).find('.header_main_left_main').stop(true).fadeOut(100) +}) +$(".header_sj a").hover(function() { + $(this).css({ + background: "#444" + }) +}, function() { + $(this).css({ + background: "#6e6568" + }) +}) +//购物车下拉 +$('.header_gw').hover(function() { + $(this).next('.header_ko').stop(true).fadeIn(100) +}, function() { + $(this).next('.header_ko').stop(true).fadeOut(100) +}) +//我的京东下拉 +$(".header_wdjd").hover(function() { + $(this).children(".header_wdjd_txt").stop(true).show(100) + $(this).css({ + background: "#fff" + }) +}, function() { + $(this).css({ + background: "#E3E4E5" + }) + $(this).children(".header_wdjd_txt").stop(true).hide(100) +}) +//地理位置下拉 +$(".header_head_p").hover(function() { + $(this).children(".header_head_p_cs").stop(true).show(100) + $(this).css({ + background: "#fff" + }) +}, function() { + $(this).css({ + background: "#E3E4E5" + }) + $(this).children(".header_head_p_cs").stop(true).hide(100) +}) +$(".header_head_p_cs a").hover(function(){ + $(this).css({background:"#f0f0f0"}) + $(".header_head_p_cs a:nth-child(1)").css({background:"#c81623"}) +},function(){ + $(this).css({background:"#fff"}) + $(".header_head_p_cs a:nth-child(1)").css({background:"#c81623"}) +}) +//客户服务下拉 +$(".header_wdjd1").hover(function() { + $(this).children(".header_wdjd_txt").stop(true).show(100) + $(this).css({ + background: "#fff" + }) +}, function() { + $(this).css({ + background: "#E3E4E5" + }) + $(this).children(".header_wdjd_txt").stop(true).hide(100) +}) +//网站导航下拉 +$(".header_wzdh").hover(function() { + $(this).children(".header_wzdh_txt").stop(true).show(100) + $(this).css({ + background: "#fff" + }) +}, function() { + $(this).css({ + background: "#E3E4E5" + }) + $(this).children(".header_wzdh_txt").stop(true).hide(100) +}) +//促销公告选项卡 +$(".header_new_t p").hover(function() { + var i = $(this).index() + $(".header_new_t p").removeClass("active").eq(i).addClass("active") + $(".header_new_connter_1").hide().eq(i).show() +}) +//话费机票 +$(".ser_box_aaa_nav li").hover(function() { + var i = $(this).index() + $(".ser_box_aaa_nav li").removeClass("active").eq(i).addClass("active") + $(".ser_ol_li").hide().eq(i).show() +}) +$(".guanbi").on("click", function() { + $(".ser_box_aaa .ser_box_aaa_one").stop(true).animate({ + top: "210px" + },600) +}) +$(".ser_box_item span").hover(function() { + $(".ser_box_aaa .ser_box_aaa_one").css("display", "block") + $(".ser_box_aaa .ser_box_aaa_one").stop(true).animate({ + top: "0" + },600) +}, function() { + +}) +//右侧侧边栏 +$(".header_bar_box ul li").hover(function() { + $(this).css({ + background: "#7A6E6E", + borderRadius: 0 + }).children(".div").css({ + display: "block" + }).stop(true).animate({ + left: "-60px" + }, 300) +}, function() { + $(this).css({ + background: "#7A6E6E", + borderRadius: 5 + }).children(".div").css({ + display: "none" + }).stop(true).animate({ + left: "0" + }, 300) +}) diff --git a/msb-mall/mall-producet/src/main/resources/static/index/js/index.js b/msb-mall/mall-producet/src/main/resources/static/index/js/index.js new file mode 100644 index 000000000..d3cdda242 --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/js/index.js @@ -0,0 +1,91 @@ + + var swiper = new Swiper(".banner", { + loop: true, + autoplay: 1000, + nextButton: ".swiper-button-next", + prevButton: ".swiper-button-prev", + pagination: '.swiper-pagination', + effect: 'fade', + fade: { + crossFade: false, + }, + }) + var swiper1 = new Swiper(".banner1", { + loop: true, + nextButton: ".swiper-button-next", + prevButton: ".swiper-button-prev", + }) + $(".section_ash_content .section_ash_con_bottom .banner1").mousemove(function() { + $(this).children(".swiper-button-next , .swiper-button-prev").css({"display": "block"}) + }).mouseleave(function() { + $(this).children(".swiper-button-next , .swiper-button-prev").css({"display": "none"}) + }) + $(".section_ash_content .section_ash_con_bottom .banner1 .swiper-button-next , .swiper-button-prev").mousemove(function() { + $(this).css({"color": "#EC0110"}) + }).mouseleave(function() { + $(this).css({"color": "gray"}) + }) + + + $(".section_xpz_content_left img").hover(function() { + $(this).stop(true).animate({ + "left": "-10px" + }, 400) + }, function() { + $(this).stop(true).animate({ + "left": "10px" + }, 400) + + }) + $(".xpz_right_bottom .right_bottom_left img").hover(function() { + $(this).stop(true).animate({ + "left": "-10px" + }, 400) + }, function() { + $(this).stop(true).animate({ + "left": 0 + }, 400) + + }) + $(".section_ash_con_top .con_top_left img").hover(function() { + $(this).stop(true).animate({ + "left": "-5px" + }, 400) + }, function() { + $(this).stop(true).animate({ + "left": "5px" + }, 400) + + }) + $(".con_top_right .right_con_img ").hover(function() { + $(this).stop(true).animate({ + "right": "5px" + }, 400) + }, function() { + $(this).stop(true).animate({ + "right": "-5px" + }, 400) + + }) + $(".xpz_right_bottom img").hover(function() { + $(this).stop(true).animate({ + "left": "-5px" + }, 400) + }, function() { + $(this).stop(true).animate({ + "left": "5px" + }, 400) + + }) + $(".section_ash_center_img img").hover(function() { + $(this).stop(true).animate({ + "left": "-5px" + }, 400) + }, function() { + $(this).stop(true).animate({ + "left": "5px" + }, 400) + + }) + + diff --git a/msb-mall/mall-producet/src/main/resources/static/index/js/jquery-3.1.1.min.js b/msb-mall/mall-producet/src/main/resources/static/index/js/jquery-3.1.1.min.js new file mode 100644 index 000000000..4c5be4c0f --- /dev/null +++ b/msb-mall/mall-producet/src/main/resources/static/index/js/jquery-3.1.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R), +a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)), +void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + + + + + + + +
    +
    + +
    + + + +
    +
    +
    +
      +
    • 享品质
    • +
    • 服饰美妆
    • +
    • 家电手机
    • +
    • 电脑数码
    • +
    • 3C运动
    • +
    • 爱吃
    • +
    • 母婴家居
    • +
    • 图书汽车
    • +
    • 游戏金融
    • +
    • 旅行健康
    • +
    • 还没逛够
    • +
    • 顶部
    • +
    +
    +
    + +

    X

    +
    + + + +
    +
    + + + + +
    +
    +
    + + 我的购物车 + 0 +
    +
    +

    购物车中还没有商品,赶紧选购吧!

    +
    +
    + + +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + +
    + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    +
    +
      +
    1. + 话费 +
    2. +
    3. + 机票 +
    4. +
    5. + 酒店 +
    6. +
    7. + 游戏 +
    8. +
    +
    +
    + + +
    +
    + +
    +
    + +
    +
    +
      +
      X
      + 点卡 + QQ + 页游 +
      + +
      面值 + ¥0.00 +

      + 直充 + 卡密 +

      +
      + + 吃鸡就要快人一步 +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +

    X

    +
    +
    +
    +
    + +
    + +
    +

    +
    +

    + 秒杀 + 总有你想不到的低价 + + +
    +
    +

    当前场次

    + 00 + + 00 + + 00 +

    后结束

    +
    +
    +
    +
    +
    +
    +
      +
    • + +

      花王 (Merries) 妙而舒 纸尿裤 大号 L54片 尿不湿(9-14千克) (日本官方直采) 花王 (Merries) 妙而舒 纸尿裤 大号 L54片 尿不湿(9-14千

      + ¥83.9¥99.9 +
    • +
    • + +

      华为mate9 4GB+32GB版 月光银 移动联通电信4G手机 双卡

      + ¥17.90¥29.90 +
    • +
    • + +

      超能 植翠低泡洗衣液(鲜艳亮丽)2kg/袋装(新老包装随机

      + ¥20.70¥44.90 +
    • +
    • + +

      长城(GreatWall)红酒 特选5年橡木桶解百纳干红葡萄酒 整

      + ¥399.00¥599.00 +
    • +
    • + +

      惠普(HP)暗影精灵2代Pro 15.6英寸游戏笔记本电脑(i5-7300H

      + ¥5999.00¥6499.00 +
    • +
    +
    +
    +
      +
    • + +

      Apple iMac 21.5英寸一体机(2017新款四核Core i5 处理器/8GB内存/1TB/RP555显卡/4K屏 MNDY2CH/A) Apple iMac 21.5英寸一体机(2017新款四核Core i5 处理

      + ¥9588.00¥10288.00 +
    • +
    • + +

      中柏(Jumper)EZpad 4S Pro 10.6英寸二合一平板电脑(X5 z

      + ¥848.00¥899.00 +
    • +
    • + +

      飞利浦(PHILIPS)电动牙刷HX6761/03亮白型成人充电式声波震动牙刷粉色 飞利浦(PHILIPS)电动牙刷HX6761/03亮白型成人充电式声波 +

      + ¥379.00¥698.00 +
    • +
    • + +

      美的(Midea) 258升 变频智能三门冰箱 一级能效 风冷无霜 中门

      + ¥3088.00¥3299.00 +
    • +
    • + +

      【第二件减50元】蒙羊 内蒙古羔羊羊肋排 2.4斤

      + ¥99.90¥199.00 +
    • +
    +
    +
    +
    +

    +
    +
    +

    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
      +

      +

      +
      +
    +
    + + +
    + + + + + + + + + + + + + diff --git a/msb-mall/mall-producet/src/test/java/com/msb/mall/product/MallProducetApplicationTests.java b/msb-mall/mall-producet/src/test/java/com/msb/mall/product/MallProducetApplicationTests.java new file mode 100644 index 000000000..ec29f6b83 --- /dev/null +++ b/msb-mall/mall-producet/src/test/java/com/msb/mall/product/MallProducetApplicationTests.java @@ -0,0 +1,42 @@ +package com.msb.mall.product; + +import com.msb.mall.product.entity.BrandEntity; +import com.msb.mall.product.service.BrandService; +import org.junit.jupiter.api.Test; +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; + +@SpringBootTest +class MallProducetApplicationTests { + + @Autowired + BrandService brandService; + + @Autowired(required=false) + StringRedisTemplate stringRedisTemplate; + + @Autowired + RedissonClient redissonClient; + @Test + void contextLoads() { + BrandEntity brandEntity = new BrandEntity(); + brandEntity.setName("xiaomi2大米"); + brandService.save(brandEntity); + } + + @Test + void testRedis(){ + ValueOperations stringStringValueOperations = stringRedisTemplate.opsForValue(); + stringStringValueOperations.set("name","name:boba"); + System.out.println("刚刚保存的值:"+stringStringValueOperations.get("name")); + } + + @Test + void testRedissonClient(){ + System.out.println(redissonClient); + } +} diff --git a/msb-mall/mall-search/.gitignore b/msb-mall/mall-search/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-search/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-search/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-search/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-search/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-search/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-search/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-search/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-search/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-search/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-search/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-search/README.md b/msb-mall/mall-search/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-search/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-search/mvnw b/msb-mall/mall-search/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-search/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-search/mvnw.cmd b/msb-mall/mall-search/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-search/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-search/pom.xml b/msb-mall/mall-search/pom.xml new file mode 100644 index 000000000..f3abc808e --- /dev/null +++ b/msb-mall/mall-search/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + com.msb.mall + mall-search + 0.0.1-SNAPSHOT + mall-search + mall-search + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + 7.4.2 + Hoxton.SR9 + + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + org.elasticsearch + elasticsearch + 7.4.2 + + + org.elasticsearch.client + elasticsearch-rest-high-level-client + 7.4.2 + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.mallsearch.MallSearchApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-search/src/main/java/com/msb/mall/mallsearch/MallSearchApplication.java b/msb-mall/mall-search/src/main/java/com/msb/mall/mallsearch/MallSearchApplication.java new file mode 100644 index 000000000..cddf690a7 --- /dev/null +++ b/msb-mall/mall-search/src/main/java/com/msb/mall/mallsearch/MallSearchApplication.java @@ -0,0 +1,16 @@ +package com.msb.mall.mallsearch; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) +public class MallSearchApplication { + + public static void main(String[] args) { + SpringApplication.run(MallSearchApplication.class, args); + } + +} diff --git a/msb-mall/mall-search/src/main/java/com/msb/mall/mallsearch/config/MallElasticSearchConfiguration.java b/msb-mall/mall-search/src/main/java/com/msb/mall/mallsearch/config/MallElasticSearchConfiguration.java new file mode 100644 index 000000000..0879e1b95 --- /dev/null +++ b/msb-mall/mall-search/src/main/java/com/msb/mall/mallsearch/config/MallElasticSearchConfiguration.java @@ -0,0 +1,26 @@ +package com.msb.mall.mallsearch.config; + +import org.apache.http.HttpHost; +import org.elasticsearch.client.*; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MallElasticSearchConfiguration { + public static final RequestOptions COMMON_OPTIONS; + static { + RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder(); +// builder.addHeader("Authorization", "Bearer " + TOKEN); +// builder.setHttpAsyncResponseConsumerFactory( +// new HttpAsyncResponseConsumerFactory +// .HeapBufferedResponseConsumerFactory(30 * 1024 * 1024 * 1024)); + COMMON_OPTIONS = builder.build(); + } + @Bean + public RestHighLevelClient restHighLevelClient(){ + RestClientBuilder builder = RestClient.builder(new HttpHost("192.168.37.133", 9200, "http")); + RestHighLevelClient client=new RestHighLevelClient(builder); + return client; + } +} diff --git a/msb-mall/mall-search/src/main/resources/application.yml b/msb-mall/mall-search/src/main/resources/application.yml new file mode 100644 index 000000000..89bba66ef --- /dev/null +++ b/msb-mall/mall-search/src/main/resources/application.yml @@ -0,0 +1,9 @@ +spring: + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + application: + name: mall-search +server: + port: 8090 \ No newline at end of file diff --git a/msb-mall/mall-search/src/main/resources/bootstrap.properties b/msb-mall/mall-search/src/main/resources/bootstrap.properties new file mode 100644 index 000000000..0470c288b --- /dev/null +++ b/msb-mall/mall-search/src/main/resources/bootstrap.properties @@ -0,0 +1,3 @@ +spring.application.name=mall-search +spring.cloud.nacos.config.server-addr=192.168.37.133:8848 +#spring.cloud.nacos.config.namespace=0fc6fc2c-0063-4e44-a879-f46fc9f7fb5f diff --git a/msb-mall/mall-search/src/test/java/com/msb/mall/mallsearch/MallSearchApplicationTests.java b/msb-mall/mall-search/src/test/java/com/msb/mall/mallsearch/MallSearchApplicationTests.java new file mode 100644 index 000000000..e1ebf8b7c --- /dev/null +++ b/msb-mall/mall-search/src/test/java/com/msb/mall/mallsearch/MallSearchApplicationTests.java @@ -0,0 +1,114 @@ +package com.msb.mall.mallsearch; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.msb.mall.mallsearch.config.MallElasticSearchConfiguration; +import lombok.Data; +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.action.index.IndexResponse; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.RestHighLevelClient; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.search.aggregations.AggregationBuilder; +import org.elasticsearch.search.aggregations.AggregationBuilders; +import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.io.IOException; + +@SpringBootTest +class MallSearchApplicationTests { + + @Autowired + private RestHighLevelClient restHighLevelClient; + @Test + void contextLoads() { + System.out.println("======>restHighLevelClient:"+restHighLevelClient); + } + + @Test + void saveElIndex(){ + IndexRequest request = new IndexRequest("system"); + request.id("1"); + String jsonString = "{" + + "\"user\":\"kimchy\"," + + "\"postDate\":\"2013-01-30\"," + + "\"message\":\"trying out Elasticsearch\"" + + "}"; +// request.source(jsonString, XContentType.JSON); + User user = new User(); + user.setAge(12); + user.setName("dalong"); + user.setGender("男"); + ObjectMapper objectMapper = new ObjectMapper(); + try { + String s = objectMapper.writeValueAsString(user); + System.out.println("====>s:"+s); + request.source(s,XContentType.JSON); + IndexResponse index = restHighLevelClient.index(request, MallElasticSearchConfiguration.COMMON_OPTIONS); + System.out.println("======>index:"+index); + } catch (Exception e) { + e.printStackTrace(); + } + } + @Test + void searchAll(){ + SearchRequest searchRequest = new SearchRequest(); + searchRequest.indices("bank"); + SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); + searchRequest.source(searchSourceBuilder); + + try { + SearchResponse search = restHighLevelClient.search(searchRequest, MallElasticSearchConfiguration.COMMON_OPTIONS); + System.out.println("======>search:"+search); + } catch (IOException e) { + e.printStackTrace(); + } + } + @Test + void searchIndexByAddress(){ + SearchRequest searchRequest = new SearchRequest(); + searchRequest.indices("bank"); + SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); + searchSourceBuilder.query(QueryBuilders.matchQuery("address","Mill Road")); + searchRequest.source(searchSourceBuilder); + + try { + SearchResponse search = restHighLevelClient.search(searchRequest, MallElasticSearchConfiguration.COMMON_OPTIONS); + System.out.println("======>search:"+search); + } catch (IOException e) { + e.printStackTrace(); + } + } + @Test + void searchIndexAggregation(){ + SearchRequest searchRequest = new SearchRequest(); + searchRequest.indices("bank"); + SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); + searchSourceBuilder.query(QueryBuilders.matchAllQuery()); + AggregationBuilder builder= AggregationBuilders.terms("ageAgg") .field("age").size(10); + builder.subAggregation(AggregationBuilders.avg("balanceAvg").field("balance")); + searchSourceBuilder.aggregation(builder); + searchSourceBuilder.size(0); + searchRequest.source(searchSourceBuilder); + System.out.println("====>searchSourceBuilder:"+searchSourceBuilder); + + try { + SearchResponse search = restHighLevelClient.search(searchRequest, MallElasticSearchConfiguration.COMMON_OPTIONS); + System.out.println("======>search:"+search); + } catch (IOException e) { + e.printStackTrace(); + } + } + @Data + class User{ + private int age; + private String name; + private String gender; + } +} diff --git a/msb-mall/mall-third-party/.gitignore b/msb-mall/mall-third-party/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-third-party/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-third-party/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-third-party/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-third-party/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-third-party/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-third-party/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-third-party/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-third-party/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-third-party/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-third-party/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-third-party/README.md b/msb-mall/mall-third-party/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-third-party/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-third-party/mvnw b/msb-mall/mall-third-party/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-third-party/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-third-party/mvnw.cmd b/msb-mall/mall-third-party/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-third-party/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-third-party/pom.xml b/msb-mall/mall-third-party/pom.xml new file mode 100644 index 000000000..6db0a4605 --- /dev/null +++ b/msb-mall/mall-third-party/pom.xml @@ -0,0 +1,107 @@ + + + 4.0.0 + com.msb.mall + mall-third-party + 0.0.1-SNAPSHOT + mall-third-party + mall-third-party + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + com.baomidou + mybatis-plus-boot-starter + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mallthirdparty.MallThirdPartyApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-third-party/src/main/java/com/msb/mallthirdparty/MallThirdPartyApplication.java b/msb-mall/mall-third-party/src/main/java/com/msb/mallthirdparty/MallThirdPartyApplication.java new file mode 100644 index 000000000..4a25f5684 --- /dev/null +++ b/msb-mall/mall-third-party/src/main/java/com/msb/mallthirdparty/MallThirdPartyApplication.java @@ -0,0 +1,15 @@ +package com.msb.mallthirdparty; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +public class MallThirdPartyApplication { + + public static void main(String[] args) { + SpringApplication.run(MallThirdPartyApplication.class, args); + } + +} diff --git a/msb-mall/mall-third-party/src/main/resources/application.yml b/msb-mall/mall-third-party/src/main/resources/application.yml new file mode 100644 index 000000000..5cefe5d47 --- /dev/null +++ b/msb-mall/mall-third-party/src/main/resources/application.yml @@ -0,0 +1,9 @@ +spring: + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + application: + name: mall-third +server: + port: 8090 diff --git a/msb-mall/mall-third-party/src/main/resources/bootstrap.properties b/msb-mall/mall-third-party/src/main/resources/bootstrap.properties new file mode 100644 index 000000000..d15b8c643 --- /dev/null +++ b/msb-mall/mall-third-party/src/main/resources/bootstrap.properties @@ -0,0 +1,2 @@ +spring.application.name=mall-third +spring.cloud.nacos.config.server-addr=192.168.37.133:8848 diff --git a/msb-mall/mall-third-party/src/test/java/com/msb/mallthirdparty/MallThirdPartyApplicationTests.java b/msb-mall/mall-third-party/src/test/java/com/msb/mallthirdparty/MallThirdPartyApplicationTests.java new file mode 100644 index 000000000..a77eab0ac --- /dev/null +++ b/msb-mall/mall-third-party/src/test/java/com/msb/mallthirdparty/MallThirdPartyApplicationTests.java @@ -0,0 +1,13 @@ +package com.msb.mallthirdparty; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MallThirdPartyApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/msb-mall/mall-ware/.gitignore b/msb-mall/mall-ware/.gitignore new file mode 100644 index 000000000..a2a3040aa --- /dev/null +++ b/msb-mall/mall-ware/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/msb-mall/mall-ware/.mvn/wrapper/MavenWrapperDownloader.java b/msb-mall/mall-ware/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..a45eb6ba2 --- /dev/null +++ b/msb-mall/mall-ware/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/msb-mall/mall-ware/.mvn/wrapper/maven-wrapper.jar b/msb-mall/mall-ware/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..2cc7d4a55 Binary files /dev/null and b/msb-mall/mall-ware/.mvn/wrapper/maven-wrapper.jar differ diff --git a/msb-mall/mall-ware/.mvn/wrapper/maven-wrapper.properties b/msb-mall/mall-ware/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..642d572ce --- /dev/null +++ b/msb-mall/mall-ware/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/msb-mall/mall-ware/README.md b/msb-mall/mall-ware/README.md new file mode 100644 index 000000000..c0d9ab2f3 --- /dev/null +++ b/msb-mall/mall-ware/README.md @@ -0,0 +1,4 @@ +# 工程简介 + +# 延伸阅读 + diff --git a/msb-mall/mall-ware/mvnw b/msb-mall/mall-ware/mvnw new file mode 100644 index 000000000..a16b5431b --- /dev/null +++ b/msb-mall/mall-ware/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/msb-mall/mall-ware/mvnw.cmd b/msb-mall/mall-ware/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/msb-mall/mall-ware/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/msb-mall/mall-ware/pom.xml b/msb-mall/mall-ware/pom.xml new file mode 100644 index 000000000..ff3766056 --- /dev/null +++ b/msb-mall/mall-ware/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + com.msb.mall + mall-ware + 0.0.1-SNAPSHOT + mall-ware + mall-ware + + + 1.8 + UTF-8 + UTF-8 + 2.3.7.RELEASE + Hoxton.SR9 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.3.7.RELEASE + + com.msb.mall.ware.MallWareApplication + + + + repackage + + repackage + + + + + + + + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/MallWareApplication.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/MallWareApplication.java new file mode 100644 index 000000000..52b688abe --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/MallWareApplication.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +@MapperScan("com.msb.mall.ware.dao") +public class MallWareApplication { + + public static void main(String[] args) { + SpringApplication.run(MallWareApplication.class, args); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/PurchaseController.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/PurchaseController.java new file mode 100644 index 000000000..e1d46b829 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/PurchaseController.java @@ -0,0 +1,84 @@ +package com.msb.mall.ware.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.ware.entity.PurchaseEntity; +import com.msb.mall.ware.service.PurchaseService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 采购信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@RestController +@RequestMapping("ware/purchase") +public class PurchaseController { + @Autowired + private PurchaseService purchaseService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = purchaseService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + PurchaseEntity purchase = purchaseService.getById(id); + + return R.ok().put("purchase", purchase); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody PurchaseEntity purchase){ + purchaseService.save(purchase); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody PurchaseEntity purchase){ + purchaseService.updateById(purchase); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + purchaseService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/PurchaseDetailController.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/PurchaseDetailController.java new file mode 100644 index 000000000..7568013a4 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/PurchaseDetailController.java @@ -0,0 +1,84 @@ +package com.msb.mall.ware.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.ware.entity.PurchaseDetailEntity; +import com.msb.mall.ware.service.PurchaseDetailService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@RestController +@RequestMapping("ware/purchasedetail") +public class PurchaseDetailController { + @Autowired + private PurchaseDetailService purchaseDetailService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = purchaseDetailService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + PurchaseDetailEntity purchaseDetail = purchaseDetailService.getById(id); + + return R.ok().put("purchaseDetail", purchaseDetail); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody PurchaseDetailEntity purchaseDetail){ + purchaseDetailService.save(purchaseDetail); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody PurchaseDetailEntity purchaseDetail){ + purchaseDetailService.updateById(purchaseDetail); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + purchaseDetailService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareInfoController.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareInfoController.java new file mode 100644 index 000000000..a5cd22fcc --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareInfoController.java @@ -0,0 +1,84 @@ +package com.msb.mall.ware.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.ware.entity.WareInfoEntity; +import com.msb.mall.ware.service.WareInfoService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 仓库信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@RestController +@RequestMapping("ware/wareinfo") +public class WareInfoController { + @Autowired + private WareInfoService wareInfoService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = wareInfoService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + WareInfoEntity wareInfo = wareInfoService.getById(id); + + return R.ok().put("wareInfo", wareInfo); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody WareInfoEntity wareInfo){ + wareInfoService.save(wareInfo); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody WareInfoEntity wareInfo){ + wareInfoService.updateById(wareInfo); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + wareInfoService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareOrderTaskController.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareOrderTaskController.java new file mode 100644 index 000000000..edba4b2d3 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareOrderTaskController.java @@ -0,0 +1,84 @@ +package com.msb.mall.ware.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.ware.entity.WareOrderTaskEntity; +import com.msb.mall.ware.service.WareOrderTaskService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@RestController +@RequestMapping("ware/wareordertask") +public class WareOrderTaskController { + @Autowired + private WareOrderTaskService wareOrderTaskService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = wareOrderTaskService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + WareOrderTaskEntity wareOrderTask = wareOrderTaskService.getById(id); + + return R.ok().put("wareOrderTask", wareOrderTask); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody WareOrderTaskEntity wareOrderTask){ + wareOrderTaskService.save(wareOrderTask); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody WareOrderTaskEntity wareOrderTask){ + wareOrderTaskService.updateById(wareOrderTask); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + wareOrderTaskService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareOrderTaskDetailController.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareOrderTaskDetailController.java new file mode 100644 index 000000000..e82650b3e --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareOrderTaskDetailController.java @@ -0,0 +1,84 @@ +package com.msb.mall.ware.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.ware.entity.WareOrderTaskDetailEntity; +import com.msb.mall.ware.service.WareOrderTaskDetailService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@RestController +@RequestMapping("ware/wareordertaskdetail") +public class WareOrderTaskDetailController { + @Autowired + private WareOrderTaskDetailService wareOrderTaskDetailService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = wareOrderTaskDetailService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + WareOrderTaskDetailEntity wareOrderTaskDetail = wareOrderTaskDetailService.getById(id); + + return R.ok().put("wareOrderTaskDetail", wareOrderTaskDetail); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody WareOrderTaskDetailEntity wareOrderTaskDetail){ + wareOrderTaskDetailService.save(wareOrderTaskDetail); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody WareOrderTaskDetailEntity wareOrderTaskDetail){ + wareOrderTaskDetailService.updateById(wareOrderTaskDetail); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + wareOrderTaskDetailService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareSkuController.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareSkuController.java new file mode 100644 index 000000000..e0f41b50a --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/controller/WareSkuController.java @@ -0,0 +1,84 @@ +package com.msb.mall.ware.controller; + +import java.util.Arrays; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.msb.mall.ware.entity.WareSkuEntity; +import com.msb.mall.ware.service.WareSkuService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.R; + + + +/** + * 商品库存 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@RestController +@RequestMapping("ware/waresku") +public class WareSkuController { + @Autowired + private WareSkuService wareSkuService; + + /** + * 列表 + */ + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils page = wareSkuService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{id}") + public R info(@PathVariable("id") Long id){ + WareSkuEntity wareSku = wareSkuService.getById(id); + + return R.ok().put("wareSku", wareSku); + } + + /** + * 保存 + */ + @RequestMapping("/save") + public R save(@RequestBody WareSkuEntity wareSku){ + wareSkuService.save(wareSku); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") + public R update(@RequestBody WareSkuEntity wareSku){ + wareSkuService.updateById(wareSku); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") + public R delete(@RequestBody Long[] ids){ + wareSkuService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/PurchaseDao.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/PurchaseDao.java new file mode 100644 index 000000000..fdc8341db --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/PurchaseDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware.dao; + +import com.msb.mall.ware.entity.PurchaseEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 采购信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@Mapper +public interface PurchaseDao extends BaseMapper { + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/PurchaseDetailDao.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/PurchaseDetailDao.java new file mode 100644 index 000000000..13bb48e4f --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/PurchaseDetailDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware.dao; + +import com.msb.mall.ware.entity.PurchaseDetailEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@Mapper +public interface PurchaseDetailDao extends BaseMapper { + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareInfoDao.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareInfoDao.java new file mode 100644 index 000000000..e7ffdaae6 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareInfoDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware.dao; + +import com.msb.mall.ware.entity.WareInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 仓库信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@Mapper +public interface WareInfoDao extends BaseMapper { + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareOrderTaskDao.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareOrderTaskDao.java new file mode 100644 index 000000000..9ccc8cc7b --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareOrderTaskDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware.dao; + +import com.msb.mall.ware.entity.WareOrderTaskEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@Mapper +public interface WareOrderTaskDao extends BaseMapper { + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareOrderTaskDetailDao.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareOrderTaskDetailDao.java new file mode 100644 index 000000000..34e7be609 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareOrderTaskDetailDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware.dao; + +import com.msb.mall.ware.entity.WareOrderTaskDetailEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@Mapper +public interface WareOrderTaskDetailDao extends BaseMapper { + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareSkuDao.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareSkuDao.java new file mode 100644 index 000000000..f78edba4d --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/dao/WareSkuDao.java @@ -0,0 +1,17 @@ +package com.msb.mall.ware.dao; + +import com.msb.mall.ware.entity.WareSkuEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 商品库存 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@Mapper +public interface WareSkuDao extends BaseMapper { + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/PurchaseDetailEntity.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/PurchaseDetailEntity.java new file mode 100644 index 000000000..89bfc762b --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/PurchaseDetailEntity.java @@ -0,0 +1,53 @@ +package com.msb.mall.ware.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@Data +@TableName("wms_purchase_detail") +public class PurchaseDetailEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId + private Long id; + /** + * 采购单id + */ + private Long purchaseId; + /** + * 采购商品id + */ + private Long skuId; + /** + * 采购数量 + */ + private Integer skuNum; + /** + * 采购金额 + */ + private BigDecimal skuPrice; + /** + * 仓库id + */ + private Long wareId; + /** + * 状态[0新建,1已分配,2正在采购,3已完成,4采购失败] + */ + private Integer status; + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/PurchaseEntity.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/PurchaseEntity.java new file mode 100644 index 000000000..b646a5227 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/PurchaseEntity.java @@ -0,0 +1,65 @@ +package com.msb.mall.ware.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 采购信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@Data +@TableName("wms_purchase") +public class PurchaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 采购单id + */ + @TableId + private Long id; + /** + * 采购人id + */ + private Long assigneeId; + /** + * 采购人名 + */ + private String assigneeName; + /** + * 联系方式 + */ + private String phone; + /** + * 优先级 + */ + private Integer priority; + /** + * 状态 + */ + private Integer status; + /** + * 仓库id + */ + private Long wareId; + /** + * 总金额 + */ + private BigDecimal amount; + /** + * 创建日期 + */ + private Date createTime; + /** + * 更新日期 + */ + private Date updateTime; + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareInfoEntity.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareInfoEntity.java new file mode 100644 index 000000000..27de2785d --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareInfoEntity.java @@ -0,0 +1,40 @@ +package com.msb.mall.ware.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 仓库信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +@Data +@TableName("wms_ware_info") +public class WareInfoEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 仓库名 + */ + private String name; + /** + * 仓库地址 + */ + private String address; + /** + * 区域编码 + */ + private String areacode; + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareOrderTaskDetailEntity.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareOrderTaskDetailEntity.java new file mode 100644 index 000000000..de56cacf8 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareOrderTaskDetailEntity.java @@ -0,0 +1,44 @@ +package com.msb.mall.ware.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@Data +@TableName("wms_ware_order_task_detail") +public class WareOrderTaskDetailEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * sku_id + */ + private Long skuId; + /** + * sku_name + */ + private String skuName; + /** + * 购买个数 + */ + private Integer skuNum; + /** + * 工作单id + */ + private Long taskId; + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareOrderTaskEntity.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareOrderTaskEntity.java new file mode 100644 index 000000000..e0a1e9bee --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareOrderTaskEntity.java @@ -0,0 +1,80 @@ +package com.msb.mall.ware.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@Data +@TableName("wms_ware_order_task") +public class WareOrderTaskEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * order_id + */ + private Long orderId; + /** + * order_sn + */ + private String orderSn; + /** + * 收货人 + */ + private String consignee; + /** + * 收货人电话 + */ + private String consigneeTel; + /** + * 配送地址 + */ + private String deliveryAddress; + /** + * 订单备注 + */ + private String orderComment; + /** + * 付款方式【 1:在线付款 2:货到付款】 + */ + private Integer paymentWay; + /** + * 任务状态 + */ + private Integer taskStatus; + /** + * 订单描述 + */ + private String orderBody; + /** + * 物流单号 + */ + private String trackingNo; + /** + * create_time + */ + private Date createTime; + /** + * 仓库id + */ + private Long wareId; + /** + * 工作单备注 + */ + private String taskComment; + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareSkuEntity.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareSkuEntity.java new file mode 100644 index 000000000..a0635d40a --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/entity/WareSkuEntity.java @@ -0,0 +1,48 @@ +package com.msb.mall.ware.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 商品库存 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +@Data +@TableName("wms_ware_sku") +public class WareSkuEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * sku_id + */ + private Long skuId; + /** + * 仓库id + */ + private Long wareId; + /** + * 库存数 + */ + private Integer stock; + /** + * sku_name + */ + private String skuName; + /** + * 锁定库存 + */ + private Integer stockLocked; + +} diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/PurchaseDetailService.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/PurchaseDetailService.java new file mode 100644 index 000000000..2800f59f6 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/PurchaseDetailService.java @@ -0,0 +1,20 @@ +package com.msb.mall.ware.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.ware.entity.PurchaseDetailEntity; + +import java.util.Map; + +/** + * + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +public interface PurchaseDetailService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/PurchaseService.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/PurchaseService.java new file mode 100644 index 000000000..f862521b3 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/PurchaseService.java @@ -0,0 +1,20 @@ +package com.msb.mall.ware.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.ware.entity.PurchaseEntity; + +import java.util.Map; + +/** + * 采购信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +public interface PurchaseService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareInfoService.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareInfoService.java new file mode 100644 index 000000000..e3c5056ea --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareInfoService.java @@ -0,0 +1,20 @@ +package com.msb.mall.ware.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.ware.entity.WareInfoEntity; + +import java.util.Map; + +/** + * 仓库信息 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:03 + */ +public interface WareInfoService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareOrderTaskDetailService.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareOrderTaskDetailService.java new file mode 100644 index 000000000..ef53ca59b --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareOrderTaskDetailService.java @@ -0,0 +1,20 @@ +package com.msb.mall.ware.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.ware.entity.WareOrderTaskDetailEntity; + +import java.util.Map; + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +public interface WareOrderTaskDetailService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareOrderTaskService.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareOrderTaskService.java new file mode 100644 index 000000000..32f5490b1 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareOrderTaskService.java @@ -0,0 +1,20 @@ +package com.msb.mall.ware.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.ware.entity.WareOrderTaskEntity; + +import java.util.Map; + +/** + * 库存工作单 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +public interface WareOrderTaskService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareSkuService.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareSkuService.java new file mode 100644 index 000000000..633443837 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/WareSkuService.java @@ -0,0 +1,20 @@ +package com.msb.mall.ware.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.ware.entity.WareSkuEntity; + +import java.util.Map; + +/** + * 商品库存 + * + * @author dalong + * @email 573607090@qq.com + * @date 2022-09-10 00:43:04 + */ +public interface WareSkuService extends IService { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/PurchaseDetailServiceImpl.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/PurchaseDetailServiceImpl.java new file mode 100644 index 000000000..1f98cad2f --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/PurchaseDetailServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.ware.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.ware.dao.PurchaseDetailDao; +import com.msb.mall.ware.entity.PurchaseDetailEntity; +import com.msb.mall.ware.service.PurchaseDetailService; + + +@Service("purchaseDetailService") +public class PurchaseDetailServiceImpl extends ServiceImpl implements PurchaseDetailService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/PurchaseServiceImpl.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/PurchaseServiceImpl.java new file mode 100644 index 000000000..1b201d273 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/PurchaseServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.ware.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.ware.dao.PurchaseDao; +import com.msb.mall.ware.entity.PurchaseEntity; +import com.msb.mall.ware.service.PurchaseService; + + +@Service("purchaseService") +public class PurchaseServiceImpl extends ServiceImpl implements PurchaseService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareInfoServiceImpl.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareInfoServiceImpl.java new file mode 100644 index 000000000..c3b3ddb8a --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareInfoServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.ware.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.ware.dao.WareInfoDao; +import com.msb.mall.ware.entity.WareInfoEntity; +import com.msb.mall.ware.service.WareInfoService; + + +@Service("wareInfoService") +public class WareInfoServiceImpl extends ServiceImpl implements WareInfoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareOrderTaskDetailServiceImpl.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareOrderTaskDetailServiceImpl.java new file mode 100644 index 000000000..fa4897a6a --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareOrderTaskDetailServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.ware.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.ware.dao.WareOrderTaskDetailDao; +import com.msb.mall.ware.entity.WareOrderTaskDetailEntity; +import com.msb.mall.ware.service.WareOrderTaskDetailService; + + +@Service("wareOrderTaskDetailService") +public class WareOrderTaskDetailServiceImpl extends ServiceImpl implements WareOrderTaskDetailService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareOrderTaskServiceImpl.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareOrderTaskServiceImpl.java new file mode 100644 index 000000000..86768675b --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareOrderTaskServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.ware.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.ware.dao.WareOrderTaskDao; +import com.msb.mall.ware.entity.WareOrderTaskEntity; +import com.msb.mall.ware.service.WareOrderTaskService; + + +@Service("wareOrderTaskService") +public class WareOrderTaskServiceImpl extends ServiceImpl implements WareOrderTaskService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareSkuServiceImpl.java b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareSkuServiceImpl.java new file mode 100644 index 000000000..4446f1e94 --- /dev/null +++ b/msb-mall/mall-ware/src/main/java/com/msb/mall/ware/service/impl/WareSkuServiceImpl.java @@ -0,0 +1,29 @@ +package com.msb.mall.ware.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msb.mall.commons.util.PageUtils; +import com.msb.mall.commons.util.Query; + +import com.msb.mall.ware.dao.WareSkuDao; +import com.msb.mall.ware.entity.WareSkuEntity; +import com.msb.mall.ware.service.WareSkuService; + + +@Service("wareSkuService") +public class WareSkuServiceImpl extends ServiceImpl implements WareSkuService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/application.yml b/msb-mall/mall-ware/src/main/resources/application.yml new file mode 100644 index 000000000..f8fa16310 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/application.yml @@ -0,0 +1,19 @@ +spring: + datasource: + username: root + password: root + url: jdbc:mysql://192.168.37.133:3306/msb-wms?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai + driver-class-name: com.mysql.cj.jdbc.Driver + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + application: + name: mall-ware +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + global-config: + db-config: + id-type: auto #主键自增 +server: + port: 8050 \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/mapper/ware/PurchaseDao.xml b/msb-mall/mall-ware/src/main/resources/mapper/ware/PurchaseDao.xml new file mode 100644 index 000000000..deba19cad --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/mapper/ware/PurchaseDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/mapper/ware/PurchaseDetailDao.xml b/msb-mall/mall-ware/src/main/resources/mapper/ware/PurchaseDetailDao.xml new file mode 100644 index 000000000..4a16e48cf --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/mapper/ware/PurchaseDetailDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/mapper/ware/WareInfoDao.xml b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareInfoDao.xml new file mode 100644 index 000000000..b4216b749 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareInfoDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/mapper/ware/WareOrderTaskDao.xml b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareOrderTaskDao.xml new file mode 100644 index 000000000..f3dd8e87c --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareOrderTaskDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/mapper/ware/WareOrderTaskDetailDao.xml b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareOrderTaskDetailDao.xml new file mode 100644 index 000000000..48558edde --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareOrderTaskDetailDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/mapper/ware/WareSkuDao.xml b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareSkuDao.xml new file mode 100644 index 000000000..b6e5eeefa --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/mapper/ware/WareSkuDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchase-add-or-update.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchase-add-or-update.vue new file mode 100644 index 000000000..fe8b54692 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchase-add-or-update.vue @@ -0,0 +1,156 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchase.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchase.vue new file mode 100644 index 000000000..3132e3b4f --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchase.vue @@ -0,0 +1,211 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchasedetail-add-or-update.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchasedetail-add-or-update.vue new file mode 100644 index 000000000..fd9555964 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchasedetail-add-or-update.vue @@ -0,0 +1,129 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchasedetail.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchasedetail.vue new file mode 100644 index 000000000..dd3c6db13 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/purchasedetail.vue @@ -0,0 +1,193 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareinfo-add-or-update.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareinfo-add-or-update.vue new file mode 100644 index 000000000..d3bcd324e --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareinfo-add-or-update.vue @@ -0,0 +1,102 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareinfo.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareinfo.vue new file mode 100644 index 000000000..a4688341e --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareinfo.vue @@ -0,0 +1,175 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertask-add-or-update.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertask-add-or-update.vue new file mode 100644 index 000000000..6baca95c1 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertask-add-or-update.vue @@ -0,0 +1,192 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertask.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertask.vue new file mode 100644 index 000000000..ac648d544 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertask.vue @@ -0,0 +1,235 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertaskdetail-add-or-update.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertaskdetail-add-or-update.vue new file mode 100644 index 000000000..90c7a6e12 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertaskdetail-add-or-update.vue @@ -0,0 +1,111 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertaskdetail.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertaskdetail.vue new file mode 100644 index 000000000..ea38ebc49 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/wareordertaskdetail.vue @@ -0,0 +1,181 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/waresku-add-or-update.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/waresku-add-or-update.vue new file mode 100644 index 000000000..06f97fe37 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/waresku-add-or-update.vue @@ -0,0 +1,120 @@ + + + diff --git a/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/waresku.vue b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/waresku.vue new file mode 100644 index 000000000..bbf173532 --- /dev/null +++ b/msb-mall/mall-ware/src/main/resources/src/views/modules/ware/waresku.vue @@ -0,0 +1,187 @@ + + + diff --git a/msb-mall/mall-ware/src/test/java/com/msb/mall/ware/MallWareApplicationTests.java b/msb-mall/mall-ware/src/test/java/com/msb/mall/ware/MallWareApplicationTests.java new file mode 100644 index 000000000..7e53734b1 --- /dev/null +++ b/msb-mall/mall-ware/src/test/java/com/msb/mall/ware/MallWareApplicationTests.java @@ -0,0 +1,13 @@ +package com.msb.mall.ware; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MallWareApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/msb-mall/renren-fast-master/.gitignore b/msb-mall/renren-fast-master/.gitignore new file mode 100644 index 000000000..dd851b65d --- /dev/null +++ b/msb-mall/renren-fast-master/.gitignore @@ -0,0 +1,25 @@ +# Compiled class file +*.class +target + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar +*.iml +.idea + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/msb-mall/renren-fast-master/Dockerfile b/msb-mall/renren-fast-master/Dockerfile new file mode 100644 index 000000000..2f0c4777e --- /dev/null +++ b/msb-mall/renren-fast-master/Dockerfile @@ -0,0 +1,7 @@ +FROM java:8 +EXPOSE 8080 + +VOLUME /tmp +ADD renren-fast.jar /app.jar +RUN bash -c 'touch /app.jar' +ENTRYPOINT ["java","-jar","/app.jar"] diff --git a/msb-mall/renren-fast-master/LICENSE b/msb-mall/renren-fast-master/LICENSE new file mode 100644 index 000000000..0148abab8 --- /dev/null +++ b/msb-mall/renren-fast-master/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "{}" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright 2019 人人开源 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/msb-mall/renren-fast-master/README.md b/msb-mall/renren-fast-master/README.md new file mode 100644 index 000000000..19e603b3f --- /dev/null +++ b/msb-mall/renren-fast-master/README.md @@ -0,0 +1,119 @@ +#### 为了项目的长远发展,renren-fast已整合到 【[renren-security](https://gitee.com/renrenio/renren-security)】里面,以后会在renren-security里面进行更新维护,感谢支持! :smiley: +
    + +**项目说明** +- renren-fast是一个轻量级的,前后端分离的Java快速开发平台,能快速开发项目并交付【接私活利器】 +- 支持MySQL、Oracle、SQL Server、PostgreSQL等主流数据库 +- 前端地址:https://gitee.com/renrenio/renren-fast-vue +- 代码生成器:https://gitee.com/renrenio/renren-generator + +
    + + +**具有如下特点** +- 友好的代码结构及注释,便于阅读及二次开发 +- 实现前后端分离,通过token进行数据交互,前端再也不用关注后端技术 +- 灵活的权限控制,可控制到页面或按钮,满足绝大部分的权限需求 +- 页面交互使用Vue2.x,极大的提高了开发效率 +- 完善的代码生成机制,可在线生成entity、xml、dao、service、vue、sql代码,减少70%以上的开发任务 +- 引入quartz定时任务,可动态完成任务的添加、修改、删除、暂停、恢复及日志查看等功能 +- 引入API模板,根据token作为登录令牌,极大的方便了APP接口开发 +- 引入Hibernate Validator校验框架,轻松实现后端校验 +- 引入云存储服务,已支持:七牛云、阿里云、腾讯云等 +- 引入swagger文档支持,方便编写API接口文档 +
    + +**项目结构** +``` +renren-fast +├─db 项目SQL语句 +│ +├─common 公共模块 +│ ├─aspect 系统日志 +│ ├─exception 异常处理 +│ ├─validator 后台校验 +│ └─xss XSS过滤 +│ +├─config 配置信息 +│ +├─modules 功能模块 +│ ├─app API接口模块(APP调用) +│ ├─job 定时任务模块 +│ ├─oss 文件服务模块 +│ └─sys 权限模块 +│ +├─RenrenApplication 项目启动类 +│ +├──resources +│ ├─mapper SQL对应的XML文件 +│ └─static 静态资源 + +``` +
    + +**如何交流、反馈、参与贡献?** +- 开发文档:https://www.renren.io/guide +- Git仓库:https://gitee.com/renrenio/renren-fast +- [人人开源社区](https://www.renren.io/community):https://www.renren.io/community +- 官方QQ群:324780204、145799952 +- 技术讨论、二次开发等咨询、问题和建议,请移步到人人开源社区,我会在第一时间进行解答和回复! +- 如需关注项目最新动态,请Watch、Star项目,同时也是对项目最好的支持 +- 微信扫码并关注【人人开源】,获得项目最新动态及更新提醒 + +
    + +![输入图片说明](https://images.gitee.com/uploads/images/2019/0307/090140_260d672d_63154.jpeg "在这里输入图片标题") + +
    + + +**技术选型:** +- 核心框架:Spring Boot 2.1 +- 安全框架:Apache Shiro 1.4 +- 视图框架:Spring MVC 5.0 +- 持久层框架:MyBatis 3.3 +- 定时器:Quartz 2.3 +- 数据库连接池:Druid 1.0 +- 日志管理:SLF4J 1.7、Log4j +- 页面交互:Vue2.x +
    + + + **后端部署** +- 通过git下载源码 +- idea、eclipse需安装lombok插件,不然会提示找不到entity的get set方法 +- 创建数据库renren_fast,数据库编码为UTF-8 +- 执行db/mysql.sql文件,初始化数据 +- 修改application-dev.yml,更新MySQL账号和密码 +- Eclipse、IDEA运行RenrenApplication.java,则可启动项目 +- Swagger文档路径:http://localhost:8080/renren-fast/swagger/index.html +- Swagger注解路径:http://localhost:8080/renren-fast/swagger-ui.html + +
    + + **前端部署** + - 本项目是前后端分离的,还需要部署前端,才能运行起来 + - 前端下载地址:https://gitee.com/renrenio/renren-fast-vue + - 前端部署文档:https://gitee.com/renrenio/renren-fast-vue/wikis/Home + - 前端部署完毕,就可以访问项目了,账号:admin,密码:admin + +
    + + **项目演示** +- 演示地址:http://demo.open.renren.io/renren-fast +- 账号密码:admin/admin +
    + +**接口文档效果图:** +![输入图片说明](https://images.gitee.com/uploads/images/2018/0728/145341_73ba6f75_63154.jpeg "在这里输入图片标题") + +


    + + +**效果图:** +![输入图片说明](https://gitee.com/uploads/images/2018/0505/173115_d3c045ef_63154.jpeg "在这里输入图片标题") +![输入图片说明](https://gitee.com/uploads/images/2018/0624/225728_b06f72b3_63154.jpeg "在这里输入图片标题") +![输入图片说明](https://gitee.com/uploads/images/2018/0505/173140_79928d91_63154.jpeg "在这里输入图片标题") +![输入图片说明](https://gitee.com/uploads/images/2018/0505/173151_12d065db_63154.jpeg "在这里输入图片标题") + +
    diff --git a/msb-mall/renren-fast-master/db/mysql.sql b/msb-mall/renren-fast-master/db/mysql.sql new file mode 100644 index 000000000..be1caef34 --- /dev/null +++ b/msb-mall/renren-fast-master/db/mysql.sql @@ -0,0 +1,356 @@ +-- 菜单 +CREATE TABLE `sys_menu` ( + `menu_id` bigint NOT NULL AUTO_INCREMENT, + `parent_id` bigint COMMENT '父菜单ID,一级菜单为0', + `name` varchar(50) COMMENT '菜单名称', + `url` varchar(200) COMMENT '菜单URL', + `perms` varchar(500) COMMENT '授权(多个用逗号分隔,如:user:list,user:create)', + `type` int COMMENT '类型 0:目录 1:菜单 2:按钮', + `icon` varchar(50) COMMENT '菜单图标', + `order_num` int COMMENT '排序', + PRIMARY KEY (`menu_id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='菜单管理'; + +-- 系统用户 +CREATE TABLE `sys_user` ( + `user_id` bigint NOT NULL AUTO_INCREMENT, + `username` varchar(50) NOT NULL COMMENT '用户名', + `password` varchar(100) COMMENT '密码', + `salt` varchar(20) COMMENT '盐', + `email` varchar(100) COMMENT '邮箱', + `mobile` varchar(100) COMMENT '手机号', + `status` tinyint COMMENT '状态 0:禁用 1:正常', + `create_user_id` bigint(20) COMMENT '创建者ID', + `create_time` datetime COMMENT '创建时间', + PRIMARY KEY (`user_id`), + UNIQUE INDEX (`username`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统用户'; + +-- 系统用户Token +CREATE TABLE `sys_user_token` ( + `user_id` bigint(20) NOT NULL, + `token` varchar(100) NOT NULL COMMENT 'token', + `expire_time` datetime DEFAULT NULL COMMENT '过期时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`user_id`), + UNIQUE KEY `token` (`token`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统用户Token'; + +-- 系统验证码 +CREATE TABLE `sys_captcha` ( + `uuid` char(36) NOT NULL COMMENT 'uuid', + `code` varchar(6) NOT NULL COMMENT '验证码', + `expire_time` datetime DEFAULT NULL COMMENT '过期时间', + PRIMARY KEY (`uuid`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统验证码'; + +-- 角色 +CREATE TABLE `sys_role` ( + `role_id` bigint NOT NULL AUTO_INCREMENT, + `role_name` varchar(100) COMMENT '角色名称', + `remark` varchar(100) COMMENT '备注', + `create_user_id` bigint(20) COMMENT '创建者ID', + `create_time` datetime COMMENT '创建时间', + PRIMARY KEY (`role_id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='角色'; + +-- 用户与角色对应关系 +CREATE TABLE `sys_user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `user_id` bigint COMMENT '用户ID', + `role_id` bigint COMMENT '角色ID', + PRIMARY KEY (`id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='用户与角色对应关系'; + +-- 角色与菜单对应关系 +CREATE TABLE `sys_role_menu` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `role_id` bigint COMMENT '角色ID', + `menu_id` bigint COMMENT '菜单ID', + PRIMARY KEY (`id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='角色与菜单对应关系'; + +-- 系统配置信息 +CREATE TABLE `sys_config` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `param_key` varchar(50) COMMENT 'key', + `param_value` varchar(2000) COMMENT 'value', + `status` tinyint DEFAULT 1 COMMENT '状态 0:隐藏 1:显示', + `remark` varchar(500) COMMENT '备注', + PRIMARY KEY (`id`), + UNIQUE INDEX (`param_key`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统配置信息表'; + + +-- 系统日志 +CREATE TABLE `sys_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `username` varchar(50) COMMENT '用户名', + `operation` varchar(50) COMMENT '用户操作', + `method` varchar(200) COMMENT '请求方法', + `params` varchar(5000) COMMENT '请求参数', + `time` bigint NOT NULL COMMENT '执行时长(毫秒)', + `ip` varchar(64) COMMENT 'IP地址', + `create_date` datetime COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统日志'; + + +-- 文件上传 +CREATE TABLE `sys_oss` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `url` varchar(200) COMMENT 'URL地址', + `create_date` datetime COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='文件上传'; + + +-- 定时任务 +CREATE TABLE `schedule_job` ( + `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id', + `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称', + `params` varchar(2000) DEFAULT NULL COMMENT '参数', + `cron_expression` varchar(100) DEFAULT NULL COMMENT 'cron表达式', + `status` tinyint(4) DEFAULT NULL COMMENT '任务状态 0:正常 1:暂停', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`job_id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='定时任务'; + +-- 定时任务日志 +CREATE TABLE `schedule_job_log` ( + `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id', + `job_id` bigint(20) NOT NULL COMMENT '任务id', + `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称', + `params` varchar(2000) DEFAULT NULL COMMENT '参数', + `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败', + `error` varchar(2000) DEFAULT NULL COMMENT '失败信息', + `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`log_id`), + KEY `job_id` (`job_id`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='定时任务日志'; + + + +-- 用户表 +CREATE TABLE `tb_user` ( + `user_id` bigint NOT NULL AUTO_INCREMENT, + `username` varchar(50) NOT NULL COMMENT '用户名', + `mobile` varchar(20) NOT NULL COMMENT '手机号', + `password` varchar(64) COMMENT '密码', + `create_time` datetime COMMENT '创建时间', + PRIMARY KEY (`user_id`), + UNIQUE INDEX (`username`) +) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='用户'; + + + + + + +-- 初始数据 +INSERT INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `email`, `mobile`, `status`, `create_user_id`, `create_time`) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11'); + +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7); +INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6); + +INSERT INTO `sys_config` (`param_key`, `param_value`, `status`, `remark`) VALUES ('CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"type\":1}', '0', '云存储配置信息'); +INSERT INTO `schedule_job` (`bean_name`, `params`, `cron_expression`, `status`, `remark`, `create_time`) VALUES ('testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', now()); + + +-- 账号:13612345678 密码:admin +INSERT INTO `tb_user` (`username`, `mobile`, `password`, `create_time`) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41'); + + + + + + + + +-- quartz自带表结构 +CREATE TABLE QRTZ_JOB_DETAILS( +SCHED_NAME VARCHAR(120) NOT NULL, +JOB_NAME VARCHAR(200) NOT NULL, +JOB_GROUP VARCHAR(200) NOT NULL, +DESCRIPTION VARCHAR(250) NULL, +JOB_CLASS_NAME VARCHAR(250) NOT NULL, +IS_DURABLE VARCHAR(1) NOT NULL, +IS_NONCONCURRENT VARCHAR(1) NOT NULL, +IS_UPDATE_DATA VARCHAR(1) NOT NULL, +REQUESTS_RECOVERY VARCHAR(1) NOT NULL, +JOB_DATA BLOB NULL, +PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_TRIGGERS ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +JOB_NAME VARCHAR(200) NOT NULL, +JOB_GROUP VARCHAR(200) NOT NULL, +DESCRIPTION VARCHAR(250) NULL, +NEXT_FIRE_TIME BIGINT(13) NULL, +PREV_FIRE_TIME BIGINT(13) NULL, +PRIORITY INTEGER NULL, +TRIGGER_STATE VARCHAR(16) NOT NULL, +TRIGGER_TYPE VARCHAR(8) NOT NULL, +START_TIME BIGINT(13) NOT NULL, +END_TIME BIGINT(13) NULL, +CALENDAR_NAME VARCHAR(200) NULL, +MISFIRE_INSTR SMALLINT(2) NULL, +JOB_DATA BLOB NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) +REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +REPEAT_COUNT BIGINT(7) NOT NULL, +REPEAT_INTERVAL BIGINT(12) NOT NULL, +TIMES_TRIGGERED BIGINT(10) NOT NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_CRON_TRIGGERS ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +CRON_EXPRESSION VARCHAR(120) NOT NULL, +TIME_ZONE_ID VARCHAR(80), +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_SIMPROP_TRIGGERS + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + STR_PROP_1 VARCHAR(512) NULL, + STR_PROP_2 VARCHAR(512) NULL, + STR_PROP_3 VARCHAR(512) NULL, + INT_PROP_1 INT NULL, + INT_PROP_2 INT NULL, + LONG_PROP_1 BIGINT NULL, + LONG_PROP_2 BIGINT NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 VARCHAR(1) NULL, + BOOL_PROP_2 VARCHAR(1) NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_BLOB_TRIGGERS ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +BLOB_DATA BLOB NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_CALENDARS ( +SCHED_NAME VARCHAR(120) NOT NULL, +CALENDAR_NAME VARCHAR(200) NOT NULL, +CALENDAR BLOB NOT NULL, +PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_FIRED_TRIGGERS ( +SCHED_NAME VARCHAR(120) NOT NULL, +ENTRY_ID VARCHAR(95) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +INSTANCE_NAME VARCHAR(200) NOT NULL, +FIRED_TIME BIGINT(13) NOT NULL, +SCHED_TIME BIGINT(13) NOT NULL, +PRIORITY INTEGER NOT NULL, +STATE VARCHAR(16) NOT NULL, +JOB_NAME VARCHAR(200) NULL, +JOB_GROUP VARCHAR(200) NULL, +IS_NONCONCURRENT VARCHAR(1) NULL, +REQUESTS_RECOVERY VARCHAR(1) NULL, +PRIMARY KEY (SCHED_NAME,ENTRY_ID)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_SCHEDULER_STATE ( +SCHED_NAME VARCHAR(120) NOT NULL, +INSTANCE_NAME VARCHAR(200) NOT NULL, +LAST_CHECKIN_TIME BIGINT(13) NOT NULL, +CHECKIN_INTERVAL BIGINT(13) NOT NULL, +PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE QRTZ_LOCKS ( +SCHED_NAME VARCHAR(120) NOT NULL, +LOCK_NAME VARCHAR(40) NOT NULL, +PRIMARY KEY (SCHED_NAME,LOCK_NAME)) +ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY); +CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP); + +CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME); +CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); +CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME); +CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); +CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); +CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); + +CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME); +CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); +CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); +CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); diff --git a/msb-mall/renren-fast-master/db/oracle.sql b/msb-mall/renren-fast-master/db/oracle.sql new file mode 100644 index 000000000..56c23e583 --- /dev/null +++ b/msb-mall/renren-fast-master/db/oracle.sql @@ -0,0 +1,346 @@ +-- 菜单 +CREATE TABLE sys_menu ( + menu_id NUMBER(20, 0) NOT NULL, + parent_id NUMBER(20, 0) NOT NULL, + name varchar2(50), + url varchar2(200), + perms varchar2(500), + type NUMBER(2, 0), + icon varchar2(50), + order_num NUMBER(8, 0), + PRIMARY KEY (menu_id) +); + +-- 系统用户 +CREATE TABLE sys_user ( + user_id NUMBER(20, 0) NOT NULL, + username varchar2(50) NOT NULL, + password varchar2(100), + salt varchar2(20), + email varchar2(100), + mobile varchar2(100), + status NUMBER(2, 0) NOT NULL, + create_user_id NUMBER(20, 0) NOT NULL, + create_time timestamp, + PRIMARY KEY (user_id) +); +CREATE UNIQUE INDEX index_sys_user_username on sys_user(username); + +-- 系统用户Token +CREATE TABLE sys_user_token ( + user_id NUMBER(20, 0) NOT NULL, + token varchar2(100) NOT NULL, + expire_time timestamp, + update_time timestamp, + PRIMARY KEY (user_id) +); +CREATE UNIQUE INDEX index_token on sys_user_token(token); + +-- 系统验证码 +CREATE TABLE sys_captcha ( + uuid varchar2(36) NOT NULL, + code varchar2(6) NOT NULL, + expire_time timestamp, + PRIMARY KEY (uuid) +); + +-- 角色 +CREATE TABLE sys_role ( + role_id NUMBER(20, 0) NOT NULL, + role_name varchar2(100), + remark varchar2(100), + create_user_id NUMBER(20, 0) NOT NULL, + create_time timestamp, + PRIMARY KEY (role_id) +); + +-- 用户与角色对应关系 +CREATE TABLE sys_user_role ( + id NUMBER(20, 0) NOT NULL, + user_id NUMBER(20, 0) NOT NULL, + role_id NUMBER(20, 0) NOT NULL, + PRIMARY KEY (id) +); + +-- 角色与菜单对应关系 +CREATE TABLE sys_role_menu ( + id NUMBER(20, 0) NOT NULL, + role_id NUMBER(20, 0) NOT NULL, + menu_id NUMBER(20, 0) NOT NULL, + PRIMARY KEY (id) +); + +-- 系统配置信息 +CREATE TABLE sys_config ( + id NUMBER(20, 0) NOT NULL, + param_key varchar2(50), + param_value varchar2(4000), + status NUMBER(2, 0) DEFAULT 1 NOT NULL, + remark varchar2(500), + PRIMARY KEY (id) +); +CREATE UNIQUE INDEX index_param_key on sys_config(param_key); + + +-- 系统日志 +CREATE TABLE sys_log ( + id NUMBER(20, 0) NOT NULL, + username varchar2(50), + operation varchar2(50), + method varchar2(200), + params clob, + time NUMBER(20, 0) NOT NULL, + ip varchar2(64), + create_date timestamp, + PRIMARY KEY (id) +); + +-- 文件上传 +CREATE TABLE sys_oss ( + id NUMBER(20, 0) NOT NULL, + url varchar2(200), + create_date timestamp, + PRIMARY KEY (id) +); + +-- 定时任务 +CREATE TABLE schedule_job ( + job_id NUMBER(20, 0) NOT NULL, + bean_name varchar2(200), + params varchar2(2000), + cron_expression varchar2(100), + status NUMBER(2, 0) NOT NULL, + remark varchar2(255), + create_time timestamp, + PRIMARY KEY (job_id) +); + +-- 定时任务日志 +CREATE TABLE schedule_job_log ( + log_id NUMBER(20, 0) NOT NULL, + job_id NUMBER(20, 0) NOT NULL, + bean_name varchar2(200), + params varchar2(2000), + status NUMBER(2, 0) NOT NULL, + error varchar2(2000), + times NUMBER(10, 0) NOT NULL, + create_time timestamp, + PRIMARY KEY (log_id) +); +CREATE INDEX index_job_id on schedule_job_log(job_id); + +-- 用户表 +CREATE TABLE tb_user ( + user_id NUMBER(20, 0) NOT NULL, + username varchar2(50) NOT NULL, + mobile varchar2(20) NOT NULL, + password varchar2(64), + create_time timestamp, + PRIMARY KEY (user_id) +); +CREATE UNIQUE INDEX index_tb_user_username on tb_user(username); + +INSERT INTO sys_user (user_id, username, password, salt, email, mobile, status, create_user_id, create_time) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', CURRENT_DATE); + +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6); + + + +INSERT INTO sys_config (id, param_key, param_value, status, remark) VALUES (1, 'CLOUD_STORAGE_CONFIG_KEY', '{"aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","aliyunDomain":"","aliyunEndPoint":"","aliyunPrefix":"","qcloudBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuBucketName":"ios-app","qiniuDomain":"http://7xlij2.com1.z0.glb.clouddn.com","qiniuPrefix":"upload","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","type":1}', '0', '云存储配置信息'); + +INSERT INTO schedule_job (job_id, bean_name, params, cron_expression, status, remark, create_time) VALUES (1, 'testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', CURRENT_DATE); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (user_id, username, mobile, password, create_time) VALUES (1, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', CURRENT_DATE); + + + + +-- quartz自带表结构 +CREATE TABLE qrtz_job_details +( + SCHED_NAME VARCHAR2(120) NOT NULL, + JOB_NAME VARCHAR2(200) NOT NULL, + JOB_GROUP VARCHAR2(200) NOT NULL, + DESCRIPTION VARCHAR2(250) NULL, + JOB_CLASS_NAME VARCHAR2(250) NOT NULL, + IS_DURABLE VARCHAR2(1) NOT NULL, + IS_NONCONCURRENT VARCHAR2(1) NOT NULL, + IS_UPDATE_DATA VARCHAR2(1) NOT NULL, + REQUESTS_RECOVERY VARCHAR2(1) NOT NULL, + JOB_DATA BLOB NULL, + CONSTRAINT QRTZ_JOB_DETAILS_PK PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) +); +CREATE TABLE qrtz_triggers +( + SCHED_NAME VARCHAR2(120) NOT NULL, + TRIGGER_NAME VARCHAR2(200) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + JOB_NAME VARCHAR2(200) NOT NULL, + JOB_GROUP VARCHAR2(200) NOT NULL, + DESCRIPTION VARCHAR2(250) NULL, + NEXT_FIRE_TIME NUMBER(13) NULL, + PREV_FIRE_TIME NUMBER(13) NULL, + PRIORITY NUMBER(13) NULL, + TRIGGER_STATE VARCHAR2(16) NOT NULL, + TRIGGER_TYPE VARCHAR2(8) NOT NULL, + START_TIME NUMBER(13) NOT NULL, + END_TIME NUMBER(13) NULL, + CALENDAR_NAME VARCHAR2(200) NULL, + MISFIRE_INSTR NUMBER(2) NULL, + JOB_DATA BLOB NULL, + CONSTRAINT QRTZ_TRIGGERS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + CONSTRAINT QRTZ_TRIGGER_TO_JOBS_FK FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) + REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) +); +CREATE TABLE qrtz_simple_triggers +( + SCHED_NAME VARCHAR2(120) NOT NULL, + TRIGGER_NAME VARCHAR2(200) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + REPEAT_COUNT NUMBER(7) NOT NULL, + REPEAT_INTERVAL NUMBER(12) NOT NULL, + TIMES_TRIGGERED NUMBER(10) NOT NULL, + CONSTRAINT QRTZ_SIMPLE_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + CONSTRAINT QRTZ_SIMPLE_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); +CREATE TABLE qrtz_cron_triggers +( + SCHED_NAME VARCHAR2(120) NOT NULL, + TRIGGER_NAME VARCHAR2(200) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + CRON_EXPRESSION VARCHAR2(120) NOT NULL, + TIME_ZONE_ID VARCHAR2(80), + CONSTRAINT QRTZ_CRON_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + CONSTRAINT QRTZ_CRON_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); +CREATE TABLE qrtz_simprop_triggers +( + SCHED_NAME VARCHAR2(120) NOT NULL, + TRIGGER_NAME VARCHAR2(200) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + STR_PROP_1 VARCHAR2(512) NULL, + STR_PROP_2 VARCHAR2(512) NULL, + STR_PROP_3 VARCHAR2(512) NULL, + INT_PROP_1 NUMBER(10) NULL, + INT_PROP_2 NUMBER(10) NULL, + LONG_PROP_1 NUMBER(13) NULL, + LONG_PROP_2 NUMBER(13) NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 VARCHAR2(1) NULL, + BOOL_PROP_2 VARCHAR2(1) NULL, + CONSTRAINT QRTZ_SIMPROP_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + CONSTRAINT QRTZ_SIMPROP_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); +CREATE TABLE qrtz_blob_triggers +( + SCHED_NAME VARCHAR2(120) NOT NULL, + TRIGGER_NAME VARCHAR2(200) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + BLOB_DATA BLOB NULL, + CONSTRAINT QRTZ_BLOB_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + CONSTRAINT QRTZ_BLOB_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); +CREATE TABLE qrtz_calendars +( + SCHED_NAME VARCHAR2(120) NOT NULL, + CALENDAR_NAME VARCHAR2(200) NOT NULL, + CALENDAR BLOB NOT NULL, + CONSTRAINT QRTZ_CALENDARS_PK PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) +); +CREATE TABLE qrtz_paused_trigger_grps +( + SCHED_NAME VARCHAR2(120) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + CONSTRAINT QRTZ_PAUSED_TRIG_GRPS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) +); +CREATE TABLE qrtz_fired_triggers +( + SCHED_NAME VARCHAR2(120) NOT NULL, + ENTRY_ID VARCHAR2(95) NOT NULL, + TRIGGER_NAME VARCHAR2(200) NOT NULL, + TRIGGER_GROUP VARCHAR2(200) NOT NULL, + INSTANCE_NAME VARCHAR2(200) NOT NULL, + FIRED_TIME NUMBER(13) NOT NULL, + SCHED_TIME NUMBER(13) NOT NULL, + PRIORITY NUMBER(13) NOT NULL, + STATE VARCHAR2(16) NOT NULL, + JOB_NAME VARCHAR2(200) NULL, + JOB_GROUP VARCHAR2(200) NULL, + IS_NONCONCURRENT VARCHAR2(1) NULL, + REQUESTS_RECOVERY VARCHAR2(1) NULL, + CONSTRAINT QRTZ_FIRED_TRIGGER_PK PRIMARY KEY (SCHED_NAME,ENTRY_ID) +); +CREATE TABLE qrtz_scheduler_state +( + SCHED_NAME VARCHAR2(120) NOT NULL, + INSTANCE_NAME VARCHAR2(200) NOT NULL, + LAST_CHECKIN_TIME NUMBER(13) NOT NULL, + CHECKIN_INTERVAL NUMBER(13) NOT NULL, + CONSTRAINT QRTZ_SCHEDULER_STATE_PK PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) +); +CREATE TABLE qrtz_locks +( + SCHED_NAME VARCHAR2(120) NOT NULL, + LOCK_NAME VARCHAR2(40) NOT NULL, + CONSTRAINT QRTZ_LOCKS_PK PRIMARY KEY (SCHED_NAME,LOCK_NAME) +); + +create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY); +create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP); + +create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP); +create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME); +create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP); +create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE); +create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); +create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); + +create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME); +create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); +create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP); +create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); +create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP); + + diff --git a/msb-mall/renren-fast-master/db/postgresql.sql b/msb-mall/renren-fast-master/db/postgresql.sql new file mode 100644 index 000000000..923da2c46 --- /dev/null +++ b/msb-mall/renren-fast-master/db/postgresql.sql @@ -0,0 +1,364 @@ +-- 菜单 +CREATE TABLE sys_menu ( + menu_id bigserial, + parent_id int8, + name varchar(50), + url varchar(200), + perms varchar(500), + type int, + icon varchar(50), + order_num int, + PRIMARY KEY (menu_id) +); + + +-- 系统用户 +CREATE TABLE sys_user ( + user_id bigserial, + username varchar(50) NOT NULL, + password varchar(100), + salt varchar(20), + email varchar(100), + mobile varchar(100), + status int, + create_user_id int8, + create_time timestamp, + PRIMARY KEY (user_id), + UNIQUE (username) +); + + +-- 系统用户Token +CREATE TABLE sys_user_token ( + user_id bigserial, + token varchar(100) NOT NULL, + expire_time timestamp, + update_time timestamp, + PRIMARY KEY (user_id), + UNIQUE (token) +); + +-- 系统验证码 +CREATE TABLE sys_captcha ( + uuid varchar(36) NOT NULL, + code varchar(6) NOT NULL, + expire_time timestamp, + PRIMARY KEY (uuid) +); + +-- 角色 +CREATE TABLE sys_role ( + role_id bigserial, + role_name varchar(100), + remark varchar(100), + create_user_id int8, + create_time timestamp, + PRIMARY KEY (role_id) +); + +-- 用户与角色对应关系 +CREATE TABLE sys_user_role ( + id bigserial, + user_id int8, + role_id int8, + PRIMARY KEY (id) +); + +-- 角色与菜单对应关系 +CREATE TABLE sys_role_menu ( + id bigserial, + role_id int8, + menu_id int8, + PRIMARY KEY (id) +); + +-- 系统配置信息 +CREATE TABLE sys_config ( + id bigserial, + param_key varchar(50), + param_value varchar(2000), + status int DEFAULT 1, + remark varchar(500), + PRIMARY KEY (id), + UNIQUE (param_key) +); + + +-- 系统日志 +CREATE TABLE sys_log ( + id bigserial, + username varchar(50), + operation varchar(50), + method varchar(200), + params varchar(5000), + time int8 NOT NULL, + ip varchar(64), + create_date timestamp, + PRIMARY KEY (id) +); + +-- 文件上传 +CREATE TABLE sys_oss ( + id bigserial, + url varchar(200), + create_date timestamp, + PRIMARY KEY (id) +); + + +-- 定时任务 +CREATE TABLE schedule_job ( + job_id bigserial, + bean_name varchar(200), + params varchar(2000), + cron_expression varchar(100), + status int, + remark varchar(255), + create_time timestamp, + PRIMARY KEY (job_id) +); + +-- 定时任务日志 +CREATE TABLE schedule_job_log ( + log_id bigserial, + job_id int8 NOT NULL, + bean_name varchar(200), + params varchar(2000), + status int NOT NULL, + error varchar(2000), + times int NOT NULL, + create_time timestamp, + PRIMARY KEY (log_id) +); +CREATE INDEX index_job_id on schedule_job_log(job_id); + +-- 用户表 +CREATE TABLE tb_user ( + user_id bigserial, + username varchar(50) NOT NULL, + mobile varchar(20) NOT NULL, + password varchar(64), + create_time timestamp, + PRIMARY KEY (user_id), + UNIQUE (username) +); + + +INSERT INTO sys_user (user_id, username, password, salt, email, mobile, status, create_user_id, create_time) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11'); + +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6); + + +INSERT INTO sys_config (param_key, param_value, status, remark) VALUES ('CLOUD_STORAGE_CONFIG_KEY', '{"aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","aliyunDomain":"","aliyunEndPoint":"","aliyunPrefix":"","qcloudBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuBucketName":"ios-app","qiniuDomain":"http://7xlij2.com1.z0.glb.clouddn.com","qiniuPrefix":"upload","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","type":1}', '0', '云存储配置信息'); + +INSERT INTO schedule_job (bean_name, params, cron_expression, status, remark, create_time) VALUES ('testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', '2016-12-01 23:16:46'); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (username, mobile, password, create_time) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41'); + + +alter sequence sys_menu_menu_id_seq restart with 31; +alter sequence sys_user_user_id_seq restart with 2; + + +-- quartz自带表结构 + +CREATE TABLE qrtz_job_details +( + SCHED_NAME VARCHAR(120) NOT NULL, + JOB_NAME VARCHAR(200) NOT NULL, + JOB_GROUP VARCHAR(200) NOT NULL, + DESCRIPTION VARCHAR(250) NULL, + JOB_CLASS_NAME VARCHAR(250) NOT NULL, + IS_DURABLE BOOL NOT NULL, + IS_NONCONCURRENT BOOL NOT NULL, + IS_UPDATE_DATA BOOL NOT NULL, + REQUESTS_RECOVERY BOOL NOT NULL, + JOB_DATA BYTEA NULL, + PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) +); + +CREATE TABLE qrtz_triggers +( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + JOB_NAME VARCHAR(200) NOT NULL, + JOB_GROUP VARCHAR(200) NOT NULL, + DESCRIPTION VARCHAR(250) NULL, + NEXT_FIRE_TIME BIGINT NULL, + PREV_FIRE_TIME BIGINT NULL, + PRIORITY INTEGER NULL, + TRIGGER_STATE VARCHAR(16) NOT NULL, + TRIGGER_TYPE VARCHAR(8) NOT NULL, + START_TIME BIGINT NOT NULL, + END_TIME BIGINT NULL, + CALENDAR_NAME VARCHAR(200) NULL, + MISFIRE_INSTR SMALLINT NULL, + JOB_DATA BYTEA NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) + REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) +); + +CREATE TABLE qrtz_simple_triggers +( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + REPEAT_COUNT BIGINT NOT NULL, + REPEAT_INTERVAL BIGINT NOT NULL, + TIMES_TRIGGERED BIGINT NOT NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_cron_triggers +( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + CRON_EXPRESSION VARCHAR(120) NOT NULL, + TIME_ZONE_ID VARCHAR(80), + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_simprop_triggers +( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + STR_PROP_1 VARCHAR(512) NULL, + STR_PROP_2 VARCHAR(512) NULL, + STR_PROP_3 VARCHAR(512) NULL, + INT_PROP_1 INT NULL, + INT_PROP_2 INT NULL, + LONG_PROP_1 BIGINT NULL, + LONG_PROP_2 BIGINT NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 BOOL NULL, + BOOL_PROP_2 BOOL NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_blob_triggers +( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + BLOB_DATA BYTEA NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_calendars +( + SCHED_NAME VARCHAR(120) NOT NULL, + CALENDAR_NAME VARCHAR(200) NOT NULL, + CALENDAR BYTEA NOT NULL, + PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) +); + + +CREATE TABLE qrtz_paused_trigger_grps +( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_fired_triggers +( + SCHED_NAME VARCHAR(120) NOT NULL, + ENTRY_ID VARCHAR(95) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + INSTANCE_NAME VARCHAR(200) NOT NULL, + FIRED_TIME BIGINT NOT NULL, + SCHED_TIME BIGINT NOT NULL, + PRIORITY INTEGER NOT NULL, + STATE VARCHAR(16) NOT NULL, + JOB_NAME VARCHAR(200) NULL, + JOB_GROUP VARCHAR(200) NULL, + IS_NONCONCURRENT BOOL NULL, + REQUESTS_RECOVERY BOOL NULL, + PRIMARY KEY (SCHED_NAME,ENTRY_ID) +); + +CREATE TABLE qrtz_scheduler_state +( + SCHED_NAME VARCHAR(120) NOT NULL, + INSTANCE_NAME VARCHAR(200) NOT NULL, + LAST_CHECKIN_TIME BIGINT NOT NULL, + CHECKIN_INTERVAL BIGINT NOT NULL, + PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) +); + +CREATE TABLE qrtz_locks +( + SCHED_NAME VARCHAR(120) NOT NULL, + LOCK_NAME VARCHAR(40) NOT NULL, + PRIMARY KEY (SCHED_NAME,LOCK_NAME) +); + +create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY); +create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP); + +create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP); +create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME); +create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP); +create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE); +create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); +create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); + +create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME); +create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); +create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP); +create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); +create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP); + + +commit; diff --git a/msb-mall/renren-fast-master/db/sqlserver.sql b/msb-mall/renren-fast-master/db/sqlserver.sql new file mode 100644 index 000000000..de38fa87b --- /dev/null +++ b/msb-mall/renren-fast-master/db/sqlserver.sql @@ -0,0 +1,512 @@ +-- 菜单 +CREATE TABLE sys_menu ( + menu_id bigint NOT NULL IDENTITY(1,1), + parent_id bigint, + name varchar(50), + url varchar(200), + perms varchar(500), + type int, + icon varchar(50), + order_num int, + PRIMARY KEY (menu_id) +); + +-- 系统用户 +CREATE TABLE sys_user ( + user_id bigint NOT NULL IDENTITY(1,1), + username varchar(50) NOT NULL, + password varchar(100), + salt varchar(20), + email varchar(100), + mobile varchar(100), + status tinyint, + create_user_id bigint, + create_time datetime, + PRIMARY KEY (user_id), + UNIQUE (username) +); + +-- 系统用户Token +CREATE TABLE sys_user_token ( + user_id bigint NOT NULL, + token varchar(100) NOT NULL, + expire_time datetime, + update_time datetime, + PRIMARY KEY (user_id), + UNIQUE (token) +); + +-- 系统验证码 +CREATE TABLE sys_captcha ( + uuid varchar(36) NOT NULL, + code varchar(6) NOT NULL, + expire_time datetime, + PRIMARY KEY (uuid) +); + +-- 角色 +CREATE TABLE sys_role ( + role_id bigint NOT NULL IDENTITY(1,1), + role_name varchar(100), + remark varchar(100), + create_user_id bigint, + create_time datetime, +PRIMARY KEY (role_id) +); + +-- 用户与角色对应关系 +CREATE TABLE sys_user_role ( + id bigint NOT NULL IDENTITY(1,1), + user_id bigint, + role_id bigint, +PRIMARY KEY (id) +); + +-- 角色与菜单对应关系 +CREATE TABLE sys_role_menu ( + id bigint NOT NULL IDENTITY(1,1), + role_id bigint, + menu_id bigint, +PRIMARY KEY (id) +); + +-- 系统配置信息 +CREATE TABLE sys_config ( + id bigint NOT NULL IDENTITY(1,1), + param_key varchar(50), + param_value varchar(2000), + status tinyint DEFAULT 1, + remark varchar(500), + PRIMARY KEY (id), + UNIQUE (param_key) +); + +-- 系统日志 +CREATE TABLE sys_log ( + id bigint NOT NULL IDENTITY(1,1), + username varchar(50), + operation varchar(50), + method varchar(200), + params varchar(5000), + time bigint NOT NULL, + ip varchar(64), + create_date datetime, +PRIMARY KEY (id) +); + +-- 文件上传 +CREATE TABLE sys_oss ( + id bigint NOT NULL IDENTITY(1,1), + url varchar(200), + create_date datetime, + PRIMARY KEY (id) +); + +-- 定时任务 +CREATE TABLE schedule_job ( + job_id bigint NOT NULL IDENTITY(1,1), + bean_name varchar(200), + params varchar(2000), + cron_expression varchar(100), + status tinyint, + remark varchar(255), + create_time datetime, + PRIMARY KEY (job_id) +); + +-- 定时任务日志 +CREATE TABLE schedule_job_log ( + log_id bigint NOT NULL IDENTITY(1,1), + job_id bigint NOT NULL, + bean_name varchar(200), + params varchar(2000), + status tinyint NOT NULL, + error varchar(2000), + times int NOT NULL, + create_time datetime, + PRIMARY KEY (log_id), + INDEX job_id (job_id) +); + +-- 用户表 +CREATE TABLE tb_user ( + user_id bigint NOT NULL IDENTITY(1,1), + username varchar(50) NOT NULL, + mobile varchar(20) NOT NULL, + password varchar(64), + create_time datetime, + PRIMARY KEY (user_id), + UNIQUE (username) +); + +SET IDENTITY_INSERT sys_user ON; +INSERT INTO sys_user (user_id, username, password, salt, email, mobile, status, create_user_id, create_time) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11'); +SET IDENTITY_INSERT sys_user OFF; + +SET IDENTITY_INSERT sys_menu ON; +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7); +INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6); + +SET IDENTITY_INSERT sys_menu OFF; + + +INSERT INTO sys_config (param_key, param_value, status, remark) VALUES ('CLOUD_STORAGE_CONFIG_KEY', '{"aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","aliyunDomain":"","aliyunEndPoint":"","aliyunPrefix":"","qcloudBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuBucketName":"ios-app","qiniuDomain":"http://7xlij2.com1.z0.glb.clouddn.com","qiniuPrefix":"upload","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","type":1}', '0', '云存储配置信息'); + +INSERT INTO schedule_job (bean_name, params, cron_expression, status, remark, create_time) VALUES ('testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', '2016-12-01 23:16:46'); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (username, mobile, password, create_time) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41'); + + + + + +-- quartz自带表结构 +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1) + ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1) + ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] DROP CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1) + ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1) + ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_CALENDARS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_LOCKS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_JOB_DETAILS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1) + DROP TABLE [dbo].[QRTZ_TRIGGERS] +GO + +CREATE TABLE [dbo].[QRTZ_CALENDARS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [CALENDAR_NAME] [VARCHAR] (200) NOT NULL , + [CALENDAR] [IMAGE] NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [TRIGGER_NAME] [VARCHAR] (200) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL , + [CRON_EXPRESSION] [VARCHAR] (120) NOT NULL , + [TIME_ZONE_ID] [VARCHAR] (80) +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [ENTRY_ID] [VARCHAR] (95) NOT NULL , + [TRIGGER_NAME] [VARCHAR] (200) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL , + [INSTANCE_NAME] [VARCHAR] (200) NOT NULL , + [FIRED_TIME] [BIGINT] NOT NULL , + [SCHED_TIME] [BIGINT] NOT NULL , + [PRIORITY] [INTEGER] NOT NULL , + [STATE] [VARCHAR] (16) NOT NULL, + [JOB_NAME] [VARCHAR] (200) NULL , + [JOB_GROUP] [VARCHAR] (200) NULL , + [IS_NONCONCURRENT] [VARCHAR] (1) NULL , + [REQUESTS_RECOVERY] [VARCHAR] (1) NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [INSTANCE_NAME] [VARCHAR] (200) NOT NULL , + [LAST_CHECKIN_TIME] [BIGINT] NOT NULL , + [CHECKIN_INTERVAL] [BIGINT] NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_LOCKS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [LOCK_NAME] [VARCHAR] (40) NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_JOB_DETAILS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [JOB_NAME] [VARCHAR] (200) NOT NULL , + [JOB_GROUP] [VARCHAR] (200) NOT NULL , + [DESCRIPTION] [VARCHAR] (250) NULL , + [JOB_CLASS_NAME] [VARCHAR] (250) NOT NULL , + [IS_DURABLE] [VARCHAR] (1) NOT NULL , + [IS_NONCONCURRENT] [VARCHAR] (1) NOT NULL , + [IS_UPDATE_DATA] [VARCHAR] (1) NOT NULL , + [REQUESTS_RECOVERY] [VARCHAR] (1) NOT NULL , + [JOB_DATA] [IMAGE] NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [TRIGGER_NAME] [VARCHAR] (200) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL , + [REPEAT_COUNT] [BIGINT] NOT NULL , + [REPEAT_INTERVAL] [BIGINT] NOT NULL , + [TIMES_TRIGGERED] [BIGINT] NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [TRIGGER_NAME] [VARCHAR] (200) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL , + [STR_PROP_1] [VARCHAR] (512) NULL, + [STR_PROP_2] [VARCHAR] (512) NULL, + [STR_PROP_3] [VARCHAR] (512) NULL, + [INT_PROP_1] [INT] NULL, + [INT_PROP_2] [INT] NULL, + [LONG_PROP_1] [BIGINT] NULL, + [LONG_PROP_2] [BIGINT] NULL, + [DEC_PROP_1] [NUMERIC] (13,4) NULL, + [DEC_PROP_2] [NUMERIC] (13,4) NULL, + [BOOL_PROP_1] [VARCHAR] (1) NULL, + [BOOL_PROP_2] [VARCHAR] (1) NULL, +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [TRIGGER_NAME] [VARCHAR] (200) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL , + [BLOB_DATA] [IMAGE] NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[QRTZ_TRIGGERS] ( + [SCHED_NAME] [VARCHAR] (120) NOT NULL , + [TRIGGER_NAME] [VARCHAR] (200) NOT NULL , + [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL , + [JOB_NAME] [VARCHAR] (200) NOT NULL , + [JOB_GROUP] [VARCHAR] (200) NOT NULL , + [DESCRIPTION] [VARCHAR] (250) NULL , + [NEXT_FIRE_TIME] [BIGINT] NULL , + [PREV_FIRE_TIME] [BIGINT] NULL , + [PRIORITY] [INTEGER] NULL , + [TRIGGER_STATE] [VARCHAR] (16) NOT NULL , + [TRIGGER_TYPE] [VARCHAR] (8) NOT NULL , + [START_TIME] [BIGINT] NOT NULL , + [END_TIME] [BIGINT] NULL , + [CALENDAR_NAME] [VARCHAR] (200) NULL , + [MISFIRE_INSTR] [SMALLINT] NULL , + [JOB_DATA] [IMAGE] NULL +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_CALENDARS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [CALENDAR_NAME] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [ENTRY_ID] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [TRIGGER_GROUP] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [INSTANCE_NAME] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_LOCKS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [LOCK_NAME] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [JOB_NAME], + [JOB_GROUP] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_TRIGGERS] WITH NOCHECK ADD + CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD + CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) REFERENCES [dbo].[QRTZ_TRIGGERS] ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD + CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) REFERENCES [dbo].[QRTZ_TRIGGERS] ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD + CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY + ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) REFERENCES [dbo].[QRTZ_TRIGGERS] ( + [SCHED_NAME], + [TRIGGER_NAME], + [TRIGGER_GROUP] + ) ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD + CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY + ( + [SCHED_NAME], + [JOB_NAME], + [JOB_GROUP] + ) REFERENCES [dbo].[QRTZ_JOB_DETAILS] ( + [SCHED_NAME], + [JOB_NAME], + [JOB_GROUP] + ) +GO + diff --git a/msb-mall/renren-fast-master/docker-compose.yml b/msb-mall/renren-fast-master/docker-compose.yml new file mode 100644 index 000000000..432ba388e --- /dev/null +++ b/msb-mall/renren-fast-master/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2' +services: + renren-fast: + image: renren/fast + ports: + - "8080:8080" + environment: + - spring.profiles.active=dev \ No newline at end of file diff --git a/msb-mall/renren-fast-master/pom.xml b/msb-mall/renren-fast-master/pom.xml new file mode 100644 index 000000000..002e26364 --- /dev/null +++ b/msb-mall/renren-fast-master/pom.xml @@ -0,0 +1,349 @@ + + + 4.0.0 + io.renren + renren-fast + 3.0.0 + jar + renren-fast + + + org.springframework.boot + spring-boot-starter-parent + 2.3.7.RELEASE + + + + UTF-8 + UTF-8 + 1.8 + 3.3.1 + 8.0.28 + 4.0 + 11.2.0.3 + 1.1.13 + 2.3.0 + 2.6 + 1.2.2 + 2.5 + 1.10 + 1.10 + 1.9.0 + 0.7.0 + 0.0.9 + 7.2.23 + 2.8.3 + 4.4 + 2.7.0 + 2.9.9 + 2.8.5 + 1.2.79 + 4.1.1 + 1.18.4 + + + /work/renren + ${project.artifactId}-${project.version}.jar + 192.168.1.10:22 + root + 123456 + + + + + com.msb.mall + mall-commons + 1.0-SNAPSHOT + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2.2.6.RELEASE + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatisplus.version} + + + com.baomidou + mybatis-plus-generator + + + + + mysql + mysql-connector-java + ${mysql.version} + + + + com.oracle + ojdbc6 + ${oracle.version} + + + + com.microsoft.sqlserver + sqljdbc4 + ${mssql.version} + + + + org.postgresql + postgresql + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + org.quartz-scheduler + quartz + ${quartz.version} + + + com.mchange + c3p0 + + + + + commons-lang + commons-lang + ${commons.lang.version} + + + commons-fileupload + commons-fileupload + ${commons.fileupload.version} + + + commons-io + commons-io + ${commons.io.version} + + + commons-codec + commons-codec + ${commons.codec.version} + + + commons-configuration + commons-configuration + ${commons.configuration.version} + + + org.apache.shiro + shiro-core + ${shiro.version} + + + org.apache.shiro + shiro-spring + ${shiro.version} + + + io.jsonwebtoken + jjwt + ${jwt.version} + + + com.github.axet + kaptcha + ${kaptcha.version} + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + + com.qiniu + qiniu-java-sdk + ${qiniu.version} + + + com.aliyun.oss + aliyun-sdk-oss + ${aliyun.oss.version} + + + com.qcloud + cos_api + ${qcloud.cos.version} + + + org.slf4j + slf4j-log4j12 + + + + + joda-time + joda-time + ${joda.time.version} + + + com.google.code.gson + gson + ${gson.version} + + + com.alibaba + fastjson + ${fastjson.version} + + + cn.hutool + hutool-all + ${hutool.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + ${project.artifactId} + + + org.apache.maven.wagon + wagon-ssh + 2.8 + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + org.codehaus.mojo + wagon-maven-plugin + 1.0 + + target/${pack-name} + + + + kill -9 `ps -ef |grep ${project.artifactId}.jar|grep -v "grep" |awk '{print $2}'` + + ${service-path}/renren.log 2>&1 & ]]> + + + + + true + + + + + com.spotify + docker-maven-plugin + 0.4.14 + + + + + + + + + + renren/fast + ${project.basedir} + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + false + + + + + diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/RenrenApplication.java b/msb-mall/renren-fast-master/src/main/java/io/renren/RenrenApplication.java new file mode 100644 index 000000000..6a69e5f2d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/RenrenApplication.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +public class RenrenApplication { + + public static void main(String[] args) { + SpringApplication.run(RenrenApplication.class, args); + } + +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/annotation/SysLog.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/annotation/SysLog.java new file mode 100644 index 000000000..46534805e --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/annotation/SysLog.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 系统日志注解 + * + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface SysLog { + + String value() default ""; +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/aspect/RedisAspect.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/aspect/RedisAspect.java new file mode 100644 index 000000000..bb2a8e5db --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/aspect/RedisAspect.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.aspect; + +import io.renren.common.exception.RRException; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +/** + * Redis切面处理类 + * + * @author Mark sunlightcs@gmail.com + */ +@Aspect +@Configuration +public class RedisAspect { + private Logger logger = LoggerFactory.getLogger(getClass()); + //是否开启redis缓存 true开启 false关闭 + @Value("${spring.redis.open: false}") + private boolean open; + + @Around("execution(* io.renren.common.utils.RedisUtils.*(..))") + public Object around(ProceedingJoinPoint point) throws Throwable { + Object result = null; + if(open){ + try{ + result = point.proceed(); + }catch (Exception e){ + logger.error("redis error", e); + throw new RRException("Redis服务异常"); + } + } + return result; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/aspect/SysLogAspect.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/aspect/SysLogAspect.java new file mode 100644 index 000000000..ae047dfa5 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/aspect/SysLogAspect.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.aspect; + +import com.google.gson.Gson; +import io.renren.common.annotation.SysLog; +import io.renren.common.utils.HttpContextUtils; +import io.renren.common.utils.IPUtils; +import io.renren.modules.sys.entity.SysLogEntity; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.service.SysLogService; +import org.apache.shiro.SecurityUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; +import java.util.Date; + + +/** + * 系统日志,切面处理类 + * + * @author Mark sunlightcs@gmail.com + */ +@Aspect +@Component +public class SysLogAspect { + @Autowired + private SysLogService sysLogService; + + @Pointcut("@annotation(io.renren.common.annotation.SysLog)") + public void logPointCut() { + + } + + @Around("logPointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable { + long beginTime = System.currentTimeMillis(); + //执行方法 + Object result = point.proceed(); + //执行时长(毫秒) + long time = System.currentTimeMillis() - beginTime; + + //保存日志 + saveSysLog(point, time); + + return result; + } + + private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + + SysLogEntity sysLog = new SysLogEntity(); + SysLog syslog = method.getAnnotation(SysLog.class); + if(syslog != null){ + //注解上的描述 + sysLog.setOperation(syslog.value()); + } + + //请求的方法名 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = signature.getName(); + sysLog.setMethod(className + "." + methodName + "()"); + + //请求的参数 + Object[] args = joinPoint.getArgs(); + try{ + String params = new Gson().toJson(args); + sysLog.setParams(params); + }catch (Exception e){ + + } + + //获取request + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + //设置IP地址 + sysLog.setIp(IPUtils.getIpAddr(request)); + + //用户名 + String username = ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername(); + sysLog.setUsername(username); + + sysLog.setTime(time); + sysLog.setCreateDate(new Date()); + //保存系统日志 + sysLogService.save(sysLog); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/exception/RRException.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/exception/RRException.java new file mode 100644 index 000000000..5c27351bf --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/exception/RRException.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.exception; + +/** + * 自定义异常 + * + * @author Mark sunlightcs@gmail.com + */ +public class RRException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private String msg; + private int code = 500; + + public RRException(String msg) { + super(msg); + this.msg = msg; + } + + public RRException(String msg, Throwable e) { + super(msg, e); + this.msg = msg; + } + + public RRException(String msg, int code) { + super(msg); + this.msg = msg; + this.code = code; + } + + public RRException(String msg, int code, Throwable e) { + super(msg, e); + this.msg = msg; + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/exception/RRExceptionHandler.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/exception/RRExceptionHandler.java new file mode 100644 index 000000000..eb060a671 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/exception/RRExceptionHandler.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.exception; + +import io.renren.common.utils.R; +import org.apache.shiro.authz.AuthorizationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; + +/** + * 异常处理器 + * + * @author Mark sunlightcs@gmail.com + */ +@RestControllerAdvice +public class RRExceptionHandler { + private Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * 处理自定义异常 + */ + @ExceptionHandler(RRException.class) + public R handleRRException(RRException e){ + R r = new R(); + r.put("code", e.getCode()); + r.put("msg", e.getMessage()); + + return r; + } + + @ExceptionHandler(NoHandlerFoundException.class) + public R handlerNoFoundException(Exception e) { + logger.error(e.getMessage(), e); + return R.error(404, "路径不存在,请检查路径是否正确"); + } + + @ExceptionHandler(DuplicateKeyException.class) + public R handleDuplicateKeyException(DuplicateKeyException e){ + logger.error(e.getMessage(), e); + return R.error("数据库中已存在该记录"); + } + + @ExceptionHandler(AuthorizationException.class) + public R handleAuthorizationException(AuthorizationException e){ + logger.error(e.getMessage(), e); + return R.error("没有权限,请联系管理员授权"); + } + + @ExceptionHandler(Exception.class) + public R handleException(Exception e){ + logger.error(e.getMessage(), e); + return R.error(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/ConfigConstant.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/ConfigConstant.java new file mode 100644 index 000000000..32897dadb --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/ConfigConstant.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +/** + * 系统参数相关Key + * + * @author Mark sunlightcs@gmail.com + */ +public class ConfigConstant { + /** + * 云存储配置KEY + */ + public final static String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY"; +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/Constant.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/Constant.java new file mode 100644 index 000000000..da3d5bce5 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/Constant.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import io.renren.common.validator.group.AliyunGroup; +import io.renren.common.validator.group.QcloudGroup; +import io.renren.common.validator.group.QiniuGroup; + +import java.util.Optional; +import java.util.stream.Stream; + +/** + * 常量 + * + * @author Mark sunlightcs@gmail.com + */ +public class Constant { + /** + * 超级管理员ID + */ + public static final int SUPER_ADMIN = 1; + /** + * 当前页码 + */ + public static final String PAGE = "page"; + /** + * 每页显示记录数 + */ + public static final String LIMIT = "limit"; + /** + * 排序字段 + */ + public static final String ORDER_FIELD = "sidx"; + /** + * 排序方式 + */ + public static final String ORDER = "order"; + /** + * 升序 + */ + public static final String ASC = "asc"; + + /** + * 菜单类型 + * + * @author chenshun + * @email sunlightcs@gmail.com + * @date 2016年11月15日 下午1:24:29 + */ + public enum MenuType { + /** + * 目录 + */ + CATALOG(0), + /** + * 菜单 + */ + MENU(1), + /** + * 按钮 + */ + BUTTON(2); + + private int value; + + MenuType(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 定时任务状态 + * + * @author chenshun + * @email sunlightcs@gmail.com + * @date 2016年12月3日 上午12:07:22 + */ + public enum ScheduleStatus { + /** + * 正常 + */ + NORMAL(0), + /** + * 暂停 + */ + PAUSE(1); + + private int value; + + ScheduleStatus(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 云服务商 + */ + public enum CloudService { + /** + * 七牛云 + */ + QINIU(1, QiniuGroup.class), + /** + * 阿里云 + */ + ALIYUN(2, AliyunGroup.class), + /** + * 腾讯云 + */ + QCLOUD(3, QcloudGroup.class); + + private int value; + + private Class validatorGroupClass; + + CloudService(int value, Class validatorGroupClass) { + this.value = value; + this.validatorGroupClass = validatorGroupClass; + } + + public int getValue() { + return value; + } + + public Class getValidatorGroupClass() { + return this.validatorGroupClass; + } + + public static CloudService getByValue(Integer value) { + Optional first = Stream.of(CloudService.values()).filter(cs -> value.equals(cs.value)).findFirst(); + if (!first.isPresent()) { + throw new IllegalArgumentException("非法的枚举值:" + value); + } + return first.get(); + } + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/DateUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/DateUtils.java new file mode 100644 index 000000000..798f7ba17 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/DateUtils.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.apache.commons.lang.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 日期处理 + * + * @author Mark sunlightcs@gmail.com + */ +public class DateUtils { + /** 时间格式(yyyy-MM-dd) */ + public final static String DATE_PATTERN = "yyyy-MM-dd"; + /** 时间格式(yyyy-MM-dd HH:mm:ss) */ + public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + /** + * 日期格式化 日期格式为:yyyy-MM-dd + * @param date 日期 + * @return 返回yyyy-MM-dd格式日期 + */ + public static String format(Date date) { + return format(date, DATE_PATTERN); + } + + /** + * 日期格式化 日期格式为:yyyy-MM-dd + * @param date 日期 + * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN + * @return 返回yyyy-MM-dd格式日期 + */ + public static String format(Date date, String pattern) { + if(date != null){ + SimpleDateFormat df = new SimpleDateFormat(pattern); + return df.format(date); + } + return null; + } + + /** + * 字符串转换成日期 + * @param strDate 日期字符串 + * @param pattern 日期的格式,如:DateUtils.DATE_TIME_PATTERN + */ + public static Date stringToDate(String strDate, String pattern) { + if (StringUtils.isBlank(strDate)){ + return null; + } + + DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern); + return fmt.parseLocalDateTime(strDate).toDate(); + } + + /** + * 根据周数,获取开始日期、结束日期 + * @param week 周期 0本周,-1上周,-2上上周,1下周,2下下周 + * @return 返回date[0]开始日期、date[1]结束日期 + */ + public static Date[] getWeekStartAndEnd(int week) { + DateTime dateTime = new DateTime(); + LocalDate date = new LocalDate(dateTime.plusWeeks(week)); + + date = date.dayOfWeek().withMinimumValue(); + Date beginDate = date.toDate(); + Date endDate = date.plusDays(6).toDate(); + return new Date[]{beginDate, endDate}; + } + + /** + * 对日期的【秒】进行加/减 + * + * @param date 日期 + * @param seconds 秒数,负数为减 + * @return 加/减几秒后的日期 + */ + public static Date addDateSeconds(Date date, int seconds) { + DateTime dateTime = new DateTime(date); + return dateTime.plusSeconds(seconds).toDate(); + } + + /** + * 对日期的【分钟】进行加/减 + * + * @param date 日期 + * @param minutes 分钟数,负数为减 + * @return 加/减几分钟后的日期 + */ + public static Date addDateMinutes(Date date, int minutes) { + DateTime dateTime = new DateTime(date); + return dateTime.plusMinutes(minutes).toDate(); + } + + /** + * 对日期的【小时】进行加/减 + * + * @param date 日期 + * @param hours 小时数,负数为减 + * @return 加/减几小时后的日期 + */ + public static Date addDateHours(Date date, int hours) { + DateTime dateTime = new DateTime(date); + return dateTime.plusHours(hours).toDate(); + } + + /** + * 对日期的【天】进行加/减 + * + * @param date 日期 + * @param days 天数,负数为减 + * @return 加/减几天后的日期 + */ + public static Date addDateDays(Date date, int days) { + DateTime dateTime = new DateTime(date); + return dateTime.plusDays(days).toDate(); + } + + /** + * 对日期的【周】进行加/减 + * + * @param date 日期 + * @param weeks 周数,负数为减 + * @return 加/减几周后的日期 + */ + public static Date addDateWeeks(Date date, int weeks) { + DateTime dateTime = new DateTime(date); + return dateTime.plusWeeks(weeks).toDate(); + } + + /** + * 对日期的【月】进行加/减 + * + * @param date 日期 + * @param months 月数,负数为减 + * @return 加/减几月后的日期 + */ + public static Date addDateMonths(Date date, int months) { + DateTime dateTime = new DateTime(date); + return dateTime.plusMonths(months).toDate(); + } + + /** + * 对日期的【年】进行加/减 + * + * @param date 日期 + * @param years 年数,负数为减 + * @return 加/减几年后的日期 + */ + public static Date addDateYears(Date date, int years) { + DateTime dateTime = new DateTime(date); + return dateTime.plusYears(years).toDate(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/HttpContextUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/HttpContextUtils.java new file mode 100644 index 000000000..09aa2c70c --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/HttpContextUtils.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +public class HttpContextUtils { + + public static HttpServletRequest getHttpServletRequest() { + return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + } + + public static String getDomain(){ + HttpServletRequest request = getHttpServletRequest(); + StringBuffer url = request.getRequestURL(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString(); + } + + public static String getOrigin(){ + HttpServletRequest request = getHttpServletRequest(); + return request.getHeader("Origin"); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/IPUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/IPUtils.java new file mode 100644 index 000000000..2f20be657 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/IPUtils.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import com.alibaba.druid.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.HttpServletRequest; + +/** + * IP地址 + * + * @author Mark sunlightcs@gmail.com + */ +public class IPUtils { + private static Logger logger = LoggerFactory.getLogger(IPUtils.class); + + /** + * 获取IP地址 + * + * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址 + * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址 + */ + public static String getIpAddr(HttpServletRequest request) { + String ip = null; + try { + ip = request.getHeader("x-forwarded-for"); + if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } catch (Exception e) { + logger.error("IPUtils ERROR ", e); + } + +// //使用代理,则获取第一个IP地址 +// if(StringUtils.isEmpty(ip) && ip.length() > 15) { +// if(ip.indexOf(",") > 0) { +// ip = ip.substring(0, ip.indexOf(",")); +// } +// } + + return ip; + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/MapUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/MapUtils.java new file mode 100644 index 000000000..95b6fb3c4 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/MapUtils.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import java.util.HashMap; + + +/** + * Map工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class MapUtils extends HashMap { + + @Override + public MapUtils put(String key, Object value) { + super.put(key, value); + return this; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/PageUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/PageUtils.java new file mode 100644 index 000000000..360452dd7 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/PageUtils.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class PageUtils implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 总记录数 + */ + private int totalCount; + /** + * 每页记录数 + */ + private int pageSize; + /** + * 总页数 + */ + private int totalPage; + /** + * 当前页数 + */ + private int currPage; + /** + * 列表数据 + */ + private List list; + + /** + * 分页 + * @param list 列表数据 + * @param totalCount 总记录数 + * @param pageSize 每页记录数 + * @param currPage 当前页数 + */ + public PageUtils(List list, int totalCount, int pageSize, int currPage) { + this.list = list; + this.totalCount = totalCount; + this.pageSize = pageSize; + this.currPage = currPage; + this.totalPage = (int)Math.ceil((double)totalCount/pageSize); + } + + /** + * 分页 + */ + public PageUtils(IPage page) { + this.list = page.getRecords(); + this.totalCount = (int)page.getTotal(); + this.pageSize = (int)page.getSize(); + this.currPage = (int)page.getCurrent(); + this.totalPage = (int)page.getPages(); + } + + public int getTotalCount() { + return totalCount; + } + + public void setTotalCount(int totalCount) { + this.totalCount = totalCount; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getTotalPage() { + return totalPage; + } + + public void setTotalPage(int totalPage) { + this.totalPage = totalPage; + } + + public int getCurrPage() { + return currPage; + } + + public void setCurrPage(int currPage) { + this.currPage = currPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/Query.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/Query.java new file mode 100644 index 000000000..ff825a074 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/Query.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.renren.common.xss.SQLFilter; +import org.apache.commons.lang.StringUtils; + +import java.util.Map; + +/** + * 查询参数 + * + * @author Mark sunlightcs@gmail.com + */ +public class Query { + + public IPage getPage(Map params) { + return this.getPage(params, null, false); + } + + public IPage getPage(Map params, String defaultOrderField, boolean isAsc) { + //分页参数 + long curPage = 1; + long limit = 10; + + if(params.get(Constant.PAGE) != null){ + curPage = Long.parseLong((String)params.get(Constant.PAGE)); + } + if(params.get(Constant.LIMIT) != null){ + limit = Long.parseLong((String)params.get(Constant.LIMIT)); + } + + //分页对象 + Page page = new Page<>(curPage, limit); + + //分页参数 + params.put(Constant.PAGE, page); + + //排序字段 + //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) + String orderField = SQLFilter.sqlInject((String)params.get(Constant.ORDER_FIELD)); + String order = (String)params.get(Constant.ORDER); + + + //前端字段排序 + if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){ + if(Constant.ASC.equalsIgnoreCase(order)) { + return page.addOrder(OrderItem.asc(orderField)); + }else { + return page.addOrder(OrderItem.desc(orderField)); + } + } + + //没有排序字段,则不排序 + if(StringUtils.isBlank(defaultOrderField)){ + return page; + } + + //默认排序 + if(isAsc) { + page.addOrder(OrderItem.asc(defaultOrderField)); + }else { + page.addOrder(OrderItem.desc(defaultOrderField)); + } + + return page; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/R.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/R.java new file mode 100644 index 000000000..1da0da66e --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/R.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.apache.http.HttpStatus; + +import java.util.HashMap; +import java.util.Map; + +/** + * 返回数据 + * + * @author Mark sunlightcs@gmail.com + */ +public class R extends HashMap { + private static final long serialVersionUID = 1L; + + public R() { + put("code", 0); + put("msg", "success"); + } + + public static R error() { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员"); + } + + public static R error(String msg) { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); + } + + public static R error(int code, String msg) { + R r = new R(); + r.put("code", code); + r.put("msg", msg); + return r; + } + + public static R ok(String msg) { + R r = new R(); + r.put("msg", msg); + return r; + } + + public static R ok(Map map) { + R r = new R(); + r.putAll(map); + return r; + } + + public static R ok() { + return new R(); + } + + public R put(String key, Object value) { + super.put(key, value); + return this; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/RedisKeys.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/RedisKeys.java new file mode 100644 index 000000000..d033b05c8 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/RedisKeys.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +/** + * Redis所有Keys + * + * @author Mark sunlightcs@gmail.com + */ +public class RedisKeys { + + public static String getSysConfigKey(String key){ + return "sys:config:" + key; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/RedisUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/RedisUtils.java new file mode 100644 index 000000000..34bbb8fd8 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/RedisUtils.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import com.google.gson.Gson; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.*; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + +/** + * Redis工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class RedisUtils { + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private ValueOperations valueOperations; + @Autowired + private HashOperations hashOperations; + @Autowired + private ListOperations listOperations; + @Autowired + private SetOperations setOperations; + @Autowired + private ZSetOperations zSetOperations; + /** 默认过期时长,单位:秒 */ + public final static long DEFAULT_EXPIRE = 60 * 60 * 24; + /** 不设置过期时长 */ + public final static long NOT_EXPIRE = -1; + private final static Gson gson = new Gson(); + + public void set(String key, Object value, long expire){ + valueOperations.set(key, toJson(value)); + if(expire != NOT_EXPIRE){ + redisTemplate.expire(key, expire, TimeUnit.SECONDS); + } + } + + public void set(String key, Object value){ + set(key, value, DEFAULT_EXPIRE); + } + + public T get(String key, Class clazz, long expire) { + String value = valueOperations.get(key); + if(expire != NOT_EXPIRE){ + redisTemplate.expire(key, expire, TimeUnit.SECONDS); + } + return value == null ? null : fromJson(value, clazz); + } + + public T get(String key, Class clazz) { + return get(key, clazz, NOT_EXPIRE); + } + + public String get(String key, long expire) { + String value = valueOperations.get(key); + if(expire != NOT_EXPIRE){ + redisTemplate.expire(key, expire, TimeUnit.SECONDS); + } + return value; + } + + public String get(String key) { + return get(key, NOT_EXPIRE); + } + + public void delete(String key) { + redisTemplate.delete(key); + } + + /** + * Object转成JSON数据 + */ + private String toJson(Object object){ + if(object instanceof Integer || object instanceof Long || object instanceof Float || + object instanceof Double || object instanceof Boolean || object instanceof String){ + return String.valueOf(object); + } + return gson.toJson(object); + } + + /** + * JSON数据,转成Object + */ + private T fromJson(String json, Class clazz){ + return gson.fromJson(json, clazz); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/ShiroUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/ShiroUtils.java new file mode 100644 index 000000000..fdf0f14c3 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/ShiroUtils.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import io.renren.common.exception.RRException; +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.session.Session; +import org.apache.shiro.subject.Subject; + +/** + * Shiro工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ShiroUtils { + + public static Session getSession() { + return SecurityUtils.getSubject().getSession(); + } + + public static Subject getSubject() { + return SecurityUtils.getSubject(); + } + + public static SysUserEntity getUserEntity() { + return (SysUserEntity)SecurityUtils.getSubject().getPrincipal(); + } + + public static Long getUserId() { + return getUserEntity().getUserId(); + } + + public static void setSessionAttribute(Object key, Object value) { + getSession().setAttribute(key, value); + } + + public static Object getSessionAttribute(Object key) { + return getSession().getAttribute(key); + } + + public static boolean isLogin() { + return SecurityUtils.getSubject().getPrincipal() != null; + } + + public static String getKaptcha(String key) { + Object kaptcha = getSessionAttribute(key); + if(kaptcha == null){ + throw new RRException("验证码已失效"); + } + getSession().removeAttribute(key); + return kaptcha.toString(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/SpringContextUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/SpringContextUtils.java new file mode 100644 index 000000000..84e787c93 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/utils/SpringContextUtils.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * Spring Context 工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class SpringContextUtils implements ApplicationContextAware { + public static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException { + SpringContextUtils.applicationContext = applicationContext; + } + + public static Object getBean(String name) { + return applicationContext.getBean(name); + } + + public static T getBean(String name, Class requiredType) { + return applicationContext.getBean(name, requiredType); + } + + public static boolean containsBean(String name) { + return applicationContext.containsBean(name); + } + + public static boolean isSingleton(String name) { + return applicationContext.isSingleton(name); + } + + public static Class getType(String name) { + return applicationContext.getType(name); + } + +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/Assert.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/Assert.java new file mode 100644 index 000000000..614e9bc96 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/Assert.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator; + +import io.renren.common.exception.RRException; +import org.apache.commons.lang.StringUtils; + +/** + * 数据校验 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class Assert { + + public static void isBlank(String str, String message) { + if (StringUtils.isBlank(str)) { + throw new RRException(message); + } + } + + public static void isNull(Object object, String message) { + if (object == null) { + throw new RRException(message); + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/ValidatorUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/ValidatorUtils.java new file mode 100644 index 000000000..06cdb0a76 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/ValidatorUtils.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package io.renren.common.validator; + +import io.renren.common.exception.RRException; +import io.renren.common.utils.Constant; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import java.util.Set; + +/** + * hibernate-validator校验工具类 + * + * 参考文档:http://docs.jboss.org/hibernate/validator/5.4/reference/en-US/html_single/ + * + * @author Mark sunlightcs@gmail.com + */ +public class ValidatorUtils { + private static Validator validator; + + static { + validator = Validation.buildDefaultValidatorFactory().getValidator(); + } + + /** + * 校验对象 + * @param object 待校验对象 + * @param groups 待校验的组 + * @throws RRException 校验不通过,则报RRException异常 + */ + public static void validateEntity(Object object, Class... groups) + throws RRException { + Set> constraintViolations = validator.validate(object, groups); + if (!constraintViolations.isEmpty()) { + StringBuilder msg = new StringBuilder(); + for (ConstraintViolation constraint : constraintViolations) { + msg.append(constraint.getMessage()).append("
    "); + } + throw new RRException(msg.toString()); + } + } + + public static void validateEntity(Object object, Constant.CloudService type) { + validateEntity(object, type.getValidatorGroupClass()); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/AddGroup.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/AddGroup.java new file mode 100644 index 000000000..81e75ad33 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/AddGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 新增数据 Group + * + * @author Mark sunlightcs@gmail.com + */ +public interface AddGroup { +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/AliyunGroup.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/AliyunGroup.java new file mode 100644 index 000000000..f05a8ccd4 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/AliyunGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 阿里云 + * + * @author Mark sunlightcs@gmail.com + */ +public interface AliyunGroup { +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/Group.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/Group.java new file mode 100644 index 000000000..5004667fe --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/Group.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +import javax.validation.GroupSequence; + +/** + * 定义校验顺序,如果AddGroup组失败,则UpdateGroup组不会再校验 + * + * @author Mark sunlightcs@gmail.com + */ +@GroupSequence({AddGroup.class, UpdateGroup.class}) +public interface Group { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/QcloudGroup.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/QcloudGroup.java new file mode 100644 index 000000000..23ad4e9e9 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/QcloudGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 腾讯云 + * + * @author Mark sunlightcs@gmail.com + */ +public interface QcloudGroup { +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/QiniuGroup.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/QiniuGroup.java new file mode 100644 index 000000000..12970753f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/QiniuGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 七牛 + * + * @author Mark sunlightcs@gmail.com + */ +public interface QiniuGroup { +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/UpdateGroup.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/UpdateGroup.java new file mode 100644 index 000000000..a917c55de --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/validator/group/UpdateGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 更新数据 Group + * + * @author Mark sunlightcs@gmail.com + */ + +public interface UpdateGroup { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/HTMLFilter.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/HTMLFilter.java new file mode 100644 index 000000000..3b5de7387 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/HTMLFilter.java @@ -0,0 +1,530 @@ +package io.renren.common.xss; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * HTML filtering utility for protecting against XSS (Cross Site Scripting). + * + * This code is licensed LGPLv3 + * + * This code is a Java port of the original work in PHP by Cal Hendersen. + * http://code.iamcal.com/php/lib_filter/ + * + * The trickiest part of the translation was handling the differences in regex handling + * between PHP and Java. These resources were helpful in the process: + * + * http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html + * http://us2.php.net/manual/en/reference.pcre.pattern.modifiers.php + * http://www.regular-expressions.info/modifiers.html + * + * A note on naming conventions: instance variables are prefixed with a "v"; global + * constants are in all caps. + * + * Sample use: + * String input = ... + * String clean = new HTMLFilter().filter( input ); + * + * The class is not thread safe. Create a new instance if in doubt. + * + * If you find bugs or have suggestions on improvement (especially regarding + * performance), please contact us. The latest version of this + * source, and our contact details, can be found at http://xss-html-filter.sf.net + * + * @author Joseph O'Connell + * @author Cal Hendersen + * @author Michael Semb Wever + */ +public final class HTMLFilter { + + /** regex flag union representing /si modifiers in php **/ + private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL; + private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL); + private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI); + private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL); + private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI); + private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI); + private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI); + private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI); + private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI); + private static final Pattern P_ENTITY = Pattern.compile("&#(\\d+);?"); + private static final Pattern P_ENTITY_UNICODE = Pattern.compile("&#x([0-9a-f]+);?"); + private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?"); + private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))"); + private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL); + private static final Pattern P_END_ARROW = Pattern.compile("^>"); + private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)"); + private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)"); + private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)"); + private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)"); + private static final Pattern P_AMP = Pattern.compile("&"); + private static final Pattern P_QUOTE = Pattern.compile("<"); + private static final Pattern P_LEFT_ARROW = Pattern.compile("<"); + private static final Pattern P_RIGHT_ARROW = Pattern.compile(">"); + private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>"); + + // @xxx could grow large... maybe use sesat's ReferenceMap + private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap(); + private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap(); + + /** set of allowed html elements, along with allowed attributes for each element **/ + private final Map> vAllowed; + /** counts of open tags for each (allowable) html element **/ + private final Map vTagCounts = new HashMap(); + + /** html elements which must always be self-closing (e.g. "") **/ + private final String[] vSelfClosingTags; + /** html elements which must always have separate opening and closing tags (e.g. "") **/ + private final String[] vNeedClosingTags; + /** set of disallowed html elements **/ + private final String[] vDisallowed; + /** attributes which should be checked for valid protocols **/ + private final String[] vProtocolAtts; + /** allowed protocols **/ + private final String[] vAllowedProtocols; + /** tags which should be removed if they contain no content (e.g. "" or "") **/ + private final String[] vRemoveBlanks; + /** entities allowed within html markup **/ + private final String[] vAllowedEntities; + /** flag determining whether comments are allowed in input String. */ + private final boolean stripComment; + private final boolean encodeQuotes; + private boolean vDebug = false; + /** + * flag determining whether to try to make tags when presented with "unbalanced" + * angle brackets (e.g. "" becomes " text "). If set to false, + * unbalanced angle brackets will be html escaped. + */ + private final boolean alwaysMakeTags; + + /** Default constructor. + * + */ + public HTMLFilter() { + vAllowed = new HashMap<>(); + + final ArrayList a_atts = new ArrayList(); + a_atts.add("href"); + a_atts.add("target"); + vAllowed.put("a", a_atts); + + final ArrayList img_atts = new ArrayList(); + img_atts.add("src"); + img_atts.add("width"); + img_atts.add("height"); + img_atts.add("alt"); + vAllowed.put("img", img_atts); + + final ArrayList no_atts = new ArrayList(); + vAllowed.put("b", no_atts); + vAllowed.put("strong", no_atts); + vAllowed.put("i", no_atts); + vAllowed.put("em", no_atts); + + vSelfClosingTags = new String[]{"img"}; + vNeedClosingTags = new String[]{"a", "b", "strong", "i", "em"}; + vDisallowed = new String[]{}; + vAllowedProtocols = new String[]{"http", "mailto", "https"}; // no ftp. + vProtocolAtts = new String[]{"src", "href"}; + vRemoveBlanks = new String[]{"a", "b", "strong", "i", "em"}; + vAllowedEntities = new String[]{"amp", "gt", "lt", "quot"}; + stripComment = true; + encodeQuotes = true; + alwaysMakeTags = true; + } + + /** Set debug flag to true. Otherwise use default settings. See the default constructor. + * + * @param debug turn debug on with a true argument + */ + public HTMLFilter(final boolean debug) { + this(); + vDebug = debug; + + } + + /** Map-parameter configurable constructor. + * + * @param conf map containing configuration. keys match field names. + */ + public HTMLFilter(final Map conf) { + + assert conf.containsKey("vAllowed") : "configuration requires vAllowed"; + assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags"; + assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags"; + assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed"; + assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols"; + assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts"; + assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks"; + assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities"; + + vAllowed = Collections.unmodifiableMap((HashMap>) conf.get("vAllowed")); + vSelfClosingTags = (String[]) conf.get("vSelfClosingTags"); + vNeedClosingTags = (String[]) conf.get("vNeedClosingTags"); + vDisallowed = (String[]) conf.get("vDisallowed"); + vAllowedProtocols = (String[]) conf.get("vAllowedProtocols"); + vProtocolAtts = (String[]) conf.get("vProtocolAtts"); + vRemoveBlanks = (String[]) conf.get("vRemoveBlanks"); + vAllowedEntities = (String[]) conf.get("vAllowedEntities"); + stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true; + encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true; + alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true; + } + + private void reset() { + vTagCounts.clear(); + } + + private void debug(final String msg) { + if (vDebug) { + Logger.getAnonymousLogger().info(msg); + } + } + + //--------------------------------------------------------------- + // my versions of some PHP library functions + public static String chr(final int decimal) { + return String.valueOf((char) decimal); + } + + public static String htmlSpecialChars(final String s) { + String result = s; + result = regexReplace(P_AMP, "&", result); + result = regexReplace(P_QUOTE, """, result); + result = regexReplace(P_LEFT_ARROW, "<", result); + result = regexReplace(P_RIGHT_ARROW, ">", result); + return result; + } + + //--------------------------------------------------------------- + /** + * given a user submitted input String, filter out any invalid or restricted + * html. + * + * @param input text (i.e. submitted by a user) than may contain html + * @return "clean" version of input, with only valid, whitelisted html elements allowed + */ + public String filter(final String input) { + reset(); + String s = input; + + debug("************************************************"); + debug(" INPUT: " + input); + + s = escapeComments(s); + debug(" escapeComments: " + s); + + s = balanceHTML(s); + debug(" balanceHTML: " + s); + + s = checkTags(s); + debug(" checkTags: " + s); + + s = processRemoveBlanks(s); + debug("processRemoveBlanks: " + s); + + s = validateEntities(s); + debug(" validateEntites: " + s); + + debug("************************************************\n\n"); + return s; + } + + public boolean isAlwaysMakeTags(){ + return alwaysMakeTags; + } + + public boolean isStripComments(){ + return stripComment; + } + + private String escapeComments(final String s) { + final Matcher m = P_COMMENTS.matcher(s); + final StringBuffer buf = new StringBuffer(); + if (m.find()) { + final String match = m.group(1); //(.*?) + m.appendReplacement(buf, Matcher.quoteReplacement("")); + } + m.appendTail(buf); + + return buf.toString(); + } + + private String balanceHTML(String s) { + if (alwaysMakeTags) { + // + // try and form html + // + s = regexReplace(P_END_ARROW, "", s); + s = regexReplace(P_BODY_TO_END, "<$1>", s); + s = regexReplace(P_XML_CONTENT, "$1<$2", s); + + } else { + // + // escape stray brackets + // + s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s); + s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s); + + // + // the last regexp causes '<>' entities to appear + // (we need to do a lookahead assertion so that the last bracket can + // be used in the next pass of the regexp) + // + s = regexReplace(P_BOTH_ARROWS, "", s); + } + + return s; + } + + private String checkTags(String s) { + Matcher m = P_TAGS.matcher(s); + + final StringBuffer buf = new StringBuffer(); + while (m.find()) { + String replaceStr = m.group(1); + replaceStr = processTag(replaceStr); + m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr)); + } + m.appendTail(buf); + + s = buf.toString(); + + // these get tallied in processTag + // (remember to reset before subsequent calls to filter method) + for (String key : vTagCounts.keySet()) { + for (int ii = 0; ii < vTagCounts.get(key); ii++) { + s += ""; + } + } + + return s; + } + + private String processRemoveBlanks(final String s) { + String result = s; + for (String tag : vRemoveBlanks) { + if(!P_REMOVE_PAIR_BLANKS.containsKey(tag)){ + P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>")); + } + result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result); + if(!P_REMOVE_SELF_BLANKS.containsKey(tag)){ + P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>")); + } + result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result); + } + + return result; + } + + private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) { + Matcher m = regex_pattern.matcher(s); + return m.replaceAll(replacement); + } + + private String processTag(final String s) { + // ending tags + Matcher m = P_END_TAG.matcher(s); + if (m.find()) { + final String name = m.group(1).toLowerCase(); + if (allowed(name)) { + if (!inArray(name, vSelfClosingTags)) { + if (vTagCounts.containsKey(name)) { + vTagCounts.put(name, vTagCounts.get(name) - 1); + return ""; + } + } + } + } + + // starting tags + m = P_START_TAG.matcher(s); + if (m.find()) { + final String name = m.group(1).toLowerCase(); + final String body = m.group(2); + String ending = m.group(3); + + //debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" ); + if (allowed(name)) { + String params = ""; + + final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body); + final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body); + final List paramNames = new ArrayList(); + final List paramValues = new ArrayList(); + while (m2.find()) { + paramNames.add(m2.group(1)); //([a-z0-9]+) + paramValues.add(m2.group(3)); //(.*?) + } + while (m3.find()) { + paramNames.add(m3.group(1)); //([a-z0-9]+) + paramValues.add(m3.group(3)); //([^\"\\s']+) + } + + String paramName, paramValue; + for (int ii = 0; ii < paramNames.size(); ii++) { + paramName = paramNames.get(ii).toLowerCase(); + paramValue = paramValues.get(ii); + +// debug( "paramName='" + paramName + "'" ); +// debug( "paramValue='" + paramValue + "'" ); +// debug( "allowed? " + vAllowed.get( name ).contains( paramName ) ); + + if (allowedAttribute(name, paramName)) { + if (inArray(paramName, vProtocolAtts)) { + paramValue = processParamProtocol(paramValue); + } + params += " " + paramName + "=\"" + paramValue + "\""; + } + } + + if (inArray(name, vSelfClosingTags)) { + ending = " /"; + } + + if (inArray(name, vNeedClosingTags)) { + ending = ""; + } + + if (ending == null || ending.length() < 1) { + if (vTagCounts.containsKey(name)) { + vTagCounts.put(name, vTagCounts.get(name) + 1); + } else { + vTagCounts.put(name, 1); + } + } else { + ending = " /"; + } + return "<" + name + params + ending + ">"; + } else { + return ""; + } + } + + // comments + m = P_COMMENT.matcher(s); + if (!stripComment && m.find()) { + return "<" + m.group() + ">"; + } + + return ""; + } + + private String processParamProtocol(String s) { + s = decodeEntities(s); + final Matcher m = P_PROTOCOL.matcher(s); + if (m.find()) { + final String protocol = m.group(1); + if (!inArray(protocol, vAllowedProtocols)) { + // bad protocol, turn into local anchor link instead + s = "#" + s.substring(protocol.length() + 1, s.length()); + if (s.startsWith("#//")) { + s = "#" + s.substring(3, s.length()); + } + } + } + + return s; + } + + private String decodeEntities(String s) { + StringBuffer buf = new StringBuffer(); + + Matcher m = P_ENTITY.matcher(s); + while (m.find()) { + final String match = m.group(1); + final int decimal = Integer.decode(match).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + buf = new StringBuffer(); + m = P_ENTITY_UNICODE.matcher(s); + while (m.find()) { + final String match = m.group(1); + final int decimal = Integer.valueOf(match, 16).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + buf = new StringBuffer(); + m = P_ENCODE.matcher(s); + while (m.find()) { + final String match = m.group(1); + final int decimal = Integer.valueOf(match, 16).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + s = validateEntities(s); + return s; + } + + private String validateEntities(final String s) { + StringBuffer buf = new StringBuffer(); + + // validate entities throughout the string + Matcher m = P_VALID_ENTITIES.matcher(s); + while (m.find()) { + final String one = m.group(1); //([^&;]*) + final String two = m.group(2); //(?=(;|&|$)) + m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two))); + } + m.appendTail(buf); + + return encodeQuotes(buf.toString()); + } + + private String encodeQuotes(final String s){ + if(encodeQuotes){ + StringBuffer buf = new StringBuffer(); + Matcher m = P_VALID_QUOTES.matcher(s); + while (m.find()) { + final String one = m.group(1); //(>|^) + final String two = m.group(2); //([^<]+?) + final String three = m.group(3); //(<|$) + m.appendReplacement(buf, Matcher.quoteReplacement(one + regexReplace(P_QUOTE, """, two) + three)); + } + m.appendTail(buf); + return buf.toString(); + }else{ + return s; + } + } + + private String checkEntity(final String preamble, final String term) { + + return ";".equals(term) && isValidEntity(preamble) + ? '&' + preamble + : "&" + preamble; + } + + private boolean isValidEntity(final String entity) { + return inArray(entity, vAllowedEntities); + } + + private static boolean inArray(final String s, final String[] array) { + for (String item : array) { + if (item != null && item.equals(s)) { + return true; + } + } + return false; + } + + private boolean allowed(final String name) { + return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed); + } + + private boolean allowedAttribute(final String name, final String paramName) { + return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName)); + } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/SQLFilter.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/SQLFilter.java new file mode 100644 index 000000000..0675ddc34 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/SQLFilter.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import io.renren.common.exception.RRException; +import org.apache.commons.lang.StringUtils; + +/** + * SQL过滤 + * + * @author Mark sunlightcs@gmail.com + */ +public class SQLFilter { + + /** + * SQL注入过滤 + * @param str 待验证的字符串 + */ + public static String sqlInject(String str){ + if(StringUtils.isBlank(str)){ + return null; + } + //去掉'|"|;|\字符 + str = StringUtils.replace(str, "'", ""); + str = StringUtils.replace(str, "\"", ""); + str = StringUtils.replace(str, ";", ""); + str = StringUtils.replace(str, "\\", ""); + + //转换成小写 + str = str.toLowerCase(); + + //非法字符 + String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; + + //判断是否包含非法字符 + for(String keyword : keywords){ + if(str.indexOf(keyword) != -1){ + throw new RRException("包含非法字符"); + } + } + + return str; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/XssFilter.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/XssFilter.java new file mode 100644 index 000000000..f12921b14 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/XssFilter.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +/** + * XSS过滤 + * + * @author Mark sunlightcs@gmail.com + */ +public class XssFilter implements Filter { + + @Override + public void init(FilterConfig config) throws ServletException { + } + + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( + (HttpServletRequest) request); + chain.doFilter(xssRequest, response); + } + + @Override + public void destroy() { + } + +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/XssHttpServletRequestWrapper.java b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/XssHttpServletRequestWrapper.java new file mode 100644 index 000000000..75a0e4728 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/common/xss/XssHttpServletRequestWrapper.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * XSS过滤处理 + * + * @author Mark sunlightcs@gmail.com + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { + //没被包装过的HttpServletRequest(特殊场景,需要自己过滤) + HttpServletRequest orgRequest; + //html过滤 + private final static HTMLFilter htmlFilter = new HTMLFilter(); + + public XssHttpServletRequestWrapper(HttpServletRequest request) { + super(request); + orgRequest = request; + } + + @Override + public ServletInputStream getInputStream() throws IOException { + //非json类型,直接返回 + if(!MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(super.getHeader(HttpHeaders.CONTENT_TYPE))){ + return super.getInputStream(); + } + + //为空,直接返回 + String json = IOUtils.toString(super.getInputStream(), "utf-8"); + if (StringUtils.isBlank(json)) { + return super.getInputStream(); + } + + //xss过滤 + json = xssEncode(json); + final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); + return new ServletInputStream() { + @Override + public boolean isFinished() { + return true; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() throws IOException { + return bis.read(); + } + }; + } + + @Override + public String getParameter(String name) { + String value = super.getParameter(xssEncode(name)); + if (StringUtils.isNotBlank(value)) { + value = xssEncode(value); + } + return value; + } + + @Override + public String[] getParameterValues(String name) { + String[] parameters = super.getParameterValues(name); + if (parameters == null || parameters.length == 0) { + return null; + } + + for (int i = 0; i < parameters.length; i++) { + parameters[i] = xssEncode(parameters[i]); + } + return parameters; + } + + @Override + public Map getParameterMap() { + Map map = new LinkedHashMap<>(); + Map parameters = super.getParameterMap(); + for (String key : parameters.keySet()) { + String[] values = parameters.get(key); + for (int i = 0; i < values.length; i++) { + values[i] = xssEncode(values[i]); + } + map.put(key, values); + } + return map; + } + + @Override + public String getHeader(String name) { + String value = super.getHeader(xssEncode(name)); + if (StringUtils.isNotBlank(value)) { + value = xssEncode(value); + } + return value; + } + + private String xssEncode(String input) { + return htmlFilter.filter(input); + } + + /** + * 获取最原始的request + */ + public HttpServletRequest getOrgRequest() { + return orgRequest; + } + + /** + * 获取最原始的request + */ + public static HttpServletRequest getOrgRequest(HttpServletRequest request) { + if (request instanceof XssHttpServletRequestWrapper) { + return ((XssHttpServletRequestWrapper) request).getOrgRequest(); + } + + return request; + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/CorsConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/CorsConfig.java new file mode 100644 index 000000000..9d9c4e59d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/CorsConfig.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +//@Configuration +public class CorsConfig implements WebMvcConfigurer { + +// @Override +// public void addCorsMappings(CorsRegistry registry) { +// registry.addMapping("/**") +//// .allowedOriginPatterns("*") +// .allowCredentials(true) +// .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") +// .maxAge(3600); +// } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/FilterConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/FilterConfig.java new file mode 100644 index 000000000..a6687f211 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/FilterConfig.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import io.renren.common.xss.XssFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.filter.DelegatingFilterProxy; + +import javax.servlet.DispatcherType; + +/** + * Filter配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class FilterConfig { + + @Bean + public FilterRegistrationBean shiroFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new DelegatingFilterProxy("shiroFilter")); + //该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理 + registration.addInitParameter("targetFilterLifecycle", "true"); + registration.setEnabled(true); + registration.setOrder(Integer.MAX_VALUE - 1); + registration.addUrlPatterns("/*"); + return registration; + } + + @Bean + public FilterRegistrationBean xssFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns("/*"); + registration.setName("xssFilter"); + registration.setOrder(Integer.MAX_VALUE); + return registration; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/KaptchaConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/KaptchaConfig.java new file mode 100644 index 000000000..d22375b98 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/KaptchaConfig.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import com.google.code.kaptcha.impl.DefaultKaptcha; +import com.google.code.kaptcha.util.Config; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Properties; + + +/** + * 生成验证码配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class KaptchaConfig { + + @Bean + public DefaultKaptcha producer() { + Properties properties = new Properties(); + properties.put("kaptcha.border", "no"); + properties.put("kaptcha.textproducer.font.color", "black"); + properties.put("kaptcha.textproducer.char.space", "5"); + properties.put("kaptcha.textproducer.font.names", "Arial,Courier,cmr10,宋体,楷体,微软雅黑"); + Config config = new Config(properties); + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + defaultKaptcha.setConfig(config); + return defaultKaptcha; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/MybatisPlusConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/MybatisPlusConfig.java new file mode 100644 index 000000000..94001abf9 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/MybatisPlusConfig.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * mybatis-plus配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class MybatisPlusConfig { + + /** + * 分页插件 + */ + @Bean + public MybatisPlusInterceptor paginationInterceptor() { + return new MybatisPlusInterceptor(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/RedisConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/RedisConfig.java new file mode 100644 index 000000000..97d033b98 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/RedisConfig.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * Redis配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class RedisConfig { + @Autowired + private RedisConnectionFactory factory; + + @Bean + public RedisTemplate redisTemplate() { + RedisTemplate redisTemplate = new RedisTemplate<>(); + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashValueSerializer(new StringRedisSerializer()); + redisTemplate.setValueSerializer(new StringRedisSerializer()); + redisTemplate.setConnectionFactory(factory); + return redisTemplate; + } + + @Bean + public HashOperations hashOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForHash(); + } + + @Bean + public ValueOperations valueOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForValue(); + } + + @Bean + public ListOperations listOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForList(); + } + + @Bean + public SetOperations setOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForSet(); + } + + @Bean + public ZSetOperations zSetOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForZSet(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/ShiroConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/ShiroConfig.java new file mode 100644 index 000000000..0925246f0 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/ShiroConfig.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import io.renren.modules.sys.oauth2.OAuth2Filter; +import io.renren.modules.sys.oauth2.OAuth2Realm; +import org.apache.shiro.mgt.SecurityManager; +import org.apache.shiro.spring.LifecycleBeanPostProcessor; +import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; +import org.apache.shiro.spring.web.ShiroFilterFactoryBean; +import org.apache.shiro.web.mgt.DefaultWebSecurityManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.Filter; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Shiro配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class ShiroConfig { + + @Bean("securityManager") + public SecurityManager securityManager(OAuth2Realm oAuth2Realm) { + DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); + securityManager.setRealm(oAuth2Realm); + securityManager.setRememberMeManager(null); + return securityManager; + } + + @Bean("shiroFilter") + public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) { + ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); + shiroFilter.setSecurityManager(securityManager); + + //oauth过滤 + Map filters = new HashMap<>(); + filters.put("oauth2", new OAuth2Filter()); + shiroFilter.setFilters(filters); + + Map filterMap = new LinkedHashMap<>(); + filterMap.put("/webjars/**", "anon"); + filterMap.put("/druid/**", "anon"); + filterMap.put("/app/**", "anon"); + filterMap.put("/sys/login", "anon"); + filterMap.put("/swagger/**", "anon"); + filterMap.put("/v2/api-docs", "anon"); + filterMap.put("/swagger-ui.html", "anon"); + filterMap.put("/swagger-resources/**", "anon"); + filterMap.put("/captcha.jpg", "anon"); + filterMap.put("/aaa.txt", "anon"); + filterMap.put("/**", "oauth2"); + shiroFilter.setFilterChainDefinitionMap(filterMap); + + return shiroFilter; + } + + @Bean("lifecycleBeanPostProcessor") + public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() { + return new LifecycleBeanPostProcessor(); + } + + @Bean + public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) { + AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor(); + advisor.setSecurityManager(securityManager); + return advisor; + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/config/SwaggerConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/config/SwaggerConfig.java new file mode 100644 index 000000000..211b6b49f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/config/SwaggerConfig.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import io.swagger.annotations.ApiOperation; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig implements WebMvcConfigurer { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,才生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + //包下的类,才生成接口文档 + //.apis(RequestHandlerSelectors.basePackage("io.renren.controller")) + .paths(PathSelectors.any()) + .build() + .securitySchemes(security()); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("人人开源") + .description("renren-fast文档") + .termsOfServiceUrl("https://www.renren.io") + .version("3.0.0") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey("token", "token", "header") + ); + } + +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/annotation/DataSource.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/annotation/DataSource.java new file mode 100644 index 000000000..1dd140a11 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/annotation/DataSource.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.annotation; + +import java.lang.annotation.*; + +/** + * 多数据源注解 + * + * @author Mark sunlightcs@gmail.com + */ +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface DataSource { + String value() default ""; +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/aspect/DataSourceAspect.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/aspect/DataSourceAspect.java new file mode 100644 index 000000000..3ee6c1fc3 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/aspect/DataSourceAspect.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.aspect; + + +import io.renren.datasource.annotation.DataSource; +import io.renren.datasource.config.DynamicContextHolder; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import java.lang.reflect.Method; + +/** + * 多数据源,切面处理类 + * + * @author Mark sunlightcs@gmail.com + */ +@Aspect +@Component +@Order(Ordered.HIGHEST_PRECEDENCE) +public class DataSourceAspect { + protected Logger logger = LoggerFactory.getLogger(getClass()); + + @Pointcut("@annotation(io.renren.datasource.annotation.DataSource) " + + "|| @within(io.renren.datasource.annotation.DataSource)") + public void dataSourcePointCut() { + + } + + @Around("dataSourcePointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable { + MethodSignature signature = (MethodSignature) point.getSignature(); + Class targetClass = point.getTarget().getClass(); + Method method = signature.getMethod(); + + DataSource targetDataSource = (DataSource)targetClass.getAnnotation(DataSource.class); + DataSource methodDataSource = method.getAnnotation(DataSource.class); + if(targetDataSource != null || methodDataSource != null){ + String value; + if(methodDataSource != null){ + value = methodDataSource.value(); + }else { + value = targetDataSource.value(); + } + + DynamicContextHolder.push(value); + logger.debug("set datasource is {}", value); + } + + try { + return point.proceed(); + } finally { + DynamicContextHolder.poll(); + logger.debug("clean datasource"); + } + } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicContextHolder.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicContextHolder.java new file mode 100644 index 000000000..d00c5d090 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicContextHolder.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.config; + +import java.util.ArrayDeque; +import java.util.Deque; + +/** + * 多数据源上下文 + * + * @author Mark sunlightcs@gmail.com + */ +public class DynamicContextHolder { + @SuppressWarnings("unchecked") + private static final ThreadLocal> CONTEXT_HOLDER = new ThreadLocal() { + @Override + protected Object initialValue() { + return new ArrayDeque(); + } + }; + + /** + * 获得当前线程数据源 + * + * @return 数据源名称 + */ + public static String peek() { + return CONTEXT_HOLDER.get().peek(); + } + + /** + * 设置当前线程数据源 + * + * @param dataSource 数据源名称 + */ + public static void push(String dataSource) { + CONTEXT_HOLDER.get().push(dataSource); + } + + /** + * 清空当前线程数据源 + */ + public static void poll() { + Deque deque = CONTEXT_HOLDER.get(); + deque.poll(); + if (deque.isEmpty()) { + CONTEXT_HOLDER.remove(); + } + } + +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSource.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSource.java new file mode 100644 index 000000000..77924781d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSource.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.config; + +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +/** + * 多数据源 + * + * @author Mark sunlightcs@gmail.com + */ +public class DynamicDataSource extends AbstractRoutingDataSource { + + @Override + protected Object determineCurrentLookupKey() { + return DynamicContextHolder.peek(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSourceConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSourceConfig.java new file mode 100644 index 000000000..a0c8ff254 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSourceConfig.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.config; + +import com.alibaba.druid.pool.DruidDataSource; +import io.renren.datasource.properties.DataSourceProperties; +import io.renren.datasource.properties.DynamicDataSourceProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.HashMap; +import java.util.Map; + +/** + * 配置多数据源 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +@EnableConfigurationProperties(DynamicDataSourceProperties.class) +public class DynamicDataSourceConfig { + @Autowired + private DynamicDataSourceProperties properties; + + @Bean + @ConfigurationProperties(prefix = "spring.datasource.druid") + public DataSourceProperties dataSourceProperties() { + return new DataSourceProperties(); + } + + @Bean + public DynamicDataSource dynamicDataSource(DataSourceProperties dataSourceProperties) { + DynamicDataSource dynamicDataSource = new DynamicDataSource(); + dynamicDataSource.setTargetDataSources(getDynamicDataSource()); + + //默认数据源 + DruidDataSource defaultDataSource = DynamicDataSourceFactory.buildDruidDataSource(dataSourceProperties); + dynamicDataSource.setDefaultTargetDataSource(defaultDataSource); + + return dynamicDataSource; + } + + private Map getDynamicDataSource(){ + Map dataSourcePropertiesMap = properties.getDatasource(); + Map targetDataSources = new HashMap<>(dataSourcePropertiesMap.size()); + dataSourcePropertiesMap.forEach((k, v) -> { + DruidDataSource druidDataSource = DynamicDataSourceFactory.buildDruidDataSource(v); + targetDataSources.put(k, druidDataSource); + }); + + return targetDataSources; + } + +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSourceFactory.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSourceFactory.java new file mode 100644 index 000000000..4a688e1c2 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/config/DynamicDataSourceFactory.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.config; + +import com.alibaba.druid.pool.DruidDataSource; +import io.renren.datasource.properties.DataSourceProperties; + +import java.sql.SQLException; + +/** + * DruidDataSource + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DynamicDataSourceFactory { + + public static DruidDataSource buildDruidDataSource(DataSourceProperties properties) { + DruidDataSource druidDataSource = new DruidDataSource(); + druidDataSource.setDriverClassName(properties.getDriverClassName()); + druidDataSource.setUrl(properties.getUrl()); + druidDataSource.setUsername(properties.getUsername()); + druidDataSource.setPassword(properties.getPassword()); + + druidDataSource.setInitialSize(properties.getInitialSize()); + druidDataSource.setMaxActive(properties.getMaxActive()); + druidDataSource.setMinIdle(properties.getMinIdle()); + druidDataSource.setMaxWait(properties.getMaxWait()); + druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis()); + druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis()); + druidDataSource.setMaxEvictableIdleTimeMillis(properties.getMaxEvictableIdleTimeMillis()); + druidDataSource.setValidationQuery(properties.getValidationQuery()); + druidDataSource.setValidationQueryTimeout(properties.getValidationQueryTimeout()); + druidDataSource.setTestOnBorrow(properties.isTestOnBorrow()); + druidDataSource.setTestOnReturn(properties.isTestOnReturn()); + druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements()); + druidDataSource.setMaxOpenPreparedStatements(properties.getMaxOpenPreparedStatements()); + druidDataSource.setSharePreparedStatements(properties.isSharePreparedStatements()); + + try { + druidDataSource.setFilters(properties.getFilters()); + druidDataSource.init(); + } catch (SQLException e) { + e.printStackTrace(); + } + return druidDataSource; + } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/properties/DataSourceProperties.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/properties/DataSourceProperties.java new file mode 100644 index 000000000..6ee7ec5fa --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/properties/DataSourceProperties.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.properties; + +/** + * 多数据源属性 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DataSourceProperties { + private String driverClassName; + private String url; + private String username; + private String password; + + /** + * Druid默认参数 + */ + private int initialSize = 2; + private int maxActive = 10; + private int minIdle = -1; + private long maxWait = 60 * 1000L; + private long timeBetweenEvictionRunsMillis = 60 * 1000L; + private long minEvictableIdleTimeMillis = 1000L * 60L * 30L; + private long maxEvictableIdleTimeMillis = 1000L * 60L * 60L * 7; + private String validationQuery = "select 1"; + private int validationQueryTimeout = -1; + private boolean testOnBorrow = false; + private boolean testOnReturn = false; + private boolean testWhileIdle = true; + private boolean poolPreparedStatements = false; + private int maxOpenPreparedStatements = -1; + private boolean sharePreparedStatements = false; + private String filters = "stat,wall"; + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getInitialSize() { + return initialSize; + } + + public void setInitialSize(int initialSize) { + this.initialSize = initialSize; + } + + public int getMaxActive() { + return maxActive; + } + + public void setMaxActive(int maxActive) { + this.maxActive = maxActive; + } + + public int getMinIdle() { + return minIdle; + } + + public void setMinIdle(int minIdle) { + this.minIdle = minIdle; + } + + public long getMaxWait() { + return maxWait; + } + + public void setMaxWait(long maxWait) { + this.maxWait = maxWait; + } + + public long getTimeBetweenEvictionRunsMillis() { + return timeBetweenEvictionRunsMillis; + } + + public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { + this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; + } + + public long getMinEvictableIdleTimeMillis() { + return minEvictableIdleTimeMillis; + } + + public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) { + this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; + } + + public long getMaxEvictableIdleTimeMillis() { + return maxEvictableIdleTimeMillis; + } + + public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) { + this.maxEvictableIdleTimeMillis = maxEvictableIdleTimeMillis; + } + + public String getValidationQuery() { + return validationQuery; + } + + public void setValidationQuery(String validationQuery) { + this.validationQuery = validationQuery; + } + + public int getValidationQueryTimeout() { + return validationQueryTimeout; + } + + public void setValidationQueryTimeout(int validationQueryTimeout) { + this.validationQueryTimeout = validationQueryTimeout; + } + + public boolean isTestOnBorrow() { + return testOnBorrow; + } + + public void setTestOnBorrow(boolean testOnBorrow) { + this.testOnBorrow = testOnBorrow; + } + + public boolean isTestOnReturn() { + return testOnReturn; + } + + public void setTestOnReturn(boolean testOnReturn) { + this.testOnReturn = testOnReturn; + } + + public boolean isTestWhileIdle() { + return testWhileIdle; + } + + public void setTestWhileIdle(boolean testWhileIdle) { + this.testWhileIdle = testWhileIdle; + } + + public boolean isPoolPreparedStatements() { + return poolPreparedStatements; + } + + public void setPoolPreparedStatements(boolean poolPreparedStatements) { + this.poolPreparedStatements = poolPreparedStatements; + } + + public int getMaxOpenPreparedStatements() { + return maxOpenPreparedStatements; + } + + public void setMaxOpenPreparedStatements(int maxOpenPreparedStatements) { + this.maxOpenPreparedStatements = maxOpenPreparedStatements; + } + + public boolean isSharePreparedStatements() { + return sharePreparedStatements; + } + + public void setSharePreparedStatements(boolean sharePreparedStatements) { + this.sharePreparedStatements = sharePreparedStatements; + } + + public String getFilters() { + return filters; + } + + public void setFilters(String filters) { + this.filters = filters; + } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/properties/DynamicDataSourceProperties.java b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/properties/DynamicDataSourceProperties.java new file mode 100644 index 000000000..5759e7b33 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/datasource/properties/DynamicDataSourceProperties.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.datasource.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * 多数据源属性 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@ConfigurationProperties(prefix = "dynamic") +public class DynamicDataSourceProperties { + private Map datasource = new LinkedHashMap<>(); + + public Map getDatasource() { + return datasource; + } + + public void setDatasource(Map datasource) { + this.datasource = datasource; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/annotation/Login.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/annotation/Login.java new file mode 100644 index 000000000..76ec13104 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/annotation/Login.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.annotation; + +import java.lang.annotation.*; + +/** + * app登录效验 + * + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Login { +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/annotation/LoginUser.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/annotation/LoginUser.java new file mode 100644 index 000000000..c7b29da5f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/annotation/LoginUser.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 登录用户信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +public @interface LoginUser { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/config/WebMvcConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/config/WebMvcConfig.java new file mode 100644 index 000000000..c2327a2fe --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/config/WebMvcConfig.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.config; + +import io.renren.modules.app.interceptor.AuthorizationInterceptor; +import io.renren.modules.app.resolver.LoginUserHandlerMethodArgumentResolver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; + +/** + * MVC配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + @Autowired + private AuthorizationInterceptor authorizationInterceptor; + @Autowired + private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authorizationInterceptor).addPathPatterns("/app/**"); + } + + @Override + public void addArgumentResolvers(List argumentResolvers) { + argumentResolvers.add(loginUserHandlerMethodArgumentResolver); + } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppLoginController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppLoginController.java new file mode 100644 index 000000000..983402107 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppLoginController.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.controller; + + +import io.renren.common.utils.R; +import io.renren.common.validator.ValidatorUtils; +import io.renren.modules.app.form.LoginForm; +import io.renren.modules.app.service.UserService; +import io.renren.modules.app.utils.JwtUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * APP登录授权 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/app") +@Api("APP登录接口") +public class AppLoginController { + @Autowired + private UserService userService; + @Autowired + private JwtUtils jwtUtils; + + /** + * 登录 + */ + @PostMapping("login") + @ApiOperation("登录") + public R login(@RequestBody LoginForm form){ + //表单校验 + ValidatorUtils.validateEntity(form); + + //用户登录 + long userId = userService.login(form); + + //生成token + String token = jwtUtils.generateToken(userId); + + Map map = new HashMap<>(); + map.put("token", token); + map.put("expire", jwtUtils.getExpire()); + + return R.ok(map); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppRegisterController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppRegisterController.java new file mode 100644 index 000000000..89b38af39 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppRegisterController.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.controller; + + +import io.renren.common.utils.R; +import io.renren.common.validator.ValidatorUtils; +import io.renren.modules.app.entity.UserEntity; +import io.renren.modules.app.form.RegisterForm; +import io.renren.modules.app.service.UserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * 注册 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/app") +@Api("APP注册接口") +public class AppRegisterController { + @Autowired + private UserService userService; + + @PostMapping("register") + @ApiOperation("注册") + public R register(@RequestBody RegisterForm form){ + //表单校验 + ValidatorUtils.validateEntity(form); + + UserEntity user = new UserEntity(); + user.setMobile(form.getMobile()); + user.setUsername(form.getMobile()); + user.setPassword(DigestUtils.sha256Hex(form.getPassword())); + user.setCreateTime(new Date()); + userService.save(user); + + return R.ok(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppTestController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppTestController.java new file mode 100644 index 000000000..196519905 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/controller/AppTestController.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.controller; + + +import io.renren.common.utils.R; +import io.renren.modules.app.annotation.Login; +import io.renren.modules.app.annotation.LoginUser; +import io.renren.modules.app.entity.UserEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * APP测试接口 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/app") +@Api("APP测试接口") +public class AppTestController { + + @Login + @GetMapping("userInfo") + @ApiOperation("获取用户信息") + public R userInfo(@LoginUser UserEntity user){ + return R.ok().put("user", user); + } + + @Login + @GetMapping("userId") + @ApiOperation("获取用户ID") + public R userInfo(@RequestAttribute("userId") Integer userId){ + return R.ok().put("userId", userId); + } + + @GetMapping("notToken") + @ApiOperation("忽略Token验证测试") + public R notToken(){ + return R.ok().put("msg", "无需token也能访问。。。"); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/dao/UserDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/dao/UserDao.java new file mode 100644 index 000000000..cb70950c7 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/dao/UserDao.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.app.entity.UserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface UserDao extends BaseMapper { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/entity/UserEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/entity/UserEntity.java new file mode 100644 index 000000000..a66847854 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/entity/UserEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("tb_user") +public class UserEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @TableId + private Long userId; + /** + * 用户名 + */ + private String username; + /** + * 手机号 + */ + private String mobile; + /** + * 密码 + */ + private String password; + /** + * 创建时间 + */ + private Date createTime; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/form/LoginForm.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/form/LoginForm.java new file mode 100644 index 000000000..f57290b53 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/form/LoginForm.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.form; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 登录表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "登录表单") +public class LoginForm { + @ApiModelProperty(value = "手机号") + @NotBlank(message="手机号不能为空") + private String mobile; + + @ApiModelProperty(value = "密码") + @NotBlank(message="密码不能为空") + private String password; + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/form/RegisterForm.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/form/RegisterForm.java new file mode 100644 index 000000000..0e2f29106 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/form/RegisterForm.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.form; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 注册表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "注册表单") +public class RegisterForm { + @ApiModelProperty(value = "手机号") + @NotBlank(message="手机号不能为空") + private String mobile; + + @ApiModelProperty(value = "密码") + @NotBlank(message="密码不能为空") + private String password; + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/interceptor/AuthorizationInterceptor.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/interceptor/AuthorizationInterceptor.java new file mode 100644 index 000000000..f7d35de5a --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/interceptor/AuthorizationInterceptor.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.interceptor; + + +import io.jsonwebtoken.Claims; +import io.renren.common.exception.RRException; +import io.renren.modules.app.utils.JwtUtils; +import io.renren.modules.app.annotation.Login; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * 权限(Token)验证 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class AuthorizationInterceptor extends HandlerInterceptorAdapter { + @Autowired + private JwtUtils jwtUtils; + + public static final String USER_KEY = "userId"; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + Login annotation; + if(handler instanceof HandlerMethod) { + annotation = ((HandlerMethod) handler).getMethodAnnotation(Login.class); + }else{ + return true; + } + + if(annotation == null){ + return true; + } + + //获取用户凭证 + String token = request.getHeader(jwtUtils.getHeader()); + if(StringUtils.isBlank(token)){ + token = request.getParameter(jwtUtils.getHeader()); + } + + //凭证为空 + if(StringUtils.isBlank(token)){ + throw new RRException(jwtUtils.getHeader() + "不能为空", HttpStatus.UNAUTHORIZED.value()); + } + + Claims claims = jwtUtils.getClaimByToken(token); + if(claims == null || jwtUtils.isTokenExpired(claims.getExpiration())){ + throw new RRException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value()); + } + + //设置userId到request里,后续根据userId,获取用户信息 + request.setAttribute(USER_KEY, Long.parseLong(claims.getSubject())); + + return true; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/resolver/LoginUserHandlerMethodArgumentResolver.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/resolver/LoginUserHandlerMethodArgumentResolver.java new file mode 100644 index 000000000..5597179c5 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/resolver/LoginUserHandlerMethodArgumentResolver.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.resolver; + +import io.renren.modules.app.annotation.LoginUser; +import io.renren.modules.app.entity.UserEntity; +import io.renren.modules.app.interceptor.AuthorizationInterceptor; +import io.renren.modules.app.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.method.support.ModelAndViewContainer; + +/** + * 有@LoginUser注解的方法参数,注入当前登录用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { + @Autowired + private UserService userService; + + @Override + public boolean supportsParameter(MethodParameter parameter) { + return parameter.getParameterType().isAssignableFrom(UserEntity.class) && parameter.hasParameterAnnotation(LoginUser.class); + } + + @Override + public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer container, + NativeWebRequest request, WebDataBinderFactory factory) throws Exception { + //获取用户ID + Object object = request.getAttribute(AuthorizationInterceptor.USER_KEY, RequestAttributes.SCOPE_REQUEST); + if(object == null){ + return null; + } + + //获取用户信息 + UserEntity user = userService.getById((Long)object); + + return user; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/service/UserService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/service/UserService.java new file mode 100644 index 000000000..b111552ab --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/service/UserService.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.modules.app.entity.UserEntity; +import io.renren.modules.app.form.LoginForm; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +public interface UserService extends IService { + + UserEntity queryByMobile(String mobile); + + /** + * 用户登录 + * @param form 登录表单 + * @return 返回用户ID + */ + long login(LoginForm form); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/service/impl/UserServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/service/impl/UserServiceImpl.java new file mode 100644 index 000000000..c6b245155 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/service/impl/UserServiceImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.exception.RRException; +import io.renren.common.validator.Assert; +import io.renren.modules.app.dao.UserDao; +import io.renren.modules.app.entity.UserEntity; +import io.renren.modules.app.form.LoginForm; +import io.renren.modules.app.service.UserService; +import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.stereotype.Service; + + +@Service("userService") +public class UserServiceImpl extends ServiceImpl implements UserService { + + @Override + public UserEntity queryByMobile(String mobile) { + return baseMapper.selectOne(new QueryWrapper().eq("mobile", mobile)); + } + + @Override + public long login(LoginForm form) { + UserEntity user = queryByMobile(form.getMobile()); + Assert.isNull(user, "手机号或密码错误"); + + //密码错误 + if(!user.getPassword().equals(DigestUtils.sha256Hex(form.getPassword()))){ + throw new RRException("手机号或密码错误"); + } + + return user.getUserId(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/utils/JwtUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/utils/JwtUtils.java new file mode 100644 index 000000000..05ec08827 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/app/utils/JwtUtils.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.app.utils; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * jwt工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@ConfigurationProperties(prefix = "renren.jwt") +@Component +public class JwtUtils { + private Logger logger = LoggerFactory.getLogger(getClass()); + + private String secret; + private long expire; + private String header; + + /** + * 生成jwt token + */ + public String generateToken(long userId) { + Date nowDate = new Date(); + //过期时间 + Date expireDate = new Date(nowDate.getTime() + expire * 1000); + + return Jwts.builder() + .setHeaderParam("typ", "JWT") + .setSubject(userId+"") + .setIssuedAt(nowDate) + .setExpiration(expireDate) + .signWith(SignatureAlgorithm.HS512, secret) + .compact(); + } + + public Claims getClaimByToken(String token) { + try { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + }catch (Exception e){ + logger.debug("validate is token error ", e); + return null; + } + } + + /** + * token是否过期 + * @return true:过期 + */ + public boolean isTokenExpired(Date expiration) { + return expiration.before(new Date()); + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public long getExpire() { + return expire; + } + + public void setExpire(long expire) { + this.expire = expire; + } + + public String getHeader() { + return header; + } + + public void setHeader(String header) { + this.header = header; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/config/ScheduleConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/config/ScheduleConfig.java new file mode 100644 index 000000000..ab12541b2 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/config/ScheduleConfig.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; + +import javax.sql.DataSource; +import java.util.Properties; + +/** + * 定时任务配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class ScheduleConfig { + + @Bean + public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) { + SchedulerFactoryBean factory = new SchedulerFactoryBean(); + factory.setDataSource(dataSource); + + //quartz参数 + Properties prop = new Properties(); + prop.put("org.quartz.scheduler.instanceName", "RenrenScheduler"); + prop.put("org.quartz.scheduler.instanceId", "AUTO"); + //线程池配置 + prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); + prop.put("org.quartz.threadPool.threadCount", "20"); + prop.put("org.quartz.threadPool.threadPriority", "5"); + //JobStore配置 + prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore"); + //集群配置 + prop.put("org.quartz.jobStore.isClustered", "true"); + prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); + prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); + + prop.put("org.quartz.jobStore.misfireThreshold", "12000"); + prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); + prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); + + //PostgreSQL数据库,需要打开此注释 + //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate"); + + factory.setQuartzProperties(prop); + + factory.setSchedulerName("RenrenScheduler"); + //延时启动 + factory.setStartupDelay(30); + factory.setApplicationContextSchedulerContextKey("applicationContextKey"); + //可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 + factory.setOverwriteExistingJobs(true); + //设置自动启动,默认为true + factory.setAutoStartup(true); + + return factory; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/controller/ScheduleJobController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/controller/ScheduleJobController.java new file mode 100644 index 000000000..4c3edaf15 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/controller/ScheduleJobController.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.controller; + +import io.renren.common.annotation.SysLog; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.common.validator.ValidatorUtils; +import io.renren.modules.job.entity.ScheduleJobEntity; +import io.renren.modules.job.service.ScheduleJobService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * 定时任务 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/schedule") +public class ScheduleJobController { + @Autowired + private ScheduleJobService scheduleJobService; + + /** + * 定时任务列表 + */ + @RequestMapping("/list") + @RequiresPermissions("sys:schedule:list") + public R list(@RequestParam Map params){ + PageUtils page = scheduleJobService.queryPage(params); + + return R.ok().put("page", page); + } + + /** + * 定时任务信息 + */ + @RequestMapping("/info/{jobId}") + @RequiresPermissions("sys:schedule:info") + public R info(@PathVariable("jobId") Long jobId){ + ScheduleJobEntity schedule = scheduleJobService.getById(jobId); + + return R.ok().put("schedule", schedule); + } + + /** + * 保存定时任务 + */ + @SysLog("保存定时任务") + @RequestMapping("/save") + @RequiresPermissions("sys:schedule:save") + public R save(@RequestBody ScheduleJobEntity scheduleJob){ + ValidatorUtils.validateEntity(scheduleJob); + + scheduleJobService.saveJob(scheduleJob); + + return R.ok(); + } + + /** + * 修改定时任务 + */ + @SysLog("修改定时任务") + @RequestMapping("/update") + @RequiresPermissions("sys:schedule:update") + public R update(@RequestBody ScheduleJobEntity scheduleJob){ + ValidatorUtils.validateEntity(scheduleJob); + + scheduleJobService.update(scheduleJob); + + return R.ok(); + } + + /** + * 删除定时任务 + */ + @SysLog("删除定时任务") + @RequestMapping("/delete") + @RequiresPermissions("sys:schedule:delete") + public R delete(@RequestBody Long[] jobIds){ + scheduleJobService.deleteBatch(jobIds); + + return R.ok(); + } + + /** + * 立即执行任务 + */ + @SysLog("立即执行任务") + @RequestMapping("/run") + @RequiresPermissions("sys:schedule:run") + public R run(@RequestBody Long[] jobIds){ + scheduleJobService.run(jobIds); + + return R.ok(); + } + + /** + * 暂停定时任务 + */ + @SysLog("暂停定时任务") + @RequestMapping("/pause") + @RequiresPermissions("sys:schedule:pause") + public R pause(@RequestBody Long[] jobIds){ + scheduleJobService.pause(jobIds); + + return R.ok(); + } + + /** + * 恢复定时任务 + */ + @SysLog("恢复定时任务") + @RequestMapping("/resume") + @RequiresPermissions("sys:schedule:resume") + public R resume(@RequestBody Long[] jobIds){ + scheduleJobService.resume(jobIds); + + return R.ok(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/controller/ScheduleJobLogController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/controller/ScheduleJobLogController.java new file mode 100644 index 000000000..b24d2ab82 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/controller/ScheduleJobLogController.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.controller; + +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.modules.job.entity.ScheduleJobLogEntity; +import io.renren.modules.job.service.ScheduleJobLogService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * 定时任务日志 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/scheduleLog") +public class ScheduleJobLogController { + @Autowired + private ScheduleJobLogService scheduleJobLogService; + + /** + * 定时任务日志列表 + */ + @RequestMapping("/list") + @RequiresPermissions("sys:schedule:log") + public R list(@RequestParam Map params){ + PageUtils page = scheduleJobLogService.queryPage(params); + + return R.ok().put("page", page); + } + + /** + * 定时任务日志信息 + */ + @RequestMapping("/info/{logId}") + public R info(@PathVariable("logId") Long logId){ + ScheduleJobLogEntity log = scheduleJobLogService.getById(logId); + + return R.ok().put("log", log); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/dao/ScheduleJobDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/dao/ScheduleJobDao.java new file mode 100644 index 000000000..c5baa5916 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/dao/ScheduleJobDao.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.job.entity.ScheduleJobEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Map; + +/** + * 定时任务 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface ScheduleJobDao extends BaseMapper { + + /** + * 批量更新状态 + */ + int updateBatch(Map map); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/dao/ScheduleJobLogDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/dao/ScheduleJobLogDao.java new file mode 100644 index 000000000..e760dc880 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/dao/ScheduleJobLogDao.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.job.entity.ScheduleJobLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 定时任务日志 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface ScheduleJobLogDao extends BaseMapper { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/entity/ScheduleJobEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/entity/ScheduleJobEntity.java new file mode 100644 index 000000000..c86db12fc --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/entity/ScheduleJobEntity.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * 定时任务 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("schedule_job") +public class ScheduleJobEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 任务调度参数key + */ + public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY"; + + /** + * 任务id + */ + @TableId + private Long jobId; + + /** + * spring bean名称 + */ + @NotBlank(message="bean名称不能为空") + private String beanName; + + /** + * 参数 + */ + private String params; + + /** + * cron表达式 + */ + @NotBlank(message="cron表达式不能为空") + private String cronExpression; + + /** + * 任务状态 + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public String getBeanName() { + return beanName; + } + + public void setBeanName(String beanName) { + this.beanName = beanName; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + + public String getCronExpression() { + return cronExpression; + } + + public void setCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/entity/ScheduleJobLogEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/entity/ScheduleJobLogEntity.java new file mode 100644 index 000000000..66becc9c9 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/entity/ScheduleJobLogEntity.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 定时任务日志 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("schedule_job_log") +public class ScheduleJobLogEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 日志id + */ + @TableId + private Long logId; + + /** + * 任务id + */ + private Long jobId; + + /** + * spring bean名称 + */ + private String beanName; + + /** + * 参数 + */ + private String params; + + /** + * 任务状态 0:成功 1:失败 + */ + private Integer status; + + /** + * 失败信息 + */ + private String error; + + /** + * 耗时(单位:毫秒) + */ + private Integer times; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + public Long getLogId() { + return logId; + } + + public void setLogId(Long logId) { + this.logId = logId; + } + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public String getBeanName() { + return beanName; + } + + public void setBeanName(String beanName) { + this.beanName = beanName; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public Integer getTimes() { + return times; + } + + public void setTimes(Integer times) { + this.times = times; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/ScheduleJobLogService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/ScheduleJobLogService.java new file mode 100644 index 000000000..9e21fd866 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/ScheduleJobLogService.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.job.entity.ScheduleJobLogEntity; + +import java.util.Map; + +/** + * 定时任务日志 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ScheduleJobLogService extends IService { + + PageUtils queryPage(Map params); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/ScheduleJobService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/ScheduleJobService.java new file mode 100644 index 000000000..118f92603 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/ScheduleJobService.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.job.entity.ScheduleJobEntity; + +import java.util.Map; + +/** + * 定时任务 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ScheduleJobService extends IService { + + PageUtils queryPage(Map params); + + /** + * 保存定时任务 + */ + void saveJob(ScheduleJobEntity scheduleJob); + + /** + * 更新定时任务 + */ + void update(ScheduleJobEntity scheduleJob); + + /** + * 批量删除定时任务 + */ + void deleteBatch(Long[] jobIds); + + /** + * 批量更新定时任务状态 + */ + int updateBatch(Long[] jobIds, int status); + + /** + * 立即执行 + */ + void run(Long[] jobIds); + + /** + * 暂停运行 + */ + void pause(Long[] jobIds); + + /** + * 恢复运行 + */ + void resume(Long[] jobIds); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/impl/ScheduleJobLogServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/impl/ScheduleJobLogServiceImpl.java new file mode 100644 index 000000000..5a55d4b49 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/impl/ScheduleJobLogServiceImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.job.dao.ScheduleJobLogDao; +import io.renren.modules.job.entity.ScheduleJobLogEntity; +import io.renren.modules.job.service.ScheduleJobLogService; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +@Service("scheduleJobLogService") +public class ScheduleJobLogServiceImpl extends ServiceImpl implements ScheduleJobLogService { + + @Override + public PageUtils queryPage(Map params) { + String jobId = (String)params.get("jobId"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper().like(StringUtils.isNotBlank(jobId),"job_id", jobId) + ); + + return new PageUtils(page); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/impl/ScheduleJobServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/impl/ScheduleJobServiceImpl.java new file mode 100644 index 000000000..56a8509bf --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/service/impl/ScheduleJobServiceImpl.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.Constant; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.job.dao.ScheduleJobDao; +import io.renren.modules.job.entity.ScheduleJobEntity; +import io.renren.modules.job.service.ScheduleJobService; +import io.renren.modules.job.utils.ScheduleUtils; +import org.apache.commons.lang.StringUtils; +import org.quartz.CronTrigger; +import org.quartz.Scheduler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.PostConstruct; +import java.util.*; + +@Service("scheduleJobService") +public class ScheduleJobServiceImpl extends ServiceImpl implements ScheduleJobService { + @Autowired + private Scheduler scheduler; + + /** + * 项目启动时,初始化定时器 + */ + @PostConstruct + public void init(){ + List scheduleJobList = this.list(); + for(ScheduleJobEntity scheduleJob : scheduleJobList){ + CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId()); + //如果不存在,则创建 + if(cronTrigger == null) { + ScheduleUtils.createScheduleJob(scheduler, scheduleJob); + }else { + ScheduleUtils.updateScheduleJob(scheduler, scheduleJob); + } + } + } + + @Override + public PageUtils queryPage(Map params) { + String beanName = (String)params.get("beanName"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper ().like(StringUtils.isNotBlank(beanName),"bean_name", beanName) + ); + + return new PageUtils(page); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveJob(ScheduleJobEntity scheduleJob) { + scheduleJob.setCreateTime(new Date()); + scheduleJob.setStatus(Constant.ScheduleStatus.NORMAL.getValue()); + this.save(scheduleJob); + + ScheduleUtils.createScheduleJob(scheduler, scheduleJob); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScheduleJobEntity scheduleJob) { + ScheduleUtils.updateScheduleJob(scheduler, scheduleJob); + + this.updateById(scheduleJob); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteBatch(Long[] jobIds) { + for(Long jobId : jobIds){ + ScheduleUtils.deleteScheduleJob(scheduler, jobId); + } + + //删除数据 + this.removeByIds(Arrays.asList(jobIds)); + } + + @Override + public int updateBatch(Long[] jobIds, int status){ + Map map = new HashMap<>(2); + map.put("list", Arrays.asList(jobIds)); + map.put("status", status); + return baseMapper.updateBatch(map); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void run(Long[] jobIds) { + for(Long jobId : jobIds){ + ScheduleUtils.run(scheduler, this.getById(jobId)); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void pause(Long[] jobIds) { + for(Long jobId : jobIds){ + ScheduleUtils.pauseJob(scheduler, jobId); + } + + updateBatch(jobIds, Constant.ScheduleStatus.PAUSE.getValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void resume(Long[] jobIds) { + for(Long jobId : jobIds){ + ScheduleUtils.resumeJob(scheduler, jobId); + } + + updateBatch(jobIds, Constant.ScheduleStatus.NORMAL.getValue()); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/task/ITask.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/task/ITask.java new file mode 100644 index 000000000..3c386f5ce --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/task/ITask.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.task; + +/** + * 定时任务接口,所有定时任务都要实现该接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ITask { + + /** + * 执行定时任务接口 + * + * @param params 参数,多参数使用JSON数据 + */ + void run(String params); +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/task/TestTask.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/task/TestTask.java new file mode 100644 index 000000000..9459cfc81 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/task/TestTask.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.task; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * 测试定时任务(演示Demo,可删除) + * + * testTask为spring bean的名称 + * + * @author Mark sunlightcs@gmail.com + */ +@Component("testTask") +public class TestTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params){ + logger.debug("TestTask定时任务正在执行,参数为:{}", params); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/utils/ScheduleJob.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/utils/ScheduleJob.java new file mode 100644 index 000000000..0f269e65d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/utils/ScheduleJob.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.utils; + +import io.renren.common.utils.SpringContextUtils; +import io.renren.modules.job.entity.ScheduleJobEntity; +import io.renren.modules.job.entity.ScheduleJobLogEntity; +import io.renren.modules.job.service.ScheduleJobLogService; +import org.apache.commons.lang.StringUtils; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.lang.reflect.Method; +import java.util.Date; + + +/** + * 定时任务 + * + * @author Mark sunlightcs@gmail.com + */ +public class ScheduleJob extends QuartzJobBean { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + ScheduleJobEntity scheduleJob = (ScheduleJobEntity) context.getMergedJobDataMap() + .get(ScheduleJobEntity.JOB_PARAM_KEY); + + //获取spring bean + ScheduleJobLogService scheduleJobLogService = (ScheduleJobLogService) SpringContextUtils.getBean("scheduleJobLogService"); + + //数据库保存执行记录 + ScheduleJobLogEntity log = new ScheduleJobLogEntity(); + log.setJobId(scheduleJob.getJobId()); + log.setBeanName(scheduleJob.getBeanName()); + log.setParams(scheduleJob.getParams()); + log.setCreateTime(new Date()); + + //任务开始时间 + long startTime = System.currentTimeMillis(); + + try { + //执行任务 + logger.debug("任务准备执行,任务ID:" + scheduleJob.getJobId()); + + Object target = SpringContextUtils.getBean(scheduleJob.getBeanName()); + Method method = target.getClass().getDeclaredMethod("run", String.class); + method.invoke(target, scheduleJob.getParams()); + + //任务执行总时长 + long times = System.currentTimeMillis() - startTime; + log.setTimes((int)times); + //任务状态 0:成功 1:失败 + log.setStatus(0); + + logger.debug("任务执行完毕,任务ID:" + scheduleJob.getJobId() + " 总共耗时:" + times + "毫秒"); + } catch (Exception e) { + logger.error("任务执行失败,任务ID:" + scheduleJob.getJobId(), e); + + //任务执行总时长 + long times = System.currentTimeMillis() - startTime; + log.setTimes((int)times); + + //任务状态 0:成功 1:失败 + log.setStatus(1); + log.setError(StringUtils.substring(e.toString(), 0, 2000)); + }finally { + scheduleJobLogService.save(log); + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java new file mode 100644 index 000000000..974f8bf83 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.job.utils; + +import io.renren.common.exception.RRException; +import io.renren.common.utils.Constant; +import io.renren.modules.job.entity.ScheduleJobEntity; +import org.quartz.*; + +/** + * 定时任务工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ScheduleUtils { + private final static String JOB_NAME = "TASK_"; + + /** + * 获取触发器key + */ + public static TriggerKey getTriggerKey(Long jobId) { + return TriggerKey.triggerKey(JOB_NAME + jobId); + } + + /** + * 获取jobKey + */ + public static JobKey getJobKey(Long jobId) { + return JobKey.jobKey(JOB_NAME + jobId); + } + + /** + * 获取表达式触发器 + */ + public static CronTrigger getCronTrigger(Scheduler scheduler, Long jobId) { + try { + return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId)); + } catch (SchedulerException e) { + throw new RRException("获取定时任务CronTrigger出现异常", e); + } + } + + /** + * 创建定时任务 + */ + public static void createScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) { + try { + //构建job信息 + JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getJobId())).build(); + + //表达式调度构建器 + CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()) + .withMisfireHandlingInstructionDoNothing(); + + //按新的cronExpression表达式构建一个新的trigger + CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob.getJobId())).withSchedule(scheduleBuilder).build(); + + //放入参数,运行时的方法可以获取 + jobDetail.getJobDataMap().put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob); + + scheduler.scheduleJob(jobDetail, trigger); + + //暂停任务 + if(scheduleJob.getStatus() == Constant.ScheduleStatus.PAUSE.getValue()){ + pauseJob(scheduler, scheduleJob.getJobId()); + } + } catch (SchedulerException e) { + throw new RRException("创建定时任务失败", e); + } + } + + /** + * 更新定时任务 + */ + public static void updateScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) { + try { + TriggerKey triggerKey = getTriggerKey(scheduleJob.getJobId()); + + //表达式调度构建器 + CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()) + .withMisfireHandlingInstructionDoNothing(); + + CronTrigger trigger = getCronTrigger(scheduler, scheduleJob.getJobId()); + + //按新的cronExpression表达式重新构建trigger + trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); + + //参数 + trigger.getJobDataMap().put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob); + + scheduler.rescheduleJob(triggerKey, trigger); + + //暂停任务 + if(scheduleJob.getStatus() == Constant.ScheduleStatus.PAUSE.getValue()){ + pauseJob(scheduler, scheduleJob.getJobId()); + } + + } catch (SchedulerException e) { + throw new RRException("更新定时任务失败", e); + } + } + + /** + * 立即执行任务 + */ + public static void run(Scheduler scheduler, ScheduleJobEntity scheduleJob) { + try { + //参数 + JobDataMap dataMap = new JobDataMap(); + dataMap.put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob); + + scheduler.triggerJob(getJobKey(scheduleJob.getJobId()), dataMap); + } catch (SchedulerException e) { + throw new RRException("立即执行定时任务失败", e); + } + } + + /** + * 暂停任务 + */ + public static void pauseJob(Scheduler scheduler, Long jobId) { + try { + scheduler.pauseJob(getJobKey(jobId)); + } catch (SchedulerException e) { + throw new RRException("暂停定时任务失败", e); + } + } + + /** + * 恢复任务 + */ + public static void resumeJob(Scheduler scheduler, Long jobId) { + try { + scheduler.resumeJob(getJobKey(jobId)); + } catch (SchedulerException e) { + throw new RRException("暂停定时任务失败", e); + } + } + + /** + * 删除定时任务 + */ + public static void deleteScheduleJob(Scheduler scheduler, Long jobId) { + try { + scheduler.deleteJob(getJobKey(jobId)); + } catch (SchedulerException e) { + throw new RRException("删除定时任务失败", e); + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/AliyunCloudStorageService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/AliyunCloudStorageService.java new file mode 100644 index 000000000..5ea513ff1 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/AliyunCloudStorageService.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import com.aliyun.oss.OSSClient; +import io.renren.common.exception.RRException; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +/** + * 阿里云存储 + * + * @author Mark sunlightcs@gmail.com + */ +public class AliyunCloudStorageService extends CloudStorageService { + private OSSClient client; + + public AliyunCloudStorageService(CloudStorageConfig config){ + this.config = config; + + //初始化 + init(); + } + + private void init(){ + client = new OSSClient(config.getAliyunEndPoint(), config.getAliyunAccessKeyId(), + config.getAliyunAccessKeySecret()); + } + + @Override + public String upload(byte[] data, String path) { + return upload(new ByteArrayInputStream(data), path); + } + + @Override + public String upload(InputStream inputStream, String path) { + try { + client.putObject(config.getAliyunBucketName(), path, inputStream); + } catch (Exception e){ + throw new RRException("上传文件失败,请检查配置信息", e); + } + + return config.getAliyunDomain() + "/" + path; + } + + @Override + public String uploadSuffix(byte[] data, String suffix) { + return upload(data, getPath(config.getAliyunPrefix(), suffix)); + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix) { + return upload(inputStream, getPath(config.getAliyunPrefix(), suffix)); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/CloudStorageConfig.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/CloudStorageConfig.java new file mode 100644 index 000000000..a6abcb4f3 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/CloudStorageConfig.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + + +import io.renren.common.validator.group.AliyunGroup; +import io.renren.common.validator.group.QcloudGroup; +import io.renren.common.validator.group.QiniuGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Range; +import org.hibernate.validator.constraints.URL; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 云存储配置信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class CloudStorageConfig implements Serializable { + private static final long serialVersionUID = 1L; + + //类型 1:七牛 2:阿里云 3:腾讯云 + @Range(min=1, max=3, message = "类型错误") + private Integer type; + + //七牛绑定的域名 + @NotBlank(message="七牛绑定的域名不能为空", groups = QiniuGroup.class) + @URL(message = "七牛绑定的域名格式不正确", groups = QiniuGroup.class) + private String qiniuDomain; + //七牛路径前缀 + private String qiniuPrefix; + //七牛ACCESS_KEY + @NotBlank(message="七牛AccessKey不能为空", groups = QiniuGroup.class) + private String qiniuAccessKey; + //七牛SECRET_KEY + @NotBlank(message="七牛SecretKey不能为空", groups = QiniuGroup.class) + private String qiniuSecretKey; + //七牛存储空间名 + @NotBlank(message="七牛空间名不能为空", groups = QiniuGroup.class) + private String qiniuBucketName; + + //阿里云绑定的域名 + @NotBlank(message="阿里云绑定的域名不能为空", groups = AliyunGroup.class) + @URL(message = "阿里云绑定的域名格式不正确", groups = AliyunGroup.class) + private String aliyunDomain; + //阿里云路径前缀 + private String aliyunPrefix; + //阿里云EndPoint + @NotBlank(message="阿里云EndPoint不能为空", groups = AliyunGroup.class) + private String aliyunEndPoint; + //阿里云AccessKeyId + @NotBlank(message="阿里云AccessKeyId不能为空", groups = AliyunGroup.class) + private String aliyunAccessKeyId; + //阿里云AccessKeySecret + @NotBlank(message="阿里云AccessKeySecret不能为空", groups = AliyunGroup.class) + private String aliyunAccessKeySecret; + //阿里云BucketName + @NotBlank(message="阿里云BucketName不能为空", groups = AliyunGroup.class) + private String aliyunBucketName; + + //腾讯云绑定的域名 + @NotBlank(message="腾讯云绑定的域名不能为空", groups = QcloudGroup.class) + @URL(message = "腾讯云绑定的域名格式不正确", groups = QcloudGroup.class) + private String qcloudDomain; + //腾讯云路径前缀 + private String qcloudPrefix; + //腾讯云AppId + @NotNull(message="腾讯云AppId不能为空", groups = QcloudGroup.class) + private Integer qcloudAppId; + //腾讯云SecretId + @NotBlank(message="腾讯云SecretId不能为空", groups = QcloudGroup.class) + private String qcloudSecretId; + //腾讯云SecretKey + @NotBlank(message="腾讯云SecretKey不能为空", groups = QcloudGroup.class) + private String qcloudSecretKey; + //腾讯云BucketName + @NotBlank(message="腾讯云BucketName不能为空", groups = QcloudGroup.class) + private String qcloudBucketName; + //腾讯云COS所属地区 + @NotBlank(message="所属地区不能为空", groups = QcloudGroup.class) + private String qcloudRegion; + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getQiniuDomain() { + return qiniuDomain; + } + + public void setQiniuDomain(String qiniuDomain) { + this.qiniuDomain = qiniuDomain; + } + + public String getQiniuPrefix() { + return qiniuPrefix; + } + + public void setQiniuPrefix(String qiniuPrefix) { + this.qiniuPrefix = qiniuPrefix; + } + + public String getQiniuAccessKey() { + return qiniuAccessKey; + } + + public void setQiniuAccessKey(String qiniuAccessKey) { + this.qiniuAccessKey = qiniuAccessKey; + } + + public String getQiniuSecretKey() { + return qiniuSecretKey; + } + + public void setQiniuSecretKey(String qiniuSecretKey) { + this.qiniuSecretKey = qiniuSecretKey; + } + + public String getQiniuBucketName() { + return qiniuBucketName; + } + + public void setQiniuBucketName(String qiniuBucketName) { + this.qiniuBucketName = qiniuBucketName; + } + + public String getAliyunDomain() { + return aliyunDomain; + } + + public void setAliyunDomain(String aliyunDomain) { + this.aliyunDomain = aliyunDomain; + } + + public String getAliyunPrefix() { + return aliyunPrefix; + } + + public void setAliyunPrefix(String aliyunPrefix) { + this.aliyunPrefix = aliyunPrefix; + } + + public String getAliyunEndPoint() { + return aliyunEndPoint; + } + + public void setAliyunEndPoint(String aliyunEndPoint) { + this.aliyunEndPoint = aliyunEndPoint; + } + + public String getAliyunAccessKeyId() { + return aliyunAccessKeyId; + } + + public void setAliyunAccessKeyId(String aliyunAccessKeyId) { + this.aliyunAccessKeyId = aliyunAccessKeyId; + } + + public String getAliyunAccessKeySecret() { + return aliyunAccessKeySecret; + } + + public void setAliyunAccessKeySecret(String aliyunAccessKeySecret) { + this.aliyunAccessKeySecret = aliyunAccessKeySecret; + } + + public String getAliyunBucketName() { + return aliyunBucketName; + } + + public void setAliyunBucketName(String aliyunBucketName) { + this.aliyunBucketName = aliyunBucketName; + } + + public String getQcloudDomain() { + return qcloudDomain; + } + + public void setQcloudDomain(String qcloudDomain) { + this.qcloudDomain = qcloudDomain; + } + + public String getQcloudPrefix() { + return qcloudPrefix; + } + + public void setQcloudPrefix(String qcloudPrefix) { + this.qcloudPrefix = qcloudPrefix; + } + + public Integer getQcloudAppId() { + return qcloudAppId; + } + + public void setQcloudAppId(Integer qcloudAppId) { + this.qcloudAppId = qcloudAppId; + } + + public String getQcloudSecretId() { + return qcloudSecretId; + } + + public void setQcloudSecretId(String qcloudSecretId) { + this.qcloudSecretId = qcloudSecretId; + } + + public String getQcloudSecretKey() { + return qcloudSecretKey; + } + + public void setQcloudSecretKey(String qcloudSecretKey) { + this.qcloudSecretKey = qcloudSecretKey; + } + + public String getQcloudBucketName() { + return qcloudBucketName; + } + + public void setQcloudBucketName(String qcloudBucketName) { + this.qcloudBucketName = qcloudBucketName; + } + + public String getQcloudRegion() { + return qcloudRegion; + } + + public void setQcloudRegion(String qcloudRegion) { + this.qcloudRegion = qcloudRegion; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/CloudStorageService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/CloudStorageService.java new file mode 100644 index 000000000..96d10930d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/CloudStorageService.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import io.renren.common.utils.DateUtils; +import org.apache.commons.lang.StringUtils; + +import java.io.InputStream; +import java.util.Date; +import java.util.UUID; + +/** + * 云存储(支持七牛、阿里云、腾讯云、又拍云) + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class CloudStorageService { + /** 云存储配置信息 */ + CloudStorageConfig config; + + /** + * 文件路径 + * @param prefix 前缀 + * @param suffix 后缀 + * @return 返回上传路径 + */ + public String getPath(String prefix, String suffix) { + //生成uuid + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + //文件路径 + String path = DateUtils.format(new Date(), "yyyyMMdd") + "/" + uuid; + + if(StringUtils.isNotBlank(prefix)){ + path = prefix + "/" + path; + } + + return path + suffix; + } + + /** + * 文件上传 + * @param data 文件字节数组 + * @param path 文件路径,包含文件名 + * @return 返回http地址 + */ + public abstract String upload(byte[] data, String path); + + /** + * 文件上传 + * @param data 文件字节数组 + * @param suffix 后缀 + * @return 返回http地址 + */ + public abstract String uploadSuffix(byte[] data, String suffix); + + /** + * 文件上传 + * @param inputStream 字节流 + * @param path 文件路径,包含文件名 + * @return 返回http地址 + */ + public abstract String upload(InputStream inputStream, String path); + + /** + * 文件上传 + * @param inputStream 字节流 + * @param suffix 后缀 + * @return 返回http地址 + */ + public abstract String uploadSuffix(InputStream inputStream, String suffix); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/OSSFactory.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/OSSFactory.java new file mode 100644 index 000000000..e72dbb176 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/OSSFactory.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + + +import io.renren.common.utils.ConfigConstant; +import io.renren.common.utils.Constant; +import io.renren.common.utils.SpringContextUtils; +import io.renren.modules.sys.service.SysConfigService; + +/** + * 文件上传Factory + * + * @author Mark sunlightcs@gmail.com + */ +public final class OSSFactory { + private static SysConfigService sysConfigService; + + static { + OSSFactory.sysConfigService = (SysConfigService) SpringContextUtils.getBean("sysConfigService"); + } + + public static CloudStorageService build(){ + //获取云存储配置信息 + CloudStorageConfig config = sysConfigService.getConfigObject(ConfigConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class); + + if(config.getType() == Constant.CloudService.QINIU.getValue()){ + return new QiniuCloudStorageService(config); + }else if(config.getType() == Constant.CloudService.ALIYUN.getValue()){ + return new AliyunCloudStorageService(config); + }else if(config.getType() == Constant.CloudService.QCLOUD.getValue()){ + return new QcloudCloudStorageService(config); + } + + return null; + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/QcloudCloudStorageService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/QcloudCloudStorageService.java new file mode 100644 index 000000000..d1d217018 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/QcloudCloudStorageService.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + + +import com.alibaba.fastjson.JSONObject; +import com.qcloud.cos.COSClient; +import com.qcloud.cos.ClientConfig; +import com.qcloud.cos.request.UploadFileRequest; +import com.qcloud.cos.sign.Credentials; +import io.renren.common.exception.RRException; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; + +/** + * 腾讯云存储 + * + * @author Mark sunlightcs@gmail.com + */ +public class QcloudCloudStorageService extends CloudStorageService { + private COSClient client; + + public QcloudCloudStorageService(CloudStorageConfig config){ + this.config = config; + + //初始化 + init(); + } + + private void init(){ + Credentials credentials = new Credentials(config.getQcloudAppId(), config.getQcloudSecretId(), + config.getQcloudSecretKey()); + + //初始化客户端配置 + ClientConfig clientConfig = new ClientConfig(); + //设置bucket所在的区域,华南:gz 华北:tj 华东:sh + clientConfig.setRegion(config.getQcloudRegion()); + + client = new COSClient(clientConfig, credentials); + } + + @Override + public String upload(byte[] data, String path) { + //腾讯云必需要以"/"开头 + if(!path.startsWith("/")) { + path = "/" + path; + } + + //上传到腾讯云 + UploadFileRequest request = new UploadFileRequest(config.getQcloudBucketName(), path, data); + String response = client.uploadFile(request); + + JSONObject jsonObject = JSONObject.parseObject(response); + if(jsonObject.getInteger("code") != 0) { + throw new RRException("文件上传失败," + jsonObject.getString("message")); + } + + return config.getQcloudDomain() + path; + } + + @Override + public String upload(InputStream inputStream, String path) { + try { + byte[] data = IOUtils.toByteArray(inputStream); + return this.upload(data, path); + } catch (IOException e) { + throw new RRException("上传文件失败", e); + } + } + + @Override + public String uploadSuffix(byte[] data, String suffix) { + return upload(data, getPath(config.getQcloudPrefix(), suffix)); + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix) { + return upload(inputStream, getPath(config.getQcloudPrefix(), suffix)); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java new file mode 100644 index 000000000..db4fab961 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import com.qiniu.common.Zone; +import com.qiniu.http.Response; +import com.qiniu.storage.Configuration; +import com.qiniu.storage.UploadManager; +import com.qiniu.util.Auth; +import io.renren.common.exception.RRException; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; + +/** + * 七牛云存储 + * + * @author Mark sunlightcs@gmail.com + */ +public class QiniuCloudStorageService extends CloudStorageService { + private UploadManager uploadManager; + private String token; + + public QiniuCloudStorageService(CloudStorageConfig config){ + this.config = config; + + //初始化 + init(); + } + + private void init(){ + uploadManager = new UploadManager(new Configuration(Zone.autoZone())); + token = Auth.create(config.getQiniuAccessKey(), config.getQiniuSecretKey()). + uploadToken(config.getQiniuBucketName()); + } + + @Override + public String upload(byte[] data, String path) { + try { + Response res = uploadManager.put(data, path, token); + if (!res.isOK()) { + throw new RuntimeException("上传七牛出错:" + res.toString()); + } + } catch (Exception e) { + throw new RRException("上传文件失败,请核对七牛配置信息", e); + } + + return config.getQiniuDomain() + "/" + path; + } + + @Override + public String upload(InputStream inputStream, String path) { + try { + byte[] data = IOUtils.toByteArray(inputStream); + return this.upload(data, path); + } catch (IOException e) { + throw new RRException("上传文件失败", e); + } + } + + @Override + public String uploadSuffix(byte[] data, String suffix) { + return upload(data, getPath(config.getQiniuPrefix(), suffix)); + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix) { + return upload(inputStream, getPath(config.getQiniuPrefix(), suffix)); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/controller/SysOssController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/controller/SysOssController.java new file mode 100644 index 000000000..e8830ac30 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/controller/SysOssController.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.controller; + +import com.google.gson.Gson; +import io.renren.common.exception.RRException; +import io.renren.common.utils.ConfigConstant; +import io.renren.common.utils.Constant; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.AliyunGroup; +import io.renren.common.validator.group.QcloudGroup; +import io.renren.common.validator.group.QiniuGroup; +import io.renren.modules.oss.cloud.CloudStorageConfig; +import io.renren.modules.oss.cloud.OSSFactory; +import io.renren.modules.oss.entity.SysOssEntity; +import io.renren.modules.oss.service.SysOssService; +import io.renren.modules.sys.service.SysConfigService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Arrays; +import java.util.Date; +import java.util.Map; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("sys/oss") +public class SysOssController { + @Autowired + private SysOssService sysOssService; + @Autowired + private SysConfigService sysConfigService; + + private final static String KEY = ConfigConstant.CLOUD_STORAGE_CONFIG_KEY; + + /** + * 列表 + */ + @GetMapping("/list") + @RequiresPermissions("sys:oss:all") + public R list(@RequestParam Map params){ + PageUtils page = sysOssService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 云存储配置信息 + */ + @GetMapping("/config") + @RequiresPermissions("sys:oss:all") + public R config(){ + CloudStorageConfig config = sysConfigService.getConfigObject(KEY, CloudStorageConfig.class); + + return R.ok().put("config", config); + } + + + /** + * 保存云存储配置信息 + */ + @PostMapping("/saveConfig") + @RequiresPermissions("sys:oss:all") + public R saveConfig(@RequestBody CloudStorageConfig config){ + //校验类型 + ValidatorUtils.validateEntity(config); + ValidatorUtils.validateEntity(config, Constant.CloudService.getByValue(config.getType())); + + sysConfigService.updateValueByKey(KEY, new Gson().toJson(config)); + + return R.ok(); + } + + + /** + * 上传文件 + */ + @PostMapping("/upload") + @RequiresPermissions("sys:oss:all") + public R upload(@RequestParam("file") MultipartFile file) throws Exception { + if (file.isEmpty()) { + throw new RRException("上传文件不能为空"); + } + + //上传文件 + String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + String url = OSSFactory.build().uploadSuffix(file.getBytes(), suffix); + + //保存文件信息 + SysOssEntity ossEntity = new SysOssEntity(); + ossEntity.setUrl(url); + ossEntity.setCreateDate(new Date()); + sysOssService.save(ossEntity); + + return R.ok().put("url", url); + } + + + /** + * 删除 + */ + @PostMapping("/delete") + @RequiresPermissions("sys:oss:all") + public R delete(@RequestBody Long[] ids){ + sysOssService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/dao/SysOssDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/dao/SysOssDao.java new file mode 100644 index 000000000..e5f04f63d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/dao/SysOssDao.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.oss.entity.SysOssEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysOssDao extends BaseMapper { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/entity/SysOssEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/entity/SysOssEntity.java new file mode 100644 index 000000000..ce40bb151 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/entity/SysOssEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_oss") +public class SysOssEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId + private Long id; + //URL地址 + private String url; + //创建时间 + private Date createDate; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/service/SysOssService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/service/SysOssService.java new file mode 100644 index 000000000..c77c00f37 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/service/SysOssService.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.oss.entity.SysOssEntity; + +import java.util.Map; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysOssService extends IService { + + PageUtils queryPage(Map params); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/service/impl/SysOssServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/service/impl/SysOssServiceImpl.java new file mode 100644 index 000000000..ffaa1942d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/oss/service/impl/SysOssServiceImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.oss.dao.SysOssDao; +import io.renren.modules.oss.entity.SysOssEntity; +import io.renren.modules.oss.service.SysOssService; +import org.springframework.stereotype.Service; + +import java.util.Map; + + +@Service("sysOssService") +public class SysOssServiceImpl extends ServiceImpl implements SysOssService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params) + ); + + return new PageUtils(page); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/AbstractController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/AbstractController.java new file mode 100644 index 000000000..608ecb325 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/AbstractController.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.shiro.SecurityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Controller公共组件 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class AbstractController { + protected Logger logger = LoggerFactory.getLogger(getClass()); + + protected SysUserEntity getUser() { + return (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + } + + protected Long getUserId() { + return getUser().getUserId(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysConfigController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysConfigController.java new file mode 100644 index 000000000..5314f39b9 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysConfigController.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + + +import io.renren.common.annotation.SysLog; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.common.validator.ValidatorUtils; +import io.renren.modules.sys.entity.SysConfigEntity; +import io.renren.modules.sys.service.SysConfigService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * 系统配置信息 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/config") +public class SysConfigController extends AbstractController { + @Autowired + private SysConfigService sysConfigService; + + /** + * 所有配置列表 + */ + @GetMapping("/list") + @RequiresPermissions("sys:config:list") + public R list(@RequestParam Map params){ + PageUtils page = sysConfigService.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 配置信息 + */ + @GetMapping("/info/{id}") + @RequiresPermissions("sys:config:info") + public R info(@PathVariable("id") Long id){ + SysConfigEntity config = sysConfigService.getById(id); + + return R.ok().put("config", config); + } + + /** + * 保存配置 + */ + @SysLog("保存配置") + @PostMapping("/save") + @RequiresPermissions("sys:config:save") + public R save(@RequestBody SysConfigEntity config){ + ValidatorUtils.validateEntity(config); + + sysConfigService.saveConfig(config); + + return R.ok(); + } + + /** + * 修改配置 + */ + @SysLog("修改配置") + @PostMapping("/update") + @RequiresPermissions("sys:config:update") + public R update(@RequestBody SysConfigEntity config){ + ValidatorUtils.validateEntity(config); + + sysConfigService.update(config); + + return R.ok(); + } + + /** + * 删除配置 + */ + @SysLog("删除配置") + @PostMapping("/delete") + @RequiresPermissions("sys:config:delete") + public R delete(@RequestBody Long[] ids){ + sysConfigService.deleteBatch(ids); + + return R.ok(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysLogController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysLogController.java new file mode 100644 index 000000000..e69af10ac --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysLogController.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.modules.sys.service.SysLogService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.Map; + + +/** + * 系统日志 + * + * @author Mark sunlightcs@gmail.com + */ +@Controller +@RequestMapping("/sys/log") +public class SysLogController { + @Autowired + private SysLogService sysLogService; + + /** + * 列表 + */ + @ResponseBody + @GetMapping("/list") + @RequiresPermissions("sys:log:list") + public R list(@RequestParam Map params){ + PageUtils page = sysLogService.queryPage(params); + + return R.ok().put("page", page); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysLoginController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysLoginController.java new file mode 100644 index 000000000..bb0915545 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysLoginController.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.utils.R; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.form.SysLoginForm; +import io.renren.modules.sys.service.SysCaptchaService; +import io.renren.modules.sys.service.SysUserService; +import io.renren.modules.sys.service.SysUserTokenService; +import org.apache.commons.io.IOUtils; +import org.apache.shiro.crypto.hash.Sha256Hash; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.imageio.ImageIO; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.Map; + +/** + * 登录相关 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +public class SysLoginController extends AbstractController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysUserTokenService sysUserTokenService; + @Autowired + private SysCaptchaService sysCaptchaService; + + /** + * 验证码 + */ + @GetMapping("captcha.jpg") + public void captcha(HttpServletResponse response, String uuid)throws IOException { + response.setHeader("Cache-Control", "no-store, no-cache"); + response.setContentType("image/jpeg"); + + //获取图片验证码 + BufferedImage image = sysCaptchaService.getCaptcha(uuid); + + ServletOutputStream out = response.getOutputStream(); + ImageIO.write(image, "jpg", out); + IOUtils.closeQuietly(out); + } + + /** + * 登录 + */ + @PostMapping("/sys/login") + public Map login(@RequestBody SysLoginForm form)throws IOException { + boolean captcha = sysCaptchaService.validate(form.getUuid(), form.getCaptcha()); + if(!captcha){ + return R.error("验证码不正确"); + } + + //用户信息 + SysUserEntity user = sysUserService.queryByUserName(form.getUsername()); + + //账号不存在、密码错误 + if(user == null || !user.getPassword().equals(new Sha256Hash(form.getPassword(), user.getSalt()).toHex())) { + return R.error("账号或密码不正确"); + } + + //账号锁定 + if(user.getStatus() == 0){ + return R.error("账号已被锁定,请联系管理员"); + } + + //生成token,并保存到数据库 + R r = sysUserTokenService.createToken(user.getUserId()); + return r; + } + + + /** + * 退出 + */ + @PostMapping("/sys/logout") + public R logout() { + sysUserTokenService.logout(getUserId()); + return R.ok(); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysMenuController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysMenuController.java new file mode 100644 index 000000000..587c3f408 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysMenuController.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.annotation.SysLog; +import io.renren.common.exception.RRException; +import io.renren.common.utils.Constant; +import io.renren.common.utils.R; +import io.renren.modules.sys.entity.SysMenuEntity; +import io.renren.modules.sys.service.ShiroService; +import io.renren.modules.sys.service.SysMenuService; +import org.apache.commons.lang.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +/** + * 系统菜单 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/menu") +public class SysMenuController extends AbstractController { + @Autowired + private SysMenuService sysMenuService; + @Autowired + private ShiroService shiroService; + + /** + * 导航菜单 + */ + @GetMapping("/nav") + public R nav(){ + List menuList = sysMenuService.getUserMenuList(getUserId()); + Set permissions = shiroService.getUserPermissions(getUserId()); + return R.ok().put("menuList", menuList).put("permissions", permissions); + } + + /** + * 所有菜单列表 + */ + @GetMapping("/list") + @RequiresPermissions("sys:menu:list") + public List list(){ + List menuList = sysMenuService.list(); + HashMap menuMap = new HashMap<>(12); + for (SysMenuEntity s : menuList) { + menuMap.put(s.getMenuId(), s); + } + for (SysMenuEntity s : menuList) { + SysMenuEntity parent = menuMap.get(s.getParentId()); + if (Objects.nonNull(parent)) { + s.setParentName(parent.getName()); + } + + } + + + return menuList; + } + + /** + * 选择菜单(添加、修改菜单) + */ + @GetMapping("/select") + @RequiresPermissions("sys:menu:select") + public R select(){ + //查询列表数据 + List menuList = sysMenuService.queryNotButtonList(); + + //添加顶级菜单 + SysMenuEntity root = new SysMenuEntity(); + root.setMenuId(0L); + root.setName("一级菜单"); + root.setParentId(-1L); + root.setOpen(true); + menuList.add(root); + + return R.ok().put("menuList", menuList); + } + + /** + * 菜单信息 + */ + @GetMapping("/info/{menuId}") + @RequiresPermissions("sys:menu:info") + public R info(@PathVariable("menuId") Long menuId){ + SysMenuEntity menu = sysMenuService.getById(menuId); + return R.ok().put("menu", menu); + } + + /** + * 保存 + */ + @SysLog("保存菜单") + @PostMapping("/save") + @RequiresPermissions("sys:menu:save") + public R save(@RequestBody SysMenuEntity menu){ + //数据校验 + verifyForm(menu); + + sysMenuService.save(menu); + + return R.ok(); + } + + /** + * 修改 + */ + @SysLog("修改菜单") + @PostMapping("/update") + @RequiresPermissions("sys:menu:update") + public R update(@RequestBody SysMenuEntity menu){ + //数据校验 + verifyForm(menu); + + sysMenuService.updateById(menu); + + return R.ok(); + } + + /** + * 删除 + */ + @SysLog("删除菜单") + @PostMapping("/delete/{menuId}") + @RequiresPermissions("sys:menu:delete") + public R delete(@PathVariable("menuId") long menuId){ + if(menuId <= 31){ + return R.error("系统菜单,不能删除"); + } + + //判断是否有子菜单或按钮 + List menuList = sysMenuService.queryListParentId(menuId); + if(menuList.size() > 0){ + return R.error("请先删除子菜单或按钮"); + } + + sysMenuService.delete(menuId); + + return R.ok(); + } + + /** + * 验证参数是否正确 + */ + private void verifyForm(SysMenuEntity menu){ + if(StringUtils.isBlank(menu.getName())){ + throw new RRException("菜单名称不能为空"); + } + + if(menu.getParentId() == null){ + throw new RRException("上级菜单不能为空"); + } + + //菜单 + if(menu.getType() == Constant.MenuType.MENU.getValue()){ + if(StringUtils.isBlank(menu.getUrl())){ + throw new RRException("菜单URL不能为空"); + } + } + + //上级菜单类型 + int parentType = Constant.MenuType.CATALOG.getValue(); + if(menu.getParentId() != 0){ + SysMenuEntity parentMenu = sysMenuService.getById(menu.getParentId()); + parentType = parentMenu.getType(); + } + + //目录、菜单 + if(menu.getType() == Constant.MenuType.CATALOG.getValue() || + menu.getType() == Constant.MenuType.MENU.getValue()){ + if(parentType != Constant.MenuType.CATALOG.getValue()){ + throw new RRException("上级菜单只能为目录类型"); + } + return ; + } + + //按钮 + if(menu.getType() == Constant.MenuType.BUTTON.getValue()){ + if(parentType != Constant.MenuType.MENU.getValue()){ + throw new RRException("上级菜单只能为菜单类型"); + } + return ; + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysRoleController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysRoleController.java new file mode 100644 index 000000000..5a6f9d861 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysRoleController.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.annotation.SysLog; +import io.renren.common.utils.Constant; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.common.validator.ValidatorUtils; +import io.renren.modules.sys.entity.SysRoleEntity; +import io.renren.modules.sys.service.SysRoleMenuService; +import io.renren.modules.sys.service.SysRoleService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/role") +public class SysRoleController extends AbstractController { + @Autowired + private SysRoleService sysRoleService; + @Autowired + private SysRoleMenuService sysRoleMenuService; + + /** + * 角色列表 + */ + @GetMapping("/list") + @RequiresPermissions("sys:role:list") + public R list(@RequestParam Map params){ + //如果不是超级管理员,则只查询自己创建的角色列表 + if(getUserId() != Constant.SUPER_ADMIN){ + params.put("createUserId", getUserId()); + } + + PageUtils page = sysRoleService.queryPage(params); + + return R.ok().put("page", page); + } + + /** + * 角色列表 + */ + @GetMapping("/select") + @RequiresPermissions("sys:role:select") + public R select(){ + Map map = new HashMap<>(); + + //如果不是超级管理员,则只查询自己所拥有的角色列表 + if(getUserId() != Constant.SUPER_ADMIN){ + map.put("create_user_id", getUserId()); + } + List list = (List) sysRoleService.listByMap(map); + + return R.ok().put("list", list); + } + + /** + * 角色信息 + */ + @GetMapping("/info/{roleId}") + @RequiresPermissions("sys:role:info") + public R info(@PathVariable("roleId") Long roleId){ + SysRoleEntity role = sysRoleService.getById(roleId); + + //查询角色对应的菜单 + List menuIdList = sysRoleMenuService.queryMenuIdList(roleId); + role.setMenuIdList(menuIdList); + + return R.ok().put("role", role); + } + + /** + * 保存角色 + */ + @SysLog("保存角色") + @PostMapping("/save") + @RequiresPermissions("sys:role:save") + public R save(@RequestBody SysRoleEntity role){ + ValidatorUtils.validateEntity(role); + + role.setCreateUserId(getUserId()); + sysRoleService.saveRole(role); + + return R.ok(); + } + + /** + * 修改角色 + */ + @SysLog("修改角色") + @PostMapping("/update") + @RequiresPermissions("sys:role:update") + public R update(@RequestBody SysRoleEntity role){ + ValidatorUtils.validateEntity(role); + + role.setCreateUserId(getUserId()); + sysRoleService.update(role); + + return R.ok(); + } + + /** + * 删除角色 + */ + @SysLog("删除角色") + @PostMapping("/delete") + @RequiresPermissions("sys:role:delete") + public R delete(@RequestBody Long[] roleIds){ + sysRoleService.deleteBatch(roleIds); + + return R.ok(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysUserController.java new file mode 100644 index 000000000..27c299038 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.annotation.SysLog; +import io.renren.common.utils.Constant; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.R; +import io.renren.common.validator.Assert; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.AddGroup; +import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.form.PasswordForm; +import io.renren.modules.sys.service.SysUserRoleService; +import io.renren.modules.sys.service.SysUserService; +import org.apache.commons.lang.ArrayUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.apache.shiro.crypto.hash.Sha256Hash; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/user") +public class SysUserController extends AbstractController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysUserRoleService sysUserRoleService; + + + /** + * 所有用户列表 + */ + @GetMapping("/list") + @RequiresPermissions("sys:user:list") + public R list(@RequestParam Map params){ + //只有超级管理员,才能查看所有管理员列表 + if(getUserId() != Constant.SUPER_ADMIN){ + params.put("createUserId", getUserId()); + } + PageUtils page = sysUserService.queryPage(params); + + return R.ok().put("page", page); + } + + /** + * 获取登录的用户信息 + */ + @GetMapping("/info") + public R info(){ + return R.ok().put("user", getUser()); + } + + /** + * 修改登录用户密码 + */ + @SysLog("修改密码") + @PostMapping("/password") + public R password(@RequestBody PasswordForm form){ + Assert.isBlank(form.getNewPassword(), "新密码不为能空"); + + //sha256加密 + String password = new Sha256Hash(form.getPassword(), getUser().getSalt()).toHex(); + //sha256加密 + String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex(); + + //更新密码 + boolean flag = sysUserService.updatePassword(getUserId(), password, newPassword); + if(!flag){ + return R.error("原密码不正确"); + } + + return R.ok(); + } + + /** + * 用户信息 + */ + @GetMapping("/info/{userId}") + @RequiresPermissions("sys:user:info") + public R info(@PathVariable("userId") Long userId){ + SysUserEntity user = sysUserService.getById(userId); + + //获取用户所属的角色列表 + List roleIdList = sysUserRoleService.queryRoleIdList(userId); + user.setRoleIdList(roleIdList); + + return R.ok().put("user", user); + } + + /** + * 保存用户 + */ + @SysLog("保存用户") + @PostMapping("/save") + @RequiresPermissions("sys:user:save") + public R save(@RequestBody SysUserEntity user){ + ValidatorUtils.validateEntity(user, AddGroup.class); + + user.setCreateUserId(getUserId()); + sysUserService.saveUser(user); + + return R.ok(); + } + + /** + * 修改用户 + */ + @SysLog("修改用户") + @PostMapping("/update") + @RequiresPermissions("sys:user:update") + public R update(@RequestBody SysUserEntity user){ + ValidatorUtils.validateEntity(user, UpdateGroup.class); + + user.setCreateUserId(getUserId()); + sysUserService.update(user); + + return R.ok(); + } + + /** + * 删除用户 + */ + @SysLog("删除用户") + @PostMapping("/delete") + @RequiresPermissions("sys:user:delete") + public R delete(@RequestBody Long[] userIds){ + if(ArrayUtils.contains(userIds, 1L)){ + return R.error("系统管理员不能删除"); + } + + if(ArrayUtils.contains(userIds, getUserId())){ + return R.error("当前用户不能删除"); + } + + sysUserService.deleteBatch(userIds); + + return R.ok(); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysCaptchaDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysCaptchaDao.java new file mode 100644 index 000000000..80d6d1895 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysCaptchaDao.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysCaptchaEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysCaptchaDao extends BaseMapper { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysConfigDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysConfigDao.java new file mode 100644 index 000000000..0132d721b --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysConfigDao.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysConfigEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 系统配置信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysConfigDao extends BaseMapper { + + /** + * 根据key,查询value + */ + SysConfigEntity queryByKey(String paramKey); + + /** + * 根据key,更新value + */ + int updateValueByKey(@Param("paramKey") String paramKey, @Param("paramValue") String paramValue); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysLogDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysLogDao.java new file mode 100644 index 000000000..afd984dde --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysLogDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 系统日志 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysLogDao extends BaseMapper { + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java new file mode 100644 index 000000000..4339a8cd3 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysMenuDao extends BaseMapper { + + /** + * 根据父菜单,查询子菜单 + * @param parentId 父菜单ID + */ + List queryListParentId(Long parentId); + + /** + * 获取不包含按钮的菜单列表 + */ + List queryNotButtonList(); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysRoleDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysRoleDao.java new file mode 100644 index 000000000..e99c8ea89 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysRoleDao.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRoleDao extends BaseMapper { + + /** + * 查询用户创建的角色ID列表 + */ + List queryRoleIdList(Long createUserId); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java new file mode 100644 index 000000000..4dc0429f8 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRoleMenuDao extends BaseMapper { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List queryMenuIdList(Long roleId); + + /** + * 根据角色ID数组,批量删除 + */ + int deleteBatch(Long[] roleIds); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserDao.java new file mode 100644 index 000000000..333c00c94 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserDao extends BaseMapper { + + /** + * 查询用户的所有权限 + * @param userId 用户ID + */ + List queryAllPerms(Long userId); + + /** + * 查询用户的所有菜单ID + */ + List queryAllMenuId(Long userId); + + /** + * 根据用户名,查询系统用户 + */ + SysUserEntity queryByUserName(String username); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserRoleDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserRoleDao.java new file mode 100644 index 000000000..298bbd692 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserRoleDao.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysUserRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 用户与角色对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserRoleDao extends BaseMapper { + + /** + * 根据用户ID,获取角色ID列表 + */ + List queryRoleIdList(Long userId); + + + /** + * 根据角色ID数组,批量删除 + */ + int deleteBatch(Long[] roleIds); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserTokenDao.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserTokenDao.java new file mode 100644 index 000000000..546cd1d20 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/dao/SysUserTokenDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.renren.modules.sys.entity.SysUserTokenEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 系统用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserTokenDao extends BaseMapper { + + SysUserTokenEntity queryByToken(String token); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysCaptchaEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysCaptchaEntity.java new file mode 100644 index 000000000..f5c482313 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysCaptchaEntity.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 系统验证码 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_captcha") +public class SysCaptchaEntity { + @TableId(type = IdType.INPUT) + private String uuid; + /** + * 验证码 + */ + private String code; + /** + * 过期时间 + */ + private Date expireTime; + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Date getExpireTime() { + return expireTime; + } + + public void setExpireTime(Date expireTime) { + this.expireTime = expireTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysConfigEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysConfigEntity.java new file mode 100644 index 000000000..7a93d79cf --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysConfigEntity.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 系统配置信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_config") +public class SysConfigEntity { + @TableId + private Long id; + @NotBlank(message="参数名不能为空") + private String paramKey; + @NotBlank(message="参数值不能为空") + private String paramValue; + private String remark; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getParamKey() { + return paramKey; + } + + public void setParamKey(String paramKey) { + this.paramKey = paramKey; + } + + public String getParamValue() { + return paramValue; + } + + public void setParamValue(String paramValue) { + this.paramValue = paramValue; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysLogEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysLogEntity.java new file mode 100644 index 000000000..75d3459f0 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysLogEntity.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 系统日志 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_log") +public class SysLogEntity implements Serializable { + private static final long serialVersionUID = 1L; + @TableId + private Long id; + //用户名 + private String username; + //用户操作 + private String operation; + //请求方法 + private String method; + //请求参数 + private String params; + //执行时长(毫秒) + private Long time; + //IP地址 + private String ip; + //创建时间 + private Date createDate; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + + public Long getTime() { + return time; + } + + public void setTime(Long time) { + this.time = time; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysMenuEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysMenuEntity.java new file mode 100644 index 000000000..22ca0b886 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysMenuEntity.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_menu") +public class SysMenuEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 菜单ID + */ + @TableId + private Long menuId; + + /** + * 父菜单ID,一级菜单为0 + */ + private Long parentId; + + /** + * 父菜单名称 + */ + @TableField(exist=false) + private String parentName; + + /** + * 菜单名称 + */ + private String name; + + /** + * 菜单URL + */ + private String url; + + /** + * 授权(多个用逗号分隔,如:user:list,user:create) + */ + private String perms; + + /** + * 类型 0:目录 1:菜单 2:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 排序 + */ + private Integer orderNum; + + /** + * ztree属性 + */ + @TableField(exist=false) + private Boolean open; + + @TableField(exist=false) + private List list=new ArrayList<>(); + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getPerms() { + return perms; + } + + public void setPerms(String perms) { + this.perms = perms; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Integer getOrderNum() { + return orderNum; + } + + public void setOrderNum(Integer orderNum) { + this.orderNum = orderNum; + } + + public Boolean getOpen() { + return open; + } + + public void setOpen(Boolean open) { + this.open = open; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysRoleEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysRoleEntity.java new file mode 100644 index 000000000..8f6eb2c69 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysRoleEntity.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_role") +public class SysRoleEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + @TableId + private Long roleId; + + /** + * 角色名称 + */ + @NotBlank(message="角色名称不能为空") + private String roleName; + + /** + * 备注 + */ + private String remark; + + /** + * 创建者ID + */ + private Long createUserId; + + @TableField(exist=false) + private List menuIdList; + + /** + * 创建时间 + */ + private Date createTime; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getCreateUserId() { + return createUserId; + } + + public void setCreateUserId(Long createUserId) { + this.createUserId = createUserId; + } + + public List getMenuIdList() { + return menuIdList; + } + + public void setMenuIdList(List menuIdList) { + this.menuIdList = menuIdList; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysRoleMenuEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysRoleMenuEntity.java new file mode 100644 index 000000000..9f26c3d01 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysRoleMenuEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_role_menu") +public class SysRoleMenuEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId + private Long id; + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserEntity.java new file mode 100644 index 000000000..9a02cef2e --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserEntity.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.renren.common.validator.group.AddGroup; +import io.renren.common.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_user") +public class SysUserEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @TableId + private Long userId; + + /** + * 用户名 + */ + @NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String username; + + /** + * 密码 + */ + @NotBlank(message="密码不能为空", groups = AddGroup.class) + private String password; + + /** + * 盐 + */ + private String salt; + + /** + * 邮箱 + */ + @NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class}) + private String email; + + /** + * 手机号 + */ + private String mobile; + + /** + * 状态 0:禁用 1:正常 + */ + private Integer status; + + /** + * 角色ID列表 + */ + @TableField(exist=false) + private List roleIdList; + + /** + * 创建者ID + */ + private Long createUserId; + + /** + * 创建时间 + */ + private Date createTime; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getSalt() { + return salt; + } + + public void setSalt(String salt) { + this.salt = salt; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public List getRoleIdList() { + return roleIdList; + } + + public void setRoleIdList(List roleIdList) { + this.roleIdList = roleIdList; + } + + public Long getCreateUserId() { + return createUserId; + } + + public void setCreateUserId(Long createUserId) { + this.createUserId = createUserId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserRoleEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserRoleEntity.java new file mode 100644 index 000000000..5d8acab9b --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserRoleEntity.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户与角色对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_user_role") +public class SysUserRoleEntity implements Serializable { + private static final long serialVersionUID = 1L; + @TableId + private Long id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 角色ID + */ + private Long roleId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserTokenEntity.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserTokenEntity.java new file mode 100644 index 000000000..ba4570140 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/entity/SysUserTokenEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 系统用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_user_token") +public class SysUserTokenEntity implements Serializable { + private static final long serialVersionUID = 1L; + + //用户ID + @TableId(type = IdType.INPUT) + private Long userId; + //token + private String token; + //过期时间 + private Date expireTime; + //更新时间 + private Date updateTime; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Date getExpireTime() { + return expireTime; + } + + public void setExpireTime(Date expireTime) { + this.expireTime = expireTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/form/PasswordForm.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/form/PasswordForm.java new file mode 100644 index 000000000..7b42e9e9c --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/form/PasswordForm.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.form; + +import lombok.Data; + +/** + * 密码表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class PasswordForm { + /** + * 原密码 + */ + private String password; + /** + * 新密码 + */ + private String newPassword; + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/form/SysLoginForm.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/form/SysLoginForm.java new file mode 100644 index 000000000..651838446 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/form/SysLoginForm.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.form; + +import lombok.Data; + +/** + * 登录表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class SysLoginForm { + private String username; + private String password; + private String captcha; + private String uuid; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getCaptcha() { + return captcha; + } + + public void setCaptcha(String captcha) { + this.captcha = captcha; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Filter.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Filter.java new file mode 100644 index 000000000..1440dfbd0 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Filter.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.oauth2; + +import com.google.gson.Gson; +import io.renren.common.utils.HttpContextUtils; +import io.renren.common.utils.R; +import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.AuthenticationToken; +import org.apache.shiro.web.filter.authc.AuthenticatingFilter; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * oauth2过滤器 + * + * @author Mark sunlightcs@gmail.com + */ +public class OAuth2Filter extends AuthenticatingFilter { + + @Override + protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) throws Exception { + //获取请求token + String token = getRequestToken((HttpServletRequest) request); + + if(StringUtils.isBlank(token)){ + return null; + } + + return new OAuth2Token(token); + } + + @Override + protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { + if(((HttpServletRequest) request).getMethod().equals(RequestMethod.OPTIONS.name())){ + return true; + } + + return false; + } + + @Override + protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { + //获取请求token,如果token不存在,直接返回401 + String token = getRequestToken((HttpServletRequest) request); + if(StringUtils.isBlank(token)){ + HttpServletResponse httpResponse = (HttpServletResponse) response; + httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); + httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); + + String json = new Gson().toJson(R.error(HttpStatus.SC_UNAUTHORIZED, "invalid token")); + + httpResponse.getWriter().print(json); + + return false; + } + + return executeLogin(request, response); + } + + @Override + protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) { + HttpServletResponse httpResponse = (HttpServletResponse) response; + httpResponse.setContentType("application/json;charset=utf-8"); + httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); + httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); + try { + //处理登录失败的异常 + Throwable throwable = e.getCause() == null ? e : e.getCause(); + R r = R.error(HttpStatus.SC_UNAUTHORIZED, throwable.getMessage()); + + String json = new Gson().toJson(r); + httpResponse.getWriter().print(json); + } catch (IOException e1) { + + } + + return false; + } + + /** + * 获取请求的token + */ + private String getRequestToken(HttpServletRequest httpRequest){ + //从header中获取token + String token = httpRequest.getHeader("token"); + + //如果header中不存在token,则从参数中获取token + if(StringUtils.isBlank(token)){ + token = httpRequest.getParameter("token"); + } + + return token; + } + + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Realm.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Realm.java new file mode 100644 index 000000000..4085d0fa2 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Realm.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.oauth2; + +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.entity.SysUserTokenEntity; +import io.renren.modules.sys.service.ShiroService; +import org.apache.shiro.authc.*; +import org.apache.shiro.authz.AuthorizationInfo; +import org.apache.shiro.authz.SimpleAuthorizationInfo; +import org.apache.shiro.realm.AuthorizingRealm; +import org.apache.shiro.subject.PrincipalCollection; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Set; + +/** + * 认证 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class OAuth2Realm extends AuthorizingRealm { + @Autowired + private ShiroService shiroService; + + @Override + public boolean supports(AuthenticationToken token) { + return token instanceof OAuth2Token; + } + + /** + * 授权(验证权限时调用) + */ + @Override + protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { + SysUserEntity user = (SysUserEntity)principals.getPrimaryPrincipal(); + Long userId = user.getUserId(); + + //用户权限列表 + Set permsSet = shiroService.getUserPermissions(userId); + + SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); + info.setStringPermissions(permsSet); + return info; + } + + /** + * 认证(登录时调用) + */ + @Override + protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { + String accessToken = (String) token.getPrincipal(); + + //根据accessToken,查询用户信息 + SysUserTokenEntity tokenEntity = shiroService.queryByToken(accessToken); + //token失效 + if(tokenEntity == null || tokenEntity.getExpireTime().getTime() < System.currentTimeMillis()){ + throw new IncorrectCredentialsException("token失效,请重新登录"); + } + + //查询用户信息 + SysUserEntity user = shiroService.queryUser(tokenEntity.getUserId()); + //账号锁定 + if(user.getStatus() == 0){ + throw new LockedAccountException("账号已被锁定,请联系管理员"); + } + + SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(user, accessToken, getName()); + return info; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Token.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Token.java new file mode 100644 index 000000000..119f31e42 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/OAuth2Token.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.oauth2; + + +import org.apache.shiro.authc.AuthenticationToken; + +/** + * token + * + * @author Mark sunlightcs@gmail.com + */ +public class OAuth2Token implements AuthenticationToken { + private String token; + + public OAuth2Token(String token){ + this.token = token; + } + + @Override + public String getPrincipal() { + return token; + } + + @Override + public Object getCredentials() { + return token; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/TokenGenerator.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/TokenGenerator.java new file mode 100644 index 000000000..54bdca1bb --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/oauth2/TokenGenerator.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.oauth2; + +import io.renren.common.exception.RRException; + +import java.security.MessageDigest; +import java.util.UUID; + +/** + * 生成token + * + * @author Mark sunlightcs@gmail.com + */ +public class TokenGenerator { + + public static String generateValue() { + return generateValue(UUID.randomUUID().toString()); + } + + private static final char[] hexCode = "0123456789abcdef".toCharArray(); + + public static String toHexString(byte[] data) { + if(data == null) { + return null; + } + StringBuilder r = new StringBuilder(data.length*2); + for ( byte b : data) { + r.append(hexCode[(b >> 4) & 0xF]); + r.append(hexCode[(b & 0xF)]); + } + return r.toString(); + } + + public static String generateValue(String param) { + try { + MessageDigest algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(param.getBytes()); + byte[] messageDigest = algorithm.digest(); + return toHexString(messageDigest); + } catch (Exception e) { + throw new RRException("生成Token失败", e); + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/redis/SysConfigRedis.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/redis/SysConfigRedis.java new file mode 100644 index 000000000..e6857e7c7 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/redis/SysConfigRedis.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.redis; + + +import io.renren.common.utils.RedisKeys; +import io.renren.common.utils.RedisUtils; +import io.renren.modules.sys.entity.SysConfigEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 系统配置Redis + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class SysConfigRedis { + @Autowired + private RedisUtils redisUtils; + + public void saveOrUpdate(SysConfigEntity config) { + if(config == null){ + return ; + } + String key = RedisKeys.getSysConfigKey(config.getParamKey()); + redisUtils.set(key, config); + } + + public void delete(String configKey) { + String key = RedisKeys.getSysConfigKey(configKey); + redisUtils.delete(key); + } + + public SysConfigEntity get(String configKey){ + String key = RedisKeys.getSysConfigKey(configKey); + return redisUtils.get(key, SysConfigEntity.class); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/ShiroService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/ShiroService.java new file mode 100644 index 000000000..5872f5753 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/ShiroService.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.entity.SysUserTokenEntity; + +import java.util.Set; + +/** + * shiro相关接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ShiroService { + /** + * 获取用户权限列表 + */ + Set getUserPermissions(long userId); + + SysUserTokenEntity queryByToken(String token); + + /** + * 根据用户ID,查询用户 + * @param userId + */ + SysUserEntity queryUser(Long userId); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysCaptchaService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysCaptchaService.java new file mode 100644 index 000000000..0eeaf47ff --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysCaptchaService.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.modules.sys.entity.SysCaptchaEntity; + +import java.awt.image.BufferedImage; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysCaptchaService extends IService { + + /** + * 获取图片验证码 + */ + BufferedImage getCaptcha(String uuid); + + /** + * 验证码效验 + * @param uuid uuid + * @param code 验证码 + * @return true:成功 false:失败 + */ + boolean validate(String uuid, String code); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysConfigService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysConfigService.java new file mode 100644 index 000000000..0f4861089 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysConfigService.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.sys.entity.SysConfigEntity; + +import java.util.Map; + +/** + * 系统配置信息 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysConfigService extends IService { + + PageUtils queryPage(Map params); + + /** + * 保存配置信息 + */ + public void saveConfig(SysConfigEntity config); + + /** + * 更新配置信息 + */ + public void update(SysConfigEntity config); + + /** + * 根据key,更新value + */ + public void updateValueByKey(String key, String value); + + /** + * 删除配置信息 + */ + public void deleteBatch(Long[] ids); + + /** + * 根据key,获取配置的value值 + * + * @param key key + */ + public String getValue(String key); + + /** + * 根据key,获取value的Object对象 + * @param key key + * @param clazz Object对象 + */ + public T getConfigObject(String key, Class clazz); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysLogService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysLogService.java new file mode 100644 index 000000000..71e8f4fb2 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysLogService.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.sys.entity.SysLogEntity; + +import java.util.Map; + + +/** + * 系统日志 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysLogService extends IService { + + PageUtils queryPage(Map params); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysMenuService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysMenuService.java new file mode 100644 index 000000000..b20056bdc --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysMenuService.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.modules.sys.entity.SysMenuEntity; + +import java.util.List; + + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysMenuService extends IService { + + /** + * 根据父菜单,查询子菜单 + * @param parentId 父菜单ID + * @param menuIdList 用户菜单ID + */ + List queryListParentId(Long parentId, List menuIdList); + + /** + * 根据父菜单,查询子菜单 + * @param parentId 父菜单ID + */ + List queryListParentId(Long parentId); + + /** + * 获取不包含按钮的菜单列表 + */ + List queryNotButtonList(); + + /** + * 获取用户菜单列表 + */ + List getUserMenuList(Long userId); + + /** + * 删除 + */ + void delete(Long menuId); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysRoleMenuService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysRoleMenuService.java new file mode 100644 index 000000000..14bd5091a --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysRoleMenuService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.modules.sys.entity.SysRoleMenuEntity; + +import java.util.List; + + + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRoleMenuService extends IService { + + void saveOrUpdate(Long roleId, List menuIdList); + + /** + * 根据角色ID,获取菜单ID列表 + */ + List queryMenuIdList(Long roleId); + + /** + * 根据角色ID数组,批量删除 + */ + int deleteBatch(Long[] roleIds); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysRoleService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysRoleService.java new file mode 100644 index 000000000..92ae5c64f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysRoleService.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.sys.entity.SysRoleEntity; + +import java.util.List; +import java.util.Map; + + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRoleService extends IService { + + PageUtils queryPage(Map params); + + void saveRole(SysRoleEntity role); + + void update(SysRoleEntity role); + + void deleteBatch(Long[] roleIds); + + + /** + * 查询用户创建的角色ID列表 + */ + List queryRoleIdList(Long createUserId); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserRoleService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserRoleService.java new file mode 100644 index 000000000..b4441facd --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserRoleService.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.modules.sys.entity.SysUserRoleEntity; + +import java.util.List; + + + +/** + * 用户与角色对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserRoleService extends IService { + + void saveOrUpdate(Long userId, List roleIdList); + + /** + * 根据用户ID,获取角色ID列表 + */ + List queryRoleIdList(Long userId); + + /** + * 根据角色ID数组,批量删除 + */ + int deleteBatch(Long[] roleIds); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserService.java new file mode 100644 index 000000000..e29b0380c --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserService.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.PageUtils; +import io.renren.modules.sys.entity.SysUserEntity; + +import java.util.List; +import java.util.Map; + + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserService extends IService { + + PageUtils queryPage(Map params); + + /** + * 查询用户的所有权限 + * @param userId 用户ID + */ + List queryAllPerms(Long userId); + + /** + * 查询用户的所有菜单ID + */ + List queryAllMenuId(Long userId); + + /** + * 根据用户名,查询系统用户 + */ + SysUserEntity queryByUserName(String username); + + /** + * 保存用户 + */ + void saveUser(SysUserEntity user); + + /** + * 修改用户 + */ + void update(SysUserEntity user); + + /** + * 删除用户 + */ + void deleteBatch(Long[] userIds); + + /** + * 修改密码 + * @param userId 用户ID + * @param password 原密码 + * @param newPassword 新密码 + */ + boolean updatePassword(Long userId, String password, String newPassword); +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserTokenService.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserTokenService.java new file mode 100644 index 000000000..f4ecb5a0e --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/SysUserTokenService.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import io.renren.common.utils.R; +import io.renren.modules.sys.entity.SysUserTokenEntity; + +/** + * 用户Token + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserTokenService extends IService { + + /** + * 生成token + * @param userId 用户ID + */ + R createToken(long userId); + + /** + * 退出,修改token值 + * @param userId 用户ID + */ + void logout(long userId); + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/ShiroServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/ShiroServiceImpl.java new file mode 100644 index 000000000..12230bc3f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/ShiroServiceImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import io.renren.common.utils.Constant; +import io.renren.modules.sys.dao.SysMenuDao; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.dao.SysUserTokenDao; +import io.renren.modules.sys.entity.SysMenuEntity; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.entity.SysUserTokenEntity; +import io.renren.modules.sys.service.ShiroService; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class ShiroServiceImpl implements ShiroService { + @Autowired + private SysMenuDao sysMenuDao; + @Autowired + private SysUserDao sysUserDao; + @Autowired + private SysUserTokenDao sysUserTokenDao; + + @Override + public Set getUserPermissions(long userId) { + List permsList; + + //系统管理员,拥有最高权限 + if(userId == Constant.SUPER_ADMIN){ + List menuList = sysMenuDao.selectList(null); + permsList = new ArrayList<>(menuList.size()); + for(SysMenuEntity menu : menuList){ + permsList.add(menu.getPerms()); + } + }else{ + permsList = sysUserDao.queryAllPerms(userId); + } + //用户权限列表 + Set permsSet = new HashSet<>(); + for(String perms : permsList){ + if(StringUtils.isBlank(perms)){ + continue; + } + permsSet.addAll(Arrays.asList(perms.trim().split(","))); + } + return permsSet; + } + + @Override + public SysUserTokenEntity queryByToken(String token) { + return sysUserTokenDao.queryByToken(token); + } + + @Override + public SysUserEntity queryUser(Long userId) { + return sysUserDao.selectById(userId); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysCaptchaServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysCaptchaServiceImpl.java new file mode 100644 index 000000000..b9c991e4d --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysCaptchaServiceImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.code.kaptcha.Producer; +import io.renren.common.exception.RRException; +import io.renren.common.utils.DateUtils; +import io.renren.modules.sys.dao.SysCaptchaDao; +import io.renren.modules.sys.entity.SysCaptchaEntity; +import io.renren.modules.sys.service.SysCaptchaService; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.awt.image.BufferedImage; +import java.util.Date; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +@Service("sysCaptchaService") +public class SysCaptchaServiceImpl extends ServiceImpl implements SysCaptchaService { + @Autowired + private Producer producer; + + @Override + public BufferedImage getCaptcha(String uuid) { + if(StringUtils.isBlank(uuid)){ + throw new RRException("uuid不能为空"); + } + //生成文字验证码 + String code = producer.createText(); + + SysCaptchaEntity captchaEntity = new SysCaptchaEntity(); + captchaEntity.setUuid(uuid); + captchaEntity.setCode(code); + //5分钟后过期 + captchaEntity.setExpireTime(DateUtils.addDateMinutes(new Date(), 5)); + this.save(captchaEntity); + + return producer.createImage(code); + } + + @Override + public boolean validate(String uuid, String code) { + SysCaptchaEntity captchaEntity = this.getOne(new QueryWrapper().eq("uuid", uuid)); + if(captchaEntity == null){ + return false; + } + + //删除验证码 + this.removeById(uuid); + + if(captchaEntity.getCode().equalsIgnoreCase(code) && captchaEntity.getExpireTime().getTime() >= System.currentTimeMillis()){ + return true; + } + + return false; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysConfigServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysConfigServiceImpl.java new file mode 100644 index 000000000..e62763d11 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.gson.Gson; +import io.renren.common.exception.RRException; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.sys.dao.SysConfigDao; +import io.renren.modules.sys.entity.SysConfigEntity; +import io.renren.modules.sys.redis.SysConfigRedis; +import io.renren.modules.sys.service.SysConfigService; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Map; + +@Service("sysConfigService") +public class SysConfigServiceImpl extends ServiceImpl implements SysConfigService { + @Autowired + private SysConfigRedis sysConfigRedis; + + @Override + public PageUtils queryPage(Map params) { + String paramKey = (String)params.get("paramKey"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + .like(StringUtils.isNotBlank(paramKey),"param_key", paramKey) + .eq("status", 1) + ); + + return new PageUtils(page); + } + + @Override + public void saveConfig(SysConfigEntity config) { + this.save(config); + sysConfigRedis.saveOrUpdate(config); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysConfigEntity config) { + this.updateById(config); + sysConfigRedis.saveOrUpdate(config); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateValueByKey(String key, String value) { + baseMapper.updateValueByKey(key, value); + sysConfigRedis.delete(key); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteBatch(Long[] ids) { + for(Long id : ids){ + SysConfigEntity config = this.getById(id); + sysConfigRedis.delete(config.getParamKey()); + } + + this.removeByIds(Arrays.asList(ids)); + } + + @Override + public String getValue(String key) { + SysConfigEntity config = sysConfigRedis.get(key); + if(config == null){ + config = baseMapper.queryByKey(key); + sysConfigRedis.saveOrUpdate(config); + } + + return config == null ? null : config.getParamValue(); + } + + @Override + public T getConfigObject(String key, Class clazz) { + String value = getValue(key); + if(StringUtils.isNotBlank(value)){ + return new Gson().fromJson(value, clazz); + } + + try { + return clazz.newInstance(); + } catch (Exception e) { + throw new RRException("获取参数失败"); + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysLogServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysLogServiceImpl.java new file mode 100644 index 000000000..517f1ec4e --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysLogServiceImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.sys.dao.SysLogDao; +import io.renren.modules.sys.entity.SysLogEntity; +import io.renren.modules.sys.service.SysLogService; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + + +@Service("sysLogService") +public class SysLogServiceImpl extends ServiceImpl implements SysLogService { + + @Override + public PageUtils queryPage(Map params) { + String key = (String)params.get("key"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper().like(StringUtils.isNotBlank(key),"username", key) + ); + + return new PageUtils(page); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java new file mode 100644 index 000000000..cf5df25be --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.Constant; +import io.renren.common.utils.MapUtils; +import io.renren.modules.sys.dao.SysMenuDao; +import io.renren.modules.sys.entity.SysMenuEntity; +import io.renren.modules.sys.service.SysMenuService; +import io.renren.modules.sys.service.SysRoleMenuService; +import io.renren.modules.sys.service.SysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + + +@Service("sysMenuService") +public class SysMenuServiceImpl extends ServiceImpl implements SysMenuService { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysRoleMenuService sysRoleMenuService; + + @Override + public List queryListParentId(Long parentId, List menuIdList) { + List menuList = queryListParentId(parentId); + if(menuIdList == null){ + return menuList; + } + + List userMenuList = new ArrayList<>(); + for(SysMenuEntity menu : menuList){ + if(menuIdList.contains(menu.getMenuId())){ + userMenuList.add(menu); + } + } + return userMenuList; + } + + @Override + public List queryListParentId(Long parentId) { + return baseMapper.queryListParentId(parentId); + } + + @Override + public List queryNotButtonList() { + return baseMapper.queryNotButtonList(); + } + + @Override + public List getUserMenuList(Long userId) { + //系统管理员,拥有最高权限 + if(userId == Constant.SUPER_ADMIN){ + return getMenuList(null); + } + + //用户菜单列表 + List menuIdList = sysUserService.queryAllMenuId(userId); + return getMenuList(menuIdList); + } + + /** + * 获取拥有的菜单列表 + * @param menuIdList + * @return + */ + private List getMenuList(List menuIdList) { + // 查询拥有的所有菜单 + List menus = this.baseMapper.selectList(new QueryWrapper() + .in(Objects.nonNull(menuIdList), "menu_id", menuIdList).in("type", 0, 1)); + // 将id和菜单绑定 + HashMap menuMap = new HashMap<>(12); + for (SysMenuEntity s : menus) { + menuMap.put(s.getMenuId(), s); + } + // 使用迭代器,组装菜单的层级关系 + Iterator iterator = menus.iterator(); + while (iterator.hasNext()) { + SysMenuEntity menu = iterator.next(); + SysMenuEntity parent = menuMap.get(menu.getParentId()); + if (Objects.nonNull(parent)) { + parent.getList().add(menu); + // 将这个菜单从当前节点移除 + iterator.remove(); + } + } + + return menus; + } + + @Override + public void delete(Long menuId){ + //删除菜单 + this.removeById(menuId); + //删除菜单与角色关联 + sysRoleMenuService.removeByMap(new MapUtils().put("menu_id", menuId)); + } + + /** + * 获取所有菜单列表 + */ + private List getAllMenuList(List menuIdList){ + //查询根菜单列表 + List menuList = queryListParentId(0L, menuIdList); + //递归获取子菜单 + getMenuTreeList(menuList, menuIdList); + + return menuList; + } + + /** + * 递归 + */ + private List getMenuTreeList(List menuList, List menuIdList){ + List subMenuList = new ArrayList(); + + for(SysMenuEntity entity : menuList){ + //目录 + if(entity.getType() == Constant.MenuType.CATALOG.getValue()){ + entity.setList(getMenuTreeList(queryListParentId(entity.getMenuId(), menuIdList), menuIdList)); + } + subMenuList.add(entity); + } + + return subMenuList; + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysRoleMenuServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysRoleMenuServiceImpl.java new file mode 100644 index 000000000..1d8626834 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysRoleMenuServiceImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.modules.sys.dao.SysRoleMenuDao; +import io.renren.modules.sys.entity.SysRoleMenuEntity; +import io.renren.modules.sys.service.SysRoleMenuService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + + + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Service("sysRoleMenuService") +public class SysRoleMenuServiceImpl extends ServiceImpl implements SysRoleMenuService { + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List menuIdList) { + //先删除角色与菜单关系 + deleteBatch(new Long[]{roleId}); + + if(menuIdList.size() == 0){ + return ; + } + + //保存角色与菜单关系 + for(Long menuId : menuIdList){ + SysRoleMenuEntity sysRoleMenuEntity = new SysRoleMenuEntity(); + sysRoleMenuEntity.setMenuId(menuId); + sysRoleMenuEntity.setRoleId(roleId); + + this.save(sysRoleMenuEntity); + } + } + + @Override + public List queryMenuIdList(Long roleId) { + return baseMapper.queryMenuIdList(roleId); + } + + @Override + public int deleteBatch(Long[] roleIds){ + return baseMapper.deleteBatch(roleIds); + } + +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java new file mode 100644 index 000000000..4885831d4 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.exception.RRException; +import io.renren.common.utils.Constant; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.sys.dao.SysRoleDao; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.entity.SysRoleEntity; +import io.renren.modules.sys.service.SysRoleMenuService; +import io.renren.modules.sys.service.SysRoleService; +import io.renren.modules.sys.service.SysUserRoleService; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +@Service("sysRoleService") +public class SysRoleServiceImpl extends ServiceImpl implements SysRoleService { + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysUserDao sysUserDao; + @Autowired + private SysUserRoleService sysUserRoleService; + + @Override + public PageUtils queryPage(Map params) { + String roleName = (String)params.get("roleName"); + Long createUserId = (Long)params.get("createUserId"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + .like(StringUtils.isNotBlank(roleName),"role_name", roleName) + .eq(createUserId != null,"create_user_id", createUserId) + ); + + return new PageUtils(page); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveRole(SysRoleEntity role) { + role.setCreateTime(new Date()); + this.save(role); + + //检查权限是否越权 + checkPrems(role); + + //保存角色与菜单关系 + sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysRoleEntity role) { + this.updateById(role); + + //检查权限是否越权 + checkPrems(role); + + //更新角色与菜单关系 + sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteBatch(Long[] roleIds) { + //删除角色 + this.removeByIds(Arrays.asList(roleIds)); + + //删除角色与菜单关联 + sysRoleMenuService.deleteBatch(roleIds); + + //删除角色与用户关联 + sysUserRoleService.deleteBatch(roleIds); + } + + + @Override + public List queryRoleIdList(Long createUserId) { + return baseMapper.queryRoleIdList(createUserId); + } + + /** + * 检查权限是否越权 + */ + private void checkPrems(SysRoleEntity role){ + //如果不是超级管理员,则需要判断角色的权限是否超过自己的权限 + if(role.getCreateUserId() == Constant.SUPER_ADMIN){ + return ; + } + + //查询用户所拥有的菜单列表 + List menuIdList = sysUserDao.queryAllMenuId(role.getCreateUserId()); + + //判断是否越权 + if(!menuIdList.containsAll(role.getMenuIdList())){ + throw new RRException("新增角色的权限,已超出你的权限范围"); + } + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserRoleServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserRoleServiceImpl.java new file mode 100644 index 000000000..7235c18e0 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserRoleServiceImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.MapUtils; +import io.renren.modules.sys.dao.SysUserRoleDao; +import io.renren.modules.sys.entity.SysUserRoleEntity; +import io.renren.modules.sys.service.SysUserRoleService; +import org.springframework.stereotype.Service; + +import java.util.List; + + + +/** + * 用户与角色对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Service("sysUserRoleService") +public class SysUserRoleServiceImpl extends ServiceImpl implements SysUserRoleService { + + @Override + public void saveOrUpdate(Long userId, List roleIdList) { + //先删除用户与角色关系 + this.removeByMap(new MapUtils().put("user_id", userId)); + + if(roleIdList == null || roleIdList.size() == 0){ + return ; + } + + //保存用户与角色关系 + for(Long roleId : roleIdList){ + SysUserRoleEntity sysUserRoleEntity = new SysUserRoleEntity(); + sysUserRoleEntity.setUserId(userId); + sysUserRoleEntity.setRoleId(roleId); + + this.save(sysUserRoleEntity); + } + } + + @Override + public List queryRoleIdList(Long userId) { + return baseMapper.queryRoleIdList(userId); + } + + @Override + public int deleteBatch(Long[] roleIds){ + return baseMapper.deleteBatch(roleIds); + } +} diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java new file mode 100644 index 000000000..52b8290ee --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.exception.RRException; +import io.renren.common.utils.Constant; +import io.renren.common.utils.PageUtils; +import io.renren.common.utils.Query; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.service.SysRoleService; +import io.renren.modules.sys.service.SysUserRoleService; +import io.renren.modules.sys.service.SysUserService; +import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.shiro.crypto.hash.Sha256Hash; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Service("sysUserService") +public class SysUserServiceImpl extends ServiceImpl implements SysUserService { + @Autowired + private SysUserRoleService sysUserRoleService; + @Autowired + private SysRoleService sysRoleService; + + @Override + public PageUtils queryPage(Map params) { + String username = (String)params.get("username"); + Long createUserId = (Long)params.get("createUserId"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + .like(StringUtils.isNotBlank(username),"username", username) + .eq(createUserId != null,"create_user_id", createUserId) + ); + + return new PageUtils(page); + } + + @Override + public List queryAllPerms(Long userId) { + return baseMapper.queryAllPerms(userId); + } + + @Override + public List queryAllMenuId(Long userId) { + return baseMapper.queryAllMenuId(userId); + } + + @Override + public SysUserEntity queryByUserName(String username) { + return baseMapper.queryByUserName(username); + } + + @Override + @Transactional + public void saveUser(SysUserEntity user) { + user.setCreateTime(new Date()); + //sha256加密 + String salt = RandomStringUtils.randomAlphanumeric(20); + user.setPassword(new Sha256Hash(user.getPassword(), salt).toHex()); + user.setSalt(salt); + this.save(user); + + //检查角色是否越权 + checkRole(user); + + //保存用户与角色关系 + sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList()); + } + + @Override + @Transactional + public void update(SysUserEntity user) { + if(StringUtils.isBlank(user.getPassword())){ + user.setPassword(null); + }else{ + user.setPassword(new Sha256Hash(user.getPassword(), user.getSalt()).toHex()); + } + this.updateById(user); + + //检查角色是否越权 + checkRole(user); + + //保存用户与角色关系 + sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList()); + } + + @Override + public void deleteBatch(Long[] userId) { + this.removeByIds(Arrays.asList(userId)); + } + + @Override + public boolean updatePassword(Long userId, String password, String newPassword) { + SysUserEntity userEntity = new SysUserEntity(); + userEntity.setPassword(newPassword); + return this.update(userEntity, + new QueryWrapper().eq("user_id", userId).eq("password", password)); + } + + /** + * 检查角色是否越权 + */ + private void checkRole(SysUserEntity user){ + if(user.getRoleIdList() == null || user.getRoleIdList().size() == 0){ + return; + } + //如果不是超级管理员,则需要判断用户的角色是否自己创建 + if(user.getCreateUserId() == Constant.SUPER_ADMIN){ + return ; + } + + //查询用户创建的角色列表 + List roleIdList = sysRoleService.queryRoleIdList(user.getCreateUserId()); + + //判断是否越权 + if(!roleIdList.containsAll(user.getRoleIdList())){ + throw new RRException("新增用户所选角色,不是本人创建"); + } + } +} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserTokenServiceImpl.java b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserTokenServiceImpl.java new file mode 100644 index 000000000..53e62e63f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/java/io/renren/modules/sys/service/impl/SysUserTokenServiceImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016-2019 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.renren.common.utils.R; +import io.renren.modules.sys.dao.SysUserTokenDao; +import io.renren.modules.sys.entity.SysUserTokenEntity; +import io.renren.modules.sys.oauth2.TokenGenerator; +import io.renren.modules.sys.service.SysUserTokenService; +import org.springframework.stereotype.Service; + +import java.util.Date; + + +@Service("sysUserTokenService") +public class SysUserTokenServiceImpl extends ServiceImpl implements SysUserTokenService { + //12小时后过期 + private final static int EXPIRE = 3600 * 12; + + + @Override + public R createToken(long userId) { + //生成一个token + String token = TokenGenerator.generateValue(); + + //当前时间 + Date now = new Date(); + //过期时间 + Date expireTime = new Date(now.getTime() + EXPIRE * 1000); + + //判断是否生成过token + SysUserTokenEntity tokenEntity = this.getById(userId); + if(tokenEntity == null){ + tokenEntity = new SysUserTokenEntity(); + tokenEntity.setUserId(userId); + tokenEntity.setToken(token); + tokenEntity.setUpdateTime(now); + tokenEntity.setExpireTime(expireTime); + + //保存token + this.save(tokenEntity); + }else{ + tokenEntity.setToken(token); + tokenEntity.setUpdateTime(now); + tokenEntity.setExpireTime(expireTime); + + //更新token + this.updateById(tokenEntity); + } + + R r = R.ok().put("token", token).put("expire", EXPIRE); + + return r; + } + + @Override + public void logout(long userId) { + //生成一个token + String token = TokenGenerator.generateValue(); + + //修改token + SysUserTokenEntity tokenEntity = new SysUserTokenEntity(); + tokenEntity.setUserId(userId); + tokenEntity.setToken(token); + this.updateById(tokenEntity); + } +} diff --git a/msb-mall/renren-fast-master/src/main/resources/application-dev.yml b/msb-mall/renren-fast-master/src/main/resources/application-dev.yml new file mode 100644 index 000000000..ec8f60df0 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/application-dev.yml @@ -0,0 +1,49 @@ +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.37.133:3306/renren-fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: root + password: root + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + + +##多数据源的配置 +#dynamic: +# datasource: +# slave1: +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_security +# username: sa +# password: 123456 +# slave2: +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/renren_security +# username: renren +# password: 123456 \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/application-prod.yml b/msb-mall/renren-fast-master/src/main/resources/application-prod.yml new file mode 100644 index 000000000..9a6c2cb52 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/application-prod.yml @@ -0,0 +1,49 @@ +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: renren + password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + + +##多数据源的配置 +#dynamic: +# datasource: +# slave1: +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_security +# username: sa +# password: 123456 +# slave2: +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/renren_security +# username: renren +# password: 123456 \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/application-test.yml b/msb-mall/renren-fast-master/src/main/resources/application-test.yml new file mode 100644 index 000000000..9a6c2cb52 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/application-test.yml @@ -0,0 +1,49 @@ +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: renren + password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + + +##多数据源的配置 +#dynamic: +# datasource: +# slave1: +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_security +# username: sa +# password: 123456 +# slave2: +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/renren_security +# username: renren +# password: 123456 \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/application.yml b/msb-mall/renren-fast-master/src/main/resources/application.yml new file mode 100644 index 000000000..548a23079 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/application.yml @@ -0,0 +1,84 @@ +# Tomcat +server: + tomcat: + uri-encoding: UTF-8 + max-threads: 1000 + min-spare-threads: 30 + port: 8080 + connection-timeout: 5000ms + servlet: + context-path: /renren-fast + +spring: + application: + name: renren-fast + cloud: + nacos: + discovery: + server-addr: 192.168.37.133:8848 + # 环境 dev|test|prod + profiles: + active: dev + # jackson时间格式化 + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + servlet: + multipart: + max-file-size: 100MB + max-request-size: 100MB + enabled: true + redis: + open: false # 是否开启redis缓存 true开启 false关闭 + database: 0 + host: localhost + port: 6379 + password: # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + mvc: + throw-exception-if-no-handler-found: true + pathmatch: + matching-strategy: ANT_PATH_MATCHER +# resources: +# add-mappings: false + + +#mybatis +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: io.renren.modules.*.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: AUTO + logic-delete-value: -1 + logic-not-delete-value: 0 + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + + +renren: + redis: + open: false + shiro: + redis: false + # APP模块,是通过jwt认证的,如果要使用APP模块,则需要修改【加密秘钥】 + jwt: + # 加密秘钥 + secret: f4e2e52034348f86b67cde581c0f9eb5[www.renren.io] + # token有效时长,7天,单位秒 + expire: 604800 + header: token \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/banner.txt b/msb-mall/renren-fast-master/src/main/resources/banner.txt new file mode 100644 index 000000000..ec3d43f85 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/banner.txt @@ -0,0 +1,5 @@ +==================================================================================================================== + + 欢迎使用 renren-fast 人人快速开发平台 - Powered By https://www.renren.io/ + +==================================================================================================================== \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/logback-spring.xml b/msb-mall/renren-fast-master/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..5deef2105 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/logback-spring.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/app/UserDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/app/UserDao.xml new file mode 100644 index 000000000..ba7cca943 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/app/UserDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/job/ScheduleJobDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/job/ScheduleJobDao.xml new file mode 100644 index 000000000..bcfe54acd --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/job/ScheduleJobDao.xml @@ -0,0 +1,14 @@ + + + + + + + + update schedule_job set status = #{status} where job_id in + + #{jobId} + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/job/ScheduleJobLogDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/job/ScheduleJobLogDao.xml new file mode 100644 index 000000000..82cc799c4 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/job/ScheduleJobLogDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/oss/SysOssDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/oss/SysOssDao.xml new file mode 100644 index 000000000..bbb3af45a --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/oss/SysOssDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysConfigDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysConfigDao.xml new file mode 100644 index 000000000..710e866ef --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysConfigDao.xml @@ -0,0 +1,15 @@ + + + + + + + update sys_config set param_value = #{paramValue} where param_key = #{paramKey} + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysLogDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysLogDao.xml new file mode 100644 index 000000000..d2be2f989 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysLogDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysMenuDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysMenuDao.xml new file mode 100644 index 000000000..01d237044 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysMenuDao.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysRoleDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysRoleDao.xml new file mode 100644 index 000000000..b048b8b32 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysRoleDao.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysRoleMenuDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysRoleMenuDao.xml new file mode 100644 index 000000000..e9453db4b --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysRoleMenuDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + delete from sys_role_menu where role_id in + + #{roleId} + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserDao.xml new file mode 100644 index 000000000..b3e8a99d3 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserRoleDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserRoleDao.xml new file mode 100644 index 000000000..e88a4185c --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserRoleDao.xml @@ -0,0 +1,16 @@ + + + + + + + delete from sys_user_role where role_id in + + #{roleId} + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserTokenDao.xml b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserTokenDao.xml new file mode 100644 index 000000000..270792b3f --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/mapper/sys/SysUserTokenDao.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/static/favicon.ico b/msb-mall/renren-fast-master/src/main/resources/static/favicon.ico new file mode 100644 index 000000000..2bd581cea Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/favicon.ico differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/print.css b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/print.css new file mode 100644 index 000000000..f2e844644 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/print.css @@ -0,0 +1 @@ +.swagger-section pre code{display:block;padding:.5em;background:#f0f0f0}.swagger-section pre .clojure .built_in,.swagger-section pre .lisp .title,.swagger-section pre .nginx .title,.swagger-section pre .subst,.swagger-section pre .tag .title,.swagger-section pre code{color:#000}.swagger-section pre .addition,.swagger-section pre .aggregate,.swagger-section pre .apache .cbracket,.swagger-section pre .apache .tag,.swagger-section pre .bash .variable,.swagger-section pre .constant,.swagger-section pre .django .variable,.swagger-section pre .erlang_repl .function_or_atom,.swagger-section pre .flow,.swagger-section pre .markdown .header,.swagger-section pre .parent,.swagger-section pre .preprocessor,.swagger-section pre .ruby .symbol,.swagger-section pre .ruby .symbol .string,.swagger-section pre .rules .value,.swagger-section pre .rules .value .number,.swagger-section pre .smalltalk .class,.swagger-section pre .stream,.swagger-section pre .string,.swagger-section pre .tag .value,.swagger-section pre .template_tag,.swagger-section pre .tex .command,.swagger-section pre .tex .special,.swagger-section pre .title{color:#800}.swagger-section pre .annotation,.swagger-section pre .chunk,.swagger-section pre .comment,.swagger-section pre .diff .header,.swagger-section pre .markdown .blockquote,.swagger-section pre .template_comment{color:#888}.swagger-section pre .change,.swagger-section pre .date,.swagger-section pre .go .constant,.swagger-section pre .literal,.swagger-section pre .markdown .bullet,.swagger-section pre .markdown .link_url,.swagger-section pre .number,.swagger-section pre .regexp,.swagger-section pre .smalltalk .char,.swagger-section pre .smalltalk .symbol{color:#080}.swagger-section pre .apache .sqbracket,.swagger-section pre .array,.swagger-section pre .attr_selector,.swagger-section pre .clojure .attribute,.swagger-section pre .coffeescript .property,.swagger-section pre .decorator,.swagger-section pre .deletion,.swagger-section pre .doctype,.swagger-section pre .envvar,.swagger-section pre .erlang_repl .reserved,.swagger-section pre .filter .argument,.swagger-section pre .important,.swagger-section pre .javadoc,.swagger-section pre .label,.swagger-section pre .localvars,.swagger-section pre .markdown .link_label,.swagger-section pre .nginx .built_in,.swagger-section pre .pi,.swagger-section pre .prompt,.swagger-section pre .pseudo,.swagger-section pre .ruby .string,.swagger-section pre .shebang,.swagger-section pre .tex .formula,.swagger-section pre .vhdl .attribute{color:#88f}.swagger-section pre .aggregate,.swagger-section pre .apache .tag,.swagger-section pre .bash .variable,.swagger-section pre .built_in,.swagger-section pre .css .tag,.swagger-section pre .go .typename,.swagger-section pre .id,.swagger-section pre .javadoctag,.swagger-section pre .keyword,.swagger-section pre .markdown .strong,.swagger-section pre .phpdoc,.swagger-section pre .request,.swagger-section pre .smalltalk .class,.swagger-section pre .status,.swagger-section pre .tex .command,.swagger-section pre .title,.swagger-section pre .winutils,.swagger-section pre .yardoctag{font-weight:700}.swagger-section pre .markdown .emphasis{font-style:italic}.swagger-section pre .nginx .built_in{font-weight:400}.swagger-section pre .coffeescript .javascript,.swagger-section pre .javascript .xml,.swagger-section pre .tex .formula,.swagger-section pre .xml .cdata,.swagger-section pre .xml .css,.swagger-section pre .xml .javascript,.swagger-section pre .xml .vbscript{opacity:.5}.swagger-section .hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.swagger-section .hljs,.swagger-section .hljs-subst{color:#444}.swagger-section .hljs-attribute,.swagger-section .hljs-doctag,.swagger-section .hljs-keyword,.swagger-section .hljs-meta-keyword,.swagger-section .hljs-name,.swagger-section .hljs-selector-tag{font-weight:700}.swagger-section .hljs-addition,.swagger-section .hljs-built_in,.swagger-section .hljs-bullet,.swagger-section .hljs-code,.swagger-section .hljs-literal{color:#1f811f}.swagger-section .hljs-link,.swagger-section .hljs-regexp,.swagger-section .hljs-selector-attr,.swagger-section .hljs-selector-pseudo,.swagger-section .hljs-symbol,.swagger-section .hljs-template-variable,.swagger-section .hljs-variable{color:#bc6060}.swagger-section .hljs-deletion,.swagger-section .hljs-number,.swagger-section .hljs-quote,.swagger-section .hljs-selector-class,.swagger-section .hljs-selector-id,.swagger-section .hljs-string,.swagger-section .hljs-template-tag,.swagger-section .hljs-type{color:#800}.swagger-section .hljs-section,.swagger-section .hljs-title{color:#800;font-weight:700}.swagger-section .hljs-comment{color:#888}.swagger-section .hljs-meta{color:#2b6ea1}.swagger-section .hljs-emphasis{font-style:italic}.swagger-section .hljs-strong{font-weight:700}.swagger-section .swagger-ui-wrap{line-height:1;font-family:Droid Sans,sans-serif;min-width:760px;max-width:960px;margin-left:auto;margin-right:auto}.swagger-section .swagger-ui-wrap b,.swagger-section .swagger-ui-wrap strong{font-family:Droid Sans,sans-serif;font-weight:700}.swagger-section .swagger-ui-wrap blockquote,.swagger-section .swagger-ui-wrap q{quotes:none}.swagger-section .swagger-ui-wrap p{line-height:1.4em;padding:0 0 10px;color:#333}.swagger-section .swagger-ui-wrap blockquote:after,.swagger-section .swagger-ui-wrap blockquote:before,.swagger-section .swagger-ui-wrap q:after,.swagger-section .swagger-ui-wrap q:before{content:none}.swagger-section .swagger-ui-wrap .heading_with_menu h1,.swagger-section .swagger-ui-wrap .heading_with_menu h2,.swagger-section .swagger-ui-wrap .heading_with_menu h3,.swagger-section .swagger-ui-wrap .heading_with_menu h4,.swagger-section .swagger-ui-wrap .heading_with_menu h5,.swagger-section .swagger-ui-wrap .heading_with_menu h6{display:block;clear:none;float:left;-ms-box-sizing:border-box;box-sizing:border-box;width:60%}.swagger-section .swagger-ui-wrap table{border-collapse:collapse;border-spacing:0}.swagger-section .swagger-ui-wrap table thead tr th{padding:5px;font-size:.9em;color:#666;border-bottom:1px solid #999}.swagger-section .swagger-ui-wrap table tbody tr:last-child td{border-bottom:none}.swagger-section .swagger-ui-wrap table tbody tr.offset{background-color:#f0f0f0}.swagger-section .swagger-ui-wrap table tbody tr td{padding:6px;font-size:.9em;border-bottom:1px solid #ccc;vertical-align:top;line-height:1.3em}.swagger-section .swagger-ui-wrap ol{margin:0 0 10px;padding:0 0 0 18px;list-style-type:decimal}.swagger-section .swagger-ui-wrap ol li{padding:5px 0;font-size:.9em;color:#333}.swagger-section .swagger-ui-wrap ol,.swagger-section .swagger-ui-wrap ul{list-style:none}.swagger-section .swagger-ui-wrap h1 a,.swagger-section .swagger-ui-wrap h2 a,.swagger-section .swagger-ui-wrap h3 a,.swagger-section .swagger-ui-wrap h4 a,.swagger-section .swagger-ui-wrap h5 a,.swagger-section .swagger-ui-wrap h6 a{text-decoration:none}.swagger-section .swagger-ui-wrap h1 a:hover,.swagger-section .swagger-ui-wrap h2 a:hover,.swagger-section .swagger-ui-wrap h3 a:hover,.swagger-section .swagger-ui-wrap h4 a:hover,.swagger-section .swagger-ui-wrap h5 a:hover,.swagger-section .swagger-ui-wrap h6 a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap h1 span.divider,.swagger-section .swagger-ui-wrap h2 span.divider,.swagger-section .swagger-ui-wrap h3 span.divider,.swagger-section .swagger-ui-wrap h4 span.divider,.swagger-section .swagger-ui-wrap h5 span.divider,.swagger-section .swagger-ui-wrap h6 span.divider{color:#aaa}.swagger-section .swagger-ui-wrap a{color:#547f00}.swagger-section .swagger-ui-wrap a img{border:none}.swagger-section .swagger-ui-wrap article,.swagger-section .swagger-ui-wrap aside,.swagger-section .swagger-ui-wrap details,.swagger-section .swagger-ui-wrap figcaption,.swagger-section .swagger-ui-wrap figure,.swagger-section .swagger-ui-wrap footer,.swagger-section .swagger-ui-wrap header,.swagger-section .swagger-ui-wrap hgroup,.swagger-section .swagger-ui-wrap menu,.swagger-section .swagger-ui-wrap nav,.swagger-section .swagger-ui-wrap section,.swagger-section .swagger-ui-wrap summary{display:block}.swagger-section .swagger-ui-wrap pre{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;background-color:#fcf6db;border:1px solid #e5e0c6;padding:10px}.swagger-section .swagger-ui-wrap pre code{line-height:1.6em;background:none}.swagger-section .swagger-ui-wrap .content>.content-type>div>label{clear:both;display:block;color:#0f6ab4;font-size:1.1em;margin:0;padding:15px 0 5px}.swagger-section .swagger-ui-wrap .content pre{font-size:12px;margin-top:5px;padding:5px}.swagger-section .swagger-ui-wrap .icon-btn{cursor:pointer}.swagger-section .swagger-ui-wrap .info_title{padding-bottom:10px;font-weight:700;font-size:25px}.swagger-section .swagger-ui-wrap .footer{margin-top:20px}.swagger-section .swagger-ui-wrap div.big p,.swagger-section .swagger-ui-wrap p.big{font-size:1em;margin-bottom:10px}.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input,.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input{width:500px!important}.swagger-section .swagger-ui-wrap .info_license,.swagger-section .swagger-ui-wrap .info_tos{padding-bottom:5px}.swagger-section .swagger-ui-wrap .message-fail{color:#c00}.swagger-section .swagger-ui-wrap .info_email,.swagger-section .swagger-ui-wrap .info_name,.swagger-section .swagger-ui-wrap .info_url{padding-bottom:5px}.swagger-section .swagger-ui-wrap .info_description{padding-bottom:10px;font-size:15px}.swagger-section .swagger-ui-wrap .markdown ol li,.swagger-section .swagger-ui-wrap .markdown ul li{padding:3px 0;line-height:1.4em;color:#333}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input{display:block;padding:4px;width:auto;clear:both}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title{font-size:1.3em}.swagger-section .swagger-ui-wrap table.fullwidth{width:100%}.swagger-section .swagger-ui-wrap .model-signature{font-family:Droid Sans,sans-serif;font-size:1em;line-height:1.5em}.swagger-section .swagger-ui-wrap .model-signature .signature-nav a{text-decoration:none;color:#aaa}.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover{text-decoration:underline;color:#000}.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected{color:#000;text-decoration:none}.swagger-section .swagger-ui-wrap .model-signature .propType{color:#55a}.swagger-section .swagger-ui-wrap .model-signature pre:hover{background-color:#ffd}.swagger-section .swagger-ui-wrap .model-signature pre{font-size:.85em;line-height:1.2em;overflow:auto;height:200px;resize:vertical;cursor:pointer}.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav{display:block;min-width:230px;margin:0;padding:0}.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child{padding-right:0;border-right:none}.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li{float:left;margin:0 5px 5px 0;padding:2px 5px 2px 0;border-right:1px solid #ddd}.swagger-section .swagger-ui-wrap .model-signature .propOpt{color:#555}.swagger-section .swagger-ui-wrap .model-signature .snippet small{font-size:.75em}.swagger-section .swagger-ui-wrap .model-signature .propOptKey{font-style:italic}.swagger-section .swagger-ui-wrap .model-signature .description .strong{font-weight:700;color:#000;font-size:.9em}.swagger-section .swagger-ui-wrap .model-signature .description div{font-size:.9em;line-height:1.5em;margin-left:1em}.swagger-section .swagger-ui-wrap .model-signature .description .stronger{font-weight:700;color:#000}.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper{border-spacing:0;position:absolute;background-color:#fff;border:1px solid #bbb;display:none;font-size:11px;max-width:400px;line-height:30px;color:#000;padding:5px;margin-left:10px}.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th{text-align:center;background-color:#eee;border:1px solid #bbb;font-size:11px;color:#666;font-weight:700;padding:5px;line-height:15px}.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName{font-weight:700}.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown>p:first-child,.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown>p:last-child{display:inline}.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown>p:not(:first-child):before{display:block;content:''}.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown>p:only-child{margin-right:-3px}.swagger-section .swagger-ui-wrap .model-signature .propName{font-weight:700}.swagger-section .swagger-ui-wrap .model-signature .signature-container{clear:both}.swagger-section .swagger-ui-wrap .body-textarea{width:300px;height:100px;border:1px solid #aaa}.swagger-section .swagger-ui-wrap .markdown li code,.swagger-section .swagger-ui-wrap .markdown p code{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;background-color:#f0f0f0;color:#000;padding:1px 3px}.swagger-section .swagger-ui-wrap .required{font-weight:700}.swagger-section .swagger-ui-wrap .editor_holder{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;font-size:.9em}.swagger-section .swagger-ui-wrap .editor_holder label{font-weight:400!important}.swagger-section .swagger-ui-wrap .editor_holder label.required{font-weight:700!important}.swagger-section .swagger-ui-wrap input.parameter{width:300px;border:1px solid #aaa}.swagger-section .swagger-ui-wrap h1{color:#000;font-size:1.5em;line-height:1.3em;padding:10px 0;font-family:Droid Sans,sans-serif;font-weight:700}.swagger-section .swagger-ui-wrap .heading_with_menu{float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap .heading_with_menu ul{display:block;clear:none;float:right;-ms-box-sizing:border-box;box-sizing:border-box;margin-top:10px}.swagger-section .swagger-ui-wrap h2{color:#000;font-size:1.3em;padding:10px 0}.swagger-section .swagger-ui-wrap h2 a{color:#000}.swagger-section .swagger-ui-wrap h2 span.sub{font-size:.7em;color:#999;font-style:italic}.swagger-section .swagger-ui-wrap h2 span.sub a{color:#777}.swagger-section .swagger-ui-wrap span.weak{color:#666}.swagger-section .swagger-ui-wrap .message-success{color:#89bf04}.swagger-section .swagger-ui-wrap caption,.swagger-section .swagger-ui-wrap td,.swagger-section .swagger-ui-wrap th{text-align:left;font-weight:400;vertical-align:middle}.swagger-section .swagger-ui-wrap .code{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea{font-family:Droid Sans,sans-serif;height:250px;padding:4px;display:block;clear:both}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select{display:block;clear:both}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean{float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label{display:block;float:left;clear:none;margin:0;padding:0}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input{display:block;float:left;clear:none;margin:0 5px 0 0}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label{color:#000}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label{display:block;clear:both;width:auto;padding:0 0 3px;color:#666}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr{padding-left:3px;color:#888}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints{margin-left:0;font-style:italic;font-size:.9em;margin:0}.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons{margin:0;padding:0}.swagger-section .swagger-ui-wrap span.blank,.swagger-section .swagger-ui-wrap span.empty{color:#888;font-style:italic}.swagger-section .swagger-ui-wrap .markdown h3{color:#547f00}.swagger-section .swagger-ui-wrap .markdown h4{color:#666}.swagger-section .swagger-ui-wrap .markdown pre{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;background-color:#fcf6db;border:1px solid #e5e0c6;padding:10px;margin:0 0 10px}.swagger-section .swagger-ui-wrap .markdown pre code{line-height:1.6em;overflow:auto}.swagger-section .swagger-ui-wrap div.gist{margin:20px 0 25px!important}.swagger-section .swagger-ui-wrap ul#resources{font-family:Droid Sans,sans-serif;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource{border-bottom:1px solid #ddd}.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a,.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a,.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a{color:#555}.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child{border-bottom:none}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading{border:1px solid transparent;float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options{overflow:hidden;padding:0;display:block;clear:none;float:right;margin:14px 10px 0 0}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li{float:left;clear:none;margin:0;padding:2px 10px;border-right:1px solid #ddd;color:#666;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a{color:#aaa;text-decoration:none}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover{text-decoration:underline;color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child{padding-left:0}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child{padding-right:0;border-right:none}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child{padding-left:0}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2{color:#999;padding-left:0;display:block;clear:none;float:left;font-family:Droid Sans,sans-serif;font-weight:700}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a{color:#999}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation{float:none;clear:both;overflow:hidden;display:block;margin:0 0 10px;padding:0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading{float:none;clear:both;overflow:hidden;display:block;margin:0;padding:0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3{display:block;clear:none;float:left;width:auto;margin:0;padding:0;line-height:1.1em;color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path{padding-left:10px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a{color:#000;text-decoration:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated{text-decoration:line-through}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a{text-transform:uppercase;text-decoration:none;color:#fff;display:inline-block;width:50px;font-size:.7em;text-align:center;padding:7px 0 4px;border-radius:2px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span{margin:0;padding:0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options{overflow:hidden;padding:0;display:block;clear:none;float:right;margin:6px 10px 0 0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li{float:left;clear:none;margin:0;padding:2px 10px;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a{text-decoration:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .markdown p{color:inherit;padding:0;line-height:inherit}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .nickname{color:#aaa;padding:0;line-height:inherit}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content{border-top:none;padding:10px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;margin:0 0 20px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4{font-size:1.1em;margin:0;padding:15px 0 5px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header{float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a{padding:4px 0 0 10px;display:inline-block;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit{display:block;clear:none;float:left;padding:6px 8px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber{background-image:url(../images/throbber.gif);width:128px;height:16px;display:block;clear:none;float:right}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type=text].error{outline:2px solid #000;outline-color:#c00}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name=parameterContentType]{max-width:300px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;padding:10px;font-size:.9em;max-height:400px;overflow-y:auto}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading{background-color:#f9f2e9;border:1px solid #f0e0ca}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a{background-color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#f0e0ca;color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a{color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content{background-color:#faf5ee;border:1px solid #f0e0ca}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4{color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a{color:#dcb67f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading{background-color:#fcffcd;border:1px solid #000;border-color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a{text-transform:uppercase;background-color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#ffd20f;color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a{color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content{background-color:#fcffcd;border:1px solid #000;border-color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4{color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a{color:#6fc992}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading{background-color:#f5e8e8;border:1px solid #e8c6c7}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a{text-transform:uppercase;background-color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#e8c6c7;color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a{color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content{background-color:#f7eded;border:1px solid #e8c6c7}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4{color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a{color:#c8787a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading{background-color:#e7f6ec;border:1px solid #c3e8d1}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a{background-color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#c3e8d1;color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a{color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content{background-color:#ebf7f0;border:1px solid #c3e8d1}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4{color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a{color:#6fc992}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading{background-color:#fce9e3;border:1px solid #f5d5c3}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a{background-color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#f0cecb;color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a{color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content{background-color:#faf0ef;border:1px solid #f0cecb}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4{color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a{color:#dcb67f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading{background-color:#e7f0f7;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a{background-color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#c3d9ec;color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content{background-color:#ebf3f9;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a{color:#6fa5d2}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading{background-color:#e7f0f7;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a{background-color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#c3d9ec;color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content{background-color:#ebf3f9;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a{color:#6fa5d2}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content{border-top:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child{padding-right:0;border-right:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child{padding-left:0}.swagger-section .swagger-ui-wrap p#colophon{margin:0 15px 40px;padding:10px 0;font-size:.8em;border-top:1px solid #ddd;font-family:Droid Sans,sans-serif;color:#999;font-style:italic}.swagger-section .swagger-ui-wrap p#colophon a{text-decoration:none;color:#547f00}.swagger-section .swagger-ui-wrap h3{color:#000;font-size:1.1em;padding:10px 0}.swagger-section .swagger-ui-wrap .markdown ol,.swagger-section .swagger-ui-wrap .markdown ul{font-family:Droid Sans,sans-serif;margin:5px 0 10px;padding:0 0 0 18px;list-style-type:disc}.swagger-section .swagger-ui-wrap form.form_box{background-color:#ebf3f9;border:1px solid #c3d9ec;padding:10px}.swagger-section .swagger-ui-wrap form.form_box label{color:#0f6ab4!important}.swagger-section .swagger-ui-wrap form.form_box input[type=submit]{display:block;padding:10px}.swagger-section .swagger-ui-wrap form.form_box p.weak{font-size:.8em}.swagger-section .swagger-ui-wrap form.form_box p{font-size:.9em;padding:0 0 15px;color:#7e7b6d}.swagger-section .swagger-ui-wrap form.form_box p a{color:#646257}.swagger-section .swagger-ui-wrap form.form_box p strong{color:#000}.swagger-section .swagger-ui-wrap .operation-status td.markdown>p:last-child{padding-bottom:0}.swagger-section .title{font-style:bold}.swagger-section .secondary_form{display:none}.swagger-section .main_image{display:block;margin-left:auto;margin-right:auto}.swagger-section .oauth_body{margin-left:100px;margin-right:100px}.swagger-section .oauth_submit{text-align:center;display:inline-block}.swagger-section .authorize-wrapper{margin:15px 0 10px}.swagger-section .authorize-wrapper_operation{float:right}.swagger-section .authorize__btn:hover{text-decoration:underline;cursor:pointer}.swagger-section .authorize__btn_operation:hover .authorize-scopes{display:block}.swagger-section .authorize-scopes{position:absolute;margin-top:20px;background:#fff;border:1px solid #ccc;border-radius:5px;display:none;font-size:13px;max-width:300px;line-height:30px;color:#000;padding:5px}.swagger-section .authorize-scopes .authorize__scope{text-decoration:none}.swagger-section .authorize__btn_operation{height:18px;vertical-align:middle;display:inline-block;background:url(../images/explorer_icons.png) no-repeat}.swagger-section .authorize__btn_operation_login{background-position:0 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section .authorize__btn_operation_logout{background-position:-30px 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section #auth_container{color:#fff;display:inline-block;border:none;padding:5px;width:87px;height:13px}.swagger-section #auth_container .authorize__btn{color:#fff}.swagger-section .auth_container{padding:0 0 10px;margin-bottom:5px;border-bottom:1px solid #ccc;font-size:.9em}.swagger-section .auth_container .auth__title{color:#547f00;font-size:1.2em}.swagger-section .auth_container .basic_auth__label{display:inline-block;width:60px}.swagger-section .auth_container .auth__description{color:#999;margin-bottom:5px}.swagger-section .auth_container .auth__button{margin-top:10px;height:30px}.swagger-section .auth_container .key_auth__field{margin:5px 0}.swagger-section .auth_container .key_auth__label{display:inline-block;width:60px}.swagger-section .api-popup-dialog{position:absolute;display:none}.swagger-section .api-popup-dialog-wrapper{z-index:2;width:500px;background:#fff;padding:20px;border:1px solid #ccc;border-radius:5px;font-size:13px;color:#777;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.swagger-section .api-popup-dialog-shadow{position:fixed;top:0;left:0;width:100%;height:100%;opacity:.2;background-color:gray;z-index:1}.swagger-section .api-popup-dialog .api-popup-title{font-size:24px;padding:10px 0}.swagger-section .api-popup-dialog .error-msg{padding-left:5px;padding-bottom:5px}.swagger-section .api-popup-dialog .api-popup-content{max-height:500px;overflow-y:auto}.swagger-section .api-popup-dialog .api-popup-authbtn,.swagger-section .api-popup-dialog .api-popup-cancel{height:30px}.swagger-section .api-popup-scopes{padding:10px 20px}.swagger-section .api-popup-scopes li{padding:5px 0;line-height:20px}.swagger-section .api-popup-scopes li input{position:relative;top:2px}.swagger-section .api-popup-scopes .api-scope-desc{padding-left:20px;font-style:italic}.swagger-section .api-popup-actions{padding-top:10px}.swagger-section fieldset{padding-bottom:10px;padding-left:20px}#header{display:none}.swagger-section .swagger-ui-wrap .model-signature pre{max-height:none}.swagger-section .swagger-ui-wrap .body-textarea,.swagger-section .swagger-ui-wrap input.parameter{width:100px}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options{display:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content{display:block!important} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/reset.css b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/reset.css new file mode 100644 index 000000000..40dc8301c --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/reset.css @@ -0,0 +1 @@ +a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/screen.css b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/screen.css new file mode 100644 index 000000000..1f069f6ab --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/screen.css @@ -0,0 +1 @@ +.swagger-section pre code{display:block;padding:.5em;background:#f0f0f0}.swagger-section pre .clojure .built_in,.swagger-section pre .lisp .title,.swagger-section pre .nginx .title,.swagger-section pre .subst,.swagger-section pre .tag .title,.swagger-section pre code{color:#000}.swagger-section pre .addition,.swagger-section pre .aggregate,.swagger-section pre .apache .cbracket,.swagger-section pre .apache .tag,.swagger-section pre .bash .variable,.swagger-section pre .constant,.swagger-section pre .django .variable,.swagger-section pre .erlang_repl .function_or_atom,.swagger-section pre .flow,.swagger-section pre .markdown .header,.swagger-section pre .parent,.swagger-section pre .preprocessor,.swagger-section pre .ruby .symbol,.swagger-section pre .ruby .symbol .string,.swagger-section pre .rules .value,.swagger-section pre .rules .value .number,.swagger-section pre .smalltalk .class,.swagger-section pre .stream,.swagger-section pre .string,.swagger-section pre .tag .value,.swagger-section pre .template_tag,.swagger-section pre .tex .command,.swagger-section pre .tex .special,.swagger-section pre .title{color:#800}.swagger-section pre .annotation,.swagger-section pre .chunk,.swagger-section pre .comment,.swagger-section pre .diff .header,.swagger-section pre .markdown .blockquote,.swagger-section pre .template_comment{color:#888}.swagger-section pre .change,.swagger-section pre .date,.swagger-section pre .go .constant,.swagger-section pre .literal,.swagger-section pre .markdown .bullet,.swagger-section pre .markdown .link_url,.swagger-section pre .number,.swagger-section pre .regexp,.swagger-section pre .smalltalk .char,.swagger-section pre .smalltalk .symbol{color:#080}.swagger-section pre .apache .sqbracket,.swagger-section pre .array,.swagger-section pre .attr_selector,.swagger-section pre .clojure .attribute,.swagger-section pre .coffeescript .property,.swagger-section pre .decorator,.swagger-section pre .deletion,.swagger-section pre .doctype,.swagger-section pre .envvar,.swagger-section pre .erlang_repl .reserved,.swagger-section pre .filter .argument,.swagger-section pre .important,.swagger-section pre .javadoc,.swagger-section pre .label,.swagger-section pre .localvars,.swagger-section pre .markdown .link_label,.swagger-section pre .nginx .built_in,.swagger-section pre .pi,.swagger-section pre .prompt,.swagger-section pre .pseudo,.swagger-section pre .ruby .string,.swagger-section pre .shebang,.swagger-section pre .tex .formula,.swagger-section pre .vhdl .attribute{color:#88f}.swagger-section pre .aggregate,.swagger-section pre .apache .tag,.swagger-section pre .bash .variable,.swagger-section pre .built_in,.swagger-section pre .css .tag,.swagger-section pre .go .typename,.swagger-section pre .id,.swagger-section pre .javadoctag,.swagger-section pre .keyword,.swagger-section pre .markdown .strong,.swagger-section pre .phpdoc,.swagger-section pre .request,.swagger-section pre .smalltalk .class,.swagger-section pre .status,.swagger-section pre .tex .command,.swagger-section pre .title,.swagger-section pre .winutils,.swagger-section pre .yardoctag{font-weight:700}.swagger-section pre .markdown .emphasis{font-style:italic}.swagger-section pre .nginx .built_in{font-weight:400}.swagger-section pre .coffeescript .javascript,.swagger-section pre .javascript .xml,.swagger-section pre .tex .formula,.swagger-section pre .xml .cdata,.swagger-section pre .xml .css,.swagger-section pre .xml .javascript,.swagger-section pre .xml .vbscript{opacity:.5}.swagger-section .hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.swagger-section .hljs,.swagger-section .hljs-subst{color:#444}.swagger-section .hljs-attribute,.swagger-section .hljs-doctag,.swagger-section .hljs-keyword,.swagger-section .hljs-meta-keyword,.swagger-section .hljs-name,.swagger-section .hljs-selector-tag{font-weight:700}.swagger-section .hljs-addition,.swagger-section .hljs-built_in,.swagger-section .hljs-bullet,.swagger-section .hljs-code,.swagger-section .hljs-literal{color:#1f811f}.swagger-section .hljs-link,.swagger-section .hljs-regexp,.swagger-section .hljs-selector-attr,.swagger-section .hljs-selector-pseudo,.swagger-section .hljs-symbol,.swagger-section .hljs-template-variable,.swagger-section .hljs-variable{color:#bc6060}.swagger-section .hljs-deletion,.swagger-section .hljs-number,.swagger-section .hljs-quote,.swagger-section .hljs-selector-class,.swagger-section .hljs-selector-id,.swagger-section .hljs-string,.swagger-section .hljs-template-tag,.swagger-section .hljs-type{color:#800}.swagger-section .hljs-section,.swagger-section .hljs-title{color:#800;font-weight:700}.swagger-section .hljs-comment{color:#888}.swagger-section .hljs-meta{color:#2b6ea1}.swagger-section .hljs-emphasis{font-style:italic}.swagger-section .hljs-strong{font-weight:700}.swagger-section .swagger-ui-wrap{line-height:1;font-family:Droid Sans,sans-serif;min-width:760px;max-width:960px;margin-left:auto;margin-right:auto}.swagger-section .swagger-ui-wrap b,.swagger-section .swagger-ui-wrap strong{font-family:Droid Sans,sans-serif;font-weight:700}.swagger-section .swagger-ui-wrap blockquote,.swagger-section .swagger-ui-wrap q{quotes:none}.swagger-section .swagger-ui-wrap p{line-height:1.4em;padding:0 0 10px;color:#333}.swagger-section .swagger-ui-wrap blockquote:after,.swagger-section .swagger-ui-wrap blockquote:before,.swagger-section .swagger-ui-wrap q:after,.swagger-section .swagger-ui-wrap q:before{content:none}.swagger-section .swagger-ui-wrap .heading_with_menu h1,.swagger-section .swagger-ui-wrap .heading_with_menu h2,.swagger-section .swagger-ui-wrap .heading_with_menu h3,.swagger-section .swagger-ui-wrap .heading_with_menu h4,.swagger-section .swagger-ui-wrap .heading_with_menu h5,.swagger-section .swagger-ui-wrap .heading_with_menu h6{display:block;clear:none;float:left;-ms-box-sizing:border-box;box-sizing:border-box;width:60%}.swagger-section .swagger-ui-wrap table{border-collapse:collapse;border-spacing:0}.swagger-section .swagger-ui-wrap table thead tr th{padding:5px;font-size:.9em;color:#666;border-bottom:1px solid #999}.swagger-section .swagger-ui-wrap table tbody tr:last-child td{border-bottom:none}.swagger-section .swagger-ui-wrap table tbody tr.offset{background-color:#f0f0f0}.swagger-section .swagger-ui-wrap table tbody tr td{padding:6px;font-size:.9em;border-bottom:1px solid #ccc;vertical-align:top;line-height:1.3em}.swagger-section .swagger-ui-wrap ol{margin:0 0 10px;padding:0 0 0 18px;list-style-type:decimal}.swagger-section .swagger-ui-wrap ol li{padding:5px 0;font-size:.9em;color:#333}.swagger-section .swagger-ui-wrap ol,.swagger-section .swagger-ui-wrap ul{list-style:none}.swagger-section .swagger-ui-wrap h1 a,.swagger-section .swagger-ui-wrap h2 a,.swagger-section .swagger-ui-wrap h3 a,.swagger-section .swagger-ui-wrap h4 a,.swagger-section .swagger-ui-wrap h5 a,.swagger-section .swagger-ui-wrap h6 a{text-decoration:none}.swagger-section .swagger-ui-wrap h1 a:hover,.swagger-section .swagger-ui-wrap h2 a:hover,.swagger-section .swagger-ui-wrap h3 a:hover,.swagger-section .swagger-ui-wrap h4 a:hover,.swagger-section .swagger-ui-wrap h5 a:hover,.swagger-section .swagger-ui-wrap h6 a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap h1 span.divider,.swagger-section .swagger-ui-wrap h2 span.divider,.swagger-section .swagger-ui-wrap h3 span.divider,.swagger-section .swagger-ui-wrap h4 span.divider,.swagger-section .swagger-ui-wrap h5 span.divider,.swagger-section .swagger-ui-wrap h6 span.divider{color:#aaa}.swagger-section .swagger-ui-wrap a{color:#547f00}.swagger-section .swagger-ui-wrap a img{border:none}.swagger-section .swagger-ui-wrap article,.swagger-section .swagger-ui-wrap aside,.swagger-section .swagger-ui-wrap details,.swagger-section .swagger-ui-wrap figcaption,.swagger-section .swagger-ui-wrap figure,.swagger-section .swagger-ui-wrap footer,.swagger-section .swagger-ui-wrap header,.swagger-section .swagger-ui-wrap hgroup,.swagger-section .swagger-ui-wrap menu,.swagger-section .swagger-ui-wrap nav,.swagger-section .swagger-ui-wrap section,.swagger-section .swagger-ui-wrap summary{display:block}.swagger-section .swagger-ui-wrap pre{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;background-color:#fcf6db;border:1px solid #e5e0c6;padding:10px}.swagger-section .swagger-ui-wrap pre code{line-height:1.6em;background:none}.swagger-section .swagger-ui-wrap .content>.content-type>div>label{clear:both;display:block;color:#0f6ab4;font-size:1.1em;margin:0;padding:15px 0 5px}.swagger-section .swagger-ui-wrap .content pre{font-size:12px;margin-top:5px;padding:5px}.swagger-section .swagger-ui-wrap .icon-btn{cursor:pointer}.swagger-section .swagger-ui-wrap .info_title{padding-bottom:10px;font-weight:700;font-size:25px}.swagger-section .swagger-ui-wrap .footer{margin-top:20px}.swagger-section .swagger-ui-wrap div.big p,.swagger-section .swagger-ui-wrap p.big{font-size:1em;margin-bottom:10px}.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input,.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input{width:500px!important}.swagger-section .swagger-ui-wrap .info_license,.swagger-section .swagger-ui-wrap .info_tos{padding-bottom:5px}.swagger-section .swagger-ui-wrap .message-fail{color:#c00}.swagger-section .swagger-ui-wrap .info_email,.swagger-section .swagger-ui-wrap .info_name,.swagger-section .swagger-ui-wrap .info_url{padding-bottom:5px}.swagger-section .swagger-ui-wrap .info_description{padding-bottom:10px;font-size:15px}.swagger-section .swagger-ui-wrap .markdown ol li,.swagger-section .swagger-ui-wrap .markdown ul li{padding:3px 0;line-height:1.4em;color:#333}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input{display:block;padding:4px;width:auto;clear:both}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title{font-size:1.3em}.swagger-section .swagger-ui-wrap table.fullwidth{width:100%}.swagger-section .swagger-ui-wrap .model-signature{font-family:Droid Sans,sans-serif;font-size:1em;line-height:1.5em}.swagger-section .swagger-ui-wrap .model-signature .signature-nav a{text-decoration:none;color:#aaa}.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover{text-decoration:underline;color:#000}.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected{color:#000;text-decoration:none}.swagger-section .swagger-ui-wrap .model-signature .propType{color:#55a}.swagger-section .swagger-ui-wrap .model-signature pre:hover{background-color:#ffd}.swagger-section .swagger-ui-wrap .model-signature pre{font-size:.85em;line-height:1.2em;overflow:auto;height:200px;resize:vertical;cursor:pointer}.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav{display:block;min-width:230px;margin:0;padding:0}.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child{padding-right:0;border-right:none}.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li{float:left;margin:0 5px 5px 0;padding:2px 5px 2px 0;border-right:1px solid #ddd}.swagger-section .swagger-ui-wrap .model-signature .propOpt{color:#555}.swagger-section .swagger-ui-wrap .model-signature .snippet small{font-size:.75em}.swagger-section .swagger-ui-wrap .model-signature .propOptKey{font-style:italic}.swagger-section .swagger-ui-wrap .model-signature .description .strong{font-weight:700;color:#000;font-size:.9em}.swagger-section .swagger-ui-wrap .model-signature .description div{font-size:.9em;line-height:1.5em;margin-left:1em}.swagger-section .swagger-ui-wrap .model-signature .description .stronger{font-weight:700;color:#000}.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper{border-spacing:0;position:absolute;background-color:#fff;border:1px solid #bbb;display:none;font-size:11px;max-width:400px;line-height:30px;color:#000;padding:5px;margin-left:10px}.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th{text-align:center;background-color:#eee;border:1px solid #bbb;font-size:11px;color:#666;font-weight:700;padding:5px;line-height:15px}.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName{font-weight:700}.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown>p:first-child,.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown>p:last-child{display:inline}.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown>p:not(:first-child):before{display:block;content:''}.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown>p:only-child{margin-right:-3px}.swagger-section .swagger-ui-wrap .model-signature .propName{font-weight:700}.swagger-section .swagger-ui-wrap .model-signature .signature-container{clear:both}.swagger-section .swagger-ui-wrap .body-textarea{width:300px;height:100px;border:1px solid #aaa}.swagger-section .swagger-ui-wrap .markdown li code,.swagger-section .swagger-ui-wrap .markdown p code{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;background-color:#f0f0f0;color:#000;padding:1px 3px}.swagger-section .swagger-ui-wrap .required{font-weight:700}.swagger-section .swagger-ui-wrap .editor_holder{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;font-size:.9em}.swagger-section .swagger-ui-wrap .editor_holder label{font-weight:400!important}.swagger-section .swagger-ui-wrap .editor_holder label.required{font-weight:700!important}.swagger-section .swagger-ui-wrap input.parameter{width:300px;border:1px solid #aaa}.swagger-section .swagger-ui-wrap h1{color:#000;font-size:1.5em;line-height:1.3em;padding:10px 0;font-family:Droid Sans,sans-serif;font-weight:700}.swagger-section .swagger-ui-wrap .heading_with_menu{float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap .heading_with_menu ul{display:block;clear:none;float:right;-ms-box-sizing:border-box;box-sizing:border-box;margin-top:10px}.swagger-section .swagger-ui-wrap h2{color:#000;font-size:1.3em;padding:10px 0}.swagger-section .swagger-ui-wrap h2 a{color:#000}.swagger-section .swagger-ui-wrap h2 span.sub{font-size:.7em;color:#999;font-style:italic}.swagger-section .swagger-ui-wrap h2 span.sub a{color:#777}.swagger-section .swagger-ui-wrap span.weak{color:#666}.swagger-section .swagger-ui-wrap .message-success{color:#89bf04}.swagger-section .swagger-ui-wrap caption,.swagger-section .swagger-ui-wrap td,.swagger-section .swagger-ui-wrap th{text-align:left;font-weight:400;vertical-align:middle}.swagger-section .swagger-ui-wrap .code{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea{font-family:Droid Sans,sans-serif;height:250px;padding:4px;display:block;clear:both}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select{display:block;clear:both}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean{float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label{display:block;float:left;clear:none;margin:0;padding:0}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input{display:block;float:left;clear:none;margin:0 5px 0 0}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label{color:#000}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label{display:block;clear:both;width:auto;padding:0 0 3px;color:#666}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr{padding-left:3px;color:#888}.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints{margin-left:0;font-style:italic;font-size:.9em;margin:0}.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons{margin:0;padding:0}.swagger-section .swagger-ui-wrap span.blank,.swagger-section .swagger-ui-wrap span.empty{color:#888;font-style:italic}.swagger-section .swagger-ui-wrap .markdown h3{color:#547f00}.swagger-section .swagger-ui-wrap .markdown h4{color:#666}.swagger-section .swagger-ui-wrap .markdown pre{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;background-color:#fcf6db;border:1px solid #e5e0c6;padding:10px;margin:0 0 10px}.swagger-section .swagger-ui-wrap .markdown pre code{line-height:1.6em;overflow:auto}.swagger-section .swagger-ui-wrap div.gist{margin:20px 0 25px!important}.swagger-section .swagger-ui-wrap ul#resources{font-family:Droid Sans,sans-serif;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource{border-bottom:1px solid #ddd}.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a,.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a,.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a{color:#555}.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child{border-bottom:none}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading{border:1px solid transparent;float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options{overflow:hidden;padding:0;display:block;clear:none;float:right;margin:14px 10px 0 0}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li{float:left;clear:none;margin:0;padding:2px 10px;border-right:1px solid #ddd;color:#666;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a{color:#aaa;text-decoration:none}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover{text-decoration:underline;color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child{padding-left:0}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child{padding-right:0;border-right:none}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first,.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child{padding-left:0}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2{color:#999;padding-left:0;display:block;clear:none;float:left;font-family:Droid Sans,sans-serif;font-weight:700}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a{color:#999}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation{float:none;clear:both;overflow:hidden;display:block;margin:0 0 10px;padding:0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading{float:none;clear:both;overflow:hidden;display:block;margin:0;padding:0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3{display:block;clear:none;float:left;width:auto;margin:0;padding:0;line-height:1.1em;color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path{padding-left:10px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a{color:#000;text-decoration:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated{text-decoration:line-through}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a{text-transform:uppercase;text-decoration:none;color:#fff;display:inline-block;width:50px;font-size:.7em;text-align:center;padding:7px 0 4px;border-radius:2px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span{margin:0;padding:0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options{overflow:hidden;padding:0;display:block;clear:none;float:right;margin:6px 10px 0 0}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li{float:left;clear:none;margin:0;padding:2px 10px;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a{text-decoration:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .markdown p{color:inherit;padding:0;line-height:inherit}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .nickname{color:#aaa;padding:0;line-height:inherit}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content{border-top:none;padding:10px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;margin:0 0 20px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4{font-size:1.1em;margin:0;padding:15px 0 5px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header{float:none;clear:both;overflow:hidden;display:block}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a{padding:4px 0 0 10px;display:inline-block;font-size:.9em}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit{display:block;clear:none;float:left;padding:6px 8px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber{background-image:url(../images/throbber.gif);width:128px;height:16px;display:block;clear:none;float:right}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type=text].error{outline:2px solid #000;outline-color:#c00}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name=parameterContentType]{max-width:300px}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre{font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;padding:10px;font-size:.9em;max-height:400px;overflow-y:auto}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading{background-color:#f9f2e9;border:1px solid #f0e0ca}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a{background-color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#f0e0ca;color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a{color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content{background-color:#faf5ee;border:1px solid #f0e0ca}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4{color:#c5862b}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a{color:#dcb67f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading{background-color:#fcffcd;border:1px solid #000;border-color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a{text-transform:uppercase;background-color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#ffd20f;color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a{color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content{background-color:#fcffcd;border:1px solid #000;border-color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4{color:#ffd20f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a{color:#6fc992}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading{background-color:#f5e8e8;border:1px solid #e8c6c7}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a{text-transform:uppercase;background-color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#e8c6c7;color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a{color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content{background-color:#f7eded;border:1px solid #e8c6c7}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4{color:#a41e22}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a{color:#c8787a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading{background-color:#e7f6ec;border:1px solid #c3e8d1}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a{background-color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#c3e8d1;color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a{color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content{background-color:#ebf7f0;border:1px solid #c3e8d1}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4{color:#10a54a}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a{color:#6fc992}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading{background-color:#fce9e3;border:1px solid #f5d5c3}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a{background-color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#f0cecb;color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a{color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content{background-color:#faf0ef;border:1px solid #f0cecb}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4{color:#d38042}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a{color:#dcb67f}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading{background-color:#e7f0f7;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a{background-color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#c3d9ec;color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content{background-color:#ebf3f9;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a{color:#6fa5d2}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading{background-color:#e7f0f7;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a{background-color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li{border-right:1px solid #ddd;border-right-color:#c3d9ec;color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content{background-color:#ebf3f9;border:1px solid #c3d9ec}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4{color:#0f6ab4}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a{color:#6fa5d2}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content{border-top:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child{padding-right:0;border-right:none}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover{text-decoration:underline}.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first,.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child{padding-left:0}.swagger-section .swagger-ui-wrap p#colophon{margin:0 15px 40px;padding:10px 0;font-size:.8em;border-top:1px solid #ddd;font-family:Droid Sans,sans-serif;color:#999;font-style:italic}.swagger-section .swagger-ui-wrap p#colophon a{text-decoration:none;color:#547f00}.swagger-section .swagger-ui-wrap h3{color:#000;font-size:1.1em;padding:10px 0}.swagger-section .swagger-ui-wrap .markdown ol,.swagger-section .swagger-ui-wrap .markdown ul{font-family:Droid Sans,sans-serif;margin:5px 0 10px;padding:0 0 0 18px;list-style-type:disc}.swagger-section .swagger-ui-wrap form.form_box{background-color:#ebf3f9;border:1px solid #c3d9ec;padding:10px}.swagger-section .swagger-ui-wrap form.form_box label{color:#0f6ab4!important}.swagger-section .swagger-ui-wrap form.form_box input[type=submit]{display:block;padding:10px}.swagger-section .swagger-ui-wrap form.form_box p.weak{font-size:.8em}.swagger-section .swagger-ui-wrap form.form_box p{font-size:.9em;padding:0 0 15px;color:#7e7b6d}.swagger-section .swagger-ui-wrap form.form_box p a{color:#646257}.swagger-section .swagger-ui-wrap form.form_box p strong{color:#000}.swagger-section .swagger-ui-wrap .operation-status td.markdown>p:last-child{padding-bottom:0}.swagger-section .title{font-style:bold}.swagger-section .secondary_form{display:none}.swagger-section .main_image{display:block;margin-left:auto;margin-right:auto}.swagger-section .oauth_body{margin-left:100px;margin-right:100px}.swagger-section .oauth_submit{text-align:center;display:inline-block}.swagger-section .authorize-wrapper{margin:15px 0 10px}.swagger-section .authorize-wrapper_operation{float:right}.swagger-section .authorize__btn:hover{text-decoration:underline;cursor:pointer}.swagger-section .authorize__btn_operation:hover .authorize-scopes{display:block}.swagger-section .authorize-scopes{position:absolute;margin-top:20px;background:#fff;border:1px solid #ccc;border-radius:5px;display:none;font-size:13px;max-width:300px;line-height:30px;color:#000;padding:5px}.swagger-section .authorize-scopes .authorize__scope{text-decoration:none}.swagger-section .authorize__btn_operation{height:18px;vertical-align:middle;display:inline-block;background:url(../images/explorer_icons.png) no-repeat}.swagger-section .authorize__btn_operation_login{background-position:0 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section .authorize__btn_operation_logout{background-position:-30px 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section #auth_container{color:#fff;display:inline-block;border:none;padding:5px;width:87px;height:13px}.swagger-section #auth_container .authorize__btn{color:#fff}.swagger-section .auth_container{padding:0 0 10px;margin-bottom:5px;border-bottom:1px solid #ccc;font-size:.9em}.swagger-section .auth_container .auth__title{color:#547f00;font-size:1.2em}.swagger-section .auth_container .basic_auth__label{display:inline-block;width:60px}.swagger-section .auth_container .auth__description{color:#999;margin-bottom:5px}.swagger-section .auth_container .auth__button{margin-top:10px;height:30px}.swagger-section .auth_container .key_auth__field{margin:5px 0}.swagger-section .auth_container .key_auth__label{display:inline-block;width:60px}.swagger-section .api-popup-dialog{position:absolute;display:none}.swagger-section .api-popup-dialog-wrapper{z-index:2;width:500px;background:#fff;padding:20px;border:1px solid #ccc;border-radius:5px;font-size:13px;color:#777;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.swagger-section .api-popup-dialog-shadow{position:fixed;top:0;left:0;width:100%;height:100%;opacity:.2;background-color:gray;z-index:1}.swagger-section .api-popup-dialog .api-popup-title{font-size:24px;padding:10px 0}.swagger-section .api-popup-dialog .error-msg{padding-left:5px;padding-bottom:5px}.swagger-section .api-popup-dialog .api-popup-content{max-height:500px;overflow-y:auto}.swagger-section .api-popup-dialog .api-popup-authbtn,.swagger-section .api-popup-dialog .api-popup-cancel{height:30px}.swagger-section .api-popup-scopes{padding:10px 20px}.swagger-section .api-popup-scopes li{padding:5px 0;line-height:20px}.swagger-section .api-popup-scopes li input{position:relative;top:2px}.swagger-section .api-popup-scopes .api-scope-desc{padding-left:20px;font-style:italic}.swagger-section .api-popup-actions{padding-top:10px}.swagger-section fieldset{padding-bottom:10px;padding-left:20px}.swagger-section .access,.swagger-section .auth{float:right}.swagger-section .api-ic{height:18px;vertical-align:middle;display:inline-block;background:url(../images/explorer_icons.png) no-repeat}.swagger-section .api-ic .api_information_panel{position:relative;margin-top:20px;margin-left:-5px;background:#fff;border:1px solid #ccc;border-radius:5px;display:none;font-size:13px;max-width:300px;line-height:30px;color:#000;padding:5px}.swagger-section .api-ic .api_information_panel p .api-msg-enabled{color:green}.swagger-section .api-ic .api_information_panel p .api-msg-disabled{color:red}.swagger-section .api-ic:hover .api_information_panel{position:absolute;display:block}.swagger-section .ic-info{background-position:0 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section .ic-warning{background-position:-60px 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section .ic-error{background-position:-30px 0;width:18px;margin-top:-6px;margin-left:4px}.swagger-section .ic-off{background-position:-90px 0;width:58px;margin-top:-4px;cursor:pointer}.swagger-section .ic-on{background-position:-160px 0;width:58px;margin-top:-4px;cursor:pointer}.swagger-section #header{background-color:#89bf04;padding:9px 14px 19px;height:23px;min-width:775px}.swagger-section #input_baseUrl{width:400px}.swagger-section #api_selector{display:block;clear:none;float:right}.swagger-section #api_selector .input{display:inline-block;clear:none;margin:0 10px 0 0}.swagger-section #api_selector input{font-size:.9em;padding:3px;margin:0}.swagger-section #input_apiKey{width:200px}.swagger-section #auth_container .authorize__btn,.swagger-section #explore{display:block;text-decoration:none;font-weight:700;padding:6px 8px;font-size:.9em;color:#fff;background-color:#547f00;border-radius:4px}.swagger-section #auth_container .authorize__btn:hover,.swagger-section #explore:hover{background-color:#547f00}.swagger-section #header #logo{font-size:1.5em;font-weight:700;text-decoration:none;color:#fff}.swagger-section #header #logo .logo__img{display:block;float:left;margin-top:2px}.swagger-section #header #logo .logo__title{display:inline-block;padding:5px 0 0 10px}.swagger-section #content_message{margin:10px 15px;font-style:italic;color:#999}.swagger-section #message-bar{min-height:30px;text-align:center;padding-top:10px}.swagger-section .swagger-collapse:before{content:"-"}.swagger-section .swagger-expand:before{content:"+"}.swagger-section .error{outline-color:#c00;background-color:#f2dede} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/style.css b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/style.css new file mode 100644 index 000000000..52907e463 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/style.css @@ -0,0 +1 @@ +.swagger-section #header a#logo{font-size:1.5em;font-weight:700;text-decoration:none;padding:20px 0 20px 40px}#text-head{font-size:80px;font-family:Roboto,sans-serif;color:#fff;float:right;margin-right:20%}.navbar-fixed-top .navbar-brand,.navbar-fixed-top .navbar-nav,.navbar-header{height:auto}.navbar-inverse{background-color:#000;border-color:#000}#navbar-brand{margin-left:20%}.navtext{font-size:10px}.h1,h1{font-size:60px}.navbar-default .navbar-header .navbar-brand{color:#a2dfee}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a{color:#393939;font-family:Arvo,serif;font-size:1.5em}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2{color:#525252;padding-left:0;display:block;clear:none;float:left;font-family:Arvo,serif;font-weight:700}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#0a0a0a}.container1{width:1500px;margin:auto;margin-top:0;background-repeat:no-repeat;background-position:-40px -20px;margin-bottom:210px}.container-inner{width:1200px;margin:auto;background-color:hsla(192,8%,88%,.75);padding-bottom:40px;padding-top:40px;border-radius:15px}.header-content{padding:0;width:1000px}.title1{font-size:80px;font-family:Vollkorn,serif;color:#404040;text-align:center;padding-top:40px;padding-bottom:100px}#icon{margin-top:-18px}.subtext{font-size:25px;font-style:italic;color:#08b;text-align:right;padding-right:250px}.bg-primary{background-color:#00468b}.navbar-default .nav>li>a,.navbar-default .nav>li>a:focus,.navbar-default .nav>li>a:focus:hover,.navbar-default .nav>li>a:hover{color:#08b}.text-faded{font-size:25px;font-family:Vollkorn,serif}.section-heading{font-family:Vollkorn,serif;font-size:45px;padding-bottom:10px}hr{border-color:#00468b;padding-bottom:10px}.description{margin-top:20px;padding-bottom:200px}.description li{font-family:Vollkorn,serif;font-size:25px;color:#525252;margin-left:28%;padding-top:5px}.gap{margin-top:200px}.troubleshootingtext{color:hsla(0,0%,100%,.7);padding-left:30%}.troubleshootingtext li{list-style-type:circle;font-size:25px;padding-bottom:5px}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.block.response_body.json:hover{cursor:pointer}.backdrop{color:blue}#myModal{height:100%}.modal-backdrop{bottom:0;position:fixed}.curl{padding:10px;font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;font-size:.9em;max-height:400px;margin-top:5px;overflow-y:auto;background-color:#fcf6db;border:1px solid #e5e0c6;border-radius:4px}.curl_title{font-size:1.1em;margin:0;padding:15px 0 5px;font-family:Open Sans,Helvetica Neue,Arial,sans-serif;font-weight:500;line-height:1.1}.footer{display:none}.swagger-section .swagger-ui-wrap h2{padding:0}h2{margin:0;margin-bottom:5px}.markdown p,.swagger-section .swagger-ui-wrap .code{font-size:15px;font-family:Arvo,serif}.swagger-section .swagger-ui-wrap b{font-family:Arvo,serif}#signin:hover{cursor:pointer}.dropdown-menu{padding:15px}.navbar-right .dropdown-menu{left:0;right:auto}#signinbutton{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}.navbar-default .nav>li .details{color:#000;text-transform:none;font-size:15px;font-weight:400;font-family:Open Sans,sans-serif;font-style:italic;line-height:20px;top:-2px}.navbar-default .nav>li .details:hover{color:#000}#signout{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b} \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/typography.css b/msb-mall/renren-fast-master/src/main/resources/static/swagger/css/typography.css new file mode 100644 index 000000000..e69de29bb diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/favicon-16x16.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/favicon-16x16.png new file mode 100644 index 000000000..0f7e13b0d Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/favicon-16x16.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/favicon-32x32.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/favicon-32x32.png new file mode 100644 index 000000000..b0a3352ff Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/favicon-32x32.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/fonts/DroidSans-Bold.ttf b/msb-mall/renren-fast-master/src/main/resources/static/swagger/fonts/DroidSans-Bold.ttf new file mode 100644 index 000000000..036c4d135 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/fonts/DroidSans-Bold.ttf differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/fonts/DroidSans.ttf b/msb-mall/renren-fast-master/src/main/resources/static/swagger/fonts/DroidSans.ttf new file mode 100644 index 000000000..e517a0c5b Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/fonts/DroidSans.ttf differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/collapse.gif b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/collapse.gif new file mode 100644 index 000000000..8843e8ce5 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/collapse.gif differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/expand.gif b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/expand.gif new file mode 100644 index 000000000..477bf1371 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/expand.gif differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/explorer_icons.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/explorer_icons.png new file mode 100644 index 000000000..be43b2739 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/explorer_icons.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon-16x16.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon-16x16.png new file mode 100644 index 000000000..0f7e13b0d Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon-16x16.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon-32x32.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon-32x32.png new file mode 100644 index 000000000..b0a3352ff Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon-32x32.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon.ico b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon.ico new file mode 100644 index 000000000..8b60bcf06 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/favicon.ico differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/logo_small.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/logo_small.png new file mode 100644 index 000000000..ce3908e3f Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/logo_small.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/pet_store_api.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/pet_store_api.png new file mode 100644 index 000000000..1192ad8cd Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/pet_store_api.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/throbber.gif b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/throbber.gif new file mode 100644 index 000000000..063938892 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/throbber.gif differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/wordnik_api.png b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/wordnik_api.png new file mode 100644 index 000000000..dc0ddab13 Binary files /dev/null and b/msb-mall/renren-fast-master/src/main/resources/static/swagger/images/wordnik_api.png differ diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/index.html b/msb-mall/renren-fast-master/src/main/resources/static/swagger/index.html new file mode 100644 index 000000000..200e5cf77 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/index.html @@ -0,0 +1,107 @@ + + + + + + 接口文档 - 人人开源 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
    +
    + + diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/index.yaml b/msb-mall/renren-fast-master/src/main/resources/static/swagger/index.yaml new file mode 100644 index 000000000..58b757853 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/index.yaml @@ -0,0 +1,1664 @@ +swagger: '2.0' +info: + description: renren-fast是一个轻量级的Java快速开发平台,能快速开发项目并交付【接私活利器】 + version: 1.0.0 + title: 人人快速开发平台 + +basePath: /renren-fast + +schemes: + - http + +#认证 +securityDefinitions: + api_key: + type: "apiKey" + name: "token" + in: "header" + +#定义接口数据 +paths: + /captcha.jpg: + get: + tags: + - 用户登录 + summary: 获取验证码 + produces: + - application/octet-stream + parameters: + - name: uuid + description: UUID + in: query + type: string + required: true + /sys/login: + post: + tags: + - 用户登录 + summary: 用户登录 + produces: + - application/json + parameters: + - name: body + description: 管理员对象 + in: body + type: string + schema: + $ref: '#/definitions/LoginForm' + required: true + responses: + '200': + schema: + $ref: '#/definitions/Login' + + /sys/user/list: + get: + tags: + - 管理员管理 + summary: 管理员列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + - name: username + description: 用户名 + in: query + type: string + responses: + '200': + description: 返回管理员列表 + schema: + $ref: '#/definitions/SysUserEntityList' + /sys/user/info: + get: + tags: + - 管理员管理 + summary: 当前管理员信息 + produces: + - application/json + responses: + '200': + description: 返回当前管理员信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + user: + $ref: '#/definitions/SysUserEntity' + /sys/user/info/{userId}: + get: + tags: + - 管理员管理 + summary: 获取管理员信息 + produces: + - application/json + parameters: + - name: userId + description: 用户ID + in: path + type: integer + required: true + responses: + '200': + description: 返回管理员信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + user: + $ref: '#/definitions/SysUserEntity' + /sys/user/password: + post: + tags: + - 管理员管理 + summary: 修改密码 + produces: + - application/json + parameters: + - name: body + description: 管理员对象 + in: body + type: string + schema: + $ref: '#/definitions/PasswordForm' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/user/save: + post: + tags: + - 管理员管理 + summary: 添加管理员 + produces: + - application/json + parameters: + - name: body + description: 管理员对象 + in: body + type: string + schema: + $ref: '#/definitions/SysUserEntityEdit' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/user/update: + post: + tags: + - 管理员管理 + summary: 修改管理员 + produces: + - application/json + parameters: + - name: body + description: 管理员对象 + in: body + type: string + schema: + $ref: '#/definitions/SysUserEntityEdit' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/user/delete: + post: + tags: + - 管理员管理 + summary: 删除管理员 + produces: + - application/json + parameters: + - name: body + description: 用户ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + + /sys/role/list: + get: + tags: + - 角色管理 + summary: 角色列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + - name: roleName + description: 角色名 + in: query + type: string + responses: + '200': + description: 返回角色列表 + schema: + $ref: '#/definitions/SysRoleEntityList' + /sys/role/select: + get: + tags: + - 角色管理 + summary: 当前账号角色列表 + description: 如果是超级管理员,则能查询所有的角色列表 + produces: + - application/json + responses: + '200': + description: 返回角色列表 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/SysRoleEntity' + /sys/role/info/{roleId}: + get: + tags: + - 角色管理 + summary: 获取角色信息 + produces: + - application/json + parameters: + - name: roleId + description: 角色ID + in: path + type: integer + required: true + responses: + '200': + description: 返回角色信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + role: + $ref: '#/definitions/SysRoleEntity' + /sys/role/save: + post: + tags: + - 角色管理 + summary: 添加角色 + produces: + - application/json + parameters: + - name: body + description: 角色对象 + in: body + type: string + schema: + $ref: '#/definitions/SysRoleEntityEdit' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/role/update: + post: + tags: + - 角色管理 + summary: 修改角色 + produces: + - application/json + parameters: + - name: body + description: 角色对象 + in: body + type: string + schema: + $ref: '#/definitions/SysRoleEntityEdit' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/role/delete: + post: + tags: + - 角色管理 + summary: 删除角色 + produces: + - application/json + parameters: + - name: body + description: 角色ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + + /sys/menu/nav: + get: + tags: + - 菜单管理 + summary: 导航菜单列表 + produces: + - application/json + responses: + '200': + description: 返回导航菜单列表 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + menuList: + description: 菜单列表 + type: array + items: + $ref: '#/definitions/SysMenuEntity' + permissions: + description: 权限列表 + type: array + items: + type: string + /sys/menu/list: + get: + tags: + - 菜单管理 + summary: 菜单列表 + produces: + - application/json + responses: + '200': + description: 返回菜单列表 + schema: + type: array + items: + $ref: '#/definitions/SysMenuEntity' + /sys/menu/select: + get: + tags: + - 菜单管理 + summary: 选择菜单 + description: 添加、修改菜单的时候,选择上级菜单接口 + produces: + - application/json + responses: + '200': + description: 返回菜单列表 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + menuList: + description: 菜单列表 + type: array + items: + $ref: '#/definitions/SysMenuEntity' + /sys/menu/info/{menuId}: + get: + tags: + - 菜单管理 + summary: 获取菜单信息 + produces: + - application/json + parameters: + - name: menuId + description: 菜单ID + in: path + type: integer + required: true + responses: + '200': + description: 返回菜单信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + menu: + description: 菜单信息 + $ref: '#/definitions/SysMenuEntity' + /sys/menu/save: + post: + tags: + - 菜单管理 + summary: 添加菜单 + produces: + - application/json + parameters: + - name: body + description: 菜单对象 + in: body + type: string + schema: + $ref: '#/definitions/SysMenuEntityEdit' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/menu/update: + post: + tags: + - 菜单管理 + summary: 修改菜单 + produces: + - application/json + parameters: + - name: body + description: 菜单对象 + in: body + type: string + schema: + $ref: '#/definitions/SysMenuEntityEdit' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/menu/delete/{menuId}: + post: + tags: + - 菜单管理 + summary: 删除菜单 + produces: + - application/json + parameters: + - name: menuId + description: 菜单ID + in: path + type: integer + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + + /sys/log/list: + get: + tags: + - 系统日志 + summary: 日志列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + - name: key + description: 用户名或用户操作 + in: query + type: string + responses: + '200': + description: 返回日志列表 + schema: + $ref: '#/definitions/SysLogEntityList' + + /sys/config/list: + get: + tags: + - 参数管理 + summary: 参数列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + - name: key + description: 参数名 + in: query + type: string + responses: + '200': + description: 返回参数列表 + schema: + $ref: '#/definitions/SysConfigEntityList' + /sys/config/info/{id}: + get: + tags: + - 参数管理 + summary: 获取参数信息 + produces: + - application/json + parameters: + - name: id + description: 参数ID + in: path + type: integer + required: true + responses: + '200': + description: 返回参数信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + config: + description: 返回参数信息 + $ref: '#/definitions/SysConfigEntity' + /sys/config/save: + post: + tags: + - 参数管理 + summary: 添加参数 + produces: + - application/json + parameters: + - name: body + description: 参数对象 + in: body + type: string + schema: + $ref: '#/definitions/SysConfigEntity' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/config/update: + post: + tags: + - 参数管理 + summary: 修改参数 + produces: + - application/json + parameters: + - name: body + description: 参数对象 + in: body + type: string + schema: + $ref: '#/definitions/SysConfigEntity' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/config/delete: + post: + tags: + - 参数管理 + summary: 删除参数 + produces: + - application/json + parameters: + - name: body + description: 参数ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + + /sys/oss/list: + get: + tags: + - 文件服务 + summary: 文件列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + responses: + '200': + description: 返回文件列表 + schema: + $ref: '#/definitions/SysOssEntityList' + /sys/oss/config: + get: + tags: + - 文件服务 + summary: 云存储配置信息 + produces: + - application/json + responses: + '200': + description: 返回云存储配置信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + config: + description: 云存储配置信息 + $ref: '#/definitions/SysCloudStorageEntity' + /sys/oss/saveConfig: + post: + tags: + - 文件服务 + summary: 保存云存储配置信息 + produces: + - application/json + parameters: + - name: body + description: 参数对象 + in: body + type: string + schema: + $ref: '#/definitions/SysCloudStorageEntity' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/oss/upload: + post: + tags: + - 文件服务 + summary: 上传文件 + consumes: + - multipart/form-data + produces: + - application/json + parameters: + - name: file + description: 文件 + in: formData + type: file + required: true + responses: + '200': + description: 返回文件列表 + schema: + $ref: '#/definitions/FileUpload' + /sys/oss/delete: + post: + tags: + - 文件服务 + summary: 删除文件 + produces: + - application/json + parameters: + - name: body + description: 文件ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + + /sys/schedule/list: + get: + tags: + - 定时任务 + summary: 定时任务列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + - name: beanName + description: spring bean名称 + in: query + type: string + responses: + '200': + description: 返回定时任务列表 + schema: + $ref: '#/definitions/ScheduleJobEntityList' + /sys/schedule/info/{jobId}: + get: + tags: + - 定时任务 + summary: 获取定时任务信息 + produces: + - application/json + parameters: + - name: jobId + description: 定时任务ID + in: path + type: integer + required: true + responses: + '200': + description: 返回定时任务信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + schedule: + description: 定时任务信息 + $ref: '#/definitions/ScheduleJobEntity' + /sys/schedule/save: + post: + tags: + - 定时任务 + summary: 添加定时任务 + produces: + - application/json + parameters: + - name: body + description: 定时任务对象 + in: body + type: string + schema: + $ref: '#/definitions/ScheduleJobEntity' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/schedule/update: + post: + tags: + - 定时任务 + summary: 修改定时任务 + produces: + - application/json + parameters: + - name: body + description: 定时任务对象 + in: body + type: string + schema: + $ref: '#/definitions/ScheduleJobEntity' + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/schedule/delete: + post: + tags: + - 定时任务 + summary: 删除定时任务 + produces: + - application/json + parameters: + - name: body + description: 定时任务ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/schedule/run: + post: + tags: + - 定时任务 + summary: 立即执行任务 + produces: + - application/json + parameters: + - name: body + description: 定时任务ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/schedule/pause: + post: + tags: + - 定时任务 + summary: 暂停定时任务 + produces: + - application/json + parameters: + - name: body + description: 定时任务ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + /sys/schedule/resume: + post: + tags: + - 定时任务 + summary: 恢复定时任务 + produces: + - application/json + parameters: + - name: body + description: 定时任务ID列表 + in: body + type: array + items: + type: integer + format: int64 + default: 0 + required: true + responses: + '200': + schema: + $ref: '#/definitions/R' + + /sys/scheduleLog/list: + get: + tags: + - 定时任务 + summary: 定时任务日志列表 + produces: + - application/json + parameters: + - name: page + description: 页码 + in: query + type: integer + required: true + - name: limit + description: 每页条数 + in: query + type: integer + required: true + - name: sidx + description: 排序字段 + in: query + type: string + - name: order + description: 排序方式,如:asc、desc + in: query + type: string + - name: beanName + description: spring bean名称 + in: query + type: string + responses: + '200': + description: 返回定时任务日志列表 + schema: + $ref: '#/definitions/ScheduleJobLogEntityList' + /sys/scheduleLog/info/{logId}: + get: + tags: + - 定时任务 + summary: 获取定时任务日志信息 + produces: + - application/json + parameters: + - name: logId + description: 日志ID + in: path + type: integer + required: true + responses: + '200': + description: 返回定时任务日志信息 + schema: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + schedule: + description: 定时任务日志信息 + $ref: '#/definitions/ScheduleJobLogEntity' + +#定义数据模型 +definitions: + R: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + msg: + description: 失败原因 + type: string + Login: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + token: + description: token + type: string + expire: + description: 过期时长 + type: integer + format: int32 + msg: + description: 失败原因 + type: string + LoginForm: + type: object + properties: + username: + description: 用户名 + type: string + password: + description: 密码 + type: string + captcha: + description: 验证码 + type: string + uuid: + description: UUID + type: string + PasswordForm: + type: object + properties: + password: + description: 原密码 + type: string + newPassword: + description: 新密码 + type: string + SysUserEntity: + type: object + properties: + userId: + description: 用户ID + type: integer + format: int64 + username: + description: 用户名 + type: string + password: + description: 密码 + type: string + email: + description: 邮箱 + type: string + mobile: + description: 手机号 + type: string + status: + description: 状态 0:禁用 1:正常 + type: integer + format: int32 + roleIdList: + description: 角色ID列表 + type: array + items: + type: integer + format: int64 + createUserId: + description: 创建者ID + type: integer + format: int64 + createTime: + description: 创建时间 + type: string + format: date-time + SysUserEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/SysUserEntity' + SysUserEntityEdit: + type: object + properties: + userId: + description: 用户ID + type: integer + format: int64 + username: + description: 用户名 + type: string + password: + description: 密码 + type: string + email: + description: 邮箱 + type: string + mobile: + description: 手机号 + type: string + status: + description: 状态 0:禁用 1:正常 + type: integer + format: int32 + roleIdList: + description: 角色ID列表 + type: array + items: + type: integer + format: int32 + + SysRoleEntity: + type: object + properties: + roleId: + description: 角色ID + type: integer + format: int64 + roleName: + description: 角色名称 + type: string + remark: + description: 备注 + type: string + menuIdList: + description: 菜单ID列表 + type: array + items: + type: integer + format: int64 + createUserId: + description: 创建者ID + type: integer + format: int64 + createTime: + description: 创建时间 + type: string + format: date-time + SysRoleEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/SysRoleEntity' + SysRoleEntityEdit: + type: object + properties: + roleId: + description: 角色ID + type: integer + format: int64 + roleName: + description: 角色名称 + type: string + remark: + description: 备注 + type: string + menuIdList: + description: 菜单ID列表 + type: array + items: + type: integer + format: int64 + + SysMenuEntity: + type: object + properties: + menuId: + description: 菜单ID + type: integer + format: int64 + name: + description: 菜单名称 + type: string + parentId: + description: 父菜单ID,一级菜单为0 + type: integer + format: int64 + parentName: + description: 父菜单名称 + type: string + url: + description: 菜单URL + type: string + perms: + description: 授权标识 + type: string + type: + description: 类型 0:目录 1:菜单 2:按钮 + type: integer + format: int32 + icon: + description: 菜单图标 + type: string + orderNum: + description: 排序 + type: integer + format: int32 + open: + description: 是否展开 true:展开 false:不展开 + type: boolean + format: int32 + SysMenuEntityEdit: + type: object + properties: + menuId: + description: 菜单ID + type: integer + format: int64 + name: + description: 菜单名称 + type: string + parentId: + description: 父菜单ID,一级菜单为0 + type: integer + format: int64 + url: + description: 菜单URL + type: string + perms: + description: 授权标识 + type: string + type: + description: 类型 0:目录 1:菜单 2:按钮 + type: integer + format: int32 + icon: + description: 菜单图标 + type: string + orderNum: + description: 排序 + type: integer + format: int32 + + SysLogEntity: + type: object + properties: + id: + description: 日志ID + type: integer + format: int64 + username: + description: 用户名 + type: string + operation: + description: 用户操作 + type: string + method: + description: 请求方法 + type: string + params: + description: 请求参数 + type: string + time: + description: 执行时长(毫秒) + type: integer + format: int64 + ip: + description: IP地址 + type: string + createTime: + description: 创建时间 + type: string + format: date-time + SysLogEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/SysLogEntity' + + SysConfigEntity: + type: object + properties: + id: + description: 参数ID + type: integer + format: int64 + key: + description: 参数名 + type: string + value: + description: 参数值 + type: string + remark: + description: 备注 + type: string + SysConfigEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/SysConfigEntity' + + SysOssEntity: + type: object + properties: + id: + description: ID + type: integer + format: int64 + url: + description: URL地址 + type: string + createTime: + description: 创建时间 + type: string + format: date-time + SysOssEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/SysOssEntity' + SysCloudStorageEntity: + type: object + properties: + type: + description: 类型 1:七牛 2:阿里云 3:腾讯云 + type: integer + format: int32 + qiniuDomain: + description: 七牛绑定的域名 + type: string + qiniuPrefix: + description: 七牛路径前缀 + type: string + qiniuAccessKey: + description: 七牛ACCESS_KEY + type: string + qiniuSecretKey: + description: 七牛SECRET_KEY + type: string + qiniuBucketName: + description: 七牛存储空间名 + type: string + aliyunDomain: + description: 阿里云绑定的域名 + type: string + aliyunPrefix: + description: 阿里云路径前缀 + type: string + aliyunEndPoint: + description: 阿里云EndPoint + type: string + aliyunAccessKeyId: + description: 阿里云AccessKeyId + type: string + aliyunAccessKeySecret: + description: 阿里云AccessKeySecret + type: string + aliyunBucketName: + description: 阿里云BucketName + type: string + qcloudDomain: + description: 腾讯云绑定的域名 + type: string + qcloudPrefix: + description: 腾讯云路径前缀 + type: string + qcloudAppId: + description: 腾讯云AppId + type: string + qcloudSecretId: + description: 腾讯云SecretId + type: string + qcloudSecretKey: + description: 腾讯云SecretKey + type: string + qcloudBucketName: + description: 腾讯云BucketName + type: string + qcloudRegion: + description: 腾讯云COS所属地区 + type: string + FileUpload: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + url: + description: 文件URL地址 + type: string + msg: + description: 失败原因 + type: string + + ScheduleJobEntity: + type: object + properties: + jobId: + description: 任务ID + type: integer + format: int64 + beanName: + description: spring bean名称 + type: string + methodName: + description: 方法名 + type: string + params: + description: 参数 + type: string + cronExpression: + description: cron表达式 + type: string + status: + description: 任务状态 0:正常 1:暂停 + type: integer + format: int32 + remark: + description: 备注 + type: string + createTime: + description: 创建时间 + type: string + format: date-time + ScheduleJobEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/ScheduleJobEntity' + + ScheduleJobLogEntity: + type: object + properties: + logId: + description: 日志id + type: integer + format: int64 + jobId: + description: 任务id + type: integer + format: int64 + beanName: + description: spring bean名称 + type: string + methodName: + description: 方法名 + type: string + params: + description: 参数 + type: string + status: + description: 任务状态 0:成功 1:失败 + type: integer + format: int32 + error: + description: 失败信息 + type: string + times: + description: 耗时(单位:毫秒) + type: integer + format: int32 + createTime: + description: 创建时间 + type: string + format: date-time + ScheduleJobLogEntityList: + type: object + properties: + code: + description: 状态码 0:成功 非0:失败 + type: integer + format: int32 + page: + type: object + properties: + totalCount: + description: 总记录数 + type: integer + format: int32 + pageSize: + description: 每页记录数 + type: integer + format: int32 + totalPage: + description: 总页数 + type: integer + format: int32 + currPage: + description: 当前页数 + type: integer + format: int32 + list: + type: array + items: + $ref: '#/definitions/ScheduleJobLogEntity' \ No newline at end of file diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/en.js b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/en.js new file mode 100644 index 000000000..918313665 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/en.js @@ -0,0 +1,56 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Warning: Deprecated", + "Implementation Notes":"Implementation Notes", + "Response Class":"Response Class", + "Status":"Status", + "Parameters":"Parameters", + "Parameter":"Parameter", + "Value":"Value", + "Description":"Description", + "Parameter Type":"Parameter Type", + "Data Type":"Data Type", + "Response Messages":"Response Messages", + "HTTP Status Code":"HTTP Status Code", + "Reason":"Reason", + "Response Model":"Response Model", + "Request URL":"Request URL", + "Response Body":"Response Body", + "Response Code":"Response Code", + "Response Headers":"Response Headers", + "Hide Response":"Hide Response", + "Headers":"Headers", + "Try it out!":"Try it out!", + "Show/Hide":"Show/Hide", + "List Operations":"List Operations", + "Expand Operations":"Expand Operations", + "Raw":"Raw", + "can't parse JSON. Raw result":"can't parse JSON. Raw result", + "Example Value":"Example Value", + "Model Schema":"Model Schema", + "Model":"Model", + "Click to set as parameter value":"Click to set as parameter value", + "apply":"apply", + "Username":"Username", + "Password":"Password", + "Terms of service":"Terms of service", + "Created by":"Created by", + "See more at":"See more at", + "Contact the developer":"Contact the developer", + "api version":"api version", + "Response Content Type":"Response Content Type", + "Parameter content type:":"Parameter content type:", + "fetching resource":"fetching resource", + "fetching resource list":"fetching resource list", + "Explore":"Explore", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.", + "Please specify the protocol for":"Please specify the protocol for", + "Can't read swagger JSON from":"Can't read swagger JSON from", + "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI", + "Unable to read api":"Unable to read api", + "from path":"from path", + "server returned":"server returned" +}); diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/translator.js b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/translator.js new file mode 100644 index 000000000..ffb879f9a --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/translator.js @@ -0,0 +1,39 @@ +'use strict'; + +/** + * Translator for documentation pages. + * + * To enable translation you should include one of language-files in your index.html + * after . + * For example - + * + * If you wish to translate some new texts you should do two things: + * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. + * 2. Mark that text it templates this way New Phrase or . + * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. + * + */ +window.SwaggerTranslator = { + + _words:[], + + translate: function(sel) { + var $this = this; + sel = sel || '[data-sw-translate]'; + + $(sel).each(function() { + $(this).html($this._tryTranslate($(this).html())); + + $(this).val($this._tryTranslate($(this).val())); + $(this).attr('title', $this._tryTranslate($(this).attr('title'))); + }); + }, + + _tryTranslate: function(word) { + return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; + }, + + learn: function(wordsMap) { + this._words = wordsMap; + } +}; diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/zh-cn.js b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/zh-cn.js new file mode 100644 index 000000000..c7f55b43c --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lang/zh-cn.js @@ -0,0 +1,56 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"警告:已过时", + "Implementation Notes":"接口备注", + "Response Class":"响应类", + "Status":"状态", + "Parameters":"参数", + "Parameter":"参数", + "Value":"值", + "Description":"描述", + "Parameter Type":"参数类型", + "Data Type":"数据类型", + "Response Messages":"响应消息", + "HTTP Status Code":"HTTP状态码", + "Reason":"原因", + "Response Model":"响应模型", + "Request URL":"请求URL", + "Response Body":"响应体", + "Response Code":"响应码", + "Response Headers":"响应头", + "Hide Response":"隐藏响应", + "Headers":"头", + "Try it out!":"试一下!", + "Show/Hide":"显示/隐藏", + "List Operations":"显示操作", + "Expand Operations":"展开操作", + "Raw":"原始", + "can't parse JSON. Raw result":"无法解析JSON. 原始结果", + "Example Value":"示例", + "Click to set as parameter value":"点击设置参数", + "Model Schema":"模型架构", + "Model":"模型", + "apply":"应用", + "Username":"用户名", + "Password":"密码", + "Terms of service":"服务条款", + "Created by":"创建者", + "See more at":"查看更多:", + "Contact the developer":"联系开发者", + "api version":"api版本", + "Response Content Type":"响应类型", + "Parameter content type:":"参数类型:", + "fetching resource":"正在获取资源", + "fetching resource list":"正在获取资源列表", + "Explore":"浏览", + "Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。", + "Please specify the protocol for":"请指定协议:", + "Can't read swagger JSON from":"无法读取swagger JSON于", + "Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI", + "Unable to read api":"无法读取api", + "from path":"从路径", + "server returned":"服务器返回" +}); diff --git a/msb-mall/renren-fast-master/src/main/resources/static/swagger/lib/backbone-min.js b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lib/backbone-min.js new file mode 100644 index 000000000..8eff02e98 --- /dev/null +++ b/msb-mall/renren-fast-master/src/main/resources/static/swagger/lib/backbone-min.js @@ -0,0 +1 @@ +!function(t,e){if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(i,n,s){t.Backbone=e(t,s,i,n)});else if("undefined"!=typeof exports){var i=require("underscore");e(t,exports,i)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,i,n){var s=t.Backbone,r=[],a=(r.push,r.slice);r.splice;e.VERSION="1.1.2",e.$=n,e.noConflict=function(){return t.Backbone=s,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var n=this._events[t]||(this._events[t]=[]);return n.push({callback:e,context:i,ctx:i||this}),this},once:function(t,e,n){if(!c(this,"once",t,[e,n])||!e)return this;var s=this,r=i.once(function(){s.off(t,r),e.apply(this,arguments)});return r._callback=e,this.on(t,r,n)},off:function(t,e,n){var s,r,a,o,h,u,l,d;if(!this._events||!c(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events=void 0,this;for(o=t?[t]:i.keys(this._events),h=0,u=o.length;h").attr(t);this.setElement(n,!1)}}}),e.sync=function(t,n,s){var r=E[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||j()),null!=s.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var o=s.beforeSend;s.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",r),o)return o.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1),"PATCH"===a.type&&x&&(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var h=s.xhr=e.ajax(i.extend(a,s));return n.trigger("request",n,h,s),h};var x=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),E={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var k=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},T=/\((.*?)\)/g,$=/(\(\?)?:\w+/g,S=/\*\w+/g,H=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(k.prototype,o,{initialize:function(){},route:function(t,n,s){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return e.history.route(t,function(i){var a=r._extractParameters(t,i);r.execute(s,a),r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),e.history.trigger("route",r,n,a)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(H,"\\$&").replace(T,"(?:$1)?").replace($,function(t,e){return e?t:"([^/?]+)"}).replace(S,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var A=e.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},I=/^[#\/]|\s+$/g,N=/^\/+|\/+$/g,R=/msie [\w.]+/,O=/\/$/,P=/#.*$/;A.started=!1,i.extend(A.prototype,o,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(O,"");t.indexOf(i)||(t=t.slice(i.length))}else t=this.getHash();return t.replace(I,"")},start:function(t){if(A.started)throw new Error("Backbone.history has already been started");A.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),s=document.documentMode,r=R.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);if(this.root=("/"+this.root+"/").replace(N,"/"),r&&this._wantsHashChange){var a=e.$('';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}e.vessel(f,function(n,r,d){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){l.parents("."+s[0])[0]||(l.data("display",l.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+s[0]+a).find("."+s[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=d),e.layero=i("#"+s[0]+a),t.scrollbar||s.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",l[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),s.anim[t.anim]&&e.layero.addClass(s.anim[t.anim]).data("anim",!0)}},l.pt.auto=function(e){function t(e){e=l.find(e),e.height(f[1]-c-d-2*(0|parseFloat(e.css("padding"))))}var a=this,o=a.config,l=i("#"+s[0]+e);""===o.area[0]&&o.maxWidth>0&&(r.ie&&r.ie<8&&o.btn&&l.width(l.innerWidth()),l.outerWidth()>o.maxWidth&&l.width(o.maxWidth));var f=[l.innerWidth(),l.innerHeight()],c=l.find(s[1]).outerHeight()||0,d=l.find("."+s[6]).outerHeight()||0;switch(o.type){case 2:t("iframe");break;default:""===o.area[1]?o.fixed&&f[1]>=n.height()&&(f[1]=n.height(),t("."+s[5])):t("."+s[5])}return a},l.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(s[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},l.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var l={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),l.autoLeft=function(){l.left+o[0]-n.width()>0?(l.tipLeft=l.left+l.width-o[0],f.css({right:12,left:"auto"})):l.tipLeft=l.left},l.where=[function(){l.autoLeft(),l.tipTop=l.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){l.tipLeft=l.left+l.width+10,l.tipTop=l.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){l.autoLeft(),l.tipTop=l.top+l.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){l.tipLeft=l.left-o[0]-10,l.tipTop=l.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],l.where[c-1](),1===c?l.top-(n.scrollTop()+o[1]+16)<0&&l.where[2]():2===c?n.width()-(l.left+l.width+o[0]+16)>0||l.where[3]():3===c?l.top-n.scrollTop()+l.height+o[1]+16-n.height()>0&&l.where[0]():4===c&&o[0]+16-l.left>0&&l.where[1](),a.find("."+s[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:l.tipLeft-(t.fixed?n.scrollLeft():0),top:l.tipTop-(t.fixed?n.scrollTop():0)})},l.pt.move=function(){var e=this,t=e.config,a=i(document),l=e.layero,s=l.find(t.move),f=l.find(".layui-layer-resize"),c={};return t.move&&s.css("cursor","move"),s.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(l.css("left")),e.clientY-parseFloat(l.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[l.outerWidth(),l.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],s="fixed"===l.css("position");if(i.preventDefault(),c.stX=s?0:n.scrollLeft(),c.stY=s?0:n.scrollTop(),!t.moveOut){var f=n.width()-l.outerWidth()+c.stX,d=n.height()-l.outerHeight()+c.stY;af&&(a=f),od&&(o=d)}l.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd()),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},l.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+s[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+s[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+s[0])[0]||1==n.attr("layer")&&i("."+s[0]).length<1&&n.removeAttr("layer").show(),n=null})},l.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+s[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},l.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){s.html.attr("layer-full")==e&&(s.html[0].style.removeProperty?s.html[0].style.removeProperty("overflow"):s.html[0].style.removeAttribute("overflow"),s.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+s[4]).attr("times"),i("#"+s[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+s[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+s[0]+e),a=n.find(s[1]).outerHeight()||0,o=n.find("."+s[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+s[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+s[0]+e),r=a.find(".layui-layer-content"),l=a.attr("type"),f=a.find(s[1]).outerHeight()||0,c=a.find("."+s[6]).outerHeight()||0;a.attr("minLeft");l!==o.type[3]&&l!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+s[6]).outerHeight(),l===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+s[0]+e),l=a.find(s[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:l,left:f,top:n.height()-l,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(s[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+s[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(s[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+s[0]+e);o.record(a),s.html.attr("layer-full")||s.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+s[0]+(t||r.index)).find(s[1]);n.html(e)},r.close=function(e){var t=i("#"+s[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var l="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+s[5]+")").remove();for(var a=t.find("."+l),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(l)}else{if(n===o.type[2])try{var f=i("#"+s[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+s[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}};t.data("anim")&&t.addClass(a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),"function"==typeof o.end[e]&&o.end[e](),delete o.end[e],t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),setTimeout(function(){f()},r.ie&&r.ie<10||!t.data("anim")?0:200)}},r.closeAll=function(e){i.each(i("."+s[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var l,s=2==e.formType?'":function(){return''}();return r.open(i.extend({type:1,btn:["确定","取消"],content:s,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){l=e.find(".layui-layer-input"),l.focus()},resize:!1,yes:function(i){var n=l.val();""===n?l.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",l,{tips:1}):t&&t(n,i,l)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{};return r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,n="";if(e>0)for(n=''+t[0].title+"";i"+t[i].title+"";return n}(),content:'
      '+function(){var e=t.length,i=1,n="";if(e>0)for(n='
    • '+(t[0].content||"no content")+"
    • ";i'+(t[i].content||"no content")+"";return n}()+"
    ",success:function(t){var n=t.find(".layui-layer-title").children(),a=t.find(".layui-layer-tabmain").children();n.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var n=i(this),o=n.index();n.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),a.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)})}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var l={};if(t=t||{},t.photos){var s=t.photos.constructor===Object,f=s?t.photos:{},d=f.data||[],u=f.start||0;if(l.imgIndex=(0|u)+1,t.img=t.img||"img",s){if(0===d.length)return r.msg("没有图片")}else{var y=i(t.photos),p=function(){d=[],y.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),d.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(p(),0===d.length)return;if(n||y.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:d,tab:t.tab},full:t.full}),!0),p()}),!n)return}l.imgprev=function(e){l.imgIndex--,l.imgIndex<1&&(l.imgIndex=d.length),l.tabimg(e)},l.imgnext=function(e,t){l.imgIndex++,l.imgIndex>d.length&&(l.imgIndex=1,t)||l.tabimg(e)},l.keyup=function(e){if(!l.end){var t=e.keyCode;e.preventDefault(),37===t?l.imgprev(!0):39===t?l.imgnext(!0):27===t&&r.close(l.index)}},l.tabimg=function(e){d.length<=1||(f.start=l.imgIndex-1,r.close(l.index),r.photos(t,!0,e))},l.event=function(){l.bigimg.hover(function(){l.imgsee.show()},function(){l.imgsee.hide()}),l.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),l.imgprev()}),l.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),l.imgnext()}),i(document).on("keyup",l.keyup)},l.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(d[u].src,function(n){r.close(l.loadi),l.index=r.open(i.extend({type:1,area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(d[u].alt||
    '+(d.length>1?'':"")+'
    '+(d[u].alt||"")+""+l.imgIndex+"/"+d.length+"
    ",success:function(e,i){l.bigimg=e.find(".layui-layer-phimg"),l.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),l.event(e),t.tab&&t.tab(d[u],e)},end:function(){l.end=!0,i(document).off("keyup",l.keyup)}},t))},function(){r.close(l.loadi),r.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){d.length>1&&l.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),s.html=i("html"),r.open=function(e){var t=new l(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.jquery),e.layer=r,t("layer",r)})):"function"==typeof define?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/mobile/layer.js b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/mobile/layer.js new file mode 100644 index 000000000..f9cf69313 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/mobile/layer.js @@ -0,0 +1,2 @@ +/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ + ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'

    '+(e?n.title[0]:n.title)+"

    ":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),'
    '+e+"
    "):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='

    '+(n.content||"")+"

    "),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"
    ':"")+'
    "+l+'
    '+n.content+"
    "+c+"
    ",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;odiv{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px} \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/icon-ext.png b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/icon-ext.png new file mode 100644 index 000000000..bbbb669bb Binary files /dev/null and b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/icon-ext.png differ diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/icon.png b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/icon.png new file mode 100644 index 000000000..3e17da8b1 Binary files /dev/null and b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/icon.png differ diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/layer.css b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/layer.css new file mode 100644 index 000000000..b88c0c7c8 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/layer.css @@ -0,0 +1 @@ +.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}*html{background-image:url(about:blank);background-attachment:fixed}html #layuicss-skinlayercss{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layui-layer{border-radius:2px;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim{-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:rollIn;animation-name:rollIn}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:bounceOut;animation-name:bounceOut;-webkit-animation-duration:.2s;animation-duration:.2s}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:0 -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 10px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:0 6px;padding:0 15px;border:1px solid #dedede;background-color:#f1f1f1;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#4898d5;background-color:#2e8ded;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:5px 10px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:1px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#BBB5B5;border:none}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-0.gif b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-0.gif new file mode 100644 index 000000000..6f3c9539a Binary files /dev/null and b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-0.gif differ diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-1.gif b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-1.gif new file mode 100644 index 000000000..db3a483e4 Binary files /dev/null and b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-1.gif differ diff --git a/src/main/ui/static/images/loading.gif b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-2.gif old mode 100755 new mode 100644 similarity index 100% rename from src/main/ui/static/images/loading.gif rename to msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/default/loading-2.gif diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/moon/default.png b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/moon/default.png new file mode 100644 index 000000000..77dfaf309 Binary files /dev/null and b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/moon/default.png differ diff --git a/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/moon/style.css b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/moon/style.css new file mode 100644 index 000000000..027dd1e04 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/static/plugins/layer/skin/moon/style.css @@ -0,0 +1 @@ +html #layui_layer_skinmoonstylecss{display:none;position:absolute;width:1989px}body .layer-ext-moon[type=dialog]{min-width:320px}body .layer-ext-moon-msg[type=dialog]{min-width:200px}body .layer-ext-moon .layui-layer-title{background:#f6f6f6;color:#212a31;font-size:16px;font-weight:700;height:46px;line-height:46px;border-bottom:1px solid #D5D5D5}body .layer-ext-moon .layui-layer-content .layui-layer-ico{height:32px;width:32px;top:18.5px}body .layer-ext-moon .layui-layer-ico0{background:url(default.png) -96px 0 no-repeat}body .layer-ext-moon .layui-layer-ico1{background:url(default.png) -224px 0 no-repeat}body .layer-ext-moon .layui-layer-ico2{background:url(default.png) -192px 0 no-repeat}body .layer-ext-moon .layui-layer-ico3{background:url(default.png) -160px 0 no-repeat}body .layer-ext-moon .layui-layer-ico4{background:url(default.png) -320px 0 no-repeat}body .layer-ext-moon .layui-layer-ico5{background:url(default.png) -288px 0 no-repeat}body .layer-ext-moon .layui-layer-ico6{background:url(default.png) -256px 0}body .layer-ext-moon .layui-layer-ico7{background:url(default.png) -128px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin{top:15px;right:15px}body .layer-ext-moon .layui-layer-setwin a{width:16px;height:16px}body .layer-ext-moon .layui-layer-setwin .layui-layer-min cite:hover{background-color:#56abe4}body .layer-ext-moon .layui-layer-setwin .layui-layer-max{background:url(default.png) -80px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-max:hover{background:url(default.png) -64px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin{background:url(default.png) -32px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover{background:url(default.png) -16px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2{background:url(default.png)}body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover{background:url(default.png) -48px 0}body .layer-ext-moon .layui-layer-padding{padding-top:24px}body .layer-ext-moon .layui-layer-btn{text-align:center;padding-top:15px;padding-bottom:15px;background:#f0f4f7;border-top:1px #c7c7c7 solid}body .layer-ext-moon .layui-layer-btn a{font-size:12px;font-weight:400;margin:0 7px;padding:6px 20px;color:#fff;border:1px solid #0064b6;background:no-repeat #0071ce;border-radius:3px;display:inline-block;height:20px;line-height:20px;text-align:center;vertical-align:middle;text-decoration:none;outline:0}body .layer-ext-moon .layui-layer-btn .layui-layer-btn0{background:#0071ce}body .layer-ext-moon .layui-layer-btn .layui-layer-btn1{background:#fff;color:#404a58;border:1px solid #c0c4cd;border-radius:3px}body .layer-ext-moon .layui-layer-btn .layui-layer-btn2{background:#f60;color:#fff;border:1px solid #f60;border-radius:3px}body .layer-ext-moon .layui-layer-btn .layui-layer-btn3{background:red;color:#fff;border:1px solid red;border-radius:3px}body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{height:47px} \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/template/Controller.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/Controller.java.vm new file mode 100644 index 000000000..9d627f065 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/Controller.java.vm @@ -0,0 +1,90 @@ +package ${package}.${moduleName}.controller; + +import java.util.Arrays; +import java.util.Map; + +##import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import ${package}.${moduleName}.entity.${className}Entity; +import ${package}.${moduleName}.service.${className}Service; +import ${mainPath}.common.utils.PageUtils; +import ${mainPath}.common.utils.R; + + + +/** + * ${comments} + * + * @author ${author} + * @email ${email} + * @date ${datetime} + */ +@RestController +@RequestMapping("${moduleName}/${pathName}") +public class ${className}Controller { + @Autowired + private ${className}Service ${classname}Service; + + /** + * 列表 + */ + @RequestMapping("/list") +## @RequiresPermissions("${moduleName}:${pathName}:list") + public R list(@RequestParam Map params){ + PageUtils page = ${classname}Service.queryPage(params); + + return R.ok().put("page", page); + } + + + /** + * 信息 + */ + @RequestMapping("/info/{${pk.attrname}}") +## @RequiresPermissions("${moduleName}:${pathName}:info") + public R info(@PathVariable("${pk.attrname}") ${pk.attrType} ${pk.attrname}){ + ${className}Entity ${classname} = ${classname}Service.getById(${pk.attrname}); + + return R.ok().put("${classname}", ${classname}); + } + + /** + * 保存 + */ + @RequestMapping("/save") +## @RequiresPermissions("${moduleName}:${pathName}:save") + public R save(@RequestBody ${className}Entity ${classname}){ + ${classname}Service.save(${classname}); + + return R.ok(); + } + + /** + * 修改 + */ + @RequestMapping("/update") +## @RequiresPermissions("${moduleName}:${pathName}:update") + public R update(@RequestBody ${className}Entity ${classname}){ + ${classname}Service.updateById(${classname}); + + return R.ok(); + } + + /** + * 删除 + */ + @RequestMapping("/delete") +## @RequiresPermissions("${moduleName}:${pathName}:delete") + public R delete(@RequestBody ${pk.attrType}[] ${pk.attrname}s){ + ${classname}Service.removeByIds(Arrays.asList(${pk.attrname}s)); + + return R.ok(); + } + +} diff --git a/msb-mall/renren-generator-master/src/main/resources/template/Dao.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/Dao.java.vm new file mode 100644 index 000000000..935a2fc42 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/Dao.java.vm @@ -0,0 +1,17 @@ +package ${package}.${moduleName}.dao; + +import ${package}.${moduleName}.entity.${className}Entity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * ${comments} + * + * @author ${author} + * @email ${email} + * @date ${datetime} + */ +@Mapper +public interface ${className}Dao extends BaseMapper<${className}Entity> { + +} diff --git a/msb-mall/renren-generator-master/src/main/resources/template/Dao.xml.vm b/msb-mall/renren-generator-master/src/main/resources/template/Dao.xml.vm new file mode 100644 index 000000000..b742fe912 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/Dao.xml.vm @@ -0,0 +1,14 @@ + + + + + + + +#foreach($column in $columns) + +#end + + + + \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/template/Entity.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/Entity.java.vm new file mode 100644 index 000000000..362cfa925 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/Entity.java.vm @@ -0,0 +1,35 @@ +package ${package}.${moduleName}.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +#if(${hasBigDecimal}) +import java.math.BigDecimal; +#end +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * ${comments} + * + * @author ${author} + * @email ${email} + * @date ${datetime} + */ +@Data +@TableName("${tableName}") +public class ${className}Entity implements Serializable { + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) + /** + * $column.comments + */ + #if($column.columnName == $pk.columnName) +@TableId + #end +private $column.attrType $column.attrname; +#end + +} diff --git a/msb-mall/renren-generator-master/src/main/resources/template/MongoChildrenEntity.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/MongoChildrenEntity.java.vm new file mode 100644 index 000000000..14a70094b --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/MongoChildrenEntity.java.vm @@ -0,0 +1,29 @@ +package ${package}.${moduleName}.entity; + + +#if(${hasList}) +import java.util.List; +#end + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; +import org.springframework.data.annotation.Id; + +/** + * ${comments} + * + * @author ${author} + * @email ${email} + * @date ${datetime} + */ +@Data +public class ${className}InnerEntity { + + +#foreach ($column in $columns) +private #if($column.extra == "array")List<#end$column.attrType#if($column.extra == "array")>#end $column.attrname; +#end + +} diff --git a/msb-mall/renren-generator-master/src/main/resources/template/MongoEntity.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/MongoEntity.java.vm new file mode 100644 index 000000000..c76aacd6a --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/MongoEntity.java.vm @@ -0,0 +1,36 @@ +package ${package}.${moduleName}.entity; + + +#if(${hasBigDecimal}) +import java.math.BigDecimal; +#end +#if(${hasList}) +import java.util.List; +#end + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; +import org.springframework.data.annotation.Id; + +/** + * ${comments} + * + * @author ${author} + * @email ${email} + * @date ${datetime} + */ +@Data +@Document(collection = "${tableName}") +public class ${className}Entity implements Serializable { + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) + #if($column.columnName == "id") +@Id + #end +private #if($column.extra == "array")List<#end$column.attrType#if($column.extra == "array")>#end $column.attrname; +#end + +} diff --git a/msb-mall/renren-generator-master/src/main/resources/template/Service.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/Service.java.vm new file mode 100644 index 000000000..2bac39b11 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/Service.java.vm @@ -0,0 +1,20 @@ +package ${package}.${moduleName}.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import ${mainPath}.common.utils.PageUtils; +import ${package}.${moduleName}.entity.${className}Entity; + +import java.util.Map; + +/** + * ${comments} + * + * @author ${author} + * @email ${email} + * @date ${datetime} + */ +public interface ${className}Service extends IService<${className}Entity> { + + PageUtils queryPage(Map params); +} + diff --git a/msb-mall/renren-generator-master/src/main/resources/template/ServiceImpl.java.vm b/msb-mall/renren-generator-master/src/main/resources/template/ServiceImpl.java.vm new file mode 100644 index 000000000..cc1a93805 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/ServiceImpl.java.vm @@ -0,0 +1,29 @@ +package ${package}.${moduleName}.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import ${mainPath}.common.utils.PageUtils; +import ${mainPath}.common.utils.Query; + +import ${package}.${moduleName}.dao.${className}Dao; +import ${package}.${moduleName}.entity.${className}Entity; +import ${package}.${moduleName}.service.${className}Service; + + +@Service("${classname}Service") +public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service { + + @Override + public PageUtils queryPage(Map params) { + IPage<${className}Entity> page = this.page( + new Query<${className}Entity>().getPage(params), + new QueryWrapper<${className}Entity>() + ); + + return new PageUtils(page); + } + +} \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/template/add-or-update.vue.vm b/msb-mall/renren-generator-master/src/main/resources/template/add-or-update.vue.vm new file mode 100644 index 000000000..d19de2fe4 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/add-or-update.vue.vm @@ -0,0 +1,109 @@ + + + diff --git a/msb-mall/renren-generator-master/src/main/resources/template/index.vue.vm b/msb-mall/renren-generator-master/src/main/resources/template/index.vue.vm new file mode 100644 index 000000000..12466552f --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/index.vue.vm @@ -0,0 +1,159 @@ + + + diff --git a/msb-mall/renren-generator-master/src/main/resources/template/menu.sql.vm b/msb-mall/renren-generator-master/src/main/resources/template/menu.sql.vm new file mode 100644 index 000000000..2b9495a35 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/template/menu.sql.vm @@ -0,0 +1,16 @@ +-- 菜单SQL +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + VALUES ('1', '${comments}', '${moduleName}/${pathName}', NULL, '1', 'config', '6'); + +-- 按钮父菜单ID +set @parentId = @@identity; + +-- 菜单对应按钮SQL +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '查看', null, '${moduleName}:${pathName}:list,${moduleName}:${pathName}:info', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '新增', null, '${moduleName}:${pathName}:save', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '修改', null, '${moduleName}:${pathName}:update', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '删除', null, '${moduleName}:${pathName}:delete', '2', null, '6'; diff --git a/msb-mall/renren-generator-master/src/main/resources/views/generator.html b/msb-mall/renren-generator-master/src/main/resources/views/generator.html new file mode 100644 index 000000000..215db6589 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/views/generator.html @@ -0,0 +1,35 @@ + + + +代码生成器 + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + 查询 +  生成代码 +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/main/resources/views/index.html b/msb-mall/renren-generator-master/src/main/resources/views/index.html new file mode 100644 index 000000000..f03ffdbbc --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/views/index.html @@ -0,0 +1,110 @@ + + + + + + 人人代码生成器 + + + + + + + + + + + + +
    +
    + + + +
    + + + + + + + +
    + +
    + +
    + + +
    + +
    + +
    + + +
    + + Copyright © 2017 renren.io All Rights Reserved +
    + + +
    + + + +
    + + + + + + + + + + + + diff --git a/msb-mall/renren-generator-master/src/main/resources/views/main.html b/msb-mall/renren-generator-master/src/main/resources/views/main.html new file mode 100644 index 000000000..9cca279b6 --- /dev/null +++ b/msb-mall/renren-generator-master/src/main/resources/views/main.html @@ -0,0 +1,29 @@ + + + + + + 欢迎页 + + + + +
    +
    基本信息
    +
    +

       获取帮助

    + + +

       官方QQ群

    +
      +
    • 高级群:324780204(大牛云集,跟大牛学习新技能)
    • +
    • 普通群:145799952(学习交流,互相解答各种疑问)
    • +
    +
    +
    + + \ No newline at end of file diff --git a/msb-mall/renren-generator-master/src/test/java/io/renren/RenrenApplicationTests.java b/msb-mall/renren-generator-master/src/test/java/io/renren/RenrenApplicationTests.java new file mode 100644 index 000000000..bacacc839 --- /dev/null +++ b/msb-mall/renren-generator-master/src/test/java/io/renren/RenrenApplicationTests.java @@ -0,0 +1,16 @@ +package io.renren; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class RenrenApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 4ab4d5910..000000000 --- a/pom.xml +++ /dev/null @@ -1,358 +0,0 @@ - - - - au.com.royalpay.payment - payment-parent - 2.3.8 - - 4.0.0 - manage - 2.4.17 - - UTF-8 - 2.4.0 - 1.0.12 - 8.0.20 - ${project.version} - - - - - au.com.royalpay.payment - tools - - - au.com.royalpay.payment - payment-core - - - au.com.royalpay.payment - wxpay-core - - - au.com.royalpay.payment - alipay-core - - - au.com.royalpay.payment - rppaymentsvc - - - au.com.royalpay.payment - rpay-core - - - au.com.royalpay.payment - shopify-core - - - com.github.stuxuhai - jpinyin - 1.1.7 - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-mongodb - - - org.springframework.boot - spring-boot-starter-web - - - com.alibaba - fastjson - 1.2.68 - - - org.springframework.boot - spring-boot-starter-websocket - - - org.springframework.boot - spring-boot-starter-jdbc - - - - org.springframework.boot - spring-boot-starter-aop - - - mysql - mysql-connector-java - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - net.sourceforge.nekohtml - nekohtml - - - cn.yixblog.google.kaptcha - kaptcha - 2.3.2 - - - com.auth0 - java-jwt - 3.7.0 - - - joda-time - joda-time - - - net.sf.jasperreports - jasperreports - 5.6.0 - - - com.lowagie - itext - - - org.olap4j - olap4j - - - - - net.sf.jasperreports - jasperreports-fonts - 6.0.0 - - - com.lowagie - itext - 2.1.7 - - - org.codehaus.groovy - groovy-all - 2.4.8 - - - org.apache.poi - poi - 3.14 - - - org.apache.poi - poi-ooxml - 3.14 - - - org.jsoup - jsoup - 1.9.2 - - - com.notnoop.apns - apns - - - javax.mail - mail - 1.4.7 - - - com.github.qcloudsms - qcloudsms - 1.0.3 - - - - cn.jpush.api - jpush-client - 3.3.3 - - - com.google.code.gson - gson - - - - - junit - junit - 4.12 - test - - - - com.taobao.api - taobao-sdk-java-auto - 1502853394064-20180710 - - - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - 1.3.2 - - - - - com.zaxxer - HikariCP - 3.2.0 - - - org.projectlombok - lombok - - - - com.itextpdf - itextpdf - 5.5.13 - - - com.itextpdf.tool - xmlworker - 5.5.13 - - - com.itextpdf - itext-asian - 5.2.0 - - - org.xhtmlrenderer - flying-saucer-pdf - 9.0.3 - - - com.jcraft - jsch - 0.1.55 - - - - org.springframework.boot - spring-boot-starter-webflux - - - - commons-codec - commons-codec - 1.12 - - - com.cronutils - cron-utils - 9.1.6 - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.17 - - - - - - officedev - - - - com.google.cloud.tools - jib-maven-plugin - ${jib-maven-plugin.version} - - - 192.168.0.84:5000/royalpay/openjdk:11.0.8 - - - 192.168.0.84:5000/royalpay/manage-dev - - latest - ${project.version} - - - - - extra/ - - - true - - - - package - - build - - - - - - - - - prod - - - - com.google.cloud.tools - jib-maven-plugin - ${jib-maven-plugin.version} - - - 192.168.0.84:5000/royalpay/openjdk:11.0.8 - - - hkccr.ccs.tencentyun.com/rpay/manage:${image.version} - - - - extra/ - - - true - - - - package - - build - - - - - - - - - - - royalpay - https://nexus.royalpay.com.au/content/groups/public - - - diff --git a/src/db/1.0.21/update.sql b/src/db/1.0.21/update.sql deleted file mode 100644 index 1d0d616f3..000000000 --- a/src/db/1.0.21/update.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table sys_clients add column settle_remark_tpl varchar(100) null default null after settle_hour; - -insert into sys_configs values ('settle.remark_template','RoyalPay{date(MMdd)}{moniker}','清算文件备注模板'); \ No newline at end of file diff --git a/src/db/2.3.73/update.sql b/src/db/2.3.73/update.sql deleted file mode 100644 index 0d192703f..000000000 --- a/src/db/2.3.73/update.sql +++ /dev/null @@ -1,46 +0,0 @@ ---2020-11-24微信渠道-商户进件字段添加 -alter table sys_wx_merchant_apply modify contact_phone varchar(20) not null; - -alter table sys_wx_merchant_apply - add merchant_country_code varchar(5) not null comment '商户国家编码'; - -alter table sys_wx_merchant_apply - add extra_merchant_type varchar(15) not null comment '商户类型:1.Enterprise 2.Individual'; - -alter table sys_wx_merchant_apply - add mcc_code varchar(4) not null comment 'Mcc编码'; - -alter table sys_wx_merchant_apply - add extra_reg_cer_number varchar(50) null comment '公司注册文件编号'; - -alter table sys_wx_merchant_apply - add extra_reg_cer_exp_date varchar(10) null comment '公司注册文件日期,格式:yyyy-MM-dd'; - -alter table sys_wx_merchant_apply - add stores_address varchar(128) null comment '店铺地址'; - -alter table sys_wx_merchant_apply - add business_type varchar(10) not null comment 'BOTH,OFFLINE,ONLINE,固定值为BOTH'; - -alter table sys_wx_merchant_apply - add director_name varchar(128) null comment '董事'; - -alter table sys_wx_merchant_apply - add director_id_number varchar(128) null comment '董事身份证号'; - -alter table sys_wx_merchant_apply - add principal_name varchar(128) null comment '负责人'; - -alter table sys_wx_merchant_apply - add principal_id_number varchar(128) null comment '负责人身份证号'; - -alter table sys_wx_merchant_apply - add is_valid tinyint(1) default '1' null comment '微信子商户进件信息是否有效'; - - - - --- 商户表 增加信息 - -ALTER TABLE `sys_clients` - ADD COLUMN certificat_expire_date date DEFAULT NULL COMMENT '注册证书过期时间'; diff --git a/src/db/20191202/R-service.sql b/src/db/20191202/R-service.sql deleted file mode 100644 index d4603bc0c..000000000 --- a/src/db/20191202/R-service.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sys_incremental_channels ADD COLUMN channel_pub_key TEXT DEFAULT NULL AFTER source_code; -ALTER TABLE sys_incremental_channels ADD COLUMN platform_pub_key TEXT DEFAULT NULL AFTER channel_pub_key; -ALTER TABLE sys_incremental_channels ADD COLUMN platform_pri_key TEXT DEFAULT NULL AFTER platform_pub_key; \ No newline at end of file diff --git a/src/db/20201028/loans_apply.sql b/src/db/20201028/loans_apply.sql deleted file mode 100644 index f7e90ca01..000000000 --- a/src/db/20201028/loans_apply.sql +++ /dev/null @@ -1,22 +0,0 @@ -ALTER TABLE `sys_clients_apply` -ADD COLUMN `type` smallint(1) NULL DEFAULT 0 COMMENT '0:PC 1:PC-卡支付'; - - -CREATE TABLE `sys_clients_loans_apply` ( - `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id', - `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `modifiy_time` timestamp(0) NULL DEFAULT NULL COMMENT '修改时间', - `modifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改者', - `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人姓名', - `phone` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人手机', - `email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系邮箱', - `business_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商业名称', - `industry` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '行业', - `status` int(1) NULL DEFAULT 0 COMMENT '贷款申请状态 0:待处理、1:处理中、2:已处理', - `source` int(1) NULL DEFAULT 0 COMMENT '申请来源: 0 : PC,1:公众号菜单,2:公众号推送,3:小程序申请,4:App申请', - `client_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商户id', - `client_moniker` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商户的parterCode', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注信息', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '贷款申请表' ROW_FORMAT = Dynamic; diff --git a/src/db/20210916/log_mch_alipay_aps_register.sql b/src/db/20210916/log_mch_alipay_aps_register.sql deleted file mode 100644 index eddcf2db4..000000000 --- a/src/db/20210916/log_mch_alipay_aps_register.sql +++ /dev/null @@ -1,20 +0,0 @@ - -CREATE TABLE `log_mch_alipay_aps_register` ( - `request_id` varchar(50) NOT NULL, - `client_id` int(11) NOT NULL, - `pid` varchar(50) NOT NULL, - `mid` varchar(50) NOT NULL, - `store_id` varchar(50) DEFAULT NULL, - `merchant_type` varchar(20) DEFAULT NULL COMMENT ' 支付类型 ONLINE,RETAIL', - `request_time` datetime DEFAULT NULL, - `confirm_time` datetime DEFAULT NULL, - `result_code` varchar(50) DEFAULT NULL COMMENT '返回的状态码', - `result_status` varchar(10) DEFAULT NULL COMMENT '返回的状态 F, S', - `is_valid` tinyint(1) DEFAULT '1' COMMENT '记录是否有效,1有效 0无效', - `registration_status` varchar(30) DEFAULT NULL, - PRIMARY KEY (`request_id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='AlipayPlus商户注册记录表'; - -// -ALTER TABLE sys_client_legal_person add legal_representative_id varchar(50) DEFAULT NULL COMMENT '法人身份ID' - diff --git a/src/db/modify.sql b/src/db/modify.sql deleted file mode 100644 index dbb2f1e46..000000000 --- a/src/db/modify.sql +++ /dev/null @@ -1,790 +0,0 @@ -CREATE TABLE `sys_rpay_merchant_apply` ( - `merchant_app_id` varchar(50) NOT NULL, - `client_id` int(11) NOT NULL, - `merchant_shortname` varchar(20) NOT NULL, - `business_category` varchar(20) NOT NULL, - `sub_merchant_id` varchar(20) DEFAULT NULL, - `create_time` datetime NOT NULL, - `operator` varchar(50) DEFAULT NULL, - PRIMARY KEY (`merchant_app_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=244; - -ALTER TABLE `pmt_refunds` - MODIFY COLUMN `refund_id` varchar(50) NOT NULL COMMENT '退款编号' FIRST ; - -ALTER TABLE `pmt_refund_applies` - MODIFY COLUMN `id` varchar(50) NOT NULL FIRST , - MODIFY COLUMN `refund_id` varchar(50) NOT NULL COMMENT 'refund order id' AFTER `order_id`; - -ALTER TABLE `pmt_transactions` - MODIFY COLUMN `transaction_id` varchar(50) NOT NULL COMMENT '交易流水编号' FIRST , - MODIFY COLUMN `refund_id` varchar(50) NULL DEFAULT NULL COMMENT '退款单号' AFTER `order_id`; - -ALTER TABLE `log_wechat_template_msg` - MODIFY COLUMN `send_id` varchar(50) NOT NULL FIRST , - MODIFY COLUMN `account_id` varchar(50) NOT NULL AFTER `client_id`; - - -ALTER TABLE `log_wechat_error` - MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ; - -ALTER TABLE `log_notify_error` - MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ; - -ALTER TABLE `log_manager_login` - MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ; - -ALTER TABLE `log_client_login` - MODIFY COLUMN `id` varchar(50) NOT NULL FIRST , - MODIFY COLUMN `account_id` varchar(50) NOT NULL AFTER `client_id`; - -ALTER TABLE `log_client_review` - MODIFY COLUMN `review_id` varchar(50) NOT NULL FIRST ; - -ALTER TABLE `log_app_msg` - MODIFY COLUMN `send_id` varchar(50) NOT NULL FIRST ; - -ALTER TABLE `sys_accounts` - MODIFY COLUMN `account_id` varchar(50) NOT NULL COMMENT '登录账户编号' FIRST ; - -ALTER TABLE `sys_clients_devices` - MODIFY COLUMN `account_id` varchar(50) NULL DEFAULT NULL COMMENT '目前登录的账号' AFTER `version`; - -ALTER TABLE `financial_bd_config` - MODIFY COLUMN `manager_id` varchar(50) NOT NULL FIRST ; - -ALTER TABLE `sys_client_bd` - MODIFY COLUMN `bd_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL AFTER `client_id`; - -ALTER TABLE `sys_client_bd` - MODIFY COLUMN `create_id` varchar(50) DEFAULT NULL FIRST ; - -ALTER TABLE `sys_managers` - MODIFY COLUMN `manager_id` varchar(50) NOT NULL COMMENT '管理员账户编号' FIRST ; - -ALTER TABLE `sys_client_rates` - MODIFY COLUMN `manager_id` varchar(50) DEFAULT NULL FIRST ; - -ALTER TABLE `log_manager_login` - MODIFY COLUMN `manager_id` varchar(50) NOT NULL AFTER `id`; - -ALTER TABLE `financial_bd_commission_config` - MODIFY COLUMN `bd_id` varchar(50) NOT NULL DEFAULT 0 COMMENT 'bd id'; - -ALTER TABLE `financial_bd_config` - MODIFY COLUMN `bd_group` varchar(50) NULL DEFAULT NULL COMMENT 'BD Leader manger_id' AFTER `get_prize`; - -ALTER TABLE `financial_bd_prize_detail` - MODIFY COLUMN `manager_id` varchar(50) NOT NULL AFTER `client_id`; - -ALTER TABLE `bd_access_log` - MODIFY COLUMN `bd_id` varchar(50) NOT NULL AFTER `date`; - -ALTER TABLE `sys_clients` - MODIFY COLUMN `creator` varchar(50) NOT NULL COMMENT '创建者' AFTER `logo_thumbnail`, - MODIFY COLUMN `bd_user` varchar(300) DEFAULT NULL COMMENT '所属BD用户' AFTER `logo_thumbnail`, - MODIFY COLUMN `approver` varchar(50) DEFAULT NULL AFTER `logo_thumbnail`; - - -ALTER TABLE `pat_goods` - MODIFY COLUMN `creator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `is_using`; - -ALTER TABLE `sys_notice` - MODIFY COLUMN `create_id` varchar(50) NOT NULL AFTER `status`, - MODIFY COLUMN `send_id` varchar(50) NULL DEFAULT NULL AFTER `create_name`; - -ALTER TABLE `sys_notice_client` - MODIFY COLUMN `read_id` varchar(50) NULL DEFAULT NULL AFTER `read_time`; - -ALTER TABLE `act_sign_events_sign_log` - MODIFY COLUMN `sign_user_id` varchar(50) NULL DEFAULT NULL AFTER `sign_time`; - -ALTER TABLE `act_red_packets_wechat` - MODIFY COLUMN `relation_id` varchar(50) NOT NULL FIRST , - MODIFY COLUMN `update_id` varchar(50) NULL DEFAULT NULL AFTER `create_time`; - - -ALTER TABLE `pat_goods` - MODIFY COLUMN `id` varchar(50) NOT NULL FIRST; - -ALTER TABLE `pat_goods_sale` - MODIFY COLUMN `good_id` varchar(50) NOT NULL AFTER `client_id`; - -ALTER TABLE `commodities` - MODIFY COLUMN `create_id` varchar(50) DEFAULT NULL; - -ALTER TABLE `sys_accounts` - MODIFY COLUMN `creator` varchar(50) NOT NULL COMMENT '开户者'; - -ALTER TABLE `sys_clients_audit_process` - MODIFY COLUMN `operator_id` tinyint(1) NOT NULL ; - -ALTER TABLE `pmt_refunds` - MODIFY COLUMN `operator_id` varchar(50) DEFAULT NULL COMMENT '退款操作者账号'; - -ALTER TABLE `sys_clients_apply` - MODIFY COLUMN `short_name` varchar(100) DEFAULT NULL COMMENT '公司简称'; - -ALTER TABLE `cashback_draw_deposits` - MODIFY COLUMN `operator_id` varchar(50) NOT NULL ; - - ALTER TABLE `sys_clients` - ADD COLUMN `local_merchant` tinyint(1) DEFAULT 0; - ---用户画像 - -ALTER TABLE sys_clients_customers ADD COLUMN headimg VARCHAR(200) DEFAULT NULL COMMENT '头像地址'; - -ALTER TABLE sys_clients_customers ADD COLUMN nick_name VARCHAR(80) DEFAULT NULL COMMENT '昵称'; - -ALTER TABLE sys_clients_customers ADD COLUMN tag VARCHAR(100) DEFAULT NULL COMMENT '标签'; - -ALTER TABLE sys_clients_customers ADD COLUMN payment_times INT DEFAULT 1 COMMENT '消费次数'; - -ALTER TABLE sys_clients_customers ADD COLUMN total_amount decimal(10 , 2) DEFAULT NULL COMMENT '消费总金额'; - -ALTER TABLE sys_clients_customers ADD COLUMN update_time datetime default NULL COMMENT '创建时间'; - -ALTER TABLE sys_clients_customers ADD COLUMN channel varchar(15) not NULL ; - -ALTER TABLE sys_clients_customers ADD COLUMN last_payment_time datetime DEFAULT NULL COMMENT '最后一次付款时间'; - -ALTER TABLE sys_org ADD COLUMN parent_org_id int(11) DEFAULT NULL; -ALTER TABLE sys_org ADD COLUMN min_wechat_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低微信费率'; -ALTER TABLE sys_org ADD COLUMN min_alipay_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低支付宝费率'; -ALTER TABLE sys_org ADD COLUMN min_alipayonline_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低支付宝线上费率'; -ALTER TABLE sys_org ADD COLUMN min_bestpay_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低翼支付费率'; -ALTER TABLE sys_org ADD COLUMN min_jd_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低京东费率'; -ALTER TABLE sys_org ADD COLUMN commission_type SMALLINT(1) DEFAULT '1' COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例'; - - ---agent_commission - -CREATE TABLE `financial_agent_commission` ( - `record_id` varchar(50) NOT NULL, - `org_id` int(11) NOT NULL, - `year` smallint(6) NOT NULL, - `month` smallint(6) NOT NULL, - `create_time` datetime NOT NULL, - `org_rate` decimal(5,2) DEFAULT NULL COMMENT '保底费率(RoyalPay抽取)', - `gross_amount` decimal(12,2) NOT NULL COMMENT '支付-退款', - `total_charge` decimal(12,2) NOT NULL COMMENT '总手续费', - `org_charge` decimal(12,2) NOT NULL COMMENT '合伙人手续', - `channel` varchar(12) NOT NULL, - `org_net_charge` decimal(12,2) DEFAULT NULL COMMENT '净值', - PRIMARY KEY (`record_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='二级代理商提成'; - -CREATE TABLE `financial_agent_commission_detail` ( - `detail_id` varchar(50) NOT NULL, - `year` smallint(6) NOT NULL, - `month` smallint(6) NOT NULL, - `record_id` varchar(50) NOT NULL, - `client_id` int(11) NOT NULL, - `client_rate` decimal(5,2) NOT NULL, - `date_from` date NOT NULL, - `date_to` date NOT NULL, - `gross_amount` decimal(12,2) NOT NULL COMMENT '总支付-总退款', - `total_charge` decimal(12,2) NOT NULL COMMENT '总手续费', - `org_charge` decimal(12,2) NOT NULL COMMENT '合伙人所得手续费', - `channel` varchar(15) NOT NULL, - `org_net_charge` decimal(12,2) DEFAULT NULL COMMENT '净值', - PRIMARY KEY (`detail_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - - -alter table financial_partner_commission add column commission_type smallint(1) DEFAULT 1 COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例'; -alter table financial_partner_commission_detail add column commission_type smallint(1) DEFAULT 1 COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例'; - - - -INSERT INTO `royalpay_production`.`sys_configs`(`config_key` , `config_value`) - - -VALUES - ( - 'android_version_content' , - '近期更新:\n\n1、修复了付款二维码的保存可能会失败的错误\n2、新增多种渠道订单及清算\n3、修复清算记录显示错误' - ); - -INSERT INTO `royalpay_production`.`sys_configs`(`config_key` , `config_value`) -VALUES - ( - 'android_version' , - '2.8.1' - ); - -INSERT INTO `royalpay_production`.`sys_configs`(`config_key` , `config_value`) -VALUES - ( - 'android_update' , - 'true' - ); - - - -CREATE TABLE `sys_wx_merchant_apply` ( - `merchant_app_id` varchar(50) NOT NULL, - `client_id` int(11) NOT NULL, - `merchant_name` varchar(50) NOT NULL, - `merchant_shortname` varchar(20) NOT NULL, - `office_phone` varchar(20) NOT NULL, - `contact_name` varchar(50) DEFAULT NULL, - `contact_phone` varchar(20) DEFAULT NULL, - `contact_email` varchar(50) DEFAULT NULL, - `business_category` varchar(20) NOT NULL, - `merchant_remark` varchar(20) NOT NULL, - `website` varchar(100) DEFAULT NULL, - `merchant_introduction` varchar(256) DEFAULT NULL, - `merchant_id` varchar(20) NOT NULL, - `sub_merchant_id` varchar(20) DEFAULT NULL, - `create_time` datetime NOT NULL, - `operator` varchar(50) DEFAULT NULL, - PRIMARY KEY (`merchant_app_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -alter table statistics_customer_order add column refund_orders int(10) DEFAULT NULL COMMENT '' AFTER `orders`; -alter table statistics_customer_order add column refund_amount DECIMAL(20,2) DEFAULT NULL COMMENT '' AFTER `total`; - -ALTER TABLE `financial_bd_prize_log` - MODIFY COLUMN `manager_id` varchar(50) NOT NULL COMMENT 'bd user id' AFTER `record_id`; - -CREATE TABLE act_mon_delay_settle -( - id VARCHAR(50) PRIMARY KEY NOT NULL, - client_id INT(11) NOT NULL, - account_id VARCHAR(50) NOT NULL, - account_name VARCHAR(100) COMMENT '商户账户名称', - create_time DATETIME NOT NULL COMMENT '参与开始时间(若在周一,下周生效)', - expire_time DATETIME COMMENT '结束时间', - is_valid TINYINT DEFAULT 1, - rate DECIMAL(4,2) COMMENT '年化收益率' -); - -CREATE TABLE act_mon_delay_settle_redpack -( - id VARCHAR(50) PRIMARY KEY NOT NULL, - client_id INT(11) NOT NULL, - settle_amount DECIMAL(10,2) NOT NULL, - rate DECIMAL(4,2) COMMENT '收益率', - redpack_amount DECIMAL(10,2) COMMENT '奖励金额', - create_time DATETIME NOT NULL, - send_time DATETIME COMMENT '奖励发放时间' -); - -CREATE TABLE `act_app_list` ( - `act_id` varchar(50) NOT NULL, - `act_name` varchar(100) NOT NULL COMMENT '活动名称', - `act_url` varchar(400) DEFAULT NULL COMMENT '活动链接', - `is_valid` tinyint(1) NOT NULL DEFAULT 0, - `params_json` text DEFAULT NULL COMMENT '活动参数', - `create_time` datetime DEFAULT NULL, - `desc` varchar(400) DEFAULT NULL COMMENT '活动简介', - `act_content` text DEFAULT NULL COMMENT 'html', - `show_type` smallint(6) DEFAULT 0 COMMENT '0:url;1:content', - `is_show_window` tinyint(4) DEFAULT 0 COMMENT 'app是否弹框', - `act_img` varchar(200) DEFAULT NULL COMMENT '广告位图片', - `window_img` varchar(200) DEFAULT NULL COMMENT 'app弹框图片', - `update_time` datetime DEFAULT NULL, - `active_date` date NOT NULL COMMENT '生效日期', - `expire_date` date DEFAULT NULL COMMENT '活动结束日期', - PRIMARY KEY (`act_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='app活动' - - -ALTER TABLE sys_notice ADD merchants_type TINYINT(1) DEFAULT 0 NOT NULL COMMENT '商户范围0:全部商户 1:自定义商户'; -ALTER TABLE sys_notice ADD is_app_window TINYINT(1) DEFAULT 0 COMMENT '是否需要APP弹框'; - - -ALTER TABLE sys_notice MODIFY end_time DATE NOT NULL COMMENT '截止日期'; -ALTER TABLE sys_notice ADD `desc` VARCHAR(1000) NULL COMMENT '简介'; - - - - - - -ALTER TABLE sys_files DROP INDEX UK_sys_files; - -create table sys_clients_contract( -id varchar(50) not null, -client_id int(11) not null, -create_time datetime not null, -expiry_date date not null, -has_sign TINYINT(1) DEFAULT 0 not null, -sign_channel varchar(10) not null , -sign_account_id varchar(50) DEFAULT null, -signatory varchar(20) DEFAULT null, -PRIMARY key (`id`) -); - - -alter table sys_clients_devices add column is_offline tinyint(1) NOT NULL DEFAULT '0'; - -ALTER TABLE `sys_customer_relation` -ADD COLUMN `globalpay_openid` varchar(100) NULL AFTER `kanga_openid`; - - -ALTER TABLE act_app_list ADD banner_img VARCHAR(200) NULL COMMENT 'App首页banner图片'; - - -alter table act_app_list add column `msg_start_date` date DEFAULT NULL; -alter table act_app_list add column `msg_end_date` date DEFAULT NULL; -alter table act_app_list add column `msg_interval` smallint(3) DEFAULT NULL; - -alter table sys_clients add column `manual_settle` tinyint(1) DEFAULT 0; - - -create table log_clients_operation( -id varchar(50) not null, -client_id int(11) not null, -operator_id varchar(50) not null comment '操作人者 账户ID', -operator_type SMALLINT (2) not null comment '操作人者类型', -create_time datetime not null, -operation varchar(50) DEFAULT NULL, -PRIMARY key(`id`) -); -alter table act_app_list MODIFY column is_show_window tinyint(1) DEFAULT 0 COMMENT 'app是否弹框' - - -alter table sys_clients_contract add column confirm_time datetime DEFAULT null comment '合同确认时间'; - - -alter table act_app_list - add show_place smallint(3) default '111' not null comment '1:app顶部 10:banner 100:列表' -; - -ALTER TABLE `sys_clients_apply` - MODIFY COLUMN `bd_user` varchar(300) DEFAULT NULL COMMENT '所属BD用户'; - - -ALTER TABLE `pmt_orders` -ADD COLUMN `surcharge_rate` decimal(10,5) NULL AFTER `customer_surcharge`; -ALTER TABLE `pmt_orders` -ADD COLUMN `custom_surcharge_rate` decimal(10,5) NULL AFTER `surcharge_rate`; - -ALTER TABLE `pmt_transactions` -ADD COLUMN `input_amount` decimal(20,2) NULL AFTER `clearing_amount`; - -ALTER TABLE `pmt_transactions` -ADD COLUMN `surcharge_cashback` decimal(10,4) default 0 after `royalpay_surcharge` comment '返现至营销账户'; - - - -ALTER TABLE sys_clients ADD store_photo VARCHAR(200) NULL; - -CREATE TABLE `log_client_sub_merchant_id` ( - `id` varchar(50) NOT NULL, - `sub_merchant_id_before` varchar(30) DEFAULT NULL COMMENT '修改之前的sub_merchant_id', - `sub_merchant_id_after` varchar(30) NOT NULL COMMENT '修改之后的sub_merchant_id', - `operator` varchar(30) NOT NULL COMMENT '操作人', - `create_time` datetime NOT NULL COMMENT '创建时间', - `client_id` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `pmt_sub_merchant_id` ( - `sub_merchant_id` varchar(30) NOT NULL, - `merchant_id` varchar(30) NOT NULL, - `is_valid` tinyint(1) DEFAULT 1, - `operator` varchar(30) DEFAULT '', - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`sub_merchant_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -alter table sys_clients add column common_sub_merchant_id tinyint(1) default 0 comment '是否使用通用子商户号'; - - -CREATE TABLE `cli_sub_merchant_id` ( - `sub_merchant_id` varchar(30) NOT NULL, - `merchant_id` varchar(30) DEFAULT NULL, - `client_count` int(8) DEFAULT NULL, - `temp_sub_merchant` tinyint(1) DEFAULT 0, - `create_time` datetime DEFAULT NULL, - PRIMARY KEY (`sub_merchant_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -ALTER TABLE `sys_clients` ADD COLUMN `business_hours` varchar(100) DEFAULT ''; -ALTER TABLE `sys_clients` ADD COLUMN `merchant_introduction` varchar(500) DEFAULT ''; -ALTER TABLE `sys_clients` ADD COLUMN `merchant_tag` varchar(100) DEFAULT ''; -ALTER TABLE `sys_clients` ADD COLUMN `merchant_video_url` varchar(200) DEFAULT ''; - - - - -create table risk_merchant_record( - id varchar(50) not null comment 'id', - create_time datetime not null comment '创建时间', - expiry_time datetime not null comment '过期时间', - client_id int(11) not null comment '商户id', - client_moniker varchar(20) not null comment '商户code', - status varchar(5) not null comment '记录状态 0:未处理,1已处理,2处理中', - risk_types varchar(50) not null comment '触发的风控类型 "," 号分割', - risk_counts varchar(70) null comment '对应类型触发次数 "," 号分割', - primary key(id), - key(client_id) using BTREE -); - - -create table risk_white_list( - client_id int(11) not null comment '商户id', - client_moniker varchar(20) not null comment '商户code', - create_time datetime not null comment '创建时间', - is_valid TINYINT(1) DEFAULT 1 COMMENT '是否可用', - primary key(client_id), - key(client_id) USING BTREE, - key(client_moniker) -); - - -create table risk_merchant_detail_log( - id varchar(50) not null comment 'id', - record_id varchar(50) not null comment '商户风控记录id', - create_time datetime not null comment '创建时间', - client_id int(11) not null comment '商户id', - auditor varchar(30) not null comment '操作者', - auditor_id varchar(50) not null comment '操作者id', - files varchar(500) null comment '上传附件 "," 号分割', - remark varchar(100) null comment '备注', - primary key(id), - key(client_id) using BTREE, - key(record_id) - -); - - -create table risk_transaction_log( - id varchar(50) not null comment 'id', - order_id varchar(500) not null comment '问题订单id', - record_id varchar(50) not null comment '商户风控记录id', - amount DECIMAL(10,2) not null comment '过期时间', - channel varchar(15) NULL COMMENT '订单支付通道', - client_id int(11) not null comment '商户id', - risk_types varchar(50) not null comment '触发的风控类型 ","号分割 ', - create_time datetime not null, - primary key(id), - key(order_id), - key(record_id), - key(client_id) - - - -); - -insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'risk_counts', '3'); -insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'risk_total_amout', '5000'); - - -CREATE TABLE `pmt_directed_bill_code` ( - `bill_code_id` varchar(50) NOT NULL DEFAULT '', - `client_id` int(15) not NULL, - `client_order_id` varchar(50) DEFAULT NULL, - `status` int(10) DEFAULT '1' COMMENT '账单状态 1:可用,2:关闭 3:完成', - `customer_id` varchar(200) DEFAULT NULL COMMENT 'open_id', - `create_time` datetime not NULL DEFAULT now() comment '账单创建时间', - `currency` varchar(10) not NULL, - `remark` varchar(200) DEFAULT NULL, - `cancle_time` datetime DEFAULT NULL, - `channel` varchar(10) DEFAULT NULL, - `nickname` varchar(80) DEFAULT NULL, - `headimg` varchar(200) DEFAULT NULL, - `code_url` varchar(200) DEFAULT '', - `order_id` varchar(50) DEFAULT '', - `order_amount` decimal(10,4) not NULL comment '账单金额', - `pay_amount` decimal(10,4) DEFAULT NULL comment '订单支付金额', - `pay_time` datetime DEFAULT NULL comment '支付时间', - `order_status` int(10) DEFAULT NULL COMMENT '订单状态(0-New,1-OrderFailed,2-WaitingForPayment,3-OrderCanceled,4-PaymentFailed,5-PaymentSuccess,6-PartialRefund,7-FullRefund)', - PRIMARY KEY (`bill_code_id`), - KEY `client_id` (`client_id`), - KEY `order_id` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -ALTER TABLE `act_red_packets_customer` ADD COLUMN `rule_max_num_limit` tinyint(1) DEFAULT 1 COMMENT '0:Whole Activity,1:day'; - - - -CREATE TABLE `sys_mail_send` ( - `id` int(11) NOT NULL, - `mail_address` varchar(100) NOT NULL COMMENT '邮箱地址', - `cc_mail_address` varchar(100) NOT NULL COMMENT '邮箱地址', - `message_id` varchar(60) NOT NULL COMMENT 'Mailgun Message id', - `status` int(9) NOT NULL DEFAULT 0, - `create_time` datetime not null DEFAULT now(), - `title` varchar(50) NOT NULL comment '邮件标题', - PRIMARY KEY (`id`,`mail_address`), - KEY `mail_address` (`mail_address`), - KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 - -alter table sys_clients add column mail_confirm tinyint(1) default '0' COMMENT '0: 未验证,1已验证'; - -CREATE TABLE `sys_client_pre_apply` ( - `client_pre_apply_id` int(11) NOT NULL AUTO_INCREMENT, - `password` varchar(20) DEFAULT '', - `contact_person` varchar(50) DEFAULT NULL, - `contact_phone` varchar(20) DEFAULT '', - `contact_email` varchar(255) DEFAULT NULL, - `company_name` varchar(100) DEFAULT NULL, - `abn` varchar(20) DEFAULT NULL, - `short_name` varchar(50) DEFAULT NULL, - `address` varchar(200) DEFAULT NULL, - `suburb` varchar(50) DEFAULT NULL, - `state` varchar(20) DEFAULT NULL, - `postcode` varchar(20) DEFAULT NULL, - `industry` varchar(50) DEFAULT NULL, - `bank_no` varchar(20) DEFAULT NULL, - `bank_name` varchar(50) DEFAULT NULL, - `bsb_no` varchar(6) DEFAULT NULL, - `clean_days` smallint(6) DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - `agree` tinyint(1) DEFAULT NULL, - `company_phone` varchar(20) DEFAULT NULL, - PRIMARY KEY (`client_pre_apply_id`), - UNIQUE KEY `username` (`username`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -alter table sys_accounts add COLUMN nation_code VARCHAR(5) DEFAULT NULL ; - -alter table sys_client_pre_apply add COLUMN `client_moniker` varchar(20) DEFAULT NULL COMMENT '客户简写识别码'; - -alter table sys_client_pre_apply modify COLUMN `agree` tinyint(1) DEFAULT 0; - - -insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]'); - - -ALTER TABLE `sys_client_config` -ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`; -ALTER TABLE `sys_clients` -ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`; - -alter table pmt_refunds add column remark varchar(200); - -alter table sys_client_pre_apply add column `salt` varchar(30) NOT NULL COMMENT '每次修改密码时随机更改'; -alter table sys_client_pre_apply add column `password_hash` varchar(150) NOT NULL COMMENT '登录账户密码 base64(sha256(salt+password))'; -alter table sys_client_pre_apply add column `password_aes` varchar(50) NOT NULL COMMENT '登录账户密码 AES加密'; - -alter table sys_client_pre_apply add column apply_source varchar(10) default null COMMENT '申请渠道'; - - -CREATE TABLE `sys_mail_unsub` ( - `id` bigint(20) NOT NULL, - `address` varchar(50) NOT NULL, - `client_id` int(11) NOT NULL, - `client_moniker` varchar(20) NOT NULL, - `create_time` timestamp NOT NULL DEFAULT now(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='邮箱取消订阅'; - - - -alter table sys_clients add column ali_sub_merchant_id varchar(20) DEFAULT NULL; -update sys_clients set ali_sub_merchant_id = client_moniker; - -alter table sys_clients add column enable_hf TINYINT(1) default '0'; -alter table sys_client_config add column enable_hf TINYINT(1) default '0'; -alter table sys_clients add column enable_link TINYINT(1) default '0'; -alter table sys_client_config add column enable_link TINYINT(1) default '0'; -alter table sys_clients add column hf_pay_url VARCHAR(150) DEFAULT null COMMENT '汇付通支付短连接'; -alter table sys_client_config add column hf_pay_url VARCHAR(150) DEFAULT null COMMENT '汇付通支付短连接'; - - -ALTER TABLE sys_org ADD COLUMN min_hf_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低hf费率'; -ALTER TABLE sys_org ADD COLUMN hf_rate_value DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户hf费率'; - - -ALTER TABLE `log_clearing_detail` -ADD COLUMN `settle_bank` varchar(10) NULL DEFAULT NULL COMMENT '清算来源银行(RoyalPay)' AFTER `account_name`; -update log_clearing_detail set settle_bank='CBA'; - - -ALTER TABLE `log_clearing` -ADD COLUMN `editable` tinyint(1) NULL DEFAULT 1 COMMENT '是否可编辑' AFTER `balance`; - - -CREATE TABLE `pre_apply_handle_log` ( - `id` varchar(50) NOT NULL, - `client_pre_apply_id` int(11) NOT NULL, - `client_id` int(11) NOT NULL, - `auditor` varchar(30) NOT NULL, - `auditor_id` varchar(50) NOT NULL, - `remark` varchar(100) DEFAULT NULL, - `create_time` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `client_id` (`client_id`) USING BTREE, - KEY `client_pre_apply_id` (`client_pre_apply_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -ALTER TABLE `sys_client_pre_apply` -ADD COLUMN `status` tinyint(2) NULL DEFAULT 0 COMMENT '0:未处理,1:处理中,2:处理完成'; - -alter table sys_clients add column hfindustry varchar(10) DEFAULT NULL COMMENT 'HF行业'; - -alter table financial_bd_prize_rate_config add column `kpi_range` smallint(6) NOT NULL; -alter table financial_bd_config add column `kpi_amount` decimal(15,2) DEFAULT NULL; -alter table financial_bd_prize_log add column `kpi_amount` decimal(15,2) DEFAULT NULL; - -CREATE TABLE sys_permission_partner_modules ( - id int(11) NOT NULL AUTO_INCREMENT, - module_name varchar(50) NOT NULL COMMENT '模块名称', - js_module varchar(50) DEFAULT NULL COMMENT 'js module name', - js_path varchar(255) DEFAULT NULL COMMENT 'js module path', - remark varchar(50) DEFAULT NULL, - PRIMARY KEY (id) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; - -CREATE TABLE sys_permission_partner_modules_clients ( - id bigint(20) NOT NULL, - client_id int(11) NOT NULL COMMENT '客户编号', - client_moniker varchar(20) NOT NULL COMMENT '客户简写识别码', - module_id int(11) NOT NULL COMMENT '模块id', - is_valid tinyint(1) DEFAULT '1' COMMENT '1:启用,0:不启用', - PRIMARY KEY (id), - UNIQUE KEY unique_client_id_module_id (client_id,module_id), - KEY index_client_id (client_id), - KEY index_client_moniker (client_moniker) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE sys_permission_partner_functions ( - func_id varchar(80) NOT NULL, - module_id int(11) DEFAULT NULL COMMENT '模块id', - role int(11) NOT NULL DEFAULT '0' COMMENT '有权限角色(mask)', - class_name varchar(30) NOT NULL COMMENT '类名', - method_name varchar(50) NOT NULL COMMENT '方法名', - uri varchar(200) NOT NULL COMMENT '请求地址', - req_methods varchar(50) NOT NULL, - module varchar(30) DEFAULT NULL COMMENT '所属模块', - name varchar(50) DEFAULT NULL COMMENT '别名(用于前端按钮指定权限)', - remark varchar(50) DEFAULT NULL COMMENT '备注', - is_valid tinyint(1) DEFAULT '1' COMMENT '是否有效', - PRIMARY KEY (func_id), - UNIQUE KEY uk_func_name (name) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `act_charity` ( - `client_id` int(11) DEFAULT NULL, - `client_moniker` varchar(20) NOT NULL COMMENT '客户简写识别码', - `active_time` date DEFAULT NULL, - PRIMARY KEY (`client_moniker`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `risk_attention_merchants` ( - `client_id` int(11) NOT NULL, - `client_moniker` varchar(20) NOT NULL, - `is_valid` tinyint(1) NOT NULL DEFAULT 1, - `create_time` datetime NOT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`client_id`), - KEY `client_moniker` (`client_moniker`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -ALTER TABLE `sys_clients` -ADD COLUMN `wechat_institution_merchant_id` varchar(6) NULL AFTER `wechat_institution_merchant_id`; -ALTER TABLE `log_client_sub_merchant_id` -ADD COLUMN `wechat_institution_merchant_id` varchar(6) NULL AFTER `client_id`; - - -INSERT INTO `sys_configs` VALUES ('payment.ali.individual_daily_limit', 100000,null); -INSERT INTO `sys_configs` VALUES ('payment.ali.individual_yearly_limit', 500000,null); -INSERT INTO `sys_configs` VALUES ('payment.ali.per_order_limit', 10000,null); - -update sys_clients set contact_phone = concat('+61',contact_phone) where create_time >'2018-06-01' and source = 4 - -ALTER TABLE `log_clearing_detail` -ADD COLUMN `total_cashback` decimal(16,3) NOT NULL DEFAULT 0 COMMENT '返现总额(2018-04-21开始计算)' AFTER `tax_amount`, -DEFAULT CHARACTER SET DEFAULT; - -ALTER TABLE `log_clearing` -ADD COLUMN `total_charge` decimal(16,3) NOT NULL DEFAULT 0 COMMENT '总手续费' AFTER `royalpay_charge`, -ADD COLUMN `charge_cashback` decimal(16,3) NOT NULL DEFAULT 0 COMMENT '返现' AFTER `total_charge`; - - -ALTER TABLE `pmt_custom_reports` -ADD COLUMN `report_serial` varchar(50) NOT NULL FIRST , -ADD COLUMN `serial_no` int NULL DEFAULT 0 AFTER `report_id`, -ADD COLUMN `custom_target` varchar(30) NOT NULL AFTER `custom`, -DROP PRIMARY KEY, -DROP INDEX `client_id` , -ADD INDEX `client_id` (`client_id`) USING HASH , -DROP INDEX `order_id` , -ADD INDEX `order_id` (`order_id`) USING HASH , -DROP INDEX `channel` , -ADD INDEX `channel` (`channel`) USING HASH , -ADD INDEX `report_id` (`report_id`) USING HASH ; - - -update pmt_custom_reports set report_serial=uuid(); - -alter pmt_custom_reports add PRIMARY key (report_serial); -alter table sys_org add COLUMN `state` varchar(20) DEFAULT NULL COMMENT '州 (使用标准码 NSW,QLD,WA,VIC,ACT,NT,TAS,SA)'; - -INSERT INTO `royalpay`.`sys_configs`(`config_key`, `config_value`, `config_desc`) VALUES ('rick_interior_send_email', 'dll19920503@qq.com', '内部调用测试发送邮箱'); - ---2020-11-24微信渠道-商户进件字段添加 -alter table sys_wx_merchant_apply modify contact_phone varchar(20) not null; - -alter table sys_wx_merchant_apply - add merchant_country_code varchar(5) not null comment '商户国家编码'; - -alter table sys_wx_merchant_apply - add extra_merchant_type varchar(15) not null comment '商户类型:1.Enterprise 2.Individual'; - -alter table sys_wx_merchant_apply - add mcc_code varchar(4) not null comment 'Mcc编码'; - -alter table sys_wx_merchant_apply - add extra_reg_cer_number varchar(50) null comment '公司注册文件编号'; - -alter table sys_wx_merchant_apply - add extra_reg_cer_exp_date varchar(10) null comment '公司注册文件日期,格式:yyyy-MM-dd'; - -alter table sys_wx_merchant_apply - add stores_address varchar(128) null comment '店铺地址'; - -alter table sys_wx_merchant_apply - add business_type varchar(10) not null comment 'BOTH,OFFLINE,ONLINE,固定值为BOTH'; - -alter table sys_wx_merchant_apply - add director_name varchar(128) null comment '董事'; - -alter table sys_wx_merchant_apply - add director_id_number varchar(128) null comment '董事身份证号'; - -alter table sys_wx_merchant_apply - add principal_name varchar(128) null comment '负责人'; - -alter table sys_wx_merchant_apply - add principal_id_number varchar(128) null comment '负责人身份证号'; - -alter table sys_wx_merchant_apply - add is_valid tinyint(1) default '1' null comment '微信子商户进件信息是否有效'; - - - - --- 商户表 增加信息 - -ALTER TABLE `sys_clients` - ADD COLUMN certificat_expire_date date DEFAULT NULL COMMENT '注册证书过期时间'; - - --- 商户表 日期类型改为varchar 2020.12.23 -ALTER TABLE `sys_clients` - modify COLUMN certificat_expire_date varchar(20) DEFAULT NULL COMMENT '注册证书过期时间'; - - --- 微信子商户表 字段长度修改 2021.04.07 -ALTER TABLE sys_wx_merchant_apply MODIFY merchant_name varchar(128); -ALTER TABLE sys_wx_merchant_apply MODIFY merchant_shortname varchar(64); - - - --- 添加清算规则 2022-03-21 -ALTER TABLE sys_clients add `settle_rule` varchar(20) DEFAULT '* * ?' COMMENT '清算时间规则' AFTER min_settle; -ALTER TABLE sys_clients add `settle_rule_ext` text COMMENT '清算规则扩展,分组清算规则' AFTER settle_rule; --- 表 sys_permission_functions 字段class_name长度改为255 2022-03-21 diff --git a/src/document/Dockerfile b/src/document/Dockerfile deleted file mode 100644 index e3caa7550..000000000 --- a/src/document/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM nginx:alpine - -COPY openapi/ /usr/share/nginx/html/openapi -COPY default.conf /etc/nginx/conf.d/default.conf - -EXPOSE 80 \ No newline at end of file diff --git a/src/document/default.conf b/src/document/default.conf deleted file mode 100644 index a34157dcf..000000000 --- a/src/document/default.conf +++ /dev/null @@ -1,13 +0,0 @@ -server { - listen 80; - server_name _ default; - - location / { - root /usr/share/nginx/html/openapi/; - index index.html; - } - - location =/ { - rewrite / /cn/ redirect; - } -} \ No newline at end of file diff --git a/src/document/openapi/cn/components_order.yml b/src/document/openapi/cn/components_order.yml deleted file mode 100644 index b142a74b4..000000000 --- a/src/document/openapi/cn/components_order.yml +++ /dev/null @@ -1,500 +0,0 @@ - -orderBasic: - required: - - description - - currency - - price - properties: - description: - type: string - maxLength: 128 - description: 订单标题(最大长度128字符,超出自动截取) - price: - type: integer - description: 订单金额,单位为货币最小单位,例如100表示AUD1.00 - currency: - type: string - enum: - - AUD - - CNY - notify_url: - type: string - description: 支付通知回调url,详见支付通知api,不填不会推送支付通知。收到通知回调后强烈建议先进行主动查询再进行确认。 - operator: - type: string - description: 操作人员标识 - expire: - type: string - default: 5m - pattern: ^\d([mh])$ - description: | - 超时时间,默认5m,如果商户端有全局配置则取商户配置 - 可以提供以下格式的精确时间:yyyy-MM-dd HH:mm:ss,基于GMT+10时区。 - 或以以下格式提供:数字+m/h,m=分钟,h=小时 - 超时时间最小1m,最大24h - extra: - type: object - description: 订单扩展参数,部分渠道必填 - properties: - pay_type: - type: string - description: | - 指定钱包类型。对于AlipayPlus线上订单,如果提供具体钱包类型,可直接进入对应钱包收银台,否则将进入钱包选择界面让消费者选择支付。参数来源于【查询可用子渠道】 -orderWithChannel: - allOf: - - $ref: '#/orderBasic' - - properties: - channel: - type: string - description: 支付渠道,大小写敏感 - enum: - - Alipay - - Wechat - - AlipayPlus - type: object - required: - - channel -cardCustomerParam: - type: object - properties: - name: - type: string - description: 消费者姓名,不填会取持卡人姓名 - postcode: - type: string - example: 2000 - description: 澳大利亚邮编 - address: - type: string - description: 地址,可使用收货地址 - city: - type: string - example: Sydney - state: - type: string - example: VIC - country: - type: string - description: 2位国家代码 - example: AU - -cardCustomerInfo: - title: 卡信息 - properties: - bank: - type: string - description: 发卡行,可能拿不到 - card_type: - type: string - description: 卡类型 - example: credit/debit - card_alias: - type: string - description: 截断卡号,包含前6位和后3位 - example: 424242...242 - card_scheme: - description: 发卡组织 - type: string - example: VISA/MASTER - card_country: - description: 发卡国家 - type: string - example: AU - customer_id: - type: string - description: 当下单时tokenize=true或customer_id不为空时存在 -orderBasicResponse: - type: object - properties: - return_code: - type: string - description: 执行结果 - result_code: - type: string - description: SUCCESS表示创建订单成功,EXISTS表示订单已存在 - channel: - type: string - description: 支付渠道 - partner_code: - type: string - description: 商户编码 - full_name: - type: string - description: 商户注册全名 - partner_name: - type: string - description: 商户名称 - order_id: - type: string - description: RoyalPay订单ID,同时也是支付渠道订单ID,最终支付成功的订单ID可能不同 - partner_order_id: - type: string - description: 商户订单ID -orderStatus: - type: object - properties: - return_code: - type: string - description: 执行结果 - example: - SUCCESS - result_code: - type: string - description: | - 订单状态 - - PAYING: 等待支付 - - CREATE_FAIL: 创建失败 - - CLOSED: 已关闭 - - PAY_FAIL: 支付失败 - - PAY_SUCCESS: 支付成功 - - PARTIAL_REFUND: 部分退款 - - FULL_REFUND: 全额退款 - 如果需要可以用相同订单号再次发起支付单,支付成功或支付中的无法重复发起订单 - enum: - - PAYING - - CREATE_FAIL - - CLOSED - - PAY_FAIL - - PAY_SUCCESS - - PARTIAL_REFUND - - FULL_REFUND - order_id: - type: string - description: RoyalPay订单ID,同时也是支付渠道订单ID,最终支付成功的订单ID可能不同 - partner_order_id: - type: string - description: 商户订单ID - channel_order_id: - type: string - description: 渠道方(支付宝、微信)交易流水号 - total_fee: - type: integer - description: 订单金额,单位是货币最小面值单位 - real_fee: - type: integer - description: 实际支付金额,单位是货币最小面值单位(目前等于订单金额,为卡券预留) - currency: - type: string - description: 币种,通常为AUD - rate: - type: number - description: 交易时使用的汇率,1AUD=?CNY - pay_time: - type: string - format: 'date-time' - pattern: yyyy-mm-dd HH:mm:ss - description: 支付时间(yyyy-MM-dd HH:mm:ss,GMT+10) - create_time: - type: string - format: 'date-time' - pattern: yyyy-mm-dd HH:mm:ss - description: 订单创建时间(最新订单为准)(yyyy-MM-dd HH:mm:ss,GMT+10) - settlement_date: - type: string - format: date - pattern: yyyy-mm-dd - description: 预期清算日期(可能受到账情况、节假日影响)(yyyy-MM-dd) - channel: - type: string - description: 支付渠道 - customer_info: - anyOf: - - title: 支付宝用户 - type: object - properties: - alipay_user_id: - type: string - description: 支付宝用户id - alipay_account: - type: string - description: 用户账号 - - $ref: 'components_order.yml#/cardCustomerInfo' -refundStatus: - type: object - properties: - return_code: - type: string - description: 执行结果 - example: - SUCCESS - result_code: - type: string - description: | - 退款状态 - - WAITING: 正在提交 - - CREATE_FAILED: 提交失败 - - SUCCESS: 提交成功,等待入账 - - FAILED: 退款失败 - - FINISHED: 退款成功,已入账 - enum: - - WATING - - CREATE_FAILED - - SUCCESS - - FAILED - - FINISHED - refund_id: - type: string - description: RoyalPay退款单号 - partner_refund_id: - type: string - description: 商户提交的退款单号 - amount: - type: integer - description: 退款金额,单位是货币最小单位 - currency: - type: string - description: 币种 - example: - AUD - settlement_date: - type: string - format: date - pattern: yyyy-mm-dd - description: 预期清算日期(可能受到账情况、节假日影响)(yyyy-MM-dd),仅退款成功存在(SUCCESS, FINISHED) -transactionItem: - type: object - properties: - transaction_time: - type: string - format: 'date-time' - pattern: yyyyMMddHHmmss - description: 交易时间,格式yyyyMMddHHmmss,GMT+10 - partner_code: - type: string - description: 订单关联商户 - order_id: - type: string - description: RoyalPay订单ID - partner_order_id: - type: string - description: 商户订单ID - channel_order_id: - type: string - description: 渠道方订单号 - refund_id: - type: string - description: RoyalPay退款单号(仅退款或退款失败补正存在) - partner_refund_id: - type: string - description: 商户系统提交退款ID(仅退款或退款失败补正) - gateway: - type: integer - description: | - 下单接口 - - 0: RoyalPay POS机付款码(扫描客户展示的付款码) - - 1: RoyalPay POS机聚合支付码(客户扫描POS展示的二维码) - - 2: RoyalPay 商户静态码 - - 3: QRCode 网关 - - 4: JSAPI 网关 - - 5: 第三方POS付款码网关 - - 6: 第三方POS聚合支付码网关 - - 7: RoyalPay 商户静态码(已停用) - - 8: H5网关 - - 9: WEB网关 - - 10: SDK订单 - - 11: RoyalPay账单码 - - 12: 小程序 - - 13: 原生二维码订单 - - 14: RoyalPay账单链接 - - 15: 原生JSAPI - - 16: 卡支付预订单 - - 17: 卡支付订单 - - 18: DirectDebit - channel: - type: string - description: 下单渠道 - type: - type: string - description: 流水类别 - enum: - - Credit - - Debit - currency: - type: string - description: 订单币种 - example: - AUD - total_amount: - type: integer - description: 订单总金额,单位是货币最小单位 - input_amount: - type: integer - description: 订单输入金额,单位是货币最小单位 - customer_payment_amount: - type: integer - description: 用户实际支付金额,单位是货币最小单位 - settle_amount: - type: integer - description: 结算金额,币种为AUD,单位是货币最小单位 - transfer_amount: - type: integer - description: 打款金额(结算金额-手续费-GST),币种为AUD,单位是货币最小单位 - surcharge: - type: integer - description: 手续费,币种为AUD,单位是货币最小单位 - gst: - type: integer - description: GST金额,币种为AUD,单位是货币最小单位 - exchange_rate: - type: number - description: 使用汇率 - remark: - type: string - description: 备注 -consultPaymentRequest: - type: object - required: - - currency - - amount - - terminal_type - properties: - currency: - type: string - description: | - 即将下单的币种,[ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) 标准3字母币种编码,如AUD - amount: - type: integer - description: 即将下单的金额,单位是货币最小单位 - terminal_type: - type: string - enum: - - WEB - - H5 - - APP - description: 下单类型,是PC端WEB页面还是移动端的H5页面,大小写敏感 - user_region: - type: string - description: | - [ISO-3166](https://www.iso.org/obp/ui/#iso:pub:PUB500001:en) 标准双字符国家编码,消费者所在国家,影响推荐的钱包优先级,如韩国顾客会优先返回KAKAOPAY - os_type: - type: string - description: 消费者支付场景操作系统类型,通常用于APP支付场景,大小写敏感 - enum: - - IOS - - ANDROID - client_ip: - type: string - description: 消费者所在ip - user_agent: - type: string - description: 如果是移动端支付,可提供User-Agent信息,用于判断当前消费者可用的钱包 -consultResultItemAlipayPlus: - type: object - required: - - sub_channel - - sub_channel_name - properties: - sub_channel: - type: string - description: 钱包名称,用于作为pay_type参数传递给下单api - sub_channel_name: - type: string - description: 钱包品牌名称,用于展示 - logo: - type: string - description: 钱包logo图片地址 -customInfo: - type: object - properties: - report_id: - type: string - description: RoyalPay海关单号 - client_report_id: - type: string - description: 商户申请报关单号 - report_status: - type: string - description: 报关单状态 - enum: - - PROCESSING - - SUBMITED - - FAILED - - SUCCESS - channel: - type: string - description: 支付渠道 - custom: - type: string - description: 海关编号 - mch_custom_no: - type: string - description: 商户在海关备案的编号 - mch_custom_name: - type: string - description: 商户海关备案名称 - order_id: - type: string - description: RoyalPay订单号 - transaction_id: - type: string - description: 支付渠道订单号 - order_currency: - type: string - description: 币种 - order_amount: - type: number - description: 订单金额 - report_time: - type: string - format: 'date-time' - description: 报关时间 - creation_date: - format: 'date-time' - type: string - description: 报关单创建时间 - last_update_date: - type: string - format: 'date-time' - description: 更新时间 - error_code: - type: string - description: 错误代码 - error_msg: - type: string - description: 错误返回的信息描述 - verify_department: - type: string - description: 验核机构 - verify_department_trade_id: - type: string - description: 验核机构交易流水号 - sub_orders: - type: array - items: - type: object - properties: - sub_order_no: - type: string - description: 商户子订单号 - fee_type: - type: string - description: 币种代码 - default: CNY - enum: - - CNY - order_fee: - type: number - description: 子订单金额 - transport_fee: - type: number - description: 子订单物流金额 - verify_department: - type: string - description: 验核机构 - verify_department_trade_id: - type: string - description: 验核机构交易流水号 - report_status: - type: string - description: 报关单状态 - enum: - - PROCESSING - - SUBMITED - - FAILED - - SUCCESS - error_code: - type: string - description: 错误代码 - error_msg: - type: string - description: 错误返回的信息描述 \ No newline at end of file diff --git a/src/document/openapi/cn/document.yml b/src/document/openapi/cn/document.yml deleted file mode 100644 index 4bfbc5465..000000000 --- a/src/document/openapi/cn/document.yml +++ /dev/null @@ -1,1499 +0,0 @@ -openapi: 3.0.3 -info: - title: RoyalPay Developer Documents - version: 1.0.0 - x-logo: - url: img/rp_logo.svg - description: | - [English](/en/) - - # 请求方式和参数格式 - 支付单和退款单提交均为PUT方式,订单查询均为GET方式;包含Request Entity的请求参数格式为json - - 除跳转页面外,所有的Accept均为application/json;所有的PUT/POST请求Content-Type为application/json - - 系统使用UTF-8字符集 - - 参数分为三种:Path Variable/Query Param/JSON entity - - - PathVariable:包含在URI内的参数 - - Query Param:在URI末尾?后的key=value形式的参数 - - JSON entity:只在PUT/POST请求中使用 - 所有返回JSON的API,成功访问返回状态值均为200(不论执行结果)。JSON固定包含字段return_code,若值为SUCCESS则表示执行成功; 其他值表示执行失败,此时可查询错误码了解对应的错误类型,此时还会携带return_msg字段作为错误描述信息 - - # 多语言支持 - - 系统错误提示支持中文、英文两种语言,默认根据Request Header中的Accept-Language值自动选择,如需调整亦可以添加locale cookie进行指定。 - - # 选择接入API - - - # 支付宝渠道区分 - - 支付宝根据调用接口不同分为线上和线下两个渠道,两个渠道分别使用不同的汇率和手续费费率,为避免混淆在此区分: - - - 线上渠道:包含H5 Mobile、Web支付、APP SDK、JSAPI、QR Code 5种支付方式 - - 线下渠道:Retail Pay 支付方式 - - 相似接口区别 - - - JSAPI和H5 Mobile:JSAPI只能在支付宝客户端内访问的页面调起支付,H5可以在移动设备任意浏览器或App的WebView调起支付 - - Web支付和QR Code: Web支付会跳转到支付宝官方收银台,用户可以选择登陆账号或用客户端扫码完成支付;QR Code方式商户可以自行展示创建的二维码,也可以跳转到RoyalPay展示的收银台页面显示二维码,用户只能用支付宝客户端扫码完成支付。 - - # 币种代码 - - 由于渠道方限制原因,RoyalPay只接受人民币和澳元两个币种标价的支付订单。其中银行卡支付渠道仅支持AUD下单。无论标价是什么币种最终结算币种为AUD - - - AUD:澳元 - - CNY:人民币 - - 除报关相关API以外,接口中的金额都应该取*币种最小单位*,如人民币和澳元都应该用分作为标价。如AUD 1.00的订单提交的金额参数为100 - - # 业务规则 - - - QRCode支付是在网页上展示二维码,用户使用微信扫一扫扫码后直接进入微信支付页面,适用于商城类web网站; - - JSAPI支付是在微信浏览器内直接跳转到RoyalPay让用户选择支付订单,页面只能在微信客户端打开,适用于微店; - - 创建订单时需要提供订单号,同一个订单允许重复提交,系统会自动根据订单状态判断是否创建新订单并关闭旧订单。因此商户端应该同一个订单只用一个单号,避免重复付款; - - 由于存在自动创建新订单机制,创建订单后返回的RoyalPay单号不代表最终支付的单号; - - QRCode支付订单创建后会直接返回QRCode和pay_url,商户可以自行选择展示支付二维码或跳转至RoyalPay支付页; - - JSAPI支付订单创建后会返回pay_url,商户应该跳转到这个地址让用户完成支付; - - 跳转pay_url时必须加上签名信息; - - 每次请求都应该生成新的签名; - - 订单成功支付后会调用订单中提供的notify_url,详情可以查看API定义;若创建订单时未提供,商户需要在创建订单后轮询订单状态接口,直到订单被支付或过期; - - 订单支付有效期为5分钟,超时可以用相同的订单号重新发起请求,建议重新发起请求的时机为用户再次打开支付页的时候; - - 使用跳转支付页前应该先调用后台服务输入金额等参数创建订单后再跳转; - - 创建订单、创建退款接口都允许同订单号重复调用,但是具体参数以初次请求的参数为准; - - 所有和金额相关的数字均以货币最小面值为单位,以AUD为例,100表示AUD 1.00。 - - # 案例 - https://example.royalpay.com.au/api/payment/order - - - - # 示例代码 - - PHP: https://mpay.royalpay.com.au/static/phpdemo.zip - - Java: https://mpay.royalpay.com.au/static/javademo.zip - - # 错误码参考 - ## 通用错误码 - - SYSTEMERROR: 系统内部异常 - - INVALID_SHORT_ID: 商户编码不合法或没有对应商户 - - SIGN_TIMEOUT: 签名超时,time字段与服务器时间相差超过5分钟 - - SIGN_EXPIRED: 签名失效,签名被重复使用 - - INVALID_SIGN: 签名错误 - - PARAM_INVALID: 参数不符合要求,具体细节可参考return_msg字段 - - ## 下单错误码 - - NOT_PERMITTED: 未开通网关支付权限 - - INVALID_CHANNEL: 不合法的支付渠道名称,请检查大小写 - - ORDER_MISMATCH: 订单号与商户不匹配 - - AUTHCODEEXPIRE: 二维码已过期 - - NOTSUPORTCARD: 不支持卡类型 - - AUTH_CODE_ERROR: 二维码被重复提交 - - AUTH_CODE_INVALID: 非法二维码 - - NOTENOUGH: 账户余额不足 - - ORDER_PAID: 订单已支付 - -servers: - - url: https://mpay.royalpay.com.au/api/v1.0 - description: production - - url: https://au.rpaygroup.com/api/v1.0 - description: proxy -tags: - - name: PublicApi - description: 公共API - - name: QRCode - description: | - QRCode支付单适用于PC端网页/应用进行支付,用户使用微信/支付宝客户端扫描下单后生成的二维码完成支付。 - - 返回值包括二维码字符串,二维码图片,支付地址,商户可以自行决定直接展示二维码或跳转支付页,跳转支付页需要带上签名信息。 货币类型如果是CNY,注意通过汇率转换后不得低于0.01AUD,否则订单可以创建成功,但支付时会报金额不合法错误 - - name: JSAPI - description: | - JSAPI适用于在微信/支付宝内打开的网页进行支付,如果用户从微信公众号进入支付页要求公众号已完成认证。用户下单后跳转至RoyalPay订单页,并拉起微信或支付宝内置收银台完成支付 - - 返回值包括支付地址,商户应该引导用户跳转支付页,跳转支付页需要带上签名信息; 货币类型如果是CNY,注意通过汇率转换后不得低于0.01AUD,否则订单可以创建成功,但支付时会报金额不合法错误 - - name: MobileH5 - description: | - 创建H5支付单 - H5支付适用场景为移动端App或者手机自带浏览器进行支付,用户下单后浏览器跳转至微信支付页面并自动拉起支付宝客户端完成支付。 - 返回值包括跳转支付地址,跳转支付页需要带上签名信息。 货币类型如果是CNY,注意通过汇率转换后不得低于0.01AUD,否则订单可以创建成功,但支付时会报金额不合法错误 - - - name: MiniProgram - description: | - 接入微信小程序需完成海外主体认证,并且认证主体需要与在RoyalPay开通的商户主体一致。具体如何认证请查看微信公众平台相关文档。 - 用于小程序中发起支付,创建订单后返回小程序支付所需参数,[微信接入参考文档](https://www.royalpay.com.au/downloads/MiniProgram_WechatPay.pdf) - - - name: CardPayment - description: | - 卡支付即消费者输入银行卡信息进行下单的接口,接入卡支付需要额外的合规流程。 - 卡支付分为预订单模式和直接下单模式。 - - 预订单模式即先提交订单基本信息(单号、金额等),得到返回的pay_url参数后跳转到对应收银台,消费者可以在收银台完成卡信息输入,同时可以通过customer_id机制允许同一个customer在后续支付中免于输入完整的卡信息实现快速支付。也支持开启3DS加强消费者的校验规避charge back风险 - - - 直接下单模式即在商户自己收银台展示我们集成的加密卡信息输入框,消费者输入卡信息后会将加密后的卡信息通过页面回调给商户前端,商户提交订单的时候将加密信息同时提交,无需额外跳转即可完成支付流程,此模式暂不支持3DS校验 - - - 两种支付模式后续的查账退款都使用了相同接口。 - - name: RetailPay - description: | - 线下支付订单接口用于线下零售收银,有B扫C和C扫B两种模式 - - name: ChannelGateway - description: | - 用于PC端渠道网关支付,创建订单后跳转到返回的pay_url(需附加签名参数和redirect参数),随后进入渠道收银台页面完成支付 - 该接口现仅支持支付宝。 - - - name: CB Bank - description: | - 用于PC端网银快捷支付,创建订单后跳转到返回的pay_url,随后进入网银快捷支付页面完成支付 - - name: SDK Payment - description: | - 用于移动端APP调用微信/支付宝SDK支付,调用API创建订单,得到微信SDK调用参数,将参数传递给SDK拉起微信/支付宝支付,并由客户端直接返回支付结果。 强烈建议获得支付结果后再调用RoyalPay订单查询API确认完成支付后再进行后续流程,避免因超时自动撤单导致资金损失 - - - 关于客户端和支付宝整和的更多信息: - - [支付宝SDK文档](https://global.alipay.com/doc/app_cn/about) - - [Alipay+接入文档](/resources/api/AlipayPlusAppIntegrationGuide.pdf) - - 关于客户端和微信整合的更多信息: - - [微信SDK文档](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1) - - [Alipay SDK for Android](/resources/api/alipaySdk-20160825.jar) - - [Alipay SDK for iOS](/resources/api/AlipaySDKForiOS.zip) - - [Wechat SDK for Android](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319167&token=&lang=zh_CN) - - [Wechat SDK for iOS](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319164&lang=zh_CN) - - - name: Custom - description: 用于商户提交海关需要的订单附件信息。仅支持微信和支付宝,微信只支持一个月内的支付订单进行报关申请。 -security: - - sign: [] - nonce_str: [] - time: [] -paths: - /gateway/partners/{partner_code}/consult_payment: - post: - tags: - - ChannelGateway - - MobileH5 - - SDK Payment - summary: 查询可用子渠道 - description: | - 用于AlipayPlus渠道查询可用子渠道。 - 可调用当前接口获取消费者可用的钱包列表,并展示给消费者自主选择。 - parameters: - - in: path - name: partner_code - required: true - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/consultPaymentRequest' - responses: - 200: - description: 查询结果 - content: - application/json: - schema: - type: object - required: - - sub_channels - properties: - sub_channels: - type: array - items: - $ref: 'components_order.yml#/consultResultItemAlipayPlus' - /gateway/partners/{partner_code}/orders/{partner_order_id}: - put: - tags: - - QRCode - summary: 创建QRCode支付单 - x-sort-order: 0 - parameters: - - name: partner_code - in: path - required: true - description: 商户编码,由4位大写字母或数字构成 - - name: partner_order_id - in: path - required: true - description: 商户支付订单号,要求同一商户唯一 - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: 执行结果 - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - code_url: - type: string - description: 支付码字符串,商户可以据此自行生产二维码 - qrcode_img: - type: string - description: Base64封装的二维码图片,可直接作为img的src属性 - pay_url: - type: string - description: 收银台URL,如果商户选择跳转到royalpay的QR收银台可使用此url - get: - summary: 查询订单状态 - x-sort-order: 9 - tags: - - SDK Payment - - CB Bank - - RetailPay - - ChannelGateway - - CardPayment - - MiniProgram - - MobileH5 - - JSAPI - - QRCode - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - responses: - 200: - description: Order Status - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - delete: - summary: 关闭订单 - x-sort-order: 10 - tags: - - SDK Payment - - CB Bank - - RetailPay - - ChannelGateway - - CardPayment - - MiniProgram - - MobileH5 - - JSAPI - - QRCode - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - responses: - 200: - description: Order Status - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - /gateway/partners/{partner_code}/native_orders/{partner_order_id}: - put: - tags: - - QRCode - summary: 创建原生QRCode支付单 - description: | - 原生二维码支付单展示的是直接由微信、支付宝生成的收款码,扫码后直接在APP内加载,对于消费者网络环境不佳的场景具有一定帮助 - parameters: - - name: partner_code - in: path - required: true - description: 商户编码,由4位大写字母或数字构成 - - name: partner_order_id - in: path - required: true - description: 商户支付订单号,要求同一商户唯一 - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: 执行结果 - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - code_url: - type: string - description: 支付码字符串,商户可以据此自行生产二维码 - qrcode_img: - type: string - description: Base64封装的二维码图片,可直接作为img的src属性 - pay_url: - type: string - description: 收银台URL,如果商户选择跳转到royalpay的QR收银台可使用此url - /gateway/partners/{partner_code}/orders/{partner_order_id}/pay: - get: - tags: - - QRCode - summary: QRCode支付页 - x-sort-order: 2 - description: 必须先调用创建QRCode订单接口再进行跳转。 建议在用户回调到对应页时通过后台查询订单状态接口确认订单的支付状态。 - parameters: - - name: partner_code - in: path - required: true - description: 商户编码,由4位大写字母或数字构成 - - name: partner_order_id - in: path - required: true - description: 商户支付订单号,要求同一商户唯一 - - name: redirect - required: true - in: query - description: 支付成功后跳转页面,回调时会带上签名参数用于校验 - responses: - 200: - description: 支付页面 - content: - text/html: - schema: - type: string - /jsapi_gateway/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: 创建JSAPI订单 - description: 创建JSAPI订单 - x-sort-order: 0 - tags: - - JSAPI - parameters: - - name: partner_code - in: path - required: true - description: 商户编码,由4位大写字母或数字构成 - - name: partner_order_id - in: path - required: true - description: 商户支付订单号,要求同一商户唯一 - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: 执行结果 - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: 收银台URL,加签后传递给前端并跳转至当前URL,让消费者完成支付 - /wechat_jsapi_gateway/partners/{partner_code}_order_{partner_order_id}: - get: - summary: 微信JSAPI支付跳转页 - description: 微信JSAPI支付跳转页,建议优先使用下单返回的pay_url字段 - x-sort-order: 2 - tags: - - JSAPI - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - - name: redirect - in: query - description: 支付完成回调,注意转义 - - name: directpay - in: query - description: 是否进入页面后直接发起支付 - schema: - type: boolean - responses: - 200: - description: 微信JSAPI支付跳转页 - content: - text/html: - schema: - type: string - /gateway/alipay/partners/{partner_code}/orders/{partner_order_id}/app_pay: - get: - summary: 支付宝JSAPI支付跳转页 - description: 支付宝JSAPI支付跳转页,建议优先使用下单返回的pay_url字段 - x-sort-order: 2 - tags: - - JSAPI - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - - name: redirect - in: query - description: 支付完成回调,注意转义 - - name: directpay - in: query - description: 是否进入页面后直接发起支付 - schema: - type: boolean - responses: - 200: - description: 支付宝JSAPI支付跳转页 - content: - text/html: - schema: - type: string - /gateway/partners/{partner_code}/native_jsapi/{partner_order_id}: - put: - summary: 原生JSSDK下单 - description: 原生JSSDK允许商户在自己的微商城页面上直接拉起微信/支付宝支付,拉起方式详见微信/支付宝官方文档 - x-sort-order: 0 - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - tags: - - JSAPI - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderWithChannel' - - type: object - required: - - customer_id - properties: - appid: - type: string - description: 商户公众号appid,接入微信支付必填,支付宝不需要 - customer_id: - type: string - description: 商户公众号获取的用户openid,支付宝需要获取userid - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - sdk_params: - type: string - description: 序列化后的json字符串,直接提交给微商城页面端作为参数发起支付 - /h5_payment/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: MobileH5下单 - description: 仅支持支付宝接口 - x-sort-order: 0 - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - tags: - - MobileH5 - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: Order - content: - application/json: - schema: - type: object - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: 收银台URL,加签后传递给前端并跳转至当前URL,让消费者完成支付 - /h5_payment/partners/{partner_code}/orders/{partner_order_id}/pay: - get: - summary: H5支付跳转页 - description: H5支付跳转页,建议优先使用下单返回的pay_url字段 - x-sort-order: 2 - tags: - - MobileH5 - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - - name: redirect - in: query - description: 支付完成回调,注意转义 - responses: - 200: - description: H5支付跳转页 - content: - text/html: - schema: - type: string - /gateway/partners/{partner_code}/microapp_orders/{partner_order_id}: - put: - summary: 小程序下单 - x-sort-order: 0 - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - tags: - - MiniProgram - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderWithChannel' - - type: object - required: - - customer_id - properties: - appid: - type: string - description: 小程序appid,接入微信小程序必填,支付宝小程序不需要 - customer_id: - type: string - description: 小程序获取的用户id(微信为openid, 支付宝为userid) - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - sdk_params: - type: string - description: 序列化后的json字符串,直接提交给小程序端作为参数发起支付 - /gateway/partners/{partner_code}/pre_card_orders/{partner_order_id}: - put: - summary: 卡支付预定单 - x-sort-order: 1 - description: | - 预订单模式是先提交基础下单参数,然后跳转到royalpay网关页让消费者完成卡信息提交并完成支付。 - 卡支付预订单允许消费者多次尝试输入,因此除非主动关闭订单,订单会一直持续到有效期结束。 - tags: - - CardPayment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - properties: - domestic_only: - type: boolean - default: false - description: | - 是否只允许本国卡。由于境内境外卡支付手续费差异巨大,可在此限制。 - **当商户开启消费者支付手续费功能,而international_only提交了false时,当前参数自动置为true。** - international_only: - type: boolean - default: false - description: | - 是否只允许国际卡。当商户开启消费者支付手续费功能,需要提交当前参数为true才可允许国际卡支付,同时此订单将只允许国际卡支付。 - **因此商户需要在支付页面提供本地卡和国际卡两个支付入口!** - - 另:当domestic_only=true的时候当前参数无效。 - disable_credit_card: - type: boolean - default: false - description: 如果希望禁止消费者使用信用卡支付可传入true - disable_threeds: - type: boolean - default: false - description: 平台会协助商户自动开启3DS校验以减少盗刷风险。如果商户希望关闭这个功能,可以提交当前参数为true。(3DS校验需要消费者多一步银行端验证,并且如小程序等场景无法实现网页跳转到银行页面导致流程无法继续) - tokenize: - type: boolean - default: false - description: 支付成功后是否返回消费者ID,此后下单可以提供customer_id免去消费者输入卡号、有效期等步骤,仅需要输入CVV2/CVC码。 - customer_id: - type: string - description: 使用tokenize得到的customer_id下单,当customer_id不为空时,tokenize参数无效,可免去消费者输入卡号、有效期等步骤,仅需要输入CVV2/CVC码。 - customer: - $ref: 'components_order.yml#/cardCustomerParam' - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: 收银台URL,加签后传递给前端并跳转至当前URL,让消费者完成支付 - /card_payment_view/partners/{partner_code}/orders/{partner_order_id}/view: - get: - summary: 卡支付收银台 - description: 建议以下单返回的pay_url为准 - x-sort-order: 2 - tags: - - CardPayment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - - name: redirect - in: query - description: 支付完成同步回调,注意转义 - responses: - 200: - description: 支付跳转页 - content: - text/html: - schema: - type: string - /gateway/partners/{partner_code}/card_orders/{partner_order_id}: - put: - summary: 卡支付下单 - x-sort-order: 0 - description: | - 商户可在页面引入https://channel-gateway.royalpay.com.au/channel/v1/view/card_input_frame.js - 并通过回调取得key_id和secret信息,并将其作为卡信息提交给royalpay直接完成下单支付。 - - js引用案例: - ``` - let cardInputContainer = document.getElementById('card-input-area');//预先准备放置卡输入界面的container - let cardInput = new CardInputFrame(cardInputContainer);//创建frame对象 - //设置iframe的样式参数 - cardInput.frameStyle = { - width: '100%', - height: '400px', - border: 'none', - borderRadius: '10px' - }; - cardInput.onError = function(msg){ - //卡输入界面返回错误信息时进行展示 - }; - cardInput.onReady = function(){ - //iframe加载完毕的触发事件 - }; - cardInput.onSuccess = function(secretData){ - //成功取得加密卡信息回调 - //secretData: {'key_id':'','secret':''} - }; - cardInput.show();//开始加载iframe - - //通过外部事件触发卡输入界面提交,注意卡输入界面没有按钮,必须通过外部触发提交事件。并回调到onSuccess回调函数。 - cardInput.commit(); - ``` - tags: - - CardPayment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - key_id - - card_info - properties: - key_id: - type: string - description: 卡输入界面回调得到的key_id - card_info: - type: string - description: 卡输入界面回调得到的secret - domestic_only: - type: boolean - default: false - description: 是否只允许本国卡。由于境内境外卡支付手续费差异巨大,可在此限制。 - disable_credit_card: - type: boolean - default: false - description: 如果希望禁止消费者使用信用卡支付可传入true - disable_threeds: - type: boolean - default: false - description: 平台会协助商户自动开启3DS校验以减少盗刷风险。如果商户希望关闭这个功能,可以提交当前参数为true。(3DS校验需要消费者多一步银行端验证,并且如小程序等场景无法实现网页跳转到银行页面导致流程无法继续) - customer: - $ref: 'components_order.yml#/cardCustomerParam' - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: 当开启3DS校验时系统会返回当前参数,商户应该引导消费者跳转到此页面完成3DS认证 - /micropay/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: 付款码下单 - x-sort-order: 0 - description: | - 线下支付订单接口用于带有扫码设备的收银终端进行对接,商户输入金额后要求客户出示支付码,用扫码枪扫码后将扫码内容和金额一并提交并完成支付操作。 - 线下支付订单接口现已兼容微信、支付宝通道。可根据付款码自动识别交易渠道。 - - tags: - - RetailPay - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - auth_code - - device_id - properties: - device_id: - type: string - description: 扫码设备id - auth_code: - type: string - description: 付款码 - responses: - 200: - description: Result - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - /retail_qrcode/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: 线下QRCode支付单 - x-sort-order: 1 - description: | - 线下QRCode支付用于对接无扫码设备的收银终端,下单后得到二维码地址,自行生成二维码图片后展示在收银终端屏幕上,并由用户使用对应支付客户端进行扫码支付。 线下QRCode现已同时兼容支付宝、微信客户端进行支付 - - tags: - - RetailPay - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - device_id - properties: - device_id: - type: string - description: 收银设备id - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - code_url: - type: string - description: 付款码字符串,商户可自行生成二维码 # todo - /web_gateway/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: 渠道网关订单下单 - x-sort-order: 0 - description: | - 创建订单后跳转到返回的pay_url(需附加签名参数和redirect参数),随后进入渠道网关支付页面完成支付 - 该接口现仅支持支付宝和Alipay+。 - tags: - - ChannelGateway - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - properties: - channel: - type: string - description: 支付渠道,默认为Alipay - enum: - - Alipay - - AlipayPlus - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: 收银台URL,加签后传递给前端并跳转至当前URL,让消费者完成支付 - /cb_bankpay/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: 网银快捷支付下单 - x-sort-order: 0 - tags: - - CB Bank - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - product_name - - gateway_type - properties: - product_name: - type: string - description: 商品名称 - gateway_type: - type: integer - description: '网关类型,8: H5网关,9:PC网关' - enum: - - 8 - - 9 - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: 收银台URL,加签后传递给前端并跳转至当前URL,让消费者完成支付 - /gateway/partners/{partner_code}/app_orders/{partner_order_id}: - put: - summary: SDK下单 - x-sort-order: 0 - tags: - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderWithChannel' - - type: object - properties: - system: - type: string - description: 客户端操作类型,Alipay选填,Wechat不需要,AlipayPlus必填 - enum: - - android - - iphone - - ipad - version: - type: string - description: 客户端版本号,Alipay选填,其他渠道不需要 - appid: - type: string - description: 微信必填,开发者平台appid - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - sdk_params: - type: string - description: json字符串,可直接传递给SDK端发起支付 - /gateway/partners/{partner_code}/channel_exchange_rate: - get: - summary: 渠道汇率查询 - description: 获取当前各渠道AUD兑CNY汇率值(1AUD=?CNY),该汇率仅做参考,以实际成交汇率为准 - tags: - - PublicApi - parameters: - - name: partner_code - in: path - required: true - responses: - 200: - description: exchange rate - content: - application/json: - schema: - type: object - description: OK - properties: - return_code: - type: string - description: 状态码 - example: - SUCCESS - wechat_rate: - type: number - description: 微信当前汇率 - example: - 4.41111 - alipay_retail_rate: - type: number - description: 支付宝线下接口汇率 - example: - 4.411111 - alipay_online_rate: - type: number - description: 支付宝线上汇率 - example: - 4.411111 - /gateway/partners/{partner_code}/orders/{partner_order_id}/revoke: - put: - summary: 发起撤单 - description: 撤销订单,若订单未支付,系统会尝试拦截支付行为,若拦截失败,在确认支付的同时会自动退款。若订单已支付,系统将全额退款 - tags: - - QRCode - - JSAPI - - MobileH5 - - MiniProgram - - CardPayment - - ChannelGateway - - RetailPay - - CB Bank - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - description: 需要撤销订单的单号 - responses: - 200: - description: Order Status - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - /gateway/partners/{partner_code}/orders/{partner_order_id}/refunds/{partner_refund_id}: - put: - summary: 发起退款 - x-sort-order: 11 - description: 一笔支付订单可以分多次退款,退款总金额不得超过实际支付金额,退款币种与支付订单一致 - tags: - - QRCode - - JSAPI - - MobileH5 - - MiniProgram - - CardPayment - - ChannelGateway - - RetailPay - - CB Bank - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - description: 需要退款订单的单号 - - name: partner_refund_id - in: path - required: true - description: 退款单号 - requestBody: - content: - application/json: - schema: - type: object - required: - - fee - properties: - fee: - type: integer - description: 退款金额,单位是货币最小单位,单个订单退款单金额总和不能超过用户支付金额 - device_id: - type: string - description: 操作设备id - responses: - 200: - description: Refund - content: - application/json: - schema: - $ref: 'components_order.yml#/refundStatus' - get: - summary: 查询退款 - x-sort-order: 12 - tags: - - QRCode - - JSAPI - - MobileH5 - - MiniProgram - - CardPayment - - ChannelGateway - - RetailPay - - CB Bank - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - description: 需要退款订单的单号 - - name: partner_refund_id - in: path - required: true - description: 退款单号 - responses: - 200: - description: Refund Status - content: - application/json: - schema: - $ref: 'components_order.yml#/refundStatus' - /gateway/partners/{partner_code}/transactions: - get: - summary: 查询流水 - description: | - 本接口将列出商户当日所有流水,包括所有接口(含非网关接口)支付通道的付款、RoyalPay优惠补贴、退款、 退款失败补正、系统补正、营销账户转入转出等,不含清算信息 - 注意一笔付款订单或退款订单均可能对应多条流水记录 - tags: - - PublicApi - parameters: - - name: partner_code - in: path - required: true - - name: date - schema: - format: date - pattern: yyyyMMdd - type: string - in: query - required: true - description: 账单日期,'yyyyMMdd'格式,GMT+10,只能查今天以前的账单 - example: 20200315 - responses: - 200: - description: Orders - content: - application/json: - schema: - type: object - properties: - return_code: - type: string - description: 执行结果 - example: - SUCCESS - result_code: - type: string - description: 业务执行结果 - example: - SUCCESS - transaction_count: - type: integer - description: 流水条数 - order_count: - type: integer - description: 付款条数 - refund_count: - type: integer - description: 退款条数 - transactions: - type: array - items: - allOf: - - $ref: 'components_order.yml#/transactionItem' - - type: object - properties: - settlement_date: - type: string - format: date - pattern: yyyy-mm-dd - description: 预期清算日期(可能受到账情况、节假日影响)(yyyy-MM-dd) - /gateway/partners/{partner_code}/settlements: - get: - summary: 查看清算详情 - description: | - 本接口将列出商户查询日期清算的所有流水,包括所有接口(含非网关接口)支付通道的付款、RoyalPay优惠补贴、退款、 退款失败补正、系统补正、营销账户转入转出等 - 注意一笔付款订单或退款订单均可能对应多条流水记录 - tags: - - PublicApi - parameters: - - name: partner_code - in: path - required: true - - name: date - in: query - schema: - format: date - pattern: yyyyMMdd - type: string - description: 清算日期,'yyyyMMdd'格式,GMT+10,只能查今天以前 - required: true - responses: - 200: - description: Settlements - content: - application/json: - schema: - type: object - properties: - return_code: - type: string - description: 执行结果 - example: - SUCCESS - result_code: - type: string - description: 业务执行结果 - example: - SUCCESS - settle_from: - type: string - format: date - description: 订单起始日期:yyyyMMdd - settle_to: - type: string - format: date - description: 订单截止日期:yyyyMMdd - settle_days: - type: string - description: 清算周期 - example: - T+2 - transaction_count: - type: integer - description: 流水条数 - order_count: - type: integer - description: 付款条数 - refund_count: - type: integer - description: 退款条数 - total_credit: - type: integer - description: 入账总金额(AUD分) - total_debits: - type: integer - description: 支出总金额(AUD分) - total_surcharge: - type: integer - description: 手续费总额(AUD分) - total_transfer: - type: integer - description: 打款总额(AUD分) - transactions: - type: array - items: - $ref: 'components_order.yml#/transactionItem' - /notify: - post: - summary: 到账通知 - description: | - 若订单创建时提供了notify_url,系统会在用户支付成功后向这个地址主动发送支付成功状态推送,请求方式为POST - 与服务器API不同,推送校验参数会包含在json内,商户系统应该验证校验参数,确定来源正确后再次进行订单接口查询确认订单支付状态再进行后续操作。 - 商户系统收到请求后应按要求返回参数,若RoyalPay未收到合法参数,视为商户未接收成功,推送动作首次触发会重试3次,随后24小时内每10分钟推送一次,直到返回200状态码。 - 商户系统应当能够处理收到的重复请求。 - 商户系统收到通知后以防万一应调用主动查询接口确认订单状态。 - tags: - - SDK Payment - - CB Bank - - RetailPay - - ChannelGateway - - CardPayment - - MiniProgram - - MobileH5 - - JSAPI - - QRCode - requestBody: - content: - application/json: - schema: - type: object - properties: - time: - type: integer - format: int64 - description: UTC时间戳 - nonce_str: - type: string - description: 随机字符串 - sign: - type: string - description: 签名 - partner_order_id: - type: string - description: 商户单号 - channel_order_id: - type: string - description: 渠道方交易单号 - order_id: - type: string - description: RoyalPay订单号 - total_fee: - type: integer - description: 订单金额,单位是最小货币单位 - real_fee: - type: integer - description: 支付金额,单位是最小货币单位 - rate: - type: number - description: 交易时使用的汇率,1AUD=?CNY - currency: - type: string - description: 币种,AUD - channel: - type: string - description: 交易渠道 - create_time: - type: string - format: 'date-time' - pattern: yyyy-MM-dd HH:mm:ss - description: 订单创建时间,格式为'yyyy-MM-dd HH:mm:ss',GMT+10 - pay_time: - type: string - format: 'date-time' - pattern: yyyy-MM-dd HH:mm:ss - description: 订单支付时间,格式为'yyyy-MM-dd HH:mm:ss',GMT+10 - responses: - 200: - description: OK - /customs/partners/{partner_code}/declare/report/{client_report_id}: - put: - summary: 创建报关单 - tags: - - Custom - parameters: - - name: partner_code - in: path - required: true - - name: client_report_id - in: path - required: true - requestBody: - content: - application/json: - schema: - type: object - properties: - order_id: - type: string - description: 商户支付订单号,要求同一商户唯一 - custom: - type: string - description: 海关编号 * [渠道海关编号](https://www.royalpay.com.au/downloads/CustomsNO.xlsx) - mch_custom_id: - type: string - description: 商户在海关备案的编号 - mch_custom_name: - type: string - description: 商户海关备案名称 - sub_order: - type: array - description: 子订单(拆单) - items: - type: object - properties: - sub_order_no: - type: string - description: 商户子订单号 - fee_type: - type: string - description: 币种代码 - default: CNY - enum: - - CNY - order_fee: - type: number - description: 子订单金额,单位是元 - transport_fee: - type: number - description: 子订单物流金额,单位是元 - responses: - 200: - description: Custom - content: - application/json: - schema: - $ref: 'components_order.yml#/customInfo' - get: - summary: 查询报关单 - description: 对于2020-10-22后的订单新增了channel_request和channel_response以应对海关对原始下单参数和返回值的要求 - tags: - - Custom - parameters: - - name: partner_code - in: path - required: true - - name: client_report_id - in: path - required: true - responses: - 200: - description: Custom - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/customInfo' - - type: object - properties: - channel_request: - type: string - description: 订单原始下单请求 - channel_response: - type: string - description: 订单原始下单请求返回值 - /customs/partners/{partner_code}/redeclare/report/{client_report_id}: - put: - summary: 重新提交报关单 - description: 用于重新提交未报关成功的报关单 - tags: - - Custom - parameters: - - name: partner_code - in: path - required: true - - name: client_report_id - in: path - required: true - responses: - 200: - description: Custom - content: - application/json: - schema: - $ref: 'components_order.yml#/customInfo' -components: - securitySchemes: - nonce_str: - type: apiKey - in: query - name: nonce_str - description: 随机字符串 - time: - type: apiKey - in: query - name: time - description: 带毫秒的Unix时间戳,务必检查服务器时间和时区配置。计算服务器上的UTC时间是否匹配真实UTC时间即可。允许误差±5分钟 - sign: - type: apiKey - in: query - name: sign - description: | - 商户签约后会分配得到一个partner_code和credential_code用于签名,其中partner_code随请求传递,credential_code务必自行存储不得外泄,仅作为签名参数。 - - 每次请求都必须加入签名信息作为请求校验。校验参数全部以Query Param参数的方式附加在URL后面,顺序不分先后。 - - 签名过程: - - 1. 连接生成签名的原始字符串,需要4个参数,使用&连接,无需转码 - > valid_string=partner_code&time&nonce_str&credential_code - - 2. 使用SHA256对valid_string进行签名,并转换为小写字符串 - > sign=hex(sha256(valid_string)).toLowerCase() - - 3. 在请求中将签名使用的time, nonce_str和生成的sign作为query参数发送 - - > 签名测试地址:https://mpay.royalpay.com.au/sign_test.html - - diff --git a/src/document/openapi/cn/img/JSAPI_process_cn.png b/src/document/openapi/cn/img/JSAPI_process_cn.png deleted file mode 100644 index d91fa5018..000000000 Binary files a/src/document/openapi/cn/img/JSAPI_process_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/img/QRCODE_process_ch.png b/src/document/openapi/cn/img/QRCODE_process_ch.png deleted file mode 100644 index 38eb53bf9..000000000 Binary files a/src/document/openapi/cn/img/QRCODE_process_ch.png and /dev/null differ diff --git a/src/document/openapi/cn/img/RetailQR_cn.png b/src/document/openapi/cn/img/RetailQR_cn.png deleted file mode 100644 index a2eb77fcb..000000000 Binary files a/src/document/openapi/cn/img/RetailQR_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/img/Retail_cn.png b/src/document/openapi/cn/img/Retail_cn.png deleted file mode 100644 index 479991f1c..000000000 Binary files a/src/document/openapi/cn/img/Retail_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/img/RoyalPay_Gateway_choose_cn.jpg b/src/document/openapi/cn/img/RoyalPay_Gateway_choose_cn.jpg deleted file mode 100644 index 5d335dd1e..000000000 Binary files a/src/document/openapi/cn/img/RoyalPay_Gateway_choose_cn.jpg and /dev/null differ diff --git a/src/document/openapi/cn/img/UPayCardOrder_CN.jpg b/src/document/openapi/cn/img/UPayCardOrder_CN.jpg deleted file mode 100644 index 4edd71a08..000000000 Binary files a/src/document/openapi/cn/img/UPayCardOrder_CN.jpg and /dev/null differ diff --git a/src/document/openapi/cn/img/UPayCardPreOrder_CN.jpg b/src/document/openapi/cn/img/UPayCardPreOrder_CN.jpg deleted file mode 100644 index a4231a3ae..000000000 Binary files a/src/document/openapi/cn/img/UPayCardPreOrder_CN.jpg and /dev/null differ diff --git a/src/document/openapi/cn/img/alipayOnline_cn.png b/src/document/openapi/cn/img/alipayOnline_cn.png deleted file mode 100644 index 3a1c2d31e..000000000 Binary files a/src/document/openapi/cn/img/alipayOnline_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/img/glyphicons-halflings-white.png b/src/document/openapi/cn/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a2..000000000 Binary files a/src/document/openapi/cn/img/glyphicons-halflings-white.png and /dev/null differ diff --git a/src/document/openapi/cn/img/glyphicons-halflings.png b/src/document/openapi/cn/img/glyphicons-halflings.png deleted file mode 100644 index a99699932..000000000 Binary files a/src/document/openapi/cn/img/glyphicons-halflings.png and /dev/null differ diff --git a/src/document/openapi/cn/img/h5_api_payment.jpg b/src/document/openapi/cn/img/h5_api_payment.jpg deleted file mode 100644 index 7439c51f4..000000000 Binary files a/src/document/openapi/cn/img/h5_api_payment.jpg and /dev/null differ diff --git a/src/document/openapi/cn/img/jd_cn.png b/src/document/openapi/cn/img/jd_cn.png deleted file mode 100644 index 814f18e86..000000000 Binary files a/src/document/openapi/cn/img/jd_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/img/logo.png b/src/document/openapi/cn/img/logo.png deleted file mode 100644 index 1bd7c7fe7..000000000 Binary files a/src/document/openapi/cn/img/logo.png and /dev/null differ diff --git a/src/document/openapi/cn/img/logo_new.jpg b/src/document/openapi/cn/img/logo_new.jpg deleted file mode 100644 index 41c02602a..000000000 Binary files a/src/document/openapi/cn/img/logo_new.jpg and /dev/null differ diff --git a/src/document/openapi/cn/img/microapp_cn.png b/src/document/openapi/cn/img/microapp_cn.png deleted file mode 100644 index fe30a4e5e..000000000 Binary files a/src/document/openapi/cn/img/microapp_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/img/rp_logo.svg b/src/document/openapi/cn/img/rp_logo.svg deleted file mode 100644 index d57a76e21..000000000 --- a/src/document/openapi/cn/img/rp_logo.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/document/openapi/cn/img/sdk_api_payment.jpg b/src/document/openapi/cn/img/sdk_api_payment.jpg deleted file mode 100644 index c67dc9591..000000000 Binary files a/src/document/openapi/cn/img/sdk_api_payment.jpg and /dev/null differ diff --git a/src/document/openapi/cn/img/sdk_wechat_api_payment_cn.png b/src/document/openapi/cn/img/sdk_wechat_api_payment_cn.png deleted file mode 100644 index c1150ef4f..000000000 Binary files a/src/document/openapi/cn/img/sdk_wechat_api_payment_cn.png and /dev/null differ diff --git a/src/document/openapi/cn/index.html b/src/document/openapi/cn/index.html deleted file mode 100644 index 6b6d61ff8..000000000 --- a/src/document/openapi/cn/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - RoyalPay Document - - - - - - - - - - - \ No newline at end of file diff --git a/src/document/openapi/en/components_order.yml b/src/document/openapi/en/components_order.yml deleted file mode 100644 index e9f7a5617..000000000 --- a/src/document/openapi/en/components_order.yml +++ /dev/null @@ -1,492 +0,0 @@ -orderBasic: - required: - - description - - currency - - price - properties: - description: - type: string - maxLength: 128 - description: Order title(Max 128 characters. Will cut automatically if too long.) - price: - type: integer - description: Order price. Minimal unit of currency. eg, 100 for AUD 1.00 - currency: - type: string - enum: - - AUD - - CNY - notify_url: - type: string - description: payment notification url. for details please visit notify api. will not post notifications if leave it null. Recommended to call order query api to confirm order status when received notification. - operator: - type: string - description: mark of operator - expire: - type: string - pattern: ^\d+([mh])$ - default: 5m - description: | - can provide an accurate time with format yyyy-MM-dd HH:mm:ss in GMT+10 timezone. - or in format: digits with 'm' or 'h' tail. m=minutes, h=hours. - default is 5m. if merchants has a global configuration in our backend, it will take the configuration. - no shorter than 1m and no longer than 24h - extra: - type: object - properties: - pay_type: - type: string - description: | - Determine wallet type. For AlipayPlus orders, merchant can determine which wallet to use so that it will directly go into cashier page. - Otherwise a wallet choice page will be shown to customers to determine which wallet they want to use. - - value comes from ConsultPayment API -orderWithChannel: - allOf: - - $ref: '#/orderBasic' - - properties: - channel: - type: string - description: order channel. case sensitive - enum: - - Alipay - - Wechat - - AlipayPlus - type: object - required: - - channel -cardCustomerParam: - properties: - name: - type: string - description: customer name. will use card holder name if leave it empty - postcode: - type: string - example: 2000 - address: - type: string - city: - type: string - example: Sydney - state: - type: string - example: VIC - country: - type: string - description: 2-character country code - example: AU - -cardCustomerInfo: - type: object - title: Card customer info - properties: - bank: - type: string - description: bank name who issued the card. may be empty - card_type: - type: string - description: card type - example: credit/debit - card_alias: - type: string - description: part of card number. for customers to recognize which card they used - example: 424242...242 - card_scheme: - description: card scheme who issued the card - type: string - example: VISA/MASTER - card_country: - description: nation code who issued the card - type: string - example: AU - customer_id: - type: string - description: customer id. if you provided customer_id param or passed tokenize=true param. it will appear -orderBasicResponse: - type: object - properties: - return_code: - type: string - description: execute result - result_code: - type: string - description: SUCCESS/EXISTS all means success. EXISTS means the order_id was not first time to commit - channel: - type: string - description: payment channel - partner_code: - type: string - description: merchant code - full_name: - type: string - description: merchant full name - partner_name: - type: string - description: merchant name - order_id: - type: string - description: RoyalPay order ID, Will be channel order ID same time. - partner_order_id: - type: string - description: order id applied by merchant -orderStatus: - type: object - properties: - return_code: - type: string - description: execute result - example: - SUCCESS - result_code: - type: string - description: | - order status code - - PAYING: waiting for payment - - CREATE_FAIL: creation failed(final status, can be actived again if submitted another create order with same order id) - - CLOSED: order closed(final status, can be actived again if submitted another create order with same order id) - - PAY_FAIL: payment failed(final status, can be actived again if submitted another create order with same order id) - - PAY_SUCCESS: payment success(final status) - - PARTIAL_REFUND: payment success and partial refunds happened(final status) - - FULL_REFUND: payment success and was full refunded(final status) - If necessary. you can use same order id to call create order api in same gateway. but when origin order is paid or paying status will be failure - enum: - - PAYING - - CREATE_FAIL - - CLOSED - - PAY_FAIL - - PAY_SUCCESS - - PARTIAL_REFUND - - FULL_REFUND - order_id: - type: string - description: RoyalPay order ID, Will be channel order ID same time. - partner_order_id: - type: string - description: order id applied by merchant - channel_order_id: - type: string - description: transaction id from payment channel - total_fee: - type: integer - description: order amount. minimal unit of the currency. - real_fee: - type: integer - description: customer actual paid amount. minimal unit of the currency.(equals to total_fee at this moment. in case there were some discounts in the future) - currency: - type: string - rate: - type: number - description: exchange rate of trading. 1AUD=?CNY - pay_time: - type: string - format: 'date-time' - pattern: yyyy-mm-dd HH:mm:ss - description: paid time(yyyy-MM-dd HH:mm:ss, GMT+10) - create_time: - type: string - format: 'date-time' - pattern: yyyy-mm-dd HH:mm:ss - description: order creation time(yyyy-MM-dd HH:mm:ss, GMT+10) - settlement_date: - type: string - format: date - pattern: yyyy-mm-dd - description: target settlement date, maybe delay due to holidays and bank issues(yyyy-MM-dd) - channel: - type: string - description: payment channel - customer_info: - anyOf: - - description: Alipay User Info - title: Alipay Users - type: object - properties: - alipay_user_id: - type: string - description: Alipay user id - alipay_account: - type: string - description: user account - - $ref: 'components_order.yml#/cardCustomerInfo' -refundStatus: - type: object - properties: - return_code: - type: string - description: Execute result - example: - SUCCESS - result_code: - type: string - description: | - Refund status - - WAITING: Submitting - - CREATE_FAILED: Submit failed - - SUCCESS: Submit success. waiting for bank processing(for Wechat, it's final status) - - FAILED: Refund failed - - FINISHED: Refund success (final status) - enum: - - WATING - - CREATE_FAILED - - SUCCESS - - FAILED - - FINISHED - refund_id: - type: string - description: RoyalPay Refund ID - partner_refund_id: - type: string - description: Refund id submitted by merchant - amount: - type: integer - description: refund amount. minimal unit of the currency. - currency: - type: string - example: - AUD - settlement_date: - type: string - format: date - pattern: yyyy-mm-dd - description: target settlement date, maybe delay due to holidays and bank issues(yyyy-MM-dd). only exists when status is SUCCESS or FINISHED -transactionItem: - type: object - properties: - transaction_time: - type: string - format: 'date-time' - pattern: yyyyMMddHHmmss - description: trading time, format is yyyyMMddHHmmss, GMT+10 - partner_code: - type: string - description: transaction related partner code - order_id: - type: string - description: RoyalPay order id - partner_order_id: - type: string - description: merchant order id - channel_order_id: - type: string - description: channel order id - refund_id: - type: string - description: RoyalPay refund id (only exists on refund or refund failure payback transactions) - partner_refund_id: - type: string - description: merchant submitted refund id (only exists on refund or refund failure payback transactions) - gateway: - type: integer - description: | - gateway - - 0: RoyalPay EftPOS with payment code (scanning payment code provided by customer) - - 1: RoyalPay EftPOS with collection code (customer scan qr code provided by EftPOS) - - 2: RoyalPay Merchant's static QR Code - - 3: QRCode Gateway - - 4: JSAPI Gateway - - 5: Third EftPOS payment code gateway - - 6: Third EftPOS collection code gateway - - 7: RoyalPay Merchant's static QR Code(deprecated) - - 8: H5 Gateway - - 9: WEB Gateway - - 10: SDK order Gateway - - 11: RoyalPay Bill QR Code - - 12: Mini Program Gateway - - 13: Native QR Code Gateway - - 14: RoyalPay Bill link - - 15: Native JSAPI Gateway - - 16: Card Order(Pre order mode) - - 17: Card Order - - 18: DirectDebit - channel: - type: string - description: Trading channel - type: - type: string - description: Transaction type - enum: - - Credit - - Debit - currency: - type: string - example: - AUD - total_amount: - type: integer - description: Total amount for order. minimal unit of the currency. - input_amount: - type: integer - description: Input amount for order. minimal unit of the currency. - customer_payment_amount: - type: integer - description: Customer actual paid amount. minimal unit of the currency. - settle_amount: - type: integer - description: Amount calculated to merchant. note that it did not sub surcharge and GST yet. AUD currency. minimal unit of the currency. - transfer_amount: - type: integer - description: Pay amount to merchant. settle_amount - surcharge - GST. AUD currency. minimal unit of the currency. - surcharge: - type: integer - description: surcharge for this transaction. AUD currency. minimal unit of the currency. - gst: - type: integer - description: GST. AUD currency. minimal unit of the currency. - exchange_rate: - type: number - description: used exchange rate. - remark: - type: string - description: transaction remark -consultPaymentRequest: - type: object - required: - - currency - - amount - - terminal_type - properties: - currency: - type: string - description: | - Currency of the incoming payment. Should be 3-character code in [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html). For example, AUD - amount: - type: integer - description: Order amount of the incoming payment. Should be minimal unit of the currency. - terminal_type: - type: string - enum: - - WEB - - H5 - - APP - description: Web is for pc browser paying, H5 is for mobile browser or inner webview in wallet apps. APP is for merchant's App. case-sensitive - user_region: - type: string - description: | - Standard 2-character code in [ISO-3166](https://www.iso.org/obp/ui/#iso:pub:PUB500001:en). Which country is your customer in. - This will help to determine which wallet is suggested. For example, a South-Korea customer will be recommended to use KakaoPay - os_type: - type: string - description: For App payment. Pass this os is customer using. Case-sensitive - enum: - - IOS - - ANDROID - client_ip: - type: string - description: customer ip address - user_agent: - type: string - description: If customer is in the inner webview of wallet. this will help to determine which wallet should be recommended -consultResultItemAlipayPlus: - type: object - required: - - sub_channel - - sub_channel_name - properties: - sub_channel: - type: string - description: wallet name. should be passed as pay_type parameter in new order requests - sub_channel_name: - type: string - description: wallet brand name which can be display to customers - logo: - type: string - description: wallet logo -customInfo: - type: object - properties: - report_id: - type: string - description: RoyalPay customs report id - client_report_id: - type: string - description: merchant submitted customs report id - report_status: - type: string - description: report status - enum: - - PROCESSING - - SUBMITED - - FAILED - - SUCCESS - channel: - type: string - description: payment channel - custom: - type: string - description: customs code - mch_custom_no: - type: string - description: merchant's customs no registered in customs system - mch_custom_name: - type: string - description: merchant's name registered in customs system - order_id: - type: string - description: RoyalPay order id - transaction_id: - type: string - description: channel transaction id - order_currency: - type: string - description: order currency - order_amount: - type: number - description: order amount - report_time: - type: string - format: 'date-time' - description: report customs time - creation_date: - format: 'date-time' - type: string - description: report create time - last_update_date: - type: string - format: 'date-time' - description: update time - error_code: - type: string - description: error code - error_msg: - type: string - description: error message - verify_department: - type: string - verify_department_trade_id: - type: string - sub_orders: - type: array - items: - type: object - properties: - sub_order_no: - type: string - description: merchant's sub order no - fee_type: - type: string - description: currency code - default: CNY - enum: - - CNY - order_fee: - type: number - description: sub order fee - transport_fee: - type: number - description: sub order transport fee - verify_department: - type: string - verify_department_trade_id: - type: string - report_status: - type: string - description: report status - enum: - - PROCESSING - - SUBMITED - - FAILED - - SUCCESS - error_code: - type: string - error_msg: - type: string \ No newline at end of file diff --git a/src/document/openapi/en/document.yml b/src/document/openapi/en/document.yml deleted file mode 100644 index 0665f2fa0..000000000 --- a/src/document/openapi/en/document.yml +++ /dev/null @@ -1,1525 +0,0 @@ -openapi: 3.0.3 -info: - title: RoyalPay Developer Documents - version: 1.0.0 - x-logo: - url: img/rp_logo.svg - description: | - [中文](/cn/) - - # Request And Parameters - Request for payment or refund shall use PUT method. Request for querying order - shall use GET method. All requests including Request Entity are in JSON format. - - Accept in the request header shall be set to application/json for all requests except redirect pages. - Content-Type in the request header shall be set to application/json for all PUT/POST requests. - - System charset is UTF-8. - - There are 3 groups of parameters: Path Variable, Query Param, JSON Entity - + Path Variable: included in the path as patterns - + Query Param: parameters after the URI '?' symbol and formatted like key=value - + JSON Entity: only used in PUT/POST requests - - Our API server will return 200 in JSON if the request has successfully reached the server, which does not indicate the success or failure of the actual operation. All responses in JSON format will include a return_code field which contains the operation result. The value SUCCESS indicates that the operation was successful while other values shows the type of error that happened. Response will also contain a return_msg field for detailed error message. - - # Multi-Language - - System error message supports Simplified Chinese and English. The system by default will automatically choose the language according to the Accept-Language value in request header. Cookie "locale" value (zh-CN or en-US) will affect the result language. - - # Which Gateway Api is for me? - - - - # Alipay Channels - - According to different Api used, Alipay channel was distributed to Retail channel and Online channel. Two channels has different exchange rate and surcharge rate. - + Online Channel: Including H5 Mobile, Online Payment, APP SDK, JSAPI and QR Code Api - + Retail Channel: Including Retail Pay - - Difference - - JSAPI and H5 Mobile: JSAPI can only be called in the web page opened in Alipay Client. H5 Mobile can call the payment panel in any browser or webview in App in the mobile device. - - Online Payment and QR Code: Online payment will jump to Alipay Official payment page. Customers can scan QR Code displayed in the page or sign in their account directly to finish payment. QR Code can provide a QR Code. Merchants can display this QR Code in their web page or jump to RoyalPay to display the QR Code. Customers can only scan the QR Code with their Alipay Client to finish payment. - - # Currency Codes - - RoyalPay can only accept the following currencies at the moment. Please note that the settlement currency will always be Australian Dollar. - - AUD - - CNY - - Except customs api. All fee parameters should use *Minimal unit of the currency*. For example, CNY and AUD should use cent unit. so AUD 1.00 should submit the parameter as 100 - - # Business Roles - - QR Code Payment displays a QR code image in a web page. Customers will scan the code via their WeChat and complete the payment in the linked web page. It is suitable for online shopping websites. - - JSAPI Payment redirects customers to a web page in WeChat. This page can only be opened within WeChat app and it is suitable for payment from micro-shops on WeChat platform. - - Retail passive payment(Scan Payment Code in customers’ WeChat Wallet) and active payment(Generate Payment QR Code for customers to scan) are used in retail environment such as payment terminals and pos machines. - - Order ID is required when creating an order. The same order id can be sent again. The system will decide to renew an order or close the old order according to the order status. System will recognise the same order id to avoid duplicated payments from customers. - - As orders can be resubmitted, Order ID returned by our server might not represent the last Order ID paid. - - QR Code order creation will return QR Code and pay_url. Merchants may decide whether to display the QR code on their website or to redirect customer to the payment page available at pay_url. - - JSAPI order creation will return pay_url. Merchants shall redirect customer to the payment page available at pay_url, and complete the payment. - - When redirecting to pay_url, sign information is required. - - Each request shall use new timestamp, nonce_str and sign. - - Our system will notify the caller after an order is paid successfully if notify_url was provided when creating an order. Otherwise, Merchants shall call the order query method repeatedly until order is paid or closed. - - Each unpaid order will be valid for 5 minutes. Expired order can be renewed with same the order id. It is suggested to trigger the event when user open the payment page again. - - Always redirect to RoyalPay’s payment page after calling the order creation method. - - Same order id is allowed in both creating new payment order and creating refund order but order details shall refer back to the initial request details. - - Price is specified in the base unit of the given currency. Using currency AUD as an example, 105 means 105 cents or $1.05. - - # Examples - https://example.royalpay.com.au/api/payment/order - - - - # Sample Code - - PHP: https://mpay.royalpay.com.au/static/phpdemo.zip - - Java: https://mpay.royalpay.com.au/static/javademo.zip - - # Error Codes - ## Common Error Codes - - SYSTEMERROR: Internel server error - - INVALID_SHORT_ID: Invalid partner code or not found - - SIGN_TIMEOUT: Signatured timedout. submitted time param has more than 5min difference to our server. please check your server time and timezone configuration. - - SIGN_EXPIRED: Signature expired. same signature was used multiple times. - - INVALID_SIGN: Signature mismatch - - PARAM_INVALID: Parameter not valid. Please check thr return_msg param - - ## Order Creation Error Codes - - NOT_PERMITTED: Not enabled the target gateway permission. - - INVALID_CHANNEL: Invalid channel name. channel name parameter was case-sensitive. please check spelling - - ORDER_MISMATCH: Order id not belongs to your merchant - - AUTHCODEEXPIRE: QR Code provided was expired(For Payment code apis) - - NOTSUPORTCARD: Not supported card type(Wechat channel only) - - AUTH_CODE_ERROR: QR Code submitted multiple times(Wechat channel only) - - AUTH_CODE_INVALID: Invalid QR Code(Wechat channel only) - - NOTENOUGH: Not enough balance in customer's account(Wechat channel only) - - ORDER_PAID: Order already paid - -servers: - - url: https://mpay.royalpay.com.au/api/v1.0 - description: production -tags: - - name: PublicApi - description: Public API - - name: QRCode - description: | - QR Code Payment is used for webpage/application on PC. Customers use WeChat or Alipay app to scan QR Code generated when creating order and finish the payment. - - Return value contains QR Code string, QR Ccode image and payment page address. Partners can decide how to finish the payment. - If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD, otherwise user will get Invalid Amount Error from WeChat when making the payment. - - name: JSAPI - description: | - JSAPI Payment is used to pay in webpage which was opened in WeChat or Alipay App. If customers enter this page from WeChat Official Account, this Official Account is required to be authorized. - Customers will jump to RoyalPay order page and call WeChat or Alipay Payment Board to finish payment. - - Return value contains a payment page. Partners shall guide users to redirect to the page. Sign params is required when redirect happens. - If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD, - otherwise user will get Invalid Amount Error from WeChat when making the payment. - - name: MobileH5 - description: | - Create H5 order. - H5 Payment is used for payment in Webpage or App on mobile outside WeChat or Alipay App. The browser would redirect to a webpage from WeChat or Alipay and call the App to finish the payment. - Return value contains a payment page. Partners shall guide users to redirect to this page. Sign params are required. - If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD, otherwise user will get Invalid Amount Error from WeChat when making the payment. - - - name: MiniProgram - description: | - Enabling Wechat mini program have to finish oversea company authorization. And authorized merchant should be equal to the merchant information in RoyalPay. - For details please visit WeChat documents. - Used for call payment in miniprogram. Create order and pass the sdk_params to mini program. [Reference Document](https://www.royalpay.com.au/downloads/MiniProgram_WechatPay.pdf) - - - name: CardPayment - description: | - Card payment method is that customer provider their card information to finish payments. Enable card payment require addition compliance process. - - Card payment contains 2 ways to create an order: Pre-Order Mode and Direct-Order Mode - - Pre-Order mode is that merchant submit other order info like order fee, order id, and will get a pay_url in response. Then guide customer visit this address so that they can type in their card information on our cashier page. And with customer_id parameter, it can allow same customers use card information in last payment so that they do not have to input entire card information. And pre-order mode also support 3-DS to decrease Charge back risk - - - Direct-Order mode allow merchants to embed our secure card input frame in their cashier page. It can supply encrypted card information with callback to merchant's ui. Merchants just submit the encrypted card information and order basic information together and will get the payment result directly. However, this mode do not support 3-DS now. - - - Both modes used same order check and refund api. - - name: RetailPay - description: | - Retail payment API for merchants has their own machine. Has 2 modes: - - Merchant scanner scan customer provided payment code.(B scan C) - - Customer scan merchant provided collection code. (C scan B) - - name: ChannelGateway - description: | - Use for Channel Cashier Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Channel cashier page to finish payment. - Alipay and AlipayPlus Channels only - - - name: CB Bank - description: | - Use for CB BankPay in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. - - name: SDK Payment - description: | - Used for mobile Apps calling Wechat payment with Wechat/Alipay SDK. - Call this api to create order and get param string for SDK calling. Call SDK api with the param to start payment and get payment result from Wechat app *It is strongly advised to request RoyalPay order query Api to confirm that the order has been paid in order to cancelling order by system at the same time.* - - More information for integration with Alipay: - - [Alipay SDK Document](https://global.alipay.com/doc/app/intro) - - [Alipay+ SDK Document](/resources/api/AlipayPlusAppIntegrationGuide.pdf) - - More information for integration with Wechat: - - [Wechat SDK Document](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1) - - [Alipay SDK for Android](/resources/api/alipaySdk-20160825.jar) - - [Alipay SDK for iOS](/resources/api/AlipaySDKForiOS.zip) - - [Wechat SDK for Android](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319167&token=&lang=zh_CN) - - [Wechat SDK for iOS](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319164&lang=zh_CN) - - - name: Custom - description: Used to submit the attachment information of the order required by the merchant. WeChat and Alipay are only supported. WeChat only supports payment orders within one month for customs declaration. -security: - - sign: [] - nonce_str: [] - time: [] -paths: - /gateway/partners/{partner_code}/consult_payment: - post: - tags: - - ChannelGateway - - MobileH5 - - SDK Payment - summary: ConsultPayment - description: | - Used for check which pay_type is available for AlipayPlus channel. - You can call this api to get available wallets and ask customers to choose. - parameters: - - in: path - name: partner_code - required: true - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/consultPaymentRequest' - responses: - 200: - description: 查询结果 - content: - application/json: - schema: - type: object - required: - - sub_channels - properties: - sub_channels: - type: array - items: - $ref: 'components_order.yml#/consultResultItemAlipayPlus' - /gateway/partners/{partner_code}/orders/{partner_order_id}: - put: - tags: - - QRCode - summary: Create QRCode Order - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: Execution result - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - code_url: - type: string - description: QR Code string. Merchants can generate a QR Code by self - qrcode_img: - type: string - description: Base64 encoded qr code img. can be used as src attribute of img tag - pay_url: - type: string - description: Payment page URL. If merchants choose jump to royalpay to finish payment can use this url. remember to add signature params - get: - summary: Check Order Status - tags: - - SDK Payment - - CB Bank - - RetailPay - - ChannelGateway - - CardPayment - - MiniProgram - - MobileH5 - - JSAPI - - QRCode - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - responses: - 200: - description: Order Status - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - delete: - summary: Close Order - tags: - - SDK Payment - - CB Bank - - RetailPay - - ChannelGateway - - CardPayment - - MiniProgram - - MobileH5 - - JSAPI - - QRCode - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - responses: - 200: - description: Order Status - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - /gateway/partners/{partner_code}/native_orders/{partner_order_id}: - put: - tags: - - QRCode - summary: Create native QRCode payment order - description: | - Native QR Code was generated directly by wechat/alipay. When scanned by their app. The payment page will directly generated by App instead of jumping to royalpay. - Will be helpful when customers are in a bad networking condition - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: Execute result - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - code_url: - type: string - description: QR Code string. Merchants can generate a QR Code by self - qrcode_img: - type: string - description: Base64 encoded qr code img. can be used as src attribute of img tag - pay_url: - type: string - description: Payment page URL. If merchants choose jump to royalpay to finish payment can use this url. remember to add signature params - /gateway/partners/{partner_code}/orders/{partner_order_id}/pay: - get: - tags: - - QRCode - summary: QRCode payment Page - description: Must call order creation api and then redirect to this page. It's recommended to call order check api when sync jumping back to the given redirect param - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - - name: redirect - required: true - in: query - description: Redirecting target when payment succeeded - responses: - 200: - description: payment page - content: - text/html: - schema: - type: string - /jsapi_gateway/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: Create JSAPI order - tags: - - JSAPI - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: Execute Result - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: Payment page URL, redirect to the url with signature parameters. - /wechat_jsapi_gateway/partners/{partner_code}_order_{partner_order_id}: - get: - summary: Wechat JSAPI payment page - description: Wechat JSAPI payment page. it's recommended to use the returned pay_url param in create order response - tags: - - JSAPI - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - - name: redirect - in: query - description: sync callback url. pay attention on url encoding - - name: directpay - in: query - description: whether call payment immediately when customer entered the page. if false, customer have to click on Pay button to call payment. - schema: - type: boolean - responses: - 200: - description: Wechat JSAPI payment page - content: - text/html: - schema: - type: string - /gateway/alipay/partners/{partner_code}/orders/{partner_order_id}/app_pay: - get: - summary: Alipay JSAPI Payment page - description: Alipay JSAPI payment page. it's recommended to use the returned pay_url param in create order response - tags: - - JSAPI - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - - name: redirect - in: query - description: sync callback url. pay attention on url encoding - - name: directpay - in: query - description: whether call payment immediately when customer entered the page. if false, customer have to click on Pay button to call payment. - schema: - type: boolean - responses: - 200: - description: Alipay JSAPI payment page - content: - text/html: - schema: - type: string - /gateway/partners/{partner_code}/native_jsapi/{partner_order_id}: - put: - summary: Native JSSDK order - description: Native JSSDK allows merchants to open Wechat/Alipay cashier view. For details please check Alipay/Wechat documents - x-sort-order: 0 - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - tags: - - JSAPI - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderWithChannel' - - type: object - required: - - customer_id - properties: - appid: - type: string - description: Wechat official account appid, required for Wechat - customer_id: - type: string - description: Customer openid acquired by merchant's wechat official account or userid from Alipay - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - sdk_params: - type: string - description: serialized json parameters. which can be take as parameter while opening cashier view in Wechat/Alipay - /h5_payment/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: Create MobileH5 order - description: only for Alipay channel - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - tags: - - MobileH5 - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderWithChannel' - responses: - 200: - description: Order - content: - application/json: - schema: - type: object - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: Payment page URL. redirect to the url with signature parameters. - /h5_payment/partners/{partner_code}/orders/{partner_order_id}/pay: - get: - summary: H5 Payment page - description: H5 payment page. it's recommended to use the returned pay_url param in create order response - tags: - - MobileH5 - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - - name: redirect - in: query - description: sync callback url. pay attention on url encoding - responses: - 200: - description: H5 Payment page - content: - text/html: - schema: - type: string - /gateway/partners/{partner_code}/microapp_orders/{partner_order_id}: - put: - summary: Create mini program order - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - tags: - - MiniProgram - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderWithChannel' - - type: object - required: - - customer_id - properties: - appid: - type: string - description: mini program appid. required when channel is Wechat. ignore on Alipay - customer_id: - type: string - description: user id recognized in mini program (openid or wechat and userid for Alipay) - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - sdk_params: - type: string - description: serialized json string. can pass to mini program to call payment method - /gateway/partners/{partner_code}/pre_card_orders/{partner_order_id}: - put: - summary: Create Card Payment Pre Order - description: | - Pre order mode is submit basic order parameters. and jump to royalpay gateway page to ask customers to input their card information and finish payment. - Pre order allows customers to try multiple times. unless merchants called order close api. order will exists enabled status until expired. - tags: - - CardPayment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - properties: - domestic_only: - type: boolean - default: false - description: | - Whether only domestic cards can pay. due to there is huge difference on surcharge rate between domestic cards and international cards. - Merchants can add a limit on the order. - **Note: If merchant enabled auto attach surcharge on orders, and international_only is false, this parameter will automatically set to true** - international_only: - type: boolean - default: false - description: | - If set this parameter to true, this order will refuse domestic cards. It is useful when merchant enabled auto attach surcharge to orders. - Then is required to set this value as true to enable international cards. This also means customers should choose use domestic cards or international cards first on merchants' page - - And if domestic_only param is true, this param will be ignored. - disable_credit_card: - type: boolean - default: false - description: pass true if merchant want to disable credit cards from paying to this order. - disable_threeds: - type: boolean - default: false - description: We will help merchants to enable 3DS verify by default. If you want to disable this feature please set this parameter as true - tokenize: - type: boolean - default: false - description: whether provide a customer id for this payment. Then merchants can pass this id in future orders for same customer and then they will only have to input cvv code then. - customer_id: - type: string - description: use customer_id provided by tokenized orders. When customer_id is not null, tokenize parameter will be ignored. Can skip steps for typing in card number/ card holder name/ expire time for customer. only required is CVV2/CVC code - customer: - $ref: 'components_order.yml#/cardCustomerParam' - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: Payment page URL. redirect to the url with signature parameters. - /card_payment_view/partners/{partner_code}/orders/{partner_order_id}/view: - get: - summary: Card Payment Page - description: Card payment page. it's recommended to use the returned pay_url param in create order response - tags: - - CardPayment - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - - name: redirect - in: query - description: sync callback url. pay attention on url encoding - responses: - 200: - description: Card payment page - content: - text/html: - schema: - type: string - /gateway/partners/{partner_code}/card_orders/{partner_order_id}: - put: - summary: Create Card Order - description: | - Input https://channel-gateway.royalpay.com.au/channel/v1/view/card_input_frame.js in merchant's webpage. - After called commit, it will return `key_id` and `secret` parameter asyncronized by callback. - - Post these parameter to royalpay and finish payment directly. - - js Example - ``` - let cardInputContainer = document.getElementById('card-input-area');//a container prepared to put the card input frame in. - let cardInput = new CardInputFrame(cardInputContainer);//create frame object - //setting iframe style - cardInput.frameStyle = { - width: '100%', - height: '400px', - border: 'none', - borderRadius: '10px' - }; - cardInput.onError = function(msg){ - //if the input card message has mistake, will call this method and pass the error detail here - }; - cardInput.onReady = function(){ - //iframe loaded event - }; - cardInput.onSuccess = function(secretData){ - //success get encrypted card informations - //secretData: {'key_id':'','secret':''} - }; - cardInput.show();//start loading iframe - - //call commit method when customer clicked pay button so that callbacks will be triggered - cardInput.commit(); - ``` - - **Note: This API do not allow customers pay for surcharge** - tags: - - CardPayment - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - key_id - - card_info - properties: - key_id: - type: string - description: card input frame returned key_id - card_info: - type: string - description: card input frame returned secret - domestic_only: - type: boolean - default: false - description: | - Whether only domestic cards can pay. due to there is huge difference on surcharge rate between domestic cards and international cards. - Merchants can add a limit on the order. - disable_credit_card: - type: boolean - default: false - description: Pass true if want to refuse credit cards. - disable_threeds: - type: boolean - default: false - description: We will help merchants to enable 3DS verify by default. If you want to disable this feature please set this parameter as true - customer: - $ref: 'components_order.yml#/cardCustomerParam' - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: If order requires 3DS verify. it will return this parameter. Merchants's system should guide customer to redirect to this url and finish 3DS verify. Remember to add signatures and return_url param - /micropay/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: Retail Passive Payment Order - description: | - Retail Passive Payment is used for cashier terminals which can scan BarCode or QRCode. Shop staff input the payment amount and ask customers for their payment code, - then system send price and payment code to server and finish the payment. Retail Passive Payment now support both Alipay and WeChat - - tags: - - RetailPay - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - auth_code - - device_id - properties: - device_id: - type: string - description: ID of the device which sends the request - auth_code: - type: string - description: The Payment QR Code scanned from customer's WeChat Wallet. - responses: - 200: - description: Result - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - /retail_qrcode/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: Retail Active Payment Order - description: | - Retail Active Payment is used for cashier terminals which cannot scan Barcode or QRCode. Get the Code url after create the order, - convert this url to a QRCode and ask customers use their app to scan this QRCode then finish the payment. - Retail Active Payment now support Alipay, WeChat - - tags: - - RetailPay - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - device_id - properties: - device_id: - type: string - description: ID of the device which sends the request. - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - code_url: - type: string - description: QR Code string. Partners can create the payment QR Code according to this value. - /web_gateway/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: Channel WEB Order - description: | - Use for Channel Payment Cashier in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Channel cashier page to finish payment. - Alipay and AlipayPlus only at the moment. - tags: - - ChannelGateway - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - $ref: 'components_order.yml#/orderBasic' - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: Payment page URL. redirect to the url with signature parameters. - /cb_bankpay/partners/{partner_code}/orders/{partner_order_id}: - put: - summary: CB BankPay Order - description: Use for CB BankPay in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. - tags: - - CB Bank - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasic' - - type: object - required: - - product_name - - gateway_type - properties: - product_name: - type: string - description: production name - gateway_type: - type: integer - description: 'Gateway Require 8: H5 gateway,9: PC gateway' - enum: - - 8 - - 9 - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - pay_url: - type: string - description: Payment page URL. redirect to the url with signature parameters. - /gateway/partners/{partner_code}/app_orders/{partner_order_id}: - put: - summary: SDK Order - description: | - Used for mobile Apps calling Wechat payment with Wechat SDK. Call this api to create order and get param string for SDK calling. - Call SDK api with the param to start payment and get payment result from Wechat app It is strongly advised to request RoyalPay order query Api to confirm that the order has been paid in order to cancelling order by system at the same time. - tags: - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - description: Given partner code - - name: partner_order_id - in: path - required: true - description: Order id in merchant side. must be unique in merchant side. - requestBody: - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderWithChannel' - - type: object - properties: - system: - type: string - description: OS type of client app, optional for Alipay, required for AlipayPlus, not required for Wechat - enum: - - android - - iphone - - ipad - version: - type: string - description: client app version, optional only for Alipay - appid: - type: string - description: wechat appid, only required for Wechat - responses: - 200: - description: Order - content: - application/json: - schema: - allOf: - - $ref: 'components_order.yml#/orderBasicResponse' - - type: object - properties: - sdk_params: - type: string - description: param string for calling SDK - /gateway/partners/{partner_code}/channel_exchange_rate: - get: - summary: Channel Exchange Rates - description: | - Get current exchange rate from AUD to CNY provided by WeChat and Alipay(AUD 1=CNY ?). - This exchange rate shown is for reference only, please refer to the real time exchange rate when processing the actual transaction. - tags: - - PublicApi - parameters: - - name: partner_code - in: path - required: true - responses: - 200: - description: exchange rate - content: - application/json: - schema: - type: object - description: OK - properties: - return_code: - type: string - description: Execution result - example: - SUCCESS - wechat_rate: - type: number - description: Wechat exchange rate - example: - 4.41111 - alipay_retail_rate: - type: number - description: Alipay retail exchange rate - example: - 4.411111 - alipay_online_rate: - type: number - description: Alipay online exchange rate - example: - 4.411111 - /gateway/partners/{partner_code}/orders/{partner_order_id}/revoke: - put: - summary: Revoke Order - description: | - Revoke the order. If order was not paid, system will try to stop paying from customer. - If failed, system will make full refund after confirmed paid. - If order was paid already, system will make full refund directly - tags: - - QRCode - - JSAPI - - MobileH5 - - MiniProgram - - CardPayment - - ChannelGateway - - RetailPay - - CB Bank - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - description: the order id in merchant's system that to be revoked - responses: - 200: - description: Order Status - content: - application/json: - schema: - $ref: 'components_order.yml#/orderStatus' - /gateway/partners/{partner_code}/orders/{partner_order_id}/refunds/{partner_refund_id}: - put: - summary: Refund Order - description: | - One payment order can create more than one refund orders. Total amount of all refund orders must be less than or equal to the actual paid amount and the currency of refund order is the same as the payment order. - tags: - - QRCode - - JSAPI - - MobileH5 - - MiniProgram - - CardPayment - - ChannelGateway - - RetailPay - - CB Bank - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - description: Payment order id in merchant's system - - name: partner_refund_id - in: path - required: true - description: Refund id in merchant's system - requestBody: - content: - application/json: - schema: - type: object - required: - - fee - properties: - fee: - type: integer - description: 退Refund amount. Use base unit of the currency. Total amount of all refund orders must be less than actual paid amount. - device_id: - type: string - description: ID of the device which sends the request - responses: - 200: - description: Refund - content: - application/json: - schema: - $ref: 'components_order.yml#/refundStatus' - get: - summary: Check Refund Status - tags: - - QRCode - - JSAPI - - MobileH5 - - MiniProgram - - CardPayment - - ChannelGateway - - RetailPay - - CB Bank - - SDK Payment - parameters: - - name: partner_code - in: path - required: true - - name: partner_order_id - in: path - required: true - description: Payment order id in merchant's system - - name: partner_refund_id - in: path - required: true - description: Refund id in merchant's system - responses: - 200: - description: Refund Status - content: - application/json: - schema: - $ref: 'components_order.yml#/refundStatus' - /gateway/partners/{partner_code}/transactions: - get: - summary: Check Transactions - description: | - This Api will list all transactions for current merchant in the day, containing all payment methods(include no gateway methods) and all payment channels such as payment, - RoyalPay discount cashback, refunds, credit for failure refunds, system pay back, - cashback account income/outcome, etc. Settlement transactions will not be contained. - - **Note: A payment order or refund order can contains several transaction records** - tags: - - PublicApi - parameters: - - name: partner_code - in: path - required: true - - name: date - schema: - format: date - pattern: yyyyMMdd - type: string - in: query - required: true - description: Transaction date. Format as 'yyyyMMdd', GMT+10. Only transaction before today can be query - example: 20200315 - responses: - 200: - description: Orders - content: - application/json: - schema: - type: object - properties: - return_code: - type: string - description: Execute Result - example: - SUCCESS - result_code: - type: string - description: 业务Execute Result - example: - SUCCESS - transaction_count: - type: integer - description: transactions number - order_count: - type: integer - description: credit number - refund_count: - type: integer - description: debit number - transactions: - type: array - items: - allOf: - - $ref: 'components_order.yml#/transactionItem' - - type: object - properties: - settlement_date: - type: string - format: date - pattern: yyyy-mm-dd - description: target settlement date, maybe delay due to holidays and bank issues(yyyy-MM-dd) - /gateway/partners/{partner_code}/settlements: - get: - summary: Check Settlements - description: | - This Api will list all transactions with the settlement this day, containing all payment methods(include no gateway methods) - and all payment channels such as payment, RoyalPay discount cashback, refunds, credit for failure refunds, - system pay back, cashback account income/outcome, etc. - - **Note: A payment order or refund order can contains several transaction records** - tags: - - PublicApi - parameters: - - name: partner_code - in: path - required: true - - name: date - in: query - schema: - format: date - pattern: yyyyMMdd - type: string - description: Settle date. Format as 'yyyyMMdd' ,GMT+10. Only settlement before today can be query - required: true - responses: - 200: - description: Settlements - content: - application/json: - schema: - type: object - properties: - return_code: - type: string - description: Execute Result - example: - SUCCESS - result_code: - type: string - description: Process Result - example: - SUCCESS - settle_from: - type: string - format: date - description: 'Transaction date from, yyyyMMdd' - settle_to: - type: string - format: date - description: Transaction date to, yyyyMMdd - settle_days: - type: string - description: Settle delay - example: - T+2 - transaction_count: - type: integer - description: transaction record count - order_count: - type: integer - description: credit count - refund_count: - type: integer - description: debit count - total_credit: - type: integer - description: total credit fee(AUD cent) - total_debits: - type: integer - description: total debit fee(AUD cent) - total_surcharge: - type: integer - description: Total surcharge(AUD cent) - total_transfer: - type: integer - description: Total transfer amount(AUD cent) - transactions: - type: array - items: - $ref: 'components_order.yml#/transactionItem' - /notify: - post: - summary: Order Paid Notify - description: | - If notify_url is provided when order is created. System will post request to this url when the payment succeeds. - Request method is POST. Different from Server APIs, sign parameters will be included in json entity. - Partner system shall valid them to prevent fake requests. Partner system shall response with correct parameters. - If RoyalPay did not receive valid response, system will regard as receiving failed and retry the notification. - System will retry up to3 times. Partner system shall be able to handle the repeated requests. - - **It is recommended to actively call the query API to confirm the payment status after receiving the push, so as to prevent other third parties from forging the push!** - tags: - - SDK Payment - - CB Bank - - RetailPay - - ChannelGateway - - CardPayment - - MiniProgram - - MobileH5 - - JSAPI - - QRCode - requestBody: - content: - application/json: - schema: - type: object - properties: - time: - type: integer - format: int64 - description: UTC timestamp in millis - nonce_str: - type: string - description: Random string - sign: - type: string - description: Sign - partner_order_id: - type: string - description: Partner order id - channel_order_id: - type: string - description: PayChannel(Alipay、Wechat) Transaction Trade No - order_id: - type: string - description: RoyalPay order id - total_fee: - type: integer - description: Order amount - real_fee: - type: integer - description: Actual paid amount - rate: - type: number - description: Exchange Rate used while trading. 1AUD=?CNY - currency: - type: string - description: Currency, AUD - channel: - type: string - description: Payment Channel Alipay, AlipayOnline, Wechat, AlipayPlus - create_time: - type: string - format: 'date-time' - pattern: yyyy-MM-dd HH:mm:ss - description: Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', GMT+10 - pay_time: - type: string - format: 'date-time' - pattern: yyyy-MM-dd HH:mm:ss - description: Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', GMT+10. - responses: - 200: - description: OK - /customs/partners/{partner_code}/declare/report/{client_report_id}: - put: - summary: Create Custom Declare - tags: - - Custom - parameters: - - name: partner_code - in: path - required: true - - name: client_report_id - in: path - required: true - requestBody: - content: - application/json: - schema: - type: object - properties: - order_id: - type: string - description: Partner order id - custom: - type: string - description: Customs No. * [Channel Custom No](https://www.royalpay.com.au/downloads/CustomsNO.xlsx) - mch_custom_id: - type: string - description: Customs record id of merchant - mch_custom_name: - type: string - description: Customs record name of merchant - sub_order: - type: array - description: Child orders(If split order required) - items: - type: object - properties: - sub_order_no: - type: string - description: Sub order no - fee_type: - type: string - description: currency - default: CNY - enum: - - CNY - order_fee: - type: number - description: Sub order price. unit is Yuan - transport_fee: - type: number - description: Sub order transport fee. unit is Yuan - responses: - 200: - description: Custom - content: - application/json: - schema: - $ref: 'components_order.yml#/customInfo' - get: - summary: Query Custom Report - tags: - - Custom - parameters: - - name: partner_code - in: path - required: true - - name: client_report_id - in: path - required: true - responses: - 200: - description: Custom - content: - application/json: - schema: - $ref: 'components_order.yml#/customInfo' - /customs/partners/{partner_code}/redeclare/report/{client_report_id}: - put: - summary: Redeclare Custom Report - description: Used to resubmit the attachment information of the order required by the merchant. - tags: - - Custom - parameters: - - name: partner_code - in: path - required: true - - name: client_report_id - in: path - required: true - responses: - 200: - description: Custom - content: - application/json: - schema: - $ref: 'components_order.yml#/customInfo' -components: - securitySchemes: - nonce_str: - type: apiKey - in: query - name: nonce_str - description: Random String - time: - type: apiKey - in: query - name: time - description: | - Unix Timestamp with millis. It is recommended to check your server time and timezone configuration. - You can calculate the UTC time according your server time & timezone and check if it was correct. - sign: - type: apiKey - in: query - name: sign - description: | - After merchants signed contract. They will get a `partner_code` and `credential_code` to make signatures. - `partner_code` is passed with requests. `credential_code` must be store safe in merchant side. it only used to make signatures. - - Each requests must add sign parameters as authentication. Sign params will tailed after request url as query param. And no sort is required. - - Signature progress: - - 1. Create origin string for validation. required 4 parameters and connect them with &. Translating is not required. - > valid_string=partner_code&time&nonce_str&credential_code - - 2. Use SHA256 to sign valid_string and get lowercased hex string - > sign=hex(sha256(valid_string)).toLowerCase() - - 3. Pass used `time`, `nonce_str` and generated `sign` as query parameter in requests. - - > Signature test address: https://mpay.royalpay.com.au/sign_test.html - - diff --git a/src/document/openapi/en/img/JSAPI_process_en.png b/src/document/openapi/en/img/JSAPI_process_en.png deleted file mode 100644 index e4b594dc9..000000000 Binary files a/src/document/openapi/en/img/JSAPI_process_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/QRCODE_process_en.png b/src/document/openapi/en/img/QRCODE_process_en.png deleted file mode 100644 index d1971039a..000000000 Binary files a/src/document/openapi/en/img/QRCODE_process_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/RetailQR_en.png b/src/document/openapi/en/img/RetailQR_en.png deleted file mode 100644 index 327ff2c93..000000000 Binary files a/src/document/openapi/en/img/RetailQR_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/Retail_en.png b/src/document/openapi/en/img/Retail_en.png deleted file mode 100644 index 3642c780f..000000000 Binary files a/src/document/openapi/en/img/Retail_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/RoyalPay_Gateway_choose_en.jpg b/src/document/openapi/en/img/RoyalPay_Gateway_choose_en.jpg deleted file mode 100644 index ab64eed40..000000000 Binary files a/src/document/openapi/en/img/RoyalPay_Gateway_choose_en.jpg and /dev/null differ diff --git a/src/document/openapi/en/img/UPayCardOrder_EN.jpg b/src/document/openapi/en/img/UPayCardOrder_EN.jpg deleted file mode 100644 index 3c02c26a8..000000000 Binary files a/src/document/openapi/en/img/UPayCardOrder_EN.jpg and /dev/null differ diff --git a/src/document/openapi/en/img/UPayCardPreOrder_EN.jpg b/src/document/openapi/en/img/UPayCardPreOrder_EN.jpg deleted file mode 100644 index a023d26f2..000000000 Binary files a/src/document/openapi/en/img/UPayCardPreOrder_EN.jpg and /dev/null differ diff --git a/src/document/openapi/en/img/alipayOnline_en.png b/src/document/openapi/en/img/alipayOnline_en.png deleted file mode 100644 index baf630a40..000000000 Binary files a/src/document/openapi/en/img/alipayOnline_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/h5_api_payment.jpg b/src/document/openapi/en/img/h5_api_payment.jpg deleted file mode 100644 index 7439c51f4..000000000 Binary files a/src/document/openapi/en/img/h5_api_payment.jpg and /dev/null differ diff --git a/src/document/openapi/en/img/jd_en.png b/src/document/openapi/en/img/jd_en.png deleted file mode 100644 index 83e785cc8..000000000 Binary files a/src/document/openapi/en/img/jd_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/logo_new.jpg b/src/document/openapi/en/img/logo_new.jpg deleted file mode 100644 index 41c02602a..000000000 Binary files a/src/document/openapi/en/img/logo_new.jpg and /dev/null differ diff --git a/src/document/openapi/en/img/microapp_en.png b/src/document/openapi/en/img/microapp_en.png deleted file mode 100644 index aabba0a10..000000000 Binary files a/src/document/openapi/en/img/microapp_en.png and /dev/null differ diff --git a/src/document/openapi/en/img/rp_logo.svg b/src/document/openapi/en/img/rp_logo.svg deleted file mode 100644 index d57a76e21..000000000 --- a/src/document/openapi/en/img/rp_logo.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/document/openapi/en/img/sdk_wechat_api_payment_en.png b/src/document/openapi/en/img/sdk_wechat_api_payment_en.png deleted file mode 100644 index 375240491..000000000 Binary files a/src/document/openapi/en/img/sdk_wechat_api_payment_en.png and /dev/null differ diff --git a/src/document/openapi/en/index.html b/src/document/openapi/en/index.html deleted file mode 100644 index 6b6d61ff8..000000000 --- a/src/document/openapi/en/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - RoyalPay Document - - - - - - - - - - - \ No newline at end of file diff --git a/src/document/openapi/resources/api/AlipayPlusAppIntegrationGuide.pdf b/src/document/openapi/resources/api/AlipayPlusAppIntegrationGuide.pdf deleted file mode 100644 index 844bbdc7d..000000000 Binary files a/src/document/openapi/resources/api/AlipayPlusAppIntegrationGuide.pdf and /dev/null differ diff --git a/src/document/openapi/resources/api/AlipaySDKForiOS.zip b/src/document/openapi/resources/api/AlipaySDKForiOS.zip deleted file mode 100644 index aad41e7b0..000000000 Binary files a/src/document/openapi/resources/api/AlipaySDKForiOS.zip and /dev/null differ diff --git a/src/document/openapi/resources/api/alipaySdk-20160825.jar b/src/document/openapi/resources/api/alipaySdk-20160825.jar deleted file mode 100644 index e74f32a0f..000000000 Binary files a/src/document/openapi/resources/api/alipaySdk-20160825.jar and /dev/null differ diff --git a/src/main/java/au/com/royalpay/payment/manage/ManagerPersistenceConfiguration.java b/src/main/java/au/com/royalpay/payment/manage/ManagerPersistenceConfiguration.java deleted file mode 100644 index fdf4efd7c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ManagerPersistenceConfiguration.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage; - -import com.yixsoft.support.mybatis.spring.annotation.MapperScanner; -import org.springframework.context.annotation.Configuration; - -/** - * Create by davep at 2020-03-17 16:53 - */ -@Configuration -@MapperScanner({".**.mapper", ".**.mappers"}) -public class ManagerPersistenceConfiguration { -} diff --git a/src/main/java/au/com/royalpay/payment/manage/PaymentManageApplication.java b/src/main/java/au/com/royalpay/payment/manage/PaymentManageApplication.java deleted file mode 100644 index c8f42a529..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/PaymentManageApplication.java +++ /dev/null @@ -1,88 +0,0 @@ -package au.com.royalpay.payment.manage; - -import au.com.royalpay.payment.tools.geo.GeoIPSupport; -import au.com.royalpay.payment.tools.geo.MaxmindGeoIPLite2Support; -import com.alibaba.fastjson.parser.ParserConfig; -import com.google.code.kaptcha.Producer; -import com.google.code.kaptcha.impl.DefaultKaptcha; -import com.google.code.kaptcha.util.Config; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.context.annotation.Bean; -import org.springframework.core.io.Resource; -import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.scheduling.annotation.EnableScheduling; - -import java.io.File; -import java.io.IOException; -import java.util.Properties; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -/** - * exclude = {DataSourceAutoConfiguration.class} - * 禁用springboot默认加载的application.properties单数据源配置 - */ -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) -@EnableScheduling -@EnableCaching(proxyTargetClass = true) -@EnableAsync -public class PaymentManageApplication { - - public static void main(String[] args) { - ParserConfig.getGlobalInstance().setAutoTypeSupport(true); - SpringApplication.run(PaymentManageApplication.class, args); - } - - - @Bean - public ScheduledExecutorService scheduledExecutorService(@Value("${app.tasks.pool-size:50}") int poolSize) { - return Executors.newScheduledThreadPool(poolSize); - } - - @Bean - public GeoIPSupport geoIPSupport(@Value("${app.geo.mmdb-file:''}") String datFile, @Value("classpath:data/geo/GeoLite2-City.mmdb") Resource mmdbFile) throws IOException { - try { - if (StringUtils.isNotEmpty(datFile) && new File(datFile).exists()) { - return new MaxmindGeoIPLite2Support(datFile); - } - } catch (IOException e) { - e.printStackTrace(); - } - return new MaxmindGeoIPLite2Support(mmdbFile); - } - - @Bean - public Producer producer() { - Properties properties = new Properties(); - properties.setProperty("kaptcha.border", "yes"); - properties.setProperty("kaptcha.border.color", "240,96,16"); -// properties.setProperty("kaptcha.textproducer.font.color","green"); - properties.setProperty("kaptcha.image.width", "80"); - properties.setProperty("kaptcha.image.height", "35"); - properties.setProperty("kaptcha.textproducer.font.size", "24"); - properties.setProperty("kaptcha.textproducer.font.names", "Arial"); - properties.setProperty("kaptcha.session.key", "code"); - properties.setProperty("kaptcha.textproducer.char.length", "4"); - properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise"); - properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy"); - Config config = new Config(properties); - - DefaultKaptcha producer = new DefaultKaptcha(); - producer.setConfig(config); - return producer; - } - - @Bean - public MongoClientSettingsBuilderCustomizer mongoOptions() { - return builder -> builder.applyToConnectionPoolSettings(config -> config.maxWaitTime(3, TimeUnit.SECONDS) - .maxConnectionIdleTime(6, TimeUnit.SECONDS) - ).applyToSocketSettings(config -> config.connectTimeout(3, TimeUnit.SECONDS)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/WebConfiguration.java b/src/main/java/au/com/royalpay/payment/manage/WebConfiguration.java deleted file mode 100644 index 26d4ad61a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/WebConfiguration.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage; - -import au.com.royalpay.payment.manage.permission.manager.ManagerUserInterceptor; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-06-24. - */ -@Configuration -public class WebConfiguration implements WebMvcConfigurer { - @Resource - private ManagerUserInterceptor managerUserInterceptor; - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(managerUserInterceptor).order(1); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/WebSocketConfig.java b/src/main/java/au/com/royalpay/payment/manage/WebSocketConfig.java deleted file mode 100644 index c4dde4311..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/WebSocketConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage; - -import au.com.royalpay.payment.tools.websocket.FastJsonSockJsMessageCodec; -import org.springframework.context.annotation.Configuration; -import org.springframework.messaging.simp.config.MessageBrokerRegistry; -import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; -import org.springframework.web.socket.config.annotation.StompEndpointRegistry; -import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; - -/** - * Created by yixian on 2016-07-01. - */ -@Configuration -@EnableWebSocketMessageBroker -public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { - @Override - public void configureMessageBroker(MessageBrokerRegistry registry) { - registry.enableSimpleBroker("/app"); - registry.setApplicationDestinationPrefixes("/application"); - } - - @Override - public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { - stompEndpointRegistry.addEndpoint("/register").setAllowedOrigins("*").withSockJS().setMessageCodec(new FastJsonSockJsMessageCodec()); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/beans/ActChairtyBean.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/beans/ActChairtyBean.java deleted file mode 100644 index aac44aefa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/beans/ActChairtyBean.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.actchairty.beans; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.time.DateUtils; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.Date; - -/** - * Created by yangluo on 2018/7/9. - */ -public class ActChairtyBean { - @JSONField(name = "date") - private String date; - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public java.util.Date toDate() { - try { - return DateUtils.parseDate(date, new String[]{"yyyy-MM-dd"}); - } catch (ParseException e) { - throw new BadRequestException("Invalid To Date"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/beans/ActChairtyQuery.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/beans/ActChairtyQuery.java deleted file mode 100644 index ee3f9340b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/beans/ActChairtyQuery.java +++ /dev/null @@ -1,75 +0,0 @@ -package au.com.royalpay.payment.manage.actchairty.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * redpack query - * Created by davep on 2016-08-03. - */ -public class ActChairtyQuery { - private static final String[] DATE_PATTERNS = {"yyyyMMdd", "yyyy-MM-dd"}; - private String begin; - private String end; - private int page = 1; - private int limit = 20; - - public JSONObject params() { - JSONObject param = new JSONObject(); - if (begin != null) { - try { - Date fromDate = DateUtils.parseDate(begin, DATE_PATTERNS); - param.put("begin", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - Date fromDate = DateUtils.addDays(DateUtils.parseDate(end, DATE_PATTERNS), 1); - param.put("end", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - param.put("page",page); - param.put("limit",limit); - return param; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java deleted file mode 100644 index e94e09f40..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.actchairty.core; - - -import au.com.royalpay.payment.manage.actchairty.beans.ActChairtyBean; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -/** - * Created by yangluo on 2018/7/9. - */ - -public interface ActChairtyService { - - void configClient(String clientMoniker, ActChairtyBean config, JSONObject manager); - - JSONObject listChairClients(int page, int limit); - - List getWeekendAnalysis(JSONObject params); - - PageList getClientRank(JSONObject params); - - JSONObject gettotal(); - - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java deleted file mode 100644 index 5bc61f09a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java +++ /dev/null @@ -1,144 +0,0 @@ -package au.com.royalpay.payment.manage.actchairty.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.actchairty.beans.ActChairtyBean; -import au.com.royalpay.payment.manage.actchairty.core.ActChairtyService; -import au.com.royalpay.payment.manage.mappers.act.ActChairtyMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * Created by yangluo on 2018/7/9. - */ -@Service -public class ActChairtyServiceImp implements ActChairtyService { - Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientManager clientManager; - @Resource - private ActChairtyMapper actChairtyMapper; - @Override - public void configClient(String clientMoniker, ActChairtyBean config, JSONObject manager) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject findChairty = actChairtyMapper.findChairtyClient(clientMoniker); - if (findChairty == null) { - JSONObject chairtyClient = new JSONObject(); - chairtyClient.put("client_id", client.get("client_id")); - chairtyClient.put("client_moniker", clientMoniker); - chairtyClient.put("active_time", config.toDate()); - actChairtyMapper.save(chairtyClient); - } - } - - @Override - public JSONObject listChairClients(int page, int limit) { - PageList clients = actChairtyMapper.chairtyClientNum(new PageBounds(page, limit)); - for (JSONObject client : clients){ - client.put("client_moniker", client.getString("client_moniker")); - client.put("active_time", DateFormatUtils.format(client.getDate("active_time"), "yyyy/MM/dd")); - BigDecimal bg = new BigDecimal(client.getIntValue("count_ordernum") * 0.01); - double f1 = bg.setScale(2, RoundingMode.HALF_UP).doubleValue(); - client.put("chairty_num", f1); - } - return PageListUtils.buildPageListResult(clients); - } - - @Override - public List getWeekendAnalysis(JSONObject params) { - List result = new ArrayList<>(); - List getAnalysis = actChairtyMapper.getChairtyWeekAnalysis(params.getDate("begin"), params.getDate("end")); - DateFormatUtils df = new DateFormatUtils(); - Calendar cal = Calendar.getInstance(); - cal.setTime(params.getDate("begin")); - cal.add(cal.DAY_OF_MONTH, -1); - long beginTime = params.getDate("begin").getTime(); - long endTime = params.getDate("end").getTime(); - long betweenDays = (long)((endTime - beginTime) / (1000 * 60 * 60 *24)); - List weekStart = new ArrayList<>(); - for(int i=0;i<=betweenDays;i++){ - cal.add(cal.DAY_OF_MONTH, 1);//DATE=日 - if ((cal.get(Calendar.DAY_OF_WEEK)) == 2) { - weekStart.add(df.format(cal.getTime(),"yyyy-MM-dd")); - } - } - for(int i=0;i= dateStar.getTime() && orderDate < dateEnd.getTime()) { - count_ordernum = count_ordernum.add(getAnalysis.get(b).getBigDecimal("count_ordernum")); - sum_ordernum = sum_ordernum.add(getAnalysis.get(b).getBigDecimal("sum_ordernum")); - } - } - BigDecimal chairty = new BigDecimal(0.01); - BigDecimal chairty_amount = count_ordernum.multiply(chairty); - BigDecimal f1 = sum_ordernum.setScale(2, RoundingMode.HALF_UP); - BigDecimal f2 = chairty_amount.setScale(2, RoundingMode.HALF_UP); - weekDay.put("weekstart", weekStart.get(i)); - weekDay.put("count_ordernum", count_ordernum); - weekDay.put("sum_ordernum", f1); - weekDay.put("chairty_amount", f2); - result.add(weekDay); - } catch (Exception e) { - logger.info("Act_Chairty Error:",e); - - } - } - - return result; - } - - @Override - public PageList getClientRank(JSONObject params) { - PageList getChairtyWeekRaking = actChairtyMapper.getChairtyWeekRaking(params.getDate("begin"), params.getDate("end"),new PageBounds(params.getIntValue("page"), params.getIntValue("limit"))); - return getChairtyWeekRaking; - } - - @Override - public JSONObject gettotal() { - List gettotalnum = actChairtyMapper.chairtyClientNum(); - BigDecimal amount = new BigDecimal(0); - double chairty = 0.00; - for (JSONObject gettotals : gettotalnum) { - amount = amount.add(gettotals.getBigDecimal("sum_ordernum")); - chairty += gettotals.getIntValue("count_ordernum") * 0.01; - } - BigDecimal bg = new BigDecimal(chairty); - double f1 = amount.setScale(2, RoundingMode.HALF_UP).doubleValue(); - double f2 = bg.setScale(2, RoundingMode.HALF_UP).doubleValue(); - JSONObject gettotal = new JSONObject(); - gettotal.put("amount", f1); - gettotal.put("chairty", f2); - return gettotal; - } - - - -} - - diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/web/ActChairtyController.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/web/ActChairtyController.java deleted file mode 100644 index 5535f93e6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/web/ActChairtyController.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.actchairty.web; - -import au.com.royalpay.payment.manage.actchairty.beans.ActChairtyBean; -import au.com.royalpay.payment.manage.actchairty.beans.ActChairtyQuery; -import au.com.royalpay.payment.manage.actchairty.core.ActChairtyService; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.management.clearing.core.SettleDelayConfigurer; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.List; - -/** - * Created by yangluo on 2018/7/9. - */ - -@RequestMapping(value = "/actchairty") -@RestController -public class ActChairtyController { - @Resource - private ActChairtyService actChairtyService; - - @ManagerMapping(value = "/clients", method = RequestMethod.GET, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER }) - public JSONObject listAttendingClients(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) { - // todo params - return actChairtyService.listChairClients(page, limit); - } - - @ManagerMapping(value = "/clients/{clientMoniker}", method = RequestMethod.PUT, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER }) - public void configClient(@PathVariable String clientMoniker, @RequestBody @Valid ActChairtyBean config, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - actChairtyService.configClient(clientMoniker, config, manager); - } - - @ManagerMapping(value = "/traAnalysis", method = RequestMethod.GET, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER }) - public List traAnalysis(ActChairtyQuery params) { - return actChairtyService.getWeekendAnalysis(params.params()); - } - @ManagerMapping(value = "/ranking", method = RequestMethod.GET, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER }) - public JSONObject getRanking(ActChairtyQuery params) { - PageList clientRank = actChairtyService.getClientRank(params.params()); - if(clientRank==null){ - return null; - } - return PageListUtils.buildPageListResult(clientRank); - } - - @ManagerMapping(value = "/total", method = RequestMethod.GET, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER }) - public JSONObject getTotal() { - return actChairtyService.gettotal(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java deleted file mode 100644 index 1624e71b3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.activities.app_index.beans; - -/** - * Created by yuan on 2018/3/23. - */ -public enum ActAppShowPlaceEnum { - App(1), - Banner(10), - List(100); - private int place; - - private ActAppShowPlaceEnum(int placeValue) { - this.place = placeValue; - } - - public int getPlace() { - return this.place; - } - - public boolean hasPlace(int placeValue) { - return (this.place & placeValue) > 0; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java deleted file mode 100644 index aca4ea5e8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java +++ /dev/null @@ -1,123 +0,0 @@ -package au.com.royalpay.payment.manage.activities.app_index.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * Created by yuan on 2018/3/14. - */ -public class AppActBean { - private static final String[] DATE_PATTERNS = {"yyyy-MM-dd"}; - private String act_name; - private String act_url; - private boolean is_valid = true; - private String show_type; - private String act_img; - private String active_date; - private String expire_date; - private String partner_black_list; - - - public JSONObject toJsonParam(){ - JSONObject params = new JSONObject(); - params.put("act_name",act_name); - params.put("act_url",act_url); - params.put("show_type",show_type); - params.put("act_img",act_img); - params.put("is_valid",is_valid); - params.put("partner_black_list", partner_black_list); - if (active_date != null) { - try { - Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS); - params.put("active_date", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("active_date", "error.payment.valid.invalid_date_format"); - } - } - if (expire_date != null) { - try { - Date fromDate = DateUtils.parseDate(expire_date, DATE_PATTERNS); - params.put("expire_date", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format"); - } - } - return params; - } - - public String getAct_name() { - return act_name; - } - - public void setAct_name(String act_name) { - this.act_name = act_name; - } - - public String getAct_url() { - return act_url; - } - - public void setAct_url(String act_url) { - this.act_url = act_url; - } - - public String getAct_img() { - return act_img; - } - - public void setAct_img(String act_img) { - this.act_img = act_img; - } - - public String getShow_type() { - return show_type; - } - - public void setShow_type(String show_type) { - this.show_type = show_type; - } - - public Boolean getIs_valid() { - return is_valid; - } - - public void setIs_valid(Boolean is_valid) { - this.is_valid = is_valid; - } - - public String getActive_date() { - return active_date; - } - - public void setActive_date(String active_date) { - this.active_date = active_date; - } - - public String getExpire_date() { - return expire_date; - } - - public void setExpire_date(String expire_date) { - this.expire_date = expire_date; - } - - public boolean isIs_valid() { - return is_valid; - } - - public void setIs_valid(boolean is_valid) { - this.is_valid = is_valid; - } - - public String getPartner_black_list() { - return partner_black_list; - } - - public void setPartner_black_list(String partner_black_list) { - this.partner_black_list = partner_black_list; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActQueryBean.java deleted file mode 100644 index c0447207a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActQueryBean.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.activities.app_index.beans; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; - -/** - * Created by yuan on 2018/3/15. - */ -public class AppActQueryBean { - private boolean is_valid; - private int page = 1; - private int limit = 10; - - public JSONObject toJsonParam(){ - JSONObject params = new JSONObject(); - if(is_valid){ - params.put("is_valid",is_valid); - } - return params; - } - - public boolean isIs_valid() { - return is_valid; - } - - public void setIs_valid(boolean is_valid) { - this.is_valid = is_valid; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java deleted file mode 100644 index 2788d7340..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.activities.app_index.core; - -import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; -import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -public interface AppActService { - - List listAppActs(); - - JSONObject getAppActPopup(); - - JSONObject newAppAct(JSONObject manager, AppActBean appActBean); - - PageList listAppActs(JSONObject manager, AppActQueryBean appActQueryBean); - - JSONObject getActDetail(JSONObject manager,String act_id); - - void updateAct(JSONObject manager,String act_id,AppActBean appActBean); - - JSONObject getLatestWindowNotice(); - - void published(JSONObject manager,String act_id,boolean is_valid); - - void sendAnnualBillMessage(JSONObject params); - - void sendTESTAnnualBillMessage(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java deleted file mode 100644 index db4721661..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java +++ /dev/null @@ -1,239 +0,0 @@ -package au.com.royalpay.payment.manage.activities.app_index.core.impls; - -import au.com.royalpay.payment.manage.activities.app_index.beans.ActAppShowPlaceEnum; -import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; -import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; -import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; -import au.com.royalpay.payment.manage.mappers.act.ActAppMapper; -import au.com.royalpay.payment.manage.mappers.log.AppMessageLogMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper; -import au.com.royalpay.payment.manage.pushMessage.APNSMessageHelper; -import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; -import au.com.royalpay.payment.manage.riskbusiness.core.impl.RiskBusinessServiceImpl; -import au.com.royalpay.payment.tools.device.message.AppMessage; -import au.com.royalpay.payment.tools.device.message.AppMsgSender; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.util.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -@Service -public class AppActServiceImp implements AppActService { - - private Logger logger = LoggerFactory.getLogger(RiskBusinessServiceImpl.class); - - @Resource - private ActAppMapper actAppMapper; - - @Resource - private ClientDeviceTokenMapper clientDeviceTokenMapper; - @Resource - private AppMessageLogMapper appMessageLogMapper; - - private Map senderMap = new HashMap<>(); - - @Resource - private APNSMessageHelper apnsMessageHelper; - - @Resource - public void setAppMsgSenders(AppMsgSender[] senders) { - Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender)); - } - - private ThreadPoolExecutor sendingAppleMsgPool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - - @Override - public List listAppActs(){ -// List list = actAppMapper.listActs(); -// for (JSONObject act:list){ -// String url = act.getString("act_url"); -// act.put("act_url", PlatformEnvironment.getEnv().concatUrl(url)); -// } - return new ArrayList<>(); - } - - @Override - public JSONObject getAppActPopup(){ - JSONObject appActPopup = actAppMapper.getAppActPopup(); - if (appActPopup == null) { - return null; - } - int appLinkType = appActPopup.getIntValue("show_type"); - switch (appLinkType) { - case 1: - appActPopup.put("link_type", "webview"); - break; - case 2: - appActPopup.put("link_type", "app_route"); - break; - default: - break; - } - return appActPopup; - } - - @Override - public PageList listAppActs(JSONObject manager, AppActQueryBean appActQueryBean){ - JSONObject params = appActQueryBean.toJsonParam(); - return actAppMapper.listAppActs(params,new PageBounds(appActQueryBean.getPage(), appActQueryBean.getLimit(), Order.formString("create_time.desc"))); - } - - @Override - public JSONObject getActDetail(JSONObject manager, String act_id) { - JSONObject appAct = actAppMapper.getActDetail(act_id); - int show_place = appAct.getIntValue("show_place"); - appAct.put("app", ActAppShowPlaceEnum.App.hasPlace(show_place)); - appAct.put("banner", ActAppShowPlaceEnum.Banner.hasPlace(show_place)); - appAct.put("list", ActAppShowPlaceEnum.List.hasPlace(show_place)); - return appAct; - } - - @Override - public void updateAct(JSONObject manager, String act_id, AppActBean appActBean) { - JSONObject act = actAppMapper.getActDetail(act_id); - Assert.notNull(act); - JSONObject params = appActBean.toJsonParam(); - params.put("act_id",act_id); - params.put("update_time",new Date()); - actAppMapper.updateAct(params); - } - - @Override - public JSONObject getLatestWindowNotice() { - return actAppMapper.getLatestWindowNotice(new Date()); - } - - @Override - public JSONObject newAppAct(JSONObject manager, AppActBean appActBean) { - JSONObject params = appActBean.toJsonParam(); - params.put("create_time",new Date()); - actAppMapper.newAppAct(params); - return params; - } - - @Override - public void published(JSONObject manager, String act_id, boolean is_valid) { - JSONObject params = new JSONObject(); - params.put("act_id",act_id); - params.put("is_valid",is_valid); - params.put("update_time",new Date()); - actAppMapper.updateAct(params); - } - - @Override - public void sendAnnualBillMessage(JSONObject params) { - logger.debug("sendAnnualMessage Begin"); - List tokens = clientDeviceTokenMapper.listAllTokens(params); - for (JSONObject devToken : tokens) { - Runnable task = () -> { - String token = devToken.getString("token"); -// token = "c271fec4_be51_4ba5_b368_48d113626911"; -// devToken.put("client_type", "android"); -// devToken.put("token", token); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), - devToken.getIntValue("client_id"), - "annual_bill" + devToken.getString("client_type"), - token, - "年度账单" - ); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "annual_bill"); - type.put("id", devToken.getString("dev_token_id")); - AppMsgSender sender = senderMap.get((devToken.getString("client_type"))); - if (StringUtils.isBlank(token) || sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.annual_bill")); - managerMsg.put("body", LocaleSupport.localeMessage("app.message.body.annual_bill")); - managerMsg.put("type", type); - JSONObject messageData = new JSONObject(); - messageData.put("url", PlatformEnvironment.getEnv().concatUrl("/annual_bill.html")); - System.out.println(PlatformEnvironment.getEnv().concatUrl("/annual_bill.html")); - managerMsg.put("data", messageData); - managerMsg.put("msgType", "annual_bill"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:" + e.getMessage()); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App" + devToken.getString("client_type") + "Filed" + ",token" + token, e); - } - }; - sendingAppleMsgPool.execute(task); - } - } - - @Override - public void sendTESTAnnualBillMessage(JSONObject params) { - logger.debug("sendAnnualMessage Begin"); - JSONObject devToken = clientDeviceTokenMapper.getTestTokens(); - Runnable task = () -> { - String token = devToken.getString("token"); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), - devToken.getIntValue("client_id"), - "annual_bill" + devToken.getString("client_type"), - token, - "年度账单" - ); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "annual_bill"); - type.put("id", devToken.getString("dev_token_id")); - AppMsgSender sender = senderMap.get((devToken.getString("client_type"))); - if (StringUtils.isBlank(token) || sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.annual_bill")); - managerMsg.put("body", LocaleSupport.localeMessage("app.message.body.annual_bill")); - managerMsg.put("type", type); - JSONObject messageData = new JSONObject(); - messageData.put("url", PlatformEnvironment.getEnv().concatUrl("/annual_bill.html")); - System.out.println(PlatformEnvironment.getEnv().concatUrl("/annual_bill.html")); - managerMsg.put("data", messageData); - managerMsg.put("msgType", "annual_bill"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:" + e.getMessage()); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App" + devToken.getString("client_type") + "Filed" + ",token" + token, e); - } - }; - sendingAppleMsgPool.execute(task); - } - - private JSONObject saveAppMessageLog(String dev_id, int client_id, String messageType, String dev_token, String remark) { - JSONObject log = new JSONObject(); - log.put("dev_id", dev_id); - log.put("client_id", client_id); - log.put("msg_type", messageType); - log.put("dev_token", dev_token); - log.put("remark", remark); - log.put("send_time", new Date()); - appMessageLogMapper.save(log); - return log; - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java deleted file mode 100644 index e42411c2f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.activities.app_index.web; - -import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; -import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; -import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/manager/app/act") -public class AppActController { - - @Autowired - private AppActService appActService; - - @ManagerMapping(value = "/list",method = RequestMethod.GET,role = ManagerRole.SITE_MANAGER) - public JSONObject getAppActList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, AppActQueryBean appActQueryBean){ - PageList appActList = appActService.listAppActs(manager,appActQueryBean); - return PageListUtils.buildPageListResult(appActList); - } - - @ManagerMapping(value = "/{act_id}/act_detail",method = RequestMethod.GET,role = ManagerRole.SITE_MANAGER) - public JSONObject getAppActDetail(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id){ - return appActService.getActDetail(manager,act_id); - } - - @ManagerMapping(method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) - public JSONObject newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){ - return appActService.newAppAct(manager,appActBean); - } - @ManagerMapping(value = "/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) - public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){ - appActService.updateAct(manager,act_id,appActBean); - } - - @ManagerMapping(value = "/published/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) - public void publishedAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody boolean is_valid){ - appActService.published(manager,act_id,is_valid); - } - - @GetMapping(value = "/annual/bill/test") - public String testSendAnnualBillMessage() { - JSONObject params = new JSONObject(); - params.put("client_id", 9); - appActService.sendTESTAnnualBillMessage(params); - return "success"; - } - -// @GetMapping(value = "/annual/bill/all") -// public String sendAnnualBillMessage() { -// appActService.sendAnnualBillMessage(null); -// return "success"; -// } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/beans/MerchantInfo.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/beans/MerchantInfo.java deleted file mode 100644 index 8a114e561..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/beans/MerchantInfo.java +++ /dev/null @@ -1,112 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -/** - * Created by yixian on 2017-03-26. - */ -public class MerchantInfo { - private String address; - @JSONField(name = "work_time") - private String worktime; - private String desc; - @JSONField(name = "shop_img") - private String shopImg; - @JSONField(name = "img_id") - private String imgId; - private String city; - @JSONField(name = "pay_url") - private String payUrl; - @JSONField(name = "display_name") - private String displayName; - private String tel; - - public JSONObject toJSON() { - return (JSONObject) JSONObject.toJSON(this); - } - - public JSONObject mergeJson(JSONObject attend) { - attend.put("address", getAddress()); - attend.put("work_time", getWorktime()); - attend.put("desc", getDesc()); - attend.put("shop_img", getShopImg()); - attend.put("city", getCity()); - attend.put("pay_url", getPayUrl()); - attend.put("display_name", getDisplayName()); - attend.put("tel", getTel()); - return attend; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getWorktime() { - return worktime; - } - - public void setWorktime(String worktime) { - this.worktime = worktime; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getShopImg() { - return shopImg; - } - - public void setShopImg(String shopImg) { - this.shopImg = shopImg; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getPayUrl() { - return payUrl; - } - - public void setPayUrl(String payUrl) { - this.payUrl = payUrl; - } - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public String getTel() { - return tel; - } - - public void setTel(String tel) { - this.tel = tel; - } - - public String getImgId() { - return imgId; - } - - public void setImgId(String imgId) { - this.imgId = imgId; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/core/OneDollarDayActivity.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/core/OneDollarDayActivity.java deleted file mode 100644 index 714da4bcc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/core/OneDollarDayActivity.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.core; - -import au.com.royalpay.payment.manage.activities.diet.beans.MerchantInfo; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-03-21. - */ -public interface OneDollarDayActivity { - JSONObject findMerchant(String city, String clientMoniker); - - JSONObject listMerchants(String city, String name, int page, int limit); - - void updateMerchant(String clientMoniker, MerchantInfo merchantInfo); - - JSONObject listMerchantsDetail(); - - List listMerchantsAnalysis(String city); - - List getTransactionAnalysis(JSONObject params); - - List getSubsidyInDays(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/core/impls/OneDollarDayActivitySupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/core/impls/OneDollarDayActivitySupportImpl.java deleted file mode 100644 index ce531dd09..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/core/impls/OneDollarDayActivitySupportImpl.java +++ /dev/null @@ -1,301 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.core.impls; - -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.beans.PaymentQueryResult; -import au.com.royalpay.payment.core.beans.PreOrderRequest; -import au.com.royalpay.payment.core.beans.coupon.CashCouponInfo; -import au.com.royalpay.payment.core.beans.coupon.CouponInfo; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.core.events.RefundSendEvent; -import au.com.royalpay.payment.core.processors.PaymentProcessor; -import au.com.royalpay.payment.manage.activities.diet.beans.MerchantInfo; -import au.com.royalpay.payment.manage.activities.diet.core.OneDollarDayActivity; -import au.com.royalpay.payment.manage.mappers.act.ActDietAttendMapper; -import au.com.royalpay.payment.manage.mappers.act.ActDietOrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.merchants.beans.TransactionBizSubType; -import au.com.royalpay.payment.tools.utils.Currency; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.TimeZone; - -/** - * Created by yixian on 2017-03-21. - */ -@Service -public class OneDollarDayActivitySupportImpl implements OneDollarDayActivity, PaymentProcessor { - - private static final String processorId = "one_dollar_diet"; - private static final BigDecimal MIN_PAY = BigDecimal.valueOf(9.99); - private static final BigDecimal DISCOUNT_AMOUNT = BigDecimal.ONE; - @Resource - private ActDietAttendMapper actDietAttendMapper; - @Resource - private ActDietOrderMapper actDietOrderMapper; - @Resource - private TransactionService transactionService; - @Resource - private MpPaymentApi mpPaymentApi; - @Resource - private OrderMapper orderMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClientManager clientManager; - @Resource - private AttachmentClient attachmentClient; - - @Override - public String processorId() { - return processorId; - } - - @Override - public void handleBeforeOrderSending(PreOrderRequest paymentInfo, JSONObject order) { - if (!checkWeekEnabled()) { - return; - } - int clientId = paymentInfo.getClientId(); - - if (isClientActive(clientId)) { - String orderId = paymentInfo.getOrderId(); - JSONObject dietOrderInfo = new JSONObject(); - dietOrderInfo.put("order_id", orderId); - dietOrderInfo.put("client_id", paymentInfo.getClientId()); - Currency currency = paymentInfo.getCurrency(); - dietOrderInfo.put("order_currency", currency); - BigDecimal totalFee = paymentInfo.getTotalFee(); - BigDecimal payAmount = totalFee.divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN); - BigDecimal payLocalCurrency = paymentInfo.getDisplayAmount().divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN); - if (currency != Currency.AUD) { - BigDecimal exchange = mpPaymentApi.queryExchangeRateDecimal(clientId); - payLocalCurrency = payLocalCurrency.divide(exchange, 2, RoundingMode.DOWN); - } - if (payLocalCurrency.compareTo(MIN_PAY) <= 0) { - return; - } - BigDecimal discount; - dietOrderInfo.put("order_amount", totalFee.divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN)); - if (currency != Currency.AUD) { - BigDecimal exchange = mpPaymentApi.queryExchangeRateDecimal(clientId); - discount = DISCOUNT_AMOUNT.multiply(exchange).setScale(2, RoundingMode.DOWN); - } else { - discount = DISCOUNT_AMOUNT; - } - if (discount.compareTo(totalFee) > 0) { - return; - } - BigDecimal discountOrigin = paymentInfo.getDiscount(); - paymentInfo.setDiscount(discountOrigin.add(discount)); - JSONObject updateOrder = new JSONObject(); - BigDecimal customerPay = payAmount.subtract(discount).setScale(2, RoundingMode.DOWN); - updateOrder.put("customer_payment_amount", customerPay); - updateOrder.put("coupon_payment_amount", discount); - updateOrder.put("order_id", orderId); - orderMapper.update(updateOrder); - dietOrderInfo.put("pay_amount", customerPay); - dietOrderInfo.put("append_amount", DISCOUNT_AMOUNT); - dietOrderInfo.put("append_currency", "AUD"); - dietOrderInfo.put("create_time", new Date()); - actDietOrderMapper.save(dietOrderInfo); - } - } - - private boolean isClientActive(int clientId) { - Date today = new Date(); - today = DateUtils.truncate(today, Calendar.DATE); - - JSONObject clientAttend = actDietAttendMapper.findClientAttend(clientId + ""); - return clientAttend != null && !clientAttend.getDate("active_time").after(today); - } - - private boolean checkWeekEnabled() { - int weekDay = sysConfigManager.getSysConfig().getIntValue("activity_one_dollar_diet_weekday"); - return new DateTime().getDayOfWeek() == weekDay; - } - - @Override - public void handleAfterOrderPaid(PaymentFinishedEvent finishedEvent) { - JSONObject order = finishedEvent.getOrder(); - String orderId = order.getString("order_id"); - JSONObject dietOrderInfo = actDietOrderMapper.findOrder(orderId); - if (dietOrderInfo == null || dietOrderInfo.getString("transaction_id") != null) { - return; - } - JSONObject log = new JSONObject(); - log.put("system_transaction_id", orderId); - log.put("client_id", order.getIntValue("client_id")); - log.put("order_id", order.getString("order_id")); - BigDecimal amount = dietOrderInfo.getBigDecimal("append_amount"); - String currency = dietOrderInfo.getString("append_currency"); - log.put("transaction_currency", currency); - log.put("transaction_amount", amount); - log.put("org_id", order.getIntValue("org_id")); - log.put("exchange_rate", finishedEvent.getExchangeRate()); - log.put("clearing_currency", currency); - log.put("clearing_amount", amount); - log.put("system_generate", 1); - log.put("channel", "Wechat"); - log.put("transaction_type", "Credit"); - PaymentQueryResult paymentQueryResult = finishedEvent.getPaymentQueryResult(); - SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); - format.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); - log.put("transaction_time", format.format(paymentQueryResult.getPayTime())); - log.put("clearing_status", 0); - log.put("remark", "Activity: Day Of One Dollar"); - transactionService.saveTransaction(log, TransactionBizSubType.COUPON_PAY); - String transactionId = log.getString("transaction_id"); - actDietOrderMapper.setTransactionId(orderId, transactionId, log.getDate("transaction_time")); - } - - @Override - public void registerCoupon(JSONObject client, String customerOpenId, String channel, List coupons) { - if (!checkWeekEnabled()) { - return; - } - if (!isClientActive(client.getIntValue("client_id"))) { - return; - } - if (!"Wechat".equals(channel)) { - return; - } - CouponInfo coupon = new CashCouponInfo("one_dollar_day", "餐饮商户特惠日立减优惠", processorId(), "每周二微信支付买单立减一澳币(满10澳币)", MIN_PAY, DISCOUNT_AMOUNT, true); - coupons.add(coupon); - } - - @Override - public void handleAfterRefund(RefundSendEvent event) { - JSONObject refund = event.getRefundOrder(); - String orderId = refund.getString("order_id"); - JSONObject dietOrderInfo = actDietOrderMapper.findOrder(orderId); - if (dietOrderInfo == null) { - return; - } - if (dietOrderInfo.getString("refund_transaction") != null) { - return; - } - JSONObject log = new JSONObject(); - log.put("system_transaction_id", orderId); - int clientId = refund.getIntValue("client_id"); - log.put("client_id", clientId); - log.put("order_id", orderId); - log.put("refund_id", refund.getString("refund_id")); - BigDecimal amount = dietOrderInfo.getBigDecimal("append_amount"); - String currency = dietOrderInfo.getString("order_currency"); - log.put("transaction_currency", currency); - log.put("transaction_amount", amount); - log.put("org_id", refund.getIntValue("org_id")); - log.put("exchange_rate", mpPaymentApi.queryExchangeRateDecimal(clientId)); - log.put("clearing_currency", currency); - log.put("clearing_amount", amount); - log.put("system_generate", 1); - log.put("channel", "Wechat"); - log.put("transaction_type", "Debit"); - log.put("transaction_time", new Date()); - log.put("clearing_status", 0); - log.put("remark", "Activity Refund: Day Of One Dollar"); - transactionService.saveTransaction(log,TransactionBizSubType.COUPON_REFUND); - - actDietOrderMapper.updateRefund(orderId, log.getString("transaction_id"), log.getDate("transaction_time")); - } - - @Override - public String registerBanner(JSONObject client, String channel) { - return null; - } - - - @Override - public JSONObject findMerchant(String city, String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Merchant Not Found"); - } - JSONObject attendInfo = actDietAttendMapper.findClientAttend(client.getString("client_id")); - attendInfo.put("client_moniker", clientMoniker); - attendInfo.put("short_name", client.getString("short_name")); - if (!city.equals(attendInfo.getString("city"))) { - throw new NotFoundException("Merchant Not Found"); - } - fillPayUrl(attendInfo); - return attendInfo; - } - - @Override - public JSONObject listMerchants(String city, String name, int page, int limit) { - PageList merchants = actDietAttendMapper.listMerchants(city, name, new PageBounds(page, limit, Order.formString("active_time.asc"))); - return PageListUtils.buildPageListResult(merchants); - } - - private void fillPayUrl(JSONObject merchant) { - if (StringUtils.isEmpty(merchant.getString("pay_url"))) { - merchant.put("pay_url", "/api/payment/v1.0/wechat_jsapi_payment/partners/" + merchant.getString("client_moniker") + "_ext_customerrate"); - } - } - - @Override - public void updateMerchant(String clientMoniker, MerchantInfo merchantInfo) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client Not Found"); - } - if (merchantInfo.getImgId() != null) { - JSONObject thumbnail = attachmentClient.getThumbnail(merchantInfo.getImgId(), 400); - merchantInfo.setShopImg(thumbnail.getString("url")); - } - JSONObject attend = actDietAttendMapper.findClientAttend(client.getString("client_id")); - if (attend == null) { - - attend = merchantInfo.toJSON(); - attend.put("client_id", client.getString("client_id")); - attend.put("active_time", new Date()); - actDietAttendMapper.save(attend); - } else { - attend = merchantInfo.mergeJson(attend); - actDietAttendMapper.update(attend); - } - } - - @Override - public JSONObject listMerchantsDetail() { - PageList merchants = actDietAttendMapper.listMerchantsDetail(new PageBounds(Order.formString("active_time.asc"))); - return PageListUtils.buildPageListResult(merchants); - } - - @Override - public List listMerchantsAnalysis(String city) { - return actDietAttendMapper.listMerchantsAnalysis(city); - } - - @Override - public List getTransactionAnalysis(JSONObject params) { - return actDietAttendMapper.listTransactionAnalysis(params); - } - - @Override - public List getSubsidyInDays(JSONObject params) { - return actDietOrderMapper.getAppendAmountInDays(params); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/package-info.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/package-info.java deleted file mode 100644 index f3671d061..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 食在有理 - * Created by yixian on 2017-03-21. - */ -package au.com.royalpay.payment.manage.activities.diet; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayActivityController.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayActivityController.java deleted file mode 100644 index 75b0fe498..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayActivityController.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.web; - -import au.com.royalpay.payment.manage.activities.diet.core.OneDollarDayActivity; -import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-03-25. - */ -@RestController -@RequestMapping("/activities/one_dollar_day") -public class OneDollarDayActivityController { - @Resource - private OneDollarDayActivity oneDollarDayActivity; - - @WechatMapping(value = "/merchants", method = RequestMethod.GET, addonMp = {KangaLandWechatApiImpl.class}) - public ModelAndView merchantsView() { - return new ModelAndView("activity/one_dollar_day/merchants"); - } - - @WechatMapping(value = "/cities/{city}/merchants/{clientMoniker}", method = RequestMethod.GET, addonMp = {KangaLandWechatApiImpl.class}) - public ModelAndView merchantDetailView(@PathVariable String city, @PathVariable String clientMoniker) { - ModelAndView mav = new ModelAndView("activity/one_dollar_day/merchant_detail"); - JSONObject merchant = oneDollarDayActivity.findMerchant(city, clientMoniker); - mav.addObject("merchant", merchant); - return mav; - } - - @GetMapping("/merchant_list") - public JSONObject listMerchants(@RequestParam(required = false) String city, @RequestParam(required = false) String name, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "15") int limit) { - return oneDollarDayActivity.listMerchants(city, name, page, limit); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayAnalysisController.java deleted file mode 100644 index 38a325329..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayAnalysisController.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.web; - -import au.com.royalpay.payment.manage.activities.diet.core.OneDollarDayActivity; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -/** - * Created by yishuqian on 05/04/2017. - */ -@RestController -@ManagerMapping("/activities/one_dollar_day/analysis") -public class OneDollarDayAnalysisController { - @Resource - private OneDollarDayActivity oneDollarDayActivity; - - @GetMapping("/merchant_list") - public List listMerchants(@RequestParam(required = false) String city) { - return oneDollarDayActivity.listMerchantsAnalysis(city); - } - - /** - * @RequestParam(required = false) String city, @RequestParam(required = false) String name, - @RequestParam(required = false) String begin,@RequestParam(required = false) String end - * @return - */ - @GetMapping("/transaction_analysis") - public List transaction_analysis(@RequestParam Map map) { - JSONObject params = JSON.parseObject(JSON.toJSONString(map)); - return oneDollarDayActivity.getTransactionAnalysis(params); - } - - @GetMapping("/subsidy") - public List transaction_subsidy(@RequestParam Map map) { - JSONObject params = JSON.parseObject(JSON.toJSONString(map)); - return oneDollarDayActivity.getSubsidyInDays(params); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayManageController.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayManageController.java deleted file mode 100644 index afccdda79..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayManageController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.web; - -import au.com.royalpay.payment.manage.activities.diet.beans.MerchantInfo; -import au.com.royalpay.payment.manage.activities.diet.core.OneDollarDayActivity; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-03-26. - */ -@RestController -@ManagerMapping(value = "/manage/activities/one_dollar_day", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) -public class OneDollarDayManageController { - @Resource - private OneDollarDayActivity oneDollarDayActivity; - - @GetMapping("/merchants") - public JSONObject listMerchants() { - return oneDollarDayActivity.listMerchantsDetail(); - } - - @PutMapping("/merchants/{clientMoniker}") - public void updateMerchant(@PathVariable String clientMoniker, @RequestBody MerchantInfo merchantInfo) { - oneDollarDayActivity.updateMerchant(clientMoniker, merchantInfo); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayMerchantBindController.java b/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayMerchantBindController.java deleted file mode 100644 index afda89e93..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/diet/web/OneDollarDayMerchantBindController.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.activities.diet.web; - -import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; - -/** - * Created by yixian on 2017-04-07. - */ -@Controller -@WechatMapping(value = "/manage/activities/one_dollar_day", addonMp = {RedpackWechatApiImpl.class}, oauthType = WxOauthType.USERINFO) -public class OneDollarDayMerchantBindController { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @GetMapping("/merchant_bind") - public String bindMerchantUser(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) { - logger.info("one_dollar_day_wechat_bind---------->{}", user); - return "templates/activity/one_dollar_day/merchant_bind"; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/beans/MonDelayBean.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/beans/MonDelayBean.java deleted file mode 100644 index 50bed1a12..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/beans/MonDelayBean.java +++ /dev/null @@ -1,85 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * Created by yuan on 2018/3/13. - */ -public class MonDelayBean { - private static final String[] DATE_PATTERNS = {"yyyyMMdd", "yyyy-MM-dd"}; - private String client_moniker; - private String begin; - private String end; - private int page = 1; - private int limit = 10; - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(client_moniker)) { - param.put("client_moniker", client_moniker); - } - if (begin != null) { - try { - Date fromDate = DateUtils.parseDate(begin, DATE_PATTERNS); - param.put("begin", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - Date fromDate = DateUtils.addDays(DateUtils.parseDate(end, DATE_PATTERNS), 1); - param.put("end", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - return param; - } - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/ActMonDelaySettleManagerService.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/ActMonDelaySettleManagerService.java deleted file mode 100644 index 5ebfd020e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/ActMonDelaySettleManagerService.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.core; - -import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -/** - * Created by yuan on 2018/3/13. - */ -public interface ActMonDelaySettleManagerService { - JSONObject listAttendingClients(JSONObject manager, MonDelayBean monDelayBean); - - //void disableClient(String clientMoniker); - - PageList getMonDelayClientRank(JSONObject manager,MonDelayBean monDelayBean); - - List getWeekendAnalysis(JSONObject manager,MonDelayBean monDelayBea); - - JSONObject analysisCashback(JSONObject manager,MonDelayBean monDelayBean); - - PageList clientRedPackList(JSONObject manager,MonDelayBean monDelayBean,String clientMoniker); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/ActMonDelaySettleService.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/ActMonDelaySettleService.java deleted file mode 100644 index c6e50f780..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/ActMonDelaySettleService.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.core; - -import com.alibaba.fastjson.JSONObject; - -public interface ActMonDelaySettleService { - JSONObject getActNotice(JSONObject device); - - JSONObject getActDetail(JSONObject device); - - void actApply(JSONObject device); - - void cancelAct(JSONObject device); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleManagerServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleManagerServiceImpl.java deleted file mode 100644 index d424dfca6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleManagerServiceImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.core.impls; - -import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean; -import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleManagerService; -import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper; -import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yuan on 2018/3/13. - */ -@Service -public class ActMonDelaySettleManagerServiceImpl implements ActMonDelaySettleManagerService { - - @Autowired - private ActMonDelaySettleMapper actMonDelaySettleMapper; - - @Resource - private ClientMapper clientMapper; - - @Autowired - private ActMonDelaySettleRedPackMapper actMonDelaySettleRedPackMapper; - @Override - public JSONObject listAttendingClients(JSONObject manager,MonDelayBean monDelayBean) { - JSONObject params = monDelayBean.toJsonParam(); - PageList clients = actMonDelaySettleMapper.listAttendClients(params, new PageBounds(monDelayBean.getPage(), monDelayBean.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(clients); - } - - /* @Override - public void disableClient(String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - List clientLogs = actMonDelaySettleMapper.clientLog(client.getInteger("client_id")); - if (clientLogs.isEmpty() || clientLogs.isEmpty()){ - throw new BadRequestException("您未参加活动,不可取消"); - } - JSONObject clientLog = clientLogs.get(0); - clientLog.put("is_valid",0); - clientLog.put("expire_time",new Date()); - actMonDelaySettleMapper.update(clientLog); - } -*/ - @Override - public PageList getMonDelayClientRank(JSONObject manager,MonDelayBean monDelayBean) { - JSONObject params = monDelayBean.toJsonParam(); - return actMonDelaySettleRedPackMapper.getMonDelayRank(params,new PageBounds(monDelayBean.getPage(),monDelayBean.getLimit())); - } - - @Override - public List getWeekendAnalysis(JSONObject manager,MonDelayBean monDelayBean) { - JSONObject params = monDelayBean.toJsonParam(); - return actMonDelaySettleRedPackMapper.getMondayAmount(params); - } - - @Override - public JSONObject analysisCashback(JSONObject manager,MonDelayBean monDelayBean) { - JSONObject params = monDelayBean.toJsonParam(); - return actMonDelaySettleRedPackMapper.analysisCashback(params); - } - - @Override - public PageList clientRedPackList(JSONObject manager, MonDelayBean monDelayBean,String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - PageList list = actMonDelaySettleRedPackMapper.listRedpacks(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc"))); - return list; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java deleted file mode 100644 index fa21fd761..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java +++ /dev/null @@ -1,205 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.core.impls; - -import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleService; -import au.com.royalpay.payment.manage.mappers.act.ActAppMapper; -import au.com.royalpay.payment.manage.mappers.act.ActMonDelayClientMapper; -import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper; -import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper; -import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.device.DeviceSupport; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.MessageSource; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import java.math.BigDecimal; -import java.time.DayOfWeek; -import java.time.LocalDateTime; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -@Service -public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService { - @Resource - private ActMonDelaySettleRedPackMapper actMonDelaySettleRedPackMapper; - @Resource - private ActMonDelaySettleMapper actMonDelaySettleMapper; - @Resource - private DeviceSupport deviceSupport; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ActAppMapper actAppMapper; - @Resource - private ClientsOperationLogMapper clientsOperationLogMapper; - @Resource - private ClientManager clientManager; - @Resource - private MessageSource messageSource; - - @Resource - private ClientMapper clientMapper; - - @Resource - private ActMonDelayClientMapper actMonDelayClientMapper; - - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public JSONObject getActNotice(JSONObject device) { - int client_id = device.getIntValue("client_id"); - BigDecimal total_redpack = actMonDelaySettleRedPackMapper.getTotalRedPack(client_id); - JSONObject res = new JSONObject(); - res.put("total_redpack", total_redpack); - res.put("desc", "你有一份奖励待领取"); - res.put("url", PlatformEnvironment.getEnv().concatUrl("/api/v1.0/retail/app/act/mondelay/desc")); - res.put("show", true); - return res; - } - - @Override - public JSONObject getActDetail(JSONObject device) { - JSONObject act = actAppMapper.getActDetail("1"); - if (!act.getBoolean("is_valid")) { - throw new BadRequestException("Activity is not valid"); - } - int client_id = device.getIntValue("client_id"); - List clientLogs = actMonDelaySettleMapper.clientLog(client_id); - JSONObject res = new JSONObject(); - res.put("operation_pause",false); - Boolean apply = false; - if (!clientLogs.isEmpty()) { - apply = true; - res.put("cancel_waring",messageSource.getMessage("sys.mondelay.cancel.waring", null, RequestEnvironment.getLocale())); - } - if (new Date().compareTo(act.getDate("active_date")) < 0) { - res.put("active", false); - res.put("active_date", act.getDate("active_date")); - res.put("expire", false); - } else if (new Date().compareTo(act.getDate("expire_date")) > 0) { - res.put("active", false); - res.put("expire", true); - } else { - res.put("active", true); - res.put("expire", false); - } - LocalDateTime dt = LocalDateTime.now(); - if(dt.getDayOfWeek()==DayOfWeek.MONDAY && dt.getHour()<18){ - res.put("operation_pause",true); - } - BigDecimal total_redpack = actMonDelaySettleRedPackMapper.getTotalRedPack(client_id); - PageList list = actMonDelaySettleRedPackMapper.listRedpacks(client_id, new PageBounds(Order.formString("create_time.desc"))); - res.put("apply", apply); - res.put("total_redpack", total_redpack); - res.put("list", list); - try { - recodeActClient(device); - }catch (Exception e){ - logger.error("add or update act_mon_delay_read_logs failed:", e.getMessage(), e); - } - return res; - } - - @Override - @Transactional - public void actApply(JSONObject device) { - LocalDateTime dt = LocalDateTime.now(); - if(dt.getDayOfWeek()== DayOfWeek.MONDAY && dt.getHour()<18){ - throw new BadRequestException("每周一0点至18点为收益计算时间,暂停申请操作"); - } - JSONObject act = actAppMapper.getActDetail("1"); - Assert.notNull(act, "The activity is not valid"); - if (!act.getBoolean("is_valid")) { - throw new BadRequestException("The activity is not valid"); - } - if (new Date().compareTo(act.getDate("active_date")) < 0) { - throw new BadRequestException("The activity has not yet begin"); - } - if (new Date().compareTo(act.getDate("expire_date")) > 0) { - throw new BadRequestException("The activity has expired"); - } - int client_id = device.getIntValue("client_id"); - List clientLogs = actMonDelaySettleMapper.clientLog(client_id); - if (!clientLogs.isEmpty()) { - throw new BadRequestException("您已经参与过活动,无需重复报名"); - } - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new ForbiddenException("You have no permission.Please login in using the administrator account"); - } - device.put("account_name", account.getString("display_name")); - device.put("create_time", new Date()); - JSONObject params = JSON.parseObject(act.getString("params_json")); - device.put("rate", params.getBigDecimal("rate") == null ? new BigDecimal(0.15) : params.getBigDecimal("rate")); - device.put("expire_time", act.getDate("expire_date")); - actMonDelaySettleMapper.save(device); - clientManager.changeManualSettle(account,client_id,true,device.getString("account_id"),1,"参加活动打开手动清算"); - - } - - - - @Override - @Transactional - public void cancelAct(JSONObject device) { - LocalDateTime dt = LocalDateTime.now(); - if(dt.getDayOfWeek()== DayOfWeek.MONDAY && dt.getHour()<18){ - throw new BadRequestException("每周一0点至18点为收益计算时间,暂停退出活动操作"); - } - int client_id = device.getIntValue("client_id"); - List clientLogs = actMonDelaySettleMapper.clientLog(client_id); - if (clientLogs.isEmpty()) { - throw new BadRequestException("您未参加活动,不可取消"); - } - JSONObject clientLog = clientLogs.get(0); - clientLog.put("is_valid", 0); - clientLog.put("expire_time", new Date()); - actMonDelaySettleMapper.update(clientLog); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientManager.changeManualSettle(account,client_id,false,device.getString("account_id"),1,"退出活动关闭手动清算"); - } - - private void recodeActClient(JSONObject device){ - JSONObject actClient = new JSONObject(); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - JSONObject clientLog = actMonDelayClientMapper.actClient(device.getIntValue("client_id")); - if(clientLog != null){ - if(!clientLog.getString("account_id").equals(device.getString("account_id"))) { - actClient.put("account_id", account.getString("account_id")); - actClient.put("account_name", account.getString("display_name")); - } - actClient.put("last_read_time",new Date()); - actClient.put("id",clientLog.getString("id")); - actMonDelayClientMapper.update(actClient); - }else { - JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); - actClient.put("client_id",client.getString("client_id")); - actClient.put("client_moniker",client.getString("client_moniker")); - actClient.put("short_name",client.getString("short_name")); - actClient.put("account_id",account.getString("account_id")); - actClient.put("account_name",account.getString("display_name")); - actClient.put("create_time",new Date()); - actClient.put("last_read_time",new Date()); - actMonDelayClientMapper.save(actClient); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/web/ActMonDelayManagerController.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/web/ActMonDelayManagerController.java deleted file mode 100644 index 027c42892..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/web/ActMonDelayManagerController.java +++ /dev/null @@ -1,65 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.web; - -import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean; -import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleManagerService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yuan on 2018/3/13. - */ -@RequestMapping(value = "/manage/mon_delay") -@RestController -public class ActMonDelayManagerController { - @Resource - private ActMonDelaySettleManagerService monDelayManagerService; - - @ManagerMapping(value = "/clients", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject listAttendingClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) { - return monDelayManagerService.listAttendingClients(manager,monDelayBean); - } - - - /*@ManagerMapping(value = "/clients/{clientMoniker}", method = RequestMethod.DELETE, role = { ManagerRole.ADMIN }) - public void disableClient(@PathVariable String clientMoniker) { - monDelayManagerService.disableClient(clientMoniker); - }*/ - - @ManagerMapping(value = "/{clientMoniker}/clients", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject clientRedPackList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,MonDelayBean monDelayBean,@PathVariable String clientMoniker) { - PageList redPackList = monDelayManagerService.clientRedPackList(manager,monDelayBean,clientMoniker); - if(redPackList==null){ - return null; - } - return PageListUtils.buildPageListResult(redPackList); - } - - - @ManagerMapping(value = "/traAnalysis", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public List traAnalysis(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) { - return monDelayManagerService.getWeekendAnalysis(manager,monDelayBean); - } - - @ManagerMapping(value = "/ranking", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject getRanking(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) { - PageList clientRank = monDelayManagerService.getMonDelayClientRank(manager,monDelayBean); - if(clientRank==null){ - return null; - } - return PageListUtils.buildPageListResult(clientRank); - } - - @ManagerMapping(value = "/total", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject getTotal(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) { - return monDelayManagerService.analysisCashback(manager,monDelayBean); - } -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/web/ActMonDelaySettleController.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/web/ActMonDelaySettleController.java deleted file mode 100644 index 4ae0af11d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/web/ActMonDelaySettleController.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.activities.monsettledelay.web; - -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; - -@RestController -@RequestMapping("/act/mondelay") -public class ActMonDelaySettleController { - @GetMapping("/desc") - public ModelAndView encourageLogs() { - ModelAndView mav = new ModelAndView("activity/"); - return mav; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/package-info.java b/src/main/java/au/com/royalpay/payment/manage/activities/package-info.java deleted file mode 100644 index b57fc1823..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/activities/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 活动相关 - * Created by yixian on 2017-03-21. - */ -package au.com.royalpay.payment.manage.activities; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java deleted file mode 100644 index 27bb22f0d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java +++ /dev/null @@ -1,250 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import javax.validation.constraints.NotEmpty; - - -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.TimeZone; - -/** - * Created by davep on 2016-07-28. - */ -public class AnalysisBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - @NotEmpty(message = "error.payment.valid.param_missing") - private String begin; - private String end; - private String[] client_ids; - private String bd_id; - private String org_id; - private String begin_month; - private String end_month; - private int page = 1; - private int limit = 10; - private String customer_id; - private String rankType; - private boolean onlyGroup=false; - private int group_bd; - private String channel; - private String client_moniker; - private String amount_from; - private String amount_to; - private String bd_name; - private String timezone; - private String orderValue; - - - public JSONObject toParams(String timezone) { - JSONObject params = new JSONObject(); - if (timezone != null) { - format.setTimeZone(TimeZone.getTimeZone(timezone)); - } - if (begin != null) { - try { - params.put("begin", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("end", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - if (client_ids != null){ - params.put("client_ids",client_ids); - } - if (bd_id != null){ - params.put("bd_id",bd_id); - } - if (org_id != null){ - params.put("org_id",org_id); - } - if (begin_month != null){ - params.put("begin_month",begin_month); - } - if (end_month != null){ - params.put("end_month",end_month); - } - if (customer_id != null && !customer_id.isEmpty()){ - params.put("customer_id", customer_id.trim()); - } - if (rankType != null){ - params.put("rankType", rankType); - } - if(channel != null){ - params.put("channel", channel); - } - if(bd_name != null){ - params.put("bd_name", bd_name); - } - if (client_moniker != null){ - params.put("client_moniker", client_moniker); - } - if (amount_from != null && amount_from.length() > 0){ - params.put("amount_from", new BigDecimal(amount_from)); - } - params.put("orderValue", orderValue); - return params; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public void setClient_ids(String[] client_ids) { - this.client_ids = client_ids; - } - - public String getBd_id() { - return bd_id; - } - - public void setBd_id(String bd_id) { - this.bd_id = bd_id; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public String getBegin_month() { - return begin_month; - } - - public void setBegin_month(String begin_month) { - this.begin_month = begin_month; - } - - public String getEnd_month() { - return end_month; - } - - public void setEnd_month(String end_month) { - this.end_month = end_month; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public void setCustomer_id(String customer_id) { - this.customer_id = customer_id; - } - - public String getRankType() { - return rankType; - } - - public void setRankType(String rankType) { - this.rankType = rankType; - } - - public boolean isOnlyGroup() { - return onlyGroup; - } - - public void setOnlyGroup(boolean onlyGroup) { - this.onlyGroup = onlyGroup; - } - - public int getGroup_bd() { - return group_bd; - } - - public void setGroup_bd(int group_bd) { - this.group_bd = group_bd; - } - - public String getChannel() { - return channel; - } - - public void setChannel(String channel) { - this.channel = channel; - } - - public String getAmount_from() { - return amount_from; - } - - public void setAmount_from(String amount_from) { - this.amount_from = amount_from; - } - - public String getAmount_to() { - return amount_to; - } - - public void setAmount_to(String amount_to) { - this.amount_to = amount_to; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getBd_name() { - return bd_name; - } - - public void setBd_name(String bd_name) { - this.bd_name = bd_name; - } - - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public String getOrderValue() { - return orderValue; - } - - public void setOrderValue(String orderValue) { - this.orderValue = orderValue; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AreaMerchantTradeQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AreaMerchantTradeQueryBean.java deleted file mode 100644 index d4ec6ec0c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AreaMerchantTradeQueryBean.java +++ /dev/null @@ -1,120 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Created by yuan on 2018/6/5. - */ -public class AreaMerchantTradeQueryBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - int page = 1; - int limit = 10; - private String state; - private String org_id; - private String bd; - private String begin; - private String end; - private String client_moniker; - - public JSONObject toParams(){ - JSONObject params = new JSONObject(); - if (StringUtils.isNotEmpty(state)) { - params.put("state",state); - } - if (StringUtils.isNotEmpty(org_id)) { - params.put("org_id",org_id); - } - if (StringUtils.isNotEmpty(bd)) { - params.put("bd_user",bd); - } - if (StringUtils.isNotEmpty(client_moniker)) { - params.put("client_monikers",client_moniker.split(",")); - } - if (begin != null) { - try { - params.put("begin", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("end", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - return params; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public String getBd() { - return bd; - } - - public void setBd(String bd) { - this.bd = bd; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ClientRateQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ClientRateQueryBean.java deleted file mode 100644 index 0e75ed031..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ClientRateQueryBean.java +++ /dev/null @@ -1,161 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import javax.validation.constraints.NotEmpty; - -import java.text.ParseException; -import java.util.Calendar; -import java.util.Date; - -/** - * Created by yixian on 2017-04-17. - */ -public class ClientRateQueryBean { - private static final String[] PARSE_PATTERNS = {"yyyyMMdd"}; - @NotEmpty - private String begin; - @NotEmpty - private String end; - private String noactive; - private String transaction; - - public Date getBegin() { - try { - return DateUtils.parseDate(begin, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public Date getEnd() { - try { - return DateUtils.parseDate(end, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - - public void setEnd(String end) { - this.end = end; - } - - public NoActive getNoactive() { - return noactive == null ? null : new NoActive(noactive); - } - - public void setNoactive(String noactive) { - this.noactive = noactive; - } - - public LowerTransaction getTransaction() { - return transaction == null ? null : new LowerTransaction(transaction); - } - - public void setTransaction(String transaction) { - this.transaction = transaction; - } - - public class NoActive { - private int range;//范围:1-一周,2-半月,3-1月,4-3月,5-半年,6-全程 - private int type;//类型:1-无交易,2-总金额小于x - private JSONObject external; - - public NoActive() { - } - - public NoActive(String json) { - JSONObject obj = JSON.parseObject(json); - range = obj.getIntValue("range"); - type = obj.getIntValue("type"); - external = obj.getJSONObject("external"); - } - - public void initParams(JSONObject params) { - Date end = DateUtils.truncate(new Date(), Calendar.DATE); - switch (range) { - case 1: { - params.put("begin", DateUtils.addDays(end, -7)); - break; - } - case 2: { - params.put("begin", DateUtils.addDays(end, -15)); - break; - } - case 3: { - params.put("begin", DateUtils.addMonths(end, -1)); - break; - } - case 4: { - params.put("begin", DateUtils.addMonths(end, -3)); - break; - } - case 5: { - params.put("begin", DateUtils.addMonths(end, -6)); - break; - } - case 6: { - params.put("begin", new Date(0)); - break; - } - default: { - throw new BadRequestException("Invalid Range"); - } - } - switch (type) { - case 1: - params.put("notrade", true); - break; - case 2: - params.put("max_amount", external == null ? 100 : external.getIntValue("max")); - break; - default: { - throw new BadRequestException("Invalid Type"); - } - } - } - - } - - public class LowerTransaction { - private String level; - private double degree; - - public LowerTransaction() { - } - - public LowerTransaction(String json) { - JSONObject obj = JSON.parseObject(json); - level = obj.getString("level"); - degree = obj.getDoubleValue("degree"); - } - - public void initParams(JSONObject params) { - Date today = DateUtils.truncate(new Date(), Calendar.DATE); - switch (level) { - case "week": { - params.put("this_end", today); - params.put("this_begin", DateUtils.addDays(today, -7)); - params.put("last_begin", DateUtils.addDays(today, -12)); - break; - } - case "month": { - params.put("this_end", today); - params.put("this_begin", DateUtils.addMonths(today, -1)); - params.put("last_begin", DateUtils.addMonths(today, -2)); - break; - } - default: - throw new BadRequestException("Invalid level"); - } - params.put("trade_degree", degree); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/RefundReviewBean.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/RefundReviewBean.java deleted file mode 100644 index e372ad334..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/RefundReviewBean.java +++ /dev/null @@ -1,123 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - - -public class RefundReviewBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private int page = 1; - private int limit = 20; - private String textType; - private String searchText; - private String datefrom; - private String dateto; - private ReviewStatus status = ReviewStatus.ALL; - - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (datefrom != null) { - try { - params.put("from", format.parse(datefrom)); - } catch (ParseException e) { - throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format"); - } - } - if (dateto != null) { - try { - params.put("to", DateUtils.addDays(format.parse(dateto), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format"); - } - } - if (StringUtils.isNotBlank(searchText)) { - params.put("search_text", searchText); - if (StringUtils.isNotBlank(textType)) { - params.put("text_type", textType); - } else { - params.put("text_type", "all"); - } - } - params.put("status", status.toString()); - return params; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getTextType() { - return textType; - } - - public void setTextType(String textType) { - this.textType = textType; - } - - public String getSearchText() { - return searchText; - } - - public void setSearchText(String searchText) { - this.searchText = searchText; - } - - public String getDatefrom() { - return datefrom; - } - - public void setDatefrom(String datefrom) { - this.datefrom = datefrom; - } - - public String getDateto() { - return dateto; - } - - public void setDateto(String dateto) { - this.dateto = dateto; - } - - public ReviewStatus getStatus() { - return status; - } - - public void setStatus(ReviewStatus status) { - this.status = status; - } - - @Override - public String toString() { - return "RefundReviewBean{" + - "format=" + format + - ", page=" + page + - ", limit=" + limit + - ", textType='" + textType + '\'' + - ", searchText='" + searchText + '\'' + - ", datefrom='" + datefrom + '\'' + - ", dateto='" + dateto + '\'' + - ", status=" + status + - '}'; - } -} - - diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ReviewStatus.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ReviewStatus.java deleted file mode 100644 index 7e7c4d193..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ReviewStatus.java +++ /dev/null @@ -1,8 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans; - -/** - * Created by Tayl0r on 2017/7/12. - */ -public enum ReviewStatus { - ALL, SUCCESS, REFUSE, WAIT_AUDIT -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/SettleDelayQuery.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/SettleDelayQuery.java deleted file mode 100644 index 07dc0e1d8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/SettleDelayQuery.java +++ /dev/null @@ -1,75 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * redpack query - * Created by davep on 2016-08-03. - */ -public class SettleDelayQuery { - private static final String[] DATE_PATTERNS = {"yyyyMMdd", "yyyy-MM-dd"}; - private String begin; - private String end; - private int page = 1; - private int limit = 20; - - public JSONObject params() { - JSONObject param = new JSONObject(); - if (begin != null) { - try { - Date fromDate = DateUtils.parseDate(begin, DATE_PATTERNS); - param.put("begin", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - Date fromDate = DateUtils.addDays(DateUtils.parseDate(end, DATE_PATTERNS), 1); - param.put("end", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - param.put("page",page); - param.put("limit",limit); - return param; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOBulkData.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOBulkData.java deleted file mode 100644 index 13428a179..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOBulkData.java +++ /dev/null @@ -1,91 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Create by yixian at 2018-08-30 18:38 - */ -public class ATOBulkData { - - private IntermediaryData intermediary; - - public ATOBulkData(IntermediaryData intermediary) { - this.intermediary = intermediary; - } - - public String outputBTTPS() { - StringBuilder builder = new StringBuilder(); - intermediary.buildLine(builder); - return builder.toString(); - } - - public static class IntermediaryData implements ATOBulkLine { - private final String identifier = "IDENTREGISTER"; - private final String version = "BTPSV001.0"; - private String abn; - private Date createTime; - private String fileReference; - private String name; - private ContactInfo contactInfo; - private AddressInfo address; - private List reportingParties = new ArrayList<>(); - - public IntermediaryData(String abn, String name, String fileReference) { - this.abn = abn; - this.fileReference = fileReference; - this.name = name; - this.createTime = new Date(); - } - - public IntermediaryData setContactInfo(ContactInfo contactInfo) { - this.contactInfo = contactInfo; - return this; - } - - public IntermediaryData setAddress(AddressInfo address) { - this.address = address; - return this; - } - - @Override - public StringBuilder buildLine(StringBuilder builder) { - StringBuilder line = new StringBuilder(); - appendNParam(line, 1400, 4); - appendAParam(line, identifier, 13); - appendAParam(line, version, 10); - appendAParam(line, abn, 11); - appendDTParam(line, createTime, 28); - appendAParam(line, fileReference, 16); - appendAParam(line, name, 200); - appendAParam(line, contactInfo.getContactName(), 40); - appendNParam(line, contactInfo.getPhoneAreaCode(), 2); - appendAParam(line, contactInfo.getPhoneNumber(), 15); - appendAParam(line, address.getAddress(), 38 * 2); - appendAParam(line, address.getSuburb(), 27); - appendAParam(line, address.getState(), 3); - appendNParam(line, address.getPostCode(), 4); - appendAParam(line, address.getCountry(), 50); - appendAParam(line, contactInfo.getEmail(), 76); - appendFiller(line, 825); - - builder.append(line); - - for (ReportingPartyData partyData : reportingParties) { - partyData.buildLine(builder); - } - - TotalDataRecord total = new TotalDataRecord() - .setReportPartyCount(reportingParties.size()) - .setBusinessCount(reportingParties.stream().mapToInt(ReportingPartyData::businessCount).sum()) - .setTransactionsCount(reportingParties.stream().mapToInt(ReportingPartyData::transactionCount).sum()); - total.buildLine(builder); - return builder; - } - - public void addReportingParty(ReportingPartyData reportingParty) { - reportingParties.add(reportingParty); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOBulkLine.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOBulkLine.java deleted file mode 100644 index 27f9c546c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOBulkLine.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.joda.time.DateTime; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; - -import java.util.Date; - -/** - * Create by yixian at 2018-08-30 21:11 - */ -public interface ATOBulkLine { - StringBuilder buildLine(StringBuilder builder); - - default StringBuilder appendAParam(StringBuilder line, String content, int length) { - content = content == null ? "" : StringUtils.trim(content); - content = StringUtils.remove(StringUtils.remove(content, '\r'), '\n'); - content = CharacterUtils.convertToAlphaBet(content); - content = content.replace("?", " "); - if (content.getBytes().length != content.length()) { - content = ""; - } - line.append(StringUtils.left(StringUtils.rightPad(content, length, " "), length)); - return line; - } - - default StringBuilder appendDParam(StringBuilder line, Date date, int len) { - String dateStr = DateFormatUtils.format(date, "yyyyMMdd"); - return appendAParam(line, dateStr, len); - } - - default StringBuilder appendDTParam(StringBuilder line, Date date, int len) { - DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSZZ"); - String dateStr = formatter.print(new DateTime(date)); - return appendAParam(line, dateStr, len); - } - - default StringBuilder appendNParam(StringBuilder line, int num, int len) { - line.append(StringUtils.right(StringUtils.leftPad(num + "", len, "0"), len)); - return line; - } - - default StringBuilder appendNParam(StringBuilder line, String num, int len) { - num = num == null ? "" : StringUtils.trim(num); - line.append(StringUtils.right(StringUtils.leftPad(num, len, "0"), len)); - return line; - } - - default StringBuilder appendNSParam(StringBuilder line, int num, int len) { - line.append(StringUtils.right(StringUtils.leftPad(num + "", len, " "), len)); - return line; - } - - default StringBuilder appendFiller(StringBuilder line, int len) { - line.append(StringUtils.repeat(" ", len)).append("\r\n"); - return line; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOCompanyConfig.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOCompanyConfig.java deleted file mode 100644 index b539806e0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ATOCompanyConfig.java +++ /dev/null @@ -1,211 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import org.joda.time.DateTime; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -@ConfigurationProperties(prefix = "app.atoreport") -public class ATOCompanyConfig { - private List companies; - - public List getCompanies() { - return companies; - } - - public ATOCompanyConfig setCompanies(List companies) { - this.companies = companies; - return this; - } - - public static class ATOCompany { - private String[] balanceGroups; - private String brand; - private String referencePrefix; - private String company; - private String abn; - private Contact contact; - private Addr address; - - public String reference() { - return referencePrefix + DateTime.now().toString("yyyyMMddHHmm"); - } - - public List balanceGroups() { - return Arrays.stream(balanceGroups).map(BalanceGroup::valueOf).collect(Collectors.toList()); - } - - public String getReferencePrefix() { - return referencePrefix; - } - - public ATOCompany setReferencePrefix(String referencePrefix) { - this.referencePrefix = referencePrefix; - return this; - } - - public String[] getBalanceGroups() { - return balanceGroups; - } - - public ATOCompany setBalanceGroups(String[] balanceGroups) { - this.balanceGroups = balanceGroups; - return this; - } - - public String getBrand() { - return brand; - } - - public ATOCompany setBrand(String brand) { - this.brand = brand; - return this; - } - - public String getAbn() { - return abn; - } - - public ATOCompany setAbn(String abn) { - this.abn = abn; - return this; - } - - public Contact getContact() { - return contact; - } - - public ContactInfo getContactInfo() { - return contact.convert(); - } - - public ATOCompany setContact(Contact contact) { - this.contact = contact; - return this; - } - - public Addr getAddress() { - return address; - } - - public ATOCompany setAddress(Addr address) { - this.address = address; - return this; - } - - public AddressInfo getAddressInfo() { - return address.convert(); - } - - public String getShortCompanyName() { - return company.replace(" PTY LTD", ""); - } - - public String getCompany() { - return company; - } - - public ATOCompany setCompany(String company) { - this.company = company; - return this; - } - } - - public static class Contact { - private String name; - private String phone; - private String email; - - public ContactInfo convert() { - return new ContactInfo(name, phone, email); - } - - public String getName() { - return name; - } - - public Contact setName(String name) { - this.name = name; - return this; - } - - - public String getPhone() { - return phone; - } - - public Contact setPhone(String phone) { - this.phone = phone; - return this; - } - - public String getEmail() { - return email; - } - - public Contact setEmail(String email) { - this.email = email; - return this; - } - } - - public static class Addr { - private String address; - private String suburb; - private String state; - private String postcode; - private String country; - - public AddressInfo convert() { - return new AddressInfo(address, suburb, state, postcode, country); - } - - public String getAddress() { - return address; - } - - public Addr setAddress(String address) { - this.address = address; - return this; - } - - public String getSuburb() { - return suburb; - } - - public Addr setSuburb(String suburb) { - this.suburb = suburb; - return this; - } - - public String getState() { - return state; - } - - public Addr setState(String state) { - this.state = state; - return this; - } - - public String getPostcode() { - return postcode; - } - - public Addr setPostcode(String postcode) { - this.postcode = postcode; - return this; - } - - public String getCountry() { - return country; - } - - public Addr setCountry(String country) { - this.country = country; - return this; - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java deleted file mode 100644 index e816d5956..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -/** - * Create by yixian at 2018-08-30 21:17 - */ -public class AddressInfo { - private final String address; - private final String suburb; - private final String state; - private final String postCode; - private final String country; - - public AddressInfo(String address, String suburb, String state, String postCode, String country) { - this.address = address; - this.suburb = suburb; - postCode = postCode.replaceAll("\\D", ""); - if (!postCode.matches("^\\d{4}$")) { - postCode = "9999"; - country = "OTH"; - state = "OTH"; - } - if (country != null && country.length() != 3) { - country = "OTH"; - state = "OTH"; - postCode = "9999"; - } - this.postCode = postCode; - if (state != null) { - this.state = state.toUpperCase(); - } else { - this.state = null; - } - this.country = country; - } - - public String getAddress() { - return address; - } - - public String getSuburb() { - return suburb; - } - - public String getState() { - return state; - } - - public String getPostCode() { - return postCode; - } - - public String getCountry() { - return "AUS".equals(country) ? "" : country; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/BusinessData.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/BusinessData.java deleted file mode 100644 index 3d0498c01..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/BusinessData.java +++ /dev/null @@ -1,121 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Create by yixian at 2018-08-30 21:21 - */ -public class BusinessData implements ATOBulkLine { - private final String identifier = "BIDR"; - private String customer; - private Date paymentFacility; - private String surName; - private String firstName; - private String secondName; - private Date birth; - private String abn; - private String acn; - private String registeredName; - private String tradingName; - private AddressInfo address; - private AddressInfo postalAddress; - private ContactInfo contactInfo; - private String mchId; - private String category; - private String lodgment; - - public BusinessData(Date paymentFacility, String abn, String acn, String registeredName, String tradingName, String mchId, String category, String lodgment) { - this.paymentFacility = paymentFacility; - if (abn != null) { - abn = abn.replaceAll("\\D", ""); - if (abn.length() != 11) { - abn = ""; - } - } - this.abn = abn; - if (acn != null) { - acn = acn.replaceAll("\\D", ""); - if (acn.length() != 9) { - acn = ""; - } - } - this.acn = acn; - this.registeredName = registeredName; - this.tradingName = tradingName; - this.mchId = mchId; - this.customer = mchId; - this.category = category; - this.lodgment = lodgment; - } - - public BusinessData setAddress(AddressInfo address) { - this.address = address; - return this; - } - - public BusinessData setPostalAddress(AddressInfo postalAddress) { - this.postalAddress = postalAddress; - return this; - } - - public BusinessData setContactInfo(ContactInfo contactInfo) { - this.contactInfo = contactInfo; - return this; - } - - private List transactions = new ArrayList<>(); - - @Override - public StringBuilder buildLine(StringBuilder builder) { - StringBuilder line = new StringBuilder(); - appendNParam(line, 1400, 4); - appendAParam(line, identifier, 4); - appendAParam(line, customer, 25); - appendDParam(line, paymentFacility, 8); - appendAParam(line, surName, 40); - appendAParam(line, firstName, 40); - appendAParam(line, secondName, 40); - appendAParam(line, null, 8); - appendNParam(line, abn, 11); - appendNParam(line, acn, 9); - appendAParam(line, registeredName, 200); - appendAParam(line, tradingName, 200); - appendAParam(line, address.getAddress(), 38 * 2); - appendAParam(line, address.getSuburb(), 27); - appendAParam(line, address.getState(), 3); - appendNParam(line, address.getPostCode(), 4); - appendAParam(line, address.getCountry(), 50); - appendAParam(line, postalAddress.getAddress(), 38 * 2); - appendAParam(line, postalAddress.getSuburb(), 27); - appendAParam(line, postalAddress.getState(), 3); - appendNParam(line, postalAddress.getPostCode(), 4); - appendAParam(line, postalAddress.getCountry(), 50); - appendAParam(line, contactInfo.getContactName(), 40); - appendNParam(line, contactInfo.getPhoneAreaCode(), 2); - appendAParam(line, contactInfo.getPhoneNumber(), 15); - appendAParam(line, contactInfo.getEmail(), 76); - appendAParam(line, mchId, 20); - appendAParam(line, category, 100); - appendAParam(line, lodgment, 1); - appendFiller(line, 237); - - builder.append(line); - - for (TransactionSummaryData trans : transactions) { - trans.buildLine(builder); - } - return builder; - } - - public int transactionCount() { - return transactions.size(); - } - - public void addTransaction(TransactionSummaryData transactionSummaryData) { - //todo system account number - transactionSummaryData.fillSystemInfo(mchId, "Merchant Acquiring System", mchId); - transactions.add(transactionSummaryData); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/CharacterUtils.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/CharacterUtils.java deleted file mode 100644 index f44fdc938..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/CharacterUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import com.github.stuxuhai.jpinyin.ChineseHelper; -import com.github.stuxuhai.jpinyin.PinyinException; -import com.github.stuxuhai.jpinyin.PinyinFormat; -import com.github.stuxuhai.jpinyin.PinyinHelper; -import org.apache.commons.lang3.StringUtils; - -import java.util.Arrays; -import java.util.stream.Collectors; - -/** - * Create by yixian at 2018-09-06 9:03 - */ -public class CharacterUtils { - - public static String convertToAlphaBet(String source) { - return convertFullWidthToHalfWidth(convertToPinYin(source)); - } - - public static String convertToPinYin(String source) { - try { - return PinyinHelper.convertToPinyinString(source, "", PinyinFormat.WITHOUT_TONE); - } catch (PinyinException e) { - return source.chars().filter(c -> !ChineseHelper.isChinese((char) c)) - .mapToObj(c -> "" + (char) c) - .collect(Collectors.joining()); - - } - } - - public static String convertFullWidthToHalfWidth(String source) { - if (StringUtils.isEmpty(source)) { - return source; - } - - return source.chars().map(ch -> { - if (ch == '\u3000') { - return '\u0020'; - } - if (isFullWidth((char) ch)) { - return (char) (ch - 65248); - } - return (char) ch; - }).filter(CharacterUtils::isHalfWidth) - .mapToObj(chInt -> "" + (char) chInt).collect(Collectors.joining()); - } - - private static boolean isHalfWidth(int ch) { - return ch >= 32 && ch <= 126; - } - - private static boolean isFullWidth(int ch) { - if (ch == '\u3000') return true; - - int i = ch - 65248; - if (i < 32) return false; - return isHalfWidth((char) i); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ContactInfo.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ContactInfo.java deleted file mode 100644 index 8a9a1918b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ContactInfo.java +++ /dev/null @@ -1,88 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; - -/** - * Create by yixian at 2018-08-30 21:19 - */ -public class ContactInfo { - private final String contactName; - private int phoneAreaCode; - private String phoneNumber; - private final String email; - - public ContactInfo(String contactName, String phoneNumber, String email) { - this.contactName = contactName; - if (isPhoneNumber(phoneNumber)) { - phoneNumber = phoneNumber.replace(" ", ""); - String auPhoneNumber = formatAustralianPhoneNumber(phoneNumber); - if (auPhoneNumber != null) { - String subPhone = auPhoneNumber.substring(3); - if (!subPhone.startsWith("1300") && !subPhone.startsWith("1800")) { - this.phoneAreaCode = Integer.parseInt(subPhone.substring(0, 1)); - if (4 == phoneAreaCode) { - this.phoneNumber = subPhone.substring(1, 3) + " " + subPhone.substring(3, 6) + " " + subPhone.substring(6); - } else { - this.phoneNumber = subPhone.substring(1, 5) + " " + subPhone.substring(5); - } - } - - } else { - this.phoneNumber = formatOtherPhoneNumber(phoneNumber); - } - } - EmailValidator validator = new EmailValidator(); - this.email = validator.isValid(email, null) ? email : ""; - } - - private boolean isPhoneNumber(String phoneNumber) { - return phoneNumber.matches("^\\+?\\d+$"); - } - - private String formatAustralianPhoneNumber(String phoneNumber) { - if (phoneNumber.startsWith("+61") && phoneNumber.length() == 12) { - return phoneNumber; - } - if (phoneNumber.startsWith("61") && phoneNumber.length() == 11) { - return "+" + phoneNumber; - } - if (phoneNumber.startsWith("0") && phoneNumber.length() == 10) { - return "+61" + phoneNumber.substring(1); - } - if (phoneNumber.length() == 9) { - return "+61" + phoneNumber; - } - return null; - } - - private String formatOtherPhoneNumber(String phoneNumber) { - String num = phoneNumber.replace(" ", ""); - if (num.startsWith("+")) { - return num.replace("+", ""); - } - if (num.startsWith("00")) { - return num.substring(2); - } - if (num.startsWith("1") && num.length() == 11) { - //中国手机号 - return "86" + num; - } - return null; - } - - public String getContactName() { - return contactName; - } - - public int getPhoneAreaCode() { - return phoneAreaCode; - } - - public String getPhoneNumber() { - return phoneNumber; - } - - public String getEmail() { - return email; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java deleted file mode 100644 index 588fc6bb9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java +++ /dev/null @@ -1,107 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import org.apache.commons.lang3.time.DateUtils; - -import java.util.Calendar; -import java.util.Date; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Create by yixian at 2018-08-30 21:13 - */ -public class ReportingPartyData implements ATOBulkLine { - private static final String IDENTIFIER = "RPDR"; - private final Date periodStart; - private final Date periodEnd; - private final String abn; - private final String branchNumber; - private final String registerName; - private String tradingName; - private AddressInfo address; - private AddressInfo postalAddress; - private ContactInfo contactInfo; - private final String softwareProductType; - - private final Map businesses = new ConcurrentHashMap<>(); - - public ReportingPartyData(Date periodStart, Date periodEnd, String abn, String branchNumber, String registerName, String softwareProductType) { - this.periodStart = DateUtils.truncate(periodStart, Calendar.DATE); - this.periodEnd = DateUtils.truncate(periodEnd, Calendar.DATE); - this.abn = abn; - this.branchNumber = branchNumber; - this.registerName = registerName; - this.softwareProductType = softwareProductType; - } - - public ReportingPartyData setTradingName(String tradingName) { - this.tradingName = tradingName; - return this; - } - - public ReportingPartyData setAddress(AddressInfo address) { - this.address = address; - return this; - } - - public ReportingPartyData setPostalAddress(AddressInfo postalAddress) { - this.postalAddress = postalAddress; - return this; - } - - public ReportingPartyData setContactInfo(ContactInfo contactInfo) { - this.contactInfo = contactInfo; - return this; - } - - @Override - public StringBuilder buildLine(StringBuilder builder) { - StringBuilder line = new StringBuilder(); - appendNParam(line, 1400, 4); - appendAParam(line, IDENTIFIER, 4); - appendDParam(line, periodStart, 8); - appendDParam(line, periodEnd, 8); - appendNParam(line, abn, 11); - appendNParam(line, branchNumber, 3); - appendAParam(line, registerName, 200); - appendAParam(line, tradingName, 200); - appendAParam(line, address.getAddress(), 38 * 2); - appendAParam(line, address.getSuburb(), 27); - appendAParam(line, address.getState(), 3); - appendNParam(line, address.getPostCode(), 4); - appendAParam(line, address.getCountry(), 50); - appendAParam(line, postalAddress.getAddress(), 38 * 2); - appendAParam(line, postalAddress.getSuburb(), 27); - appendAParam(line, postalAddress.getState(), 3); - appendNParam(line, postalAddress.getPostCode(), 4); - appendAParam(line, postalAddress.getCountry(), 50); - appendAParam(line, contactInfo.getContactName(), 40); - appendNParam(line, contactInfo.getPhoneAreaCode(), 2); - appendAParam(line, contactInfo.getPhoneNumber(), 15); - appendAParam(line, contactInfo.getEmail(), 76); - appendAParam(line, softwareProductType, 80); - appendFiller(line, 429); - - builder.append(line); - businesses.values().stream() - .filter(biz -> biz.transactionCount() > 0) - .forEach(biz -> biz.buildLine(builder)); - return builder; - } - - public int businessCount() { - return (int) businesses.values().stream().filter(biz -> biz.transactionCount() > 0).count(); - } - - public int transactionCount() { - return businesses.values().stream().mapToInt(BusinessData::transactionCount).sum(); - } - - public BusinessData findBusiness(Integer clientId) { - return businesses.get(clientId); - } - - public void addBusiness(Integer clientId, BusinessData biz) { - businesses.put(clientId, biz); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/TotalDataRecord.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/TotalDataRecord.java deleted file mode 100644 index 4231dd587..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/TotalDataRecord.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -/** - * Create by yixian at 2018-08-30 21:35 - */ -public class TotalDataRecord implements ATOBulkLine { - private final String identifier = "FILE-TOTAL"; - private int reportPartyCount; - private int businessCount; - private int transactionsCount; - - - public TotalDataRecord setReportPartyCount(int reportPartyCount) { - this.reportPartyCount = reportPartyCount; - return this; - } - - public TotalDataRecord setBusinessCount(int businessCount) { - this.businessCount = businessCount; - return this; - } - - public TotalDataRecord setTransactionsCount(int transactionsCount) { - this.transactionsCount = transactionsCount; - return this; - } - - @Override - public StringBuilder buildLine(StringBuilder builder) { - StringBuilder line = new StringBuilder(); - appendNParam(line, 1400, 4); - appendAParam(line, identifier, 10); - appendNParam(line, getRecords(), 10); - appendNParam(line, reportPartyCount, 10); - appendNParam(line, businessCount, 10); - appendNParam(line, transactionsCount, 10); - appendFiller(line, 1346); - - builder.append(line); - return builder; - } - - private int getRecords() { - return reportPartyCount + businessCount + transactionsCount + 2; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/TransactionSummaryData.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/TransactionSummaryData.java deleted file mode 100644 index b72202d0a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/TransactionSummaryData.java +++ /dev/null @@ -1,82 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.beans.ato; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * Create by yixian at 2018-08-30 21:30 - */ -public class TransactionSummaryData implements ATOBulkLine { - private final String identifier = "TSDR"; - private String customer; - private String description; - private String accountNumber; - private String settleAccountName; - private String settleBSB; - private String settleAccountNo; - private Date periodStart; - private Date periodEnd; - private String currency = "AUD"; - private BigDecimal grossPayment; - private int transactionCount; - private BigDecimal totalRefund; - private int refundCount; - private BigDecimal cashoutAmount = BigDecimal.ZERO; - private int cashoutCount = 0; - private BigDecimal cashoutComponentAmount = BigDecimal.ZERO; - - public TransactionSummaryData(JSONObject analysis, DateTime startOfMon, DateTime endOfMon) { - settleAccountName = analysis.getString("account_name"); - settleBSB = analysis.getString("bsb_no"); - settleAccountNo = analysis.getString("account_no").replaceAll("\\D", ""); - periodStart = analysis.getDate("period_start"); - periodEnd = analysis.getDate("period_end"); - if (DateUtils.isSameDay(periodStart, periodEnd)) { - if (DateUtils.isSameDay(periodStart, startOfMon.toDate())) { - periodEnd = DateUtils.addDays(periodEnd, 1); - } else { - periodStart = DateUtils.addDays(periodStart, -1); - } - } - grossPayment = analysis.getBigDecimal("gross_payment"); - transactionCount = analysis.getIntValue("pay_count"); - totalRefund = analysis.getBigDecimal("total_refund"); - refundCount = analysis.getIntValue("refund_count"); - } - - public void fillSystemInfo(String customer, String systemDesc, String systemAccount) { - this.customer = customer; - this.description = systemDesc; - this.accountNumber = systemAccount; - } - - @Override - public StringBuilder buildLine(StringBuilder builder) { - StringBuilder line = new StringBuilder(); - appendNParam(line, 1400, 4); - appendAParam(line, identifier, 4); - appendAParam(line, customer, 25); - appendAParam(line, description, 40); - appendAParam(line, accountNumber, 25); - appendAParam(line, settleAccountName, 30); - appendNParam(line, settleBSB, 6); - appendNParam(line, settleAccountNo, 30); - appendDParam(line, periodStart, 8); - appendDParam(line, periodEnd, 8); - appendAParam(line, currency, 3); - appendNParam(line, grossPayment.intValue(), 13); - appendNParam(line, transactionCount, 13); - appendNParam(line, totalRefund.intValue(), 13); - appendNParam(line, refundCount, 13); - appendNParam(line, cashoutAmount.intValue(), 13); - appendNParam(line, cashoutCount, 13); - appendNParam(line, cashoutComponentAmount.intValue(), 20); - appendFiller(line, 1119); - builder.append(line); - return builder; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ATOReportFinishedConsumer.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/ATOReportFinishedConsumer.java deleted file mode 100644 index 8129587c3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ATOReportFinishedConsumer.java +++ /dev/null @@ -1,7 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import java.io.IOException; - -public interface ATOReportFinishedConsumer { - void accept(String brand, String content) throws IOException; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ATOReportService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/ATOReportService.java deleted file mode 100644 index bf1d5f092..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ATOReportService.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Date; - -/** - * Create by yixian at 2018-08-31 1:22 - */ -public interface ATOReportService { - - void exportBTTPSFile(Date from, Date to, ATOReportFinishedConsumer resultConsumer); - - void startExportTask(Date from, Date to); - - JSONObject taskStatus(); - - void downloadFile(HttpServletResponse resp) throws IOException; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/AmountAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/AmountAnalysisService.java deleted file mode 100644 index 2132a7ac7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/AmountAnalysisService.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yishuqian on 27/10/2017. - */ -public interface AmountAnalysisService { - List getAmountRangeAnalysis(JSONObject params); - - JSONObject getAmountRangeOrders(AnalysisBean analysisBean); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/AreaMerchantTradeAnalysis.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/AreaMerchantTradeAnalysis.java deleted file mode 100644 index 791f273fc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/AreaMerchantTradeAnalysis.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import au.com.royalpay.payment.manage.analysis.beans.AreaMerchantTradeQueryBean; -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yuan on 2018/6/5. - */ -public interface AreaMerchantTradeAnalysis { - JSONObject listAreaMerchantTrade(JSONObject manager,AreaMerchantTradeQueryBean queryBean); - - void importTradeExcel(JSONObject manager,AreaMerchantTradeQueryBean queryBean,HttpServletResponse response) throws Exception; - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/BDAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/BDAnalysisService.java deleted file mode 100644 index 7f9360453..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/BDAnalysisService.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * Created by yishuqian on 30/09/2016. - */ -public interface BDAnalysisService { - List getSalesAnalysis(JSONObject jsonObject); - - List getSalesPartnersByBD(JSONObject jsonObject); - - List getSalesPartnersReportByBD(JSONObject jsonObject); - - void exportSalesExcel(AnalysisBean analysisBean, HttpServletResponse httpResponse, JSONObject manager) throws IOException; - - void exportPartnerExcelByBd(AnalysisBean analysisBean, HttpServletResponse httpResponse,JSONObject manager) throws IOException; - - void exportPartnerExcelByData(AnalysisBean analysisBean, HttpServletResponse httpResponse,JSONObject manager) throws IOException; - - /** - * 开通商户按bd统计 - * - * @param params begin(date,included);end(date,excluded);org_id;source(1-bd creation,2-others:applies,distributed) - * @return bd_id, bd_name, num - */ - List approvedAnalysis(JSONObject params); - - /** - * BD销售每日数据统计 - * @param format - */ - void generateReport(String format); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ChannelsAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/ChannelsAnalysisService.java deleted file mode 100644 index d40b4a3d3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ChannelsAnalysisService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yuan on 2017/8/22. - */ -public interface ChannelsAnalysisService { - - List getChannelMount(JSONObject params); - - List getChannelDate(JSONObject params); - - void exportData(JSONObject params, HttpServletResponse resp); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ClientRatesAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/ClientRatesAnalysisService.java deleted file mode 100644 index 80b8ca5b0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/ClientRatesAnalysisService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import au.com.royalpay.payment.manage.analysis.beans.ClientRateQueryBean; -import com.alibaba.fastjson.JSONObject; -import java.util.Date; - -/** - * Created by yixian on 2016-11-08. - */ -public interface ClientRatesAnalysisService { - JSONObject listAnalysisOfBDUsers(JSONObject manager, String orgId,String orgId2, Date beginDate, Date endDate); - - JSONObject listAllClientRates(Integer orgId, ClientRateQueryBean query); - - JSONObject listClientRatesOfBDUser(String bdId, ClientRateQueryBean query); - - void saveReviewEvent(String clientMoniker, String managerId, String reviewDate, String desc); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java deleted file mode 100644 index f80b125ae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 10/11/2016. - */ -public interface CustomersAnalysisService { - List getCustomersAnalysis(JSONObject params); - - JSONObject getChannelAmountAnalysis(JSONObject params); - - JSONObject getCBBankChannelAmountAnalysis(JSONObject params); - - JSONObject getCustomersRanking(JSONObject params, int page, int limit); - - JSONObject getCustomersTotal(JSONObject params); - - JSONObject getOrdersByOpenid(JSONObject params, int page, int limit); - - void sendPartnerTransactionDaily(Date date); - - List getCustomersAnalysisMonthly(JSONObject params); - - JSONObject getUserEcharts(JSONObject params, JSONObject manager); -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DailyReport.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/DailyReport.java deleted file mode 100644 index 0f71a5ffb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DailyReport.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 16/11/2017. - */ -public interface DailyReport { - void generateReport(String date, boolean send_msg); - - JSONObject getReport(String reportId, String openid); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardAnalysisTask.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardAnalysisTask.java deleted file mode 100644 index 277df43fd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardAnalysisTask.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import java.util.Date; - -/** - * Created by yixian on 2016-11-14. - */ -public interface DashboardAnalysisTask { - void generateCustomersAndOrdersStatistics(Date analysisDate); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java deleted file mode 100644 index 2f04724b0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-07-28. - */ -public interface DashboardService { - JSONObject getCommonAnalysis1(JSONObject params); - - JSONObject getCommonAnalysis3(JSONObject params); - - JSONObject getCommonAnalysis2(JSONObject params); - - JSONObject getCommonAnalysis4(JSONObject params); - -// JSONObject getCommonAnalysis(JSONObject params); - - List getTradeInTypes(JSONObject params); - - List getTopTradePartners(JSONObject params, int limit); - - List getTopTradePartnersNew(JSONObject params); - - List getTradeAnalysisInHours(JSONObject params); - - - List getTradeAnalysisInTime(JSONObject params); - - List getPartnerTradeAnalysisInDays(JSONObject params); - - List getTradeAnalysisInDays(JSONObject params); - - List getClientsTradeAnalysisInDays(JSONObject params); - - JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean); - - JSONObject getCommonAnalysisByChannel(JSONObject partner, AnalysisBean partnerAnalysisBean); - - List getTradeAnalysisInHours(JSONObject partner, AnalysisBean partnerAnalysisBean); - - List getTradeAnalysisInDays(JSONObject partner, AnalysisBean partnerAnalysisBean); - - List getPartnersInTypes(JSONObject params); - - List getPartnersByTradeType(JSONObject params); - - List listExchangeRateHistory(String begin, String end); - - List getCustomersAndOrdersInDays(JSONObject partner, AnalysisBean partnerAnalysisBean); - - JSONObject getNewRecord(); - - JSONObject getPlatformAmount(JSONObject params); - - void generateCustomersAndOrdersStatistics(Date analysisDate); - - void generateCustomersAndOrdersStatisticsByClientMoniker(Date analysisDate,String clientId); - - JSONObject getOrderAndCustomerPerDay(JSONObject partner,AnalysisBean partnerAnalysisBean); - - List getStatisticsCustomersAndOrdersInDays(JSONObject partner, AnalysisBean partnerAnalysisBean); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/EstimateAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/EstimateAnalysisService.java deleted file mode 100644 index cdf011d0b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/EstimateAnalysisService.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by Tayl0r on 2017/7/3. - */ -public interface EstimateAnalysisService { - - List listFutureInfo() throws Exception; - - void clearEstimateFutureCache(); - - void generateSettleAmount(); - - void generateTransactionData(); - - List listEstimateLog(int logType, String date); - - void initSettleAmount(String date) throws Exception; - - void initTransactionData(String date) throws Exception; - - List listEstimateLogs(String start_date, String end_date); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/EstimateCacheSupport.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/EstimateCacheSupport.java deleted file mode 100644 index 74c42db1a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/EstimateCacheSupport.java +++ /dev/null @@ -1,6 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -public interface EstimateCacheSupport { - - void clearEstimateFutureCache(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/OrderSuccessRateAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/OrderSuccessRateAnalysisService.java deleted file mode 100644 index 204d6ec99..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/OrderSuccessRateAnalysisService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; - -/** - * Created by yixian on 2016-11-10. - */ -public interface OrderSuccessRateAnalysisService { - JSONObject analysisOrderSuccessRates(Date beginDate, Date endDate); - - JSONObject analysisDateDetail(Date date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/OrgAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/OrgAnalysisService.java deleted file mode 100644 index 4e8faebf2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/OrgAnalysisService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yishuqian on 27/02/2017. - */ -public interface OrgAnalysisService { - List getSalesAnalysis(JSONObject params,JSONObject manager); - - List getPartnersSaleByOrgId(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java deleted file mode 100644 index ce02b7b9f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import com.alibaba.fastjson.JSONObject; -import java.util.List; - -/** - * Created by yishuqian on 20/02/2017. - */ -public interface PartnerCardDashboardService { - JSONObject getCommonAnalysis(String clientMoniker); - - JSONObject getTransactionAnalysis(String clientMoniker); - - List getOrderCustomerChartAnalysis(String clientMoniker); - - List getTransTypesAnalysis(String clientMoniker); - - JSONObject getOrderAndCustomerPerDay(String clientMoniker); - - List getTradeAnalysisInHours(String clientMoniker); - - JSONObject getSettlementLog(String clientMoniker, TradeLogQuery query); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnersAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnersAnalysisService.java deleted file mode 100644 index 758a615ad..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnersAnalysisService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -public interface PartnersAnalysisService { - List getNewPartnersAnalysis(JSONObject params); - - List getTradePartnersAnalysis(JSONObject params); - - List getPartnersTypesAnalysis(JSONObject params); - - List getPartnersSettlementAnalysis(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java deleted file mode 100644 index 232339e9f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.text.ParseException; - -public interface PlatformClearService { - - JSONObject getPlatformSettleLog(String channel, int page, int limit); - - JSONObject getChannelSettleLog(String channel); - - void verifySettleLogByDate(String startDate, String endDate, String channel) throws ParseException; - - void generateSettleLogs(); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformRevenueService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformRevenueService.java deleted file mode 100644 index 3b713604b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformRevenueService.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by Tayl0r on 2017/5/24. - */ -public interface PlatformRevenueService { - - JSONObject getPlatformRevenue(int year, int monthOfYear, String month); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/RefundAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/RefundAnalysisService.java deleted file mode 100644 index 97a3d3157..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/RefundAnalysisService.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.text.ParseException; -import java.util.List; - -/** - * Created by Tayl0r on 2017/6/7. - */ -public interface RefundAnalysisService { - JSONObject findRefundInfoListByDay(String begin, String end) throws ParseException; - - List findRefundCount(String begin, String end) throws ParseException; - - List listRefundInfoByDay(String begin, String end) throws ParseException; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/WeekReporter.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/WeekReporter.java deleted file mode 100644 index 55edf215e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/WeekReporter.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2017-03-03. - */ -public interface WeekReporter { - JSONObject getReport(String reportId, String openid); - - void generateReport(String date, boolean sendMsg); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ATOReportServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ATOReportServiceImpl.java deleted file mode 100644 index 36d51fe04..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ATOReportServiceImpl.java +++ /dev/null @@ -1,347 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.manage.analysis.beans.ato.*; -import au.com.royalpay.payment.manage.analysis.core.ATOReportFinishedConsumer; -import au.com.royalpay.payment.manage.analysis.core.ATOReportService; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.Charsets; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.IOUtils; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.http.ContentDisposition; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; - -/** - * Create by yixian at 2018-08-31 1:23 - */ -@Service -@EnableConfigurationProperties(ATOCompanyConfig.class) -public class ATOReportServiceImpl implements ATOReportService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private TransactionMapper transactionMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private PaymentApi paymentApi; - private final ATOCompanyConfig atoCompanies; - @Value("classpath:data/category/billbuddyindustry.json") - private org.springframework.core.io.Resource industryResource; - private Map industryMap; - private final StringRedisTemplate redisTemplate; - private final String prefix; - private Progress progress; - - public ATOReportServiceImpl(StringRedisTemplate redisTemplate, @Value("${app.redis.prefix}") String prefix, ATOCompanyConfig atoCompanies) { - this.redisTemplate = redisTemplate; - this.prefix = prefix; - this.atoCompanies = atoCompanies; - } - - @PostConstruct - public void loadIndustryConfiguration() throws IOException { - industryMap = new HashMap<>(); - JSONArray config = JSON.parseArray(IOUtils.toString(industryResource.getInputStream(), Charsets.UTF_8)); - for (int i = 0; i < config.size(); i++) { - JSONObject industry = config.getJSONObject(i); - loadIndustry(industry, null); - } - } - - private void loadIndustry(JSONObject industry, String parentCategory) { - JSONArray children = industry.getJSONArray("children"); - String category = industry.getString("category"); - String code = industry.getString("mccCode"); - if (category == null && parentCategory == null) { - throw new ServerErrorException("Industry Have No Category Code:" + code); - } - category = category == null ? parentCategory : category; - industryMap.put(code, category); - if (children != null && !children.isEmpty()) { - for (int i = 0; i < children.size(); i++) { - JSONObject subIndustry = children.getJSONObject(i); - loadIndustry(subIndustry, category); - } - } - } - - @Override - public void exportBTTPSFile(Date from, Date to, ATOReportFinishedConsumer resultConsumer) { - atoCompanies.getCompanies().forEach(company -> exportBTTPS(company, from, to, resultConsumer)); - - } - - private void exportBTTPS(ATOCompanyConfig.ATOCompany company, Date from, Date to, ATOReportFinishedConsumer resultConsumer) { - if (progress != null) { - progress.setStatus("Init task"); - progress.setBrand(company.getBrand()); - synchronizeProgress(); - } - ATOBulkData.IntermediaryData intermediary = new ATOBulkData.IntermediaryData(company.getAbn(), company.getCompany(), company.reference()) - .setAddress(company.getAddressInfo()) - .setContactInfo(company.getContactInfo()); - ATOBulkData data = new ATOBulkData(intermediary); - - ReportingPartyData reportingParty = new ReportingPartyData(from, to, company.getAbn(), "001", company.getCompany(), "INHOUSE " + company.getShortCompanyName()) - .setAddress(company.getAddressInfo()) - .setPostalAddress(company.getAddressInfo()) - .setContactInfo(company.getContactInfo()) - .setTradingName(company.getBrand()); - intermediary.addReportingParty(reportingParty); - - DateTime fromDateTime = new DateTime(from).withTimeAtStartOfDay(); - DateTime toDateTime = new DateTime(to).plusDays(1).withTimeAtStartOfDay(); - DateTime startOfMon = new DateTime(fromDateTime); - DateTime endOfMon = new DateTime(fromDateTime.plusMonths(1).withDayOfMonth(1)); - while (endOfMon.isBefore(toDateTime)) { - logger.debug("Exporting date range:{} ~ {}", startOfMon.toString("yyyy-MM-dd"), endOfMon.toString("yyyy-MM-dd")); - loadMonthTransactions(company, reportingParty, startOfMon, endOfMon); - startOfMon = new DateTime(endOfMon); - endOfMon = new DateTime(endOfMon.plusMonths(1)); - } - endOfMon = new DateTime(toDateTime); - logger.debug("Exporting date range:{} ~ {}", startOfMon.toString("yyyy-MM-dd"), endOfMon.toString("yyyy-MM-dd")); - loadMonthTransactions(company, reportingParty, startOfMon, endOfMon); - logger.info("output BTTPS file"); - try { - resultConsumer.accept(company.getBrand(), data.outputBTTPS()); - } catch (IOException e) { - throw new ServerErrorException("Failed to export bttps file", e); - } - } - - private String progressKey() { - return prefix + ":tasks:exporting-bttps"; - } - - private String reportFileKey() { - return prefix + ":caching:exporting-bttps-file"; - } - - @Override - public void startExportTask(Date from, Date to) { - if (progress != null && !progress.isFinished()) { - throw new BadRequestException("In Progress"); - } - if (redisTemplate.boundValueOps(progressKey()).get() != null) { - throw new BadRequestException("In Progress"); - } - new Thread(() -> { - progress = new Progress(); - synchronizeProgress(); - try { - exportBTTPSFile(from, to, (brand, content) -> { - byte[] contentBytes = content.getBytes(StandardCharsets.UTF_8); - progress.setStatus(brand + " Uploading,filesize:" + contentBytes.length); - String filename = brand + "_ato_report_" + new DateTime(from).toString("yyyyMMdd") + "_to_" + new DateTime(to).toString("yyyyMMdd") + ".bttps"; - File saveFile = new File("/var/log/payment/" + filename); - FileUtils.writeByteArrayToFile(saveFile, contentBytes); - String path = saveFile.getAbsolutePath(); - logger.info("uploaded ATO report to {}", path); - progress.setFileid(path); - redisTemplate.boundValueOps(reportFileKey()).set(path, Duration.ofDays(1)); - }); - - } catch (Exception e) { - progress.setStatus(e.getMessage()); - logger.error("output bttps file failed", e); - synchronizeProgress(); - } finally { - progress.setFinished(); - synchronizeProgress(); - } - }).start(); - } - - @Override - public JSONObject taskStatus() { - String status = redisTemplate.boundValueOps(progressKey()).get(); - if (status != null) { - JSONObject std = JSON.parseObject(status); - std.remove("fileid"); - return std; - } else { - String file = redisTemplate.boundValueOps(reportFileKey()).get(); - JSONObject std = new JSONObject(); - if (file != null) { - std.put("success", true); - std.put("finished", true); - } - return std; - } - } - - @Override - public void downloadFile(HttpServletResponse resp) throws IOException { - String file = redisTemplate.boundValueOps(reportFileKey()).get(); - if (file != null) { - String filename = FilenameUtils.getName(file); - resp.setHeader(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition.builder("attachment").filename(filename).build().toString()); - resp.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); - try (OutputStream out = resp.getOutputStream(); - InputStream in = new FileInputStream(file)) { - IOUtils.copy(in, out); - out.flush(); - } - } else { - throw new BadRequestException("No file available"); - } - } - - private void loadMonthTransactions(ATOCompanyConfig.ATOCompany company, ReportingPartyData reportingParty, DateTime startOfMon, DateTime endOfMon) { - List channels = company.balanceGroups().stream().flatMap(group -> paymentApi.channelsInGroup(group).stream()).distinct().collect(Collectors.toList()); - List clients = clientMapper.listClientsWithTransactionsSettled(channels, startOfMon.toDate(), endOfMon.toDate()); - if (progress != null) { - progress.setMonth(startOfMon, clients); - synchronizeProgress(); - } - clients.parallelStream().forEach(clientId -> loadClientMonthTransactions(channels, reportingParty, clientId, startOfMon, endOfMon)); - } - - private void loadClientMonthTransactions(List channels, ReportingPartyData reportingParty, Integer clientId, DateTime startOfMon, DateTime endOfMon) { - BusinessData biz = reportingParty.findBusiness(clientId); - logger.debug("Exporting date range for client[{}]:{} ~ {}", clientId, startOfMon.toString("yyyy-MM-dd"), endOfMon.toString("yyyy-MM-dd")); - if (biz == null) { - JSONObject cli = clientMapper.findClientIgnoreInvalid(clientId); - AddressInfo addr = new AddressInfo(cli.getString("address"), cli.getString("suburb"), cli.getString("state"), cli.getString("postcode"), cli.getString("country")); - ContactInfo contact = new ContactInfo(cli.getString("contact_person"), cli.getString("contact_phone"), cli.getString("contact_email")); - String industry = industryMap.getOrDefault(cli.getString("royalpayindustry"), cli.getString("royalpayindustry")); - String clientMoniker = cli.getString("client_moniker"); - biz = new BusinessData(cli.getDate("create_time"), cli.getString("abn"), cli.getString("acn"), - cli.getString("company_name"), cli.getString("short_name"), clientMoniker, - industry, "O") - .setAddress(addr) - .setPostalAddress(addr) - .setContactInfo(contact); - reportingParty.addBusiness(clientId, biz); - } - List analysisList = transactionMapper.analysisForATOReport(clientId, channels, startOfMon.toDate(), endOfMon.toDate()); - for (JSONObject analysis : analysisList) { - biz.addTransaction(new TransactionSummaryData(analysis, startOfMon, endOfMon)); - } - if (progress != null) { - progress.markClientFinished(clientId); - synchronizeProgress(); - } - } - - private void synchronizeProgress() { - redisTemplate.boundValueOps(progressKey()).set(JSON.toJSONString(progress), Duration.ofMinutes(5)); - } - - public static class Progress { - private static final Logger logger = LoggerFactory.getLogger(Progress.class); - private String brand; - private String currentMonth; - private Map clientsStatus; - private final String server; - private String fileid; - private boolean finished; - - private String status; - - public Progress() { - status = "Init"; - server = PlatformEnvironment.getEnv().appName(true); - } - - public String getBrand() { - return brand; - } - - public Progress setBrand(String brand) { - this.brand = brand; - return this; - } - - public void setMonth(DateTime start, List clients) { - currentMonth = start.toString("yyyy-MM"); - clientsStatus = clients.stream().collect(ConcurrentHashMap::new, (map, cid) -> map.put(cid, false), Map::putAll); - status = "Exporting"; - } - - public String getFileid() { - return fileid; - } - - public Progress setFileid(String fileid) { - this.fileid = fileid; - return this; - } - - public boolean isFinished() { - return finished; - } - - public boolean isSuccess() { - return fileid != null; - } - - public void setFinished() { - this.finished = true; - setStatus("Finished!"); - } - - public String getStatus() { - return status; - } - - public int getProgress() { - if (clientsStatus == null || clientsStatus.isEmpty()) { - return 0; - } - int total = clientsStatus.size(); - long finishedCount = clientsStatus.values().stream().filter(success -> success).count(); - return (int) finishedCount * 100 / total; - } - - public String getCurrentMonth() { - return currentMonth; - } - - public String getServer() { - return server; - } - - public Progress setStatus(String status) { - logger.info("ATO export status:{}", status); - this.status = status; - return this; - } - - public void markClientFinished(Integer clientId) { - if (clientsStatus != null) { - clientsStatus.put(clientId, true); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/AmountAnalysisServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/AmountAnalysisServiceImp.java deleted file mode 100644 index 68a4f8627..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/AmountAnalysisServiceImp.java +++ /dev/null @@ -1,96 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.AmountAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by yishuqian on 27/10/2017. - */ -@Service -public class AmountAnalysisServiceImp implements AmountAnalysisService { - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - @Resource - private SysConfigManager sysConfigManager; - - - @Override - public List getAmountRangeAnalysis(JSONObject params) { - params.remove("amount_from"); - params.remove("amount_to"); - ArrayList res = new ArrayList<>(); - JSONObject config = sysConfigManager.getSysConfig(); - String amount_range = config.getString("amount_range_analysis"); - JSONArray ar = JSON.parseArray(amount_range); -// JSONObject amountData = transactionAnalysisMapper.getAmountRangeAnalysis(params); -// for (Map.Entry entry :amountData.entrySet()){ -// -// } - if (ar.isEmpty()) { - return res; - } - PageList logs = transactionAnalysisMapper.listAmountRangeOrders(params, - new PageBounds(Order.formString("transaction_time.desc"))); - for (JSONObject log : logs) { - if (!ar.isEmpty()) { - for (int i = 0; i < ar.size(); i++) { - JSONObject amountObj = ar.getJSONObject(i); -// params.put("amount_from",amountObj.getString("from").length()>0?amountObj.getBigDecimal("from"):null); -// params.put("amount_to",amountObj.getString("to").length()>0?amountObj.getBigDecimal("to"):null); - if (log.getBigDecimal("clearing_amount").compareTo(amountObj.getBigDecimal("from")) >= 0) { - if (amountObj.getString("to").length() > 0) { - if (log.getBigDecimal("clearing_amount").compareTo(amountObj.getBigDecimal("to")) < 0) { - if (!amountObj.containsKey("counts")) { - amountObj.put("counts", 1); - } else { - amountObj.put("counts", amountObj.getIntValue("counts") + 1); - } - } - } else { - if (!amountObj.containsKey("counts")) { - amountObj.put("counts", 1); - } else { - amountObj.put("counts", amountObj.getIntValue("counts") + 1); - } - } - - } - } - } - } - if (!ar.isEmpty()) { - for (int i = 0; i < ar.size(); i++) { - JSONObject amountObj = ar.getJSONObject(i); - res.add(amountObj); - } - } - - return res; - } - - @Override - public JSONObject getAmountRangeOrders(AnalysisBean analysisBean) { - JSONObject params = analysisBean.toParams(null); - PageList logs = transactionAnalysisMapper.listAmountRangeOrders(params, - new PageBounds(analysisBean.getPage(), analysisBean.getLimit(), Order.formString("transaction_time.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - return result; - - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/AreaMerchantTradeAnalysisImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/AreaMerchantTradeAnalysisImpl.java deleted file mode 100644 index 5f62099df..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/AreaMerchantTradeAnalysisImpl.java +++ /dev/null @@ -1,388 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.beans.AreaMerchantTradeQueryBean; -import au.com.royalpay.payment.manage.analysis.core.AreaMerchantTradeAnalysis; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.NumberFormat; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Created by yuan on 2018/6/5. - */ -@Service -public class AreaMerchantTradeAnalysisImpl implements AreaMerchantTradeAnalysis{ - - @Autowired - private TransactionAnalysisMapper transactionAnalysisMapper; - - @Autowired - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - - @Autowired - private OrgManager orgManager; - - @Autowired - private SysConfigManager sysConfigManager; - @Override - public JSONObject listAreaMerchantTrade(JSONObject manager, AreaMerchantTradeQueryBean queryBean) { - if (manager == null || !manager.getBooleanValue("is_valid")) { - throw new ForbiddenException(); - } - JSONObject params = queryBean.toParams(); - PageList clientAmount = null; - orgManager.checkOrgIds(manager,params); - if(params.containsKey("begin") && params.containsKey("end")){ - if (params.getDate("end").after(new Date()) && params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1))==0){ - clientAmount = transactionAnalysisMapper.getAreaMerchantAmountAnalysis(params,new PageBounds(queryBean.getPage(),queryBean.getLimit())); - }else { - clientAmount = customerAndOrdersStatisticsMapper.getAreaMerchantTradeAnalysis(params,new PageBounds(queryBean.getPage(),queryBean.getLimit())); - } - } - return PageListUtils.buildPageListResult(clientAmount); - } - - @Override - public void importTradeExcel(JSONObject manager, AreaMerchantTradeQueryBean queryBean,HttpServletResponse response) throws Exception { - if (manager == null || !manager.getBooleanValue("is_valid")) { - throw new ForbiddenException(); - } - JSONObject params = queryBean.toParams(); - orgManager.checkOrgIds(manager,params); - PageList clientAmount = null; - List clientAmountLastCycle = null; - - if(params.containsKey("begin") && params.containsKey("end")){ - if (params.getDate("end").after(new Date()) && params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1))==0){ - clientAmount = transactionAnalysisMapper.getAreaMerchantAmountAnalysis(params,new PageBounds()); - clientAmountLastCycle = transactionAnalysisMapper.getAreaMerchantAmountByCycle(params); - }else { - clientAmount = customerAndOrdersStatisticsMapper.getAreaMerchantTradeAnalysis(params,new PageBounds()); - clientAmountLastCycle = customerAndOrdersStatisticsMapper.getAreaMerchantTradeByLastCycle(params); - } - } - Map cycleMap = clientAmountLastCycle.stream().collect( - Collectors.toMap(cylce -> cylce.getString("client_moniker"), cylce -> cylce)); - List allAmount = clientAmount.stream().map(amount -> {return toAmount(cycleMap.get(amount.getString("client_moniker")), amount);}).collect(Collectors.toList()); - - HSSFWorkbook workbook = new HSSFWorkbook(); - // 声明一个工作薄 - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet("clientAmount_excel"); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth((short) 40); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index); - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style.setBorderRight(HSSFCellStyle.BORDER_THIN); - style.setBorderTop(HSSFCellStyle.BORDER_THIN); - style.setAlignment(HSSFCellStyle.ALIGN_CENTER); - HSSFFont font = workbook.createFont(); - font.setFontHeightInPoints((short) 16); - font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); - // 把字体应用到当前的样式 - style.setFont(font); - - HSSFCellStyle style2 = workbook.createCellStyle(); - // 设置这些样式 - style2.setFillForegroundColor(HSSFColor.WHITE.index); - style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style2.setBorderRight(HSSFCellStyle.BORDER_THIN); - style2.setBorderTop(HSSFCellStyle.BORDER_THIN); - style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); - HSSFFont font2 = workbook.createFont(); - font2.setFontHeightInPoints((short) 12); - font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - - HSSFCellStyle style3 = workbook.createCellStyle(); - style3.setFillForegroundColor(HSSFColor.WHITE.index); - style3.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style3.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style3.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style3.setBorderRight(HSSFCellStyle.BORDER_THIN); - style3.setBorderTop(HSSFCellStyle.BORDER_THIN); - style3.setAlignment(HSSFCellStyle.ALIGN_CENTER); - HSSFFont font3 = workbook.createFont(); - font3.setFontHeightInPoints((short) 12); - font3.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - font3.setColor(HSSFColor.GREEN.index); - style3.setFont(font3); - HSSFCellStyle style4 = workbook.createCellStyle(); - style4.setFillForegroundColor(HSSFColor.WHITE.index); - style4.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style4.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style4.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style4.setBorderRight(HSSFCellStyle.BORDER_THIN); - style4.setBorderTop(HSSFCellStyle.BORDER_THIN); - style4.setAlignment(HSSFCellStyle.ALIGN_CENTER); - HSSFFont font4 = workbook.createFont(); - font4.setFontHeightInPoints((short) 12); - font4.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - font4.setColor(HSSFColor.RED.index); - style4.setFont(font4); - HSSFRow row0 = sheet.createRow(0); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell02 = row0.createCell(2); - HSSFCell cell03 = row0.createCell(3); - HSSFCell cell04 = row0.createCell(4); - HSSFCell cell05 = row0.createCell(5); - HSSFCell cell06 = row0.createCell(6); - HSSFCell cell07 = row0.createCell(7); - HSSFCell cell08 = row0.createCell(8); - HSSFCell cell09 = row0.createCell(9); - HSSFCell cell10 = row0.createCell(10); - HSSFCell cell11 = row0.createCell(11); - HSSFCell cell12 = row0.createCell(12); - HSSFCell cell13 = row0.createCell(13); - HSSFCell cell14 = row0.createCell(14); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell02.setCellStyle(style); - cell03.setCellStyle(style); - cell04.setCellStyle(style); - cell05.setCellStyle(style); - cell06.setCellStyle(style); - cell07.setCellStyle(style); - cell08.setCellStyle(style); - cell09.setCellStyle(style); - cell10.setCellStyle(style); - cell11.setCellStyle(style); - cell12.setCellStyle(style); - cell13.setCellStyle(style); - cell14.setCellStyle(style); - - HSSFRichTextString text00 = new HSSFRichTextString("Partner Code"); - HSSFRichTextString text01 = new HSSFRichTextString("Short name"); - HSSFRichTextString text02 = new HSSFRichTextString("Bd name"); - HSSFRichTextString text03 = new HSSFRichTextString("State"); - HSSFRichTextString text04 = new HSSFRichTextString("Suburb"); - HSSFRichTextString text05 = new HSSFRichTextString("Industry"); - HSSFRichTextString text06 = new HSSFRichTextString("Amount"); - HSSFRichTextString text07 = new HSSFRichTextString("Last Cycle"); - HSSFRichTextString text08 = new HSSFRichTextString("Orders"); - HSSFRichTextString text09 = new HSSFRichTextString("Alipay Amount"); - HSSFRichTextString text10 = new HSSFRichTextString("Last Cycle"); - HSSFRichTextString text11 = new HSSFRichTextString("Alipay Orders"); - HSSFRichTextString text12 = new HSSFRichTextString("Wechat Amount"); - HSSFRichTextString text13 = new HSSFRichTextString("Last Cycle"); - HSSFRichTextString text14 = new HSSFRichTextString("Wechat Orders"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell02.setCellValue(text02); - cell03.setCellValue(text03); - cell04.setCellValue(text04); - cell05.setCellValue(text05); - cell06.setCellValue(text06); - cell07.setCellValue(text07); - cell08.setCellValue(text08); - cell09.setCellValue(text09); - cell10.setCellValue(text10); - cell11.setCellValue(text11); - cell12.setCellValue(text12); - cell13.setCellValue(text13); - cell14.setCellValue(text14); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - String json = sysConfig.getString("royalpayindustry.json"); - JSONArray jsonArray = JSONObject.parseArray(json); - for (int i = 0; i < allAmount.size(); i++) { - HSSFRow row = sheet.createRow(i + 1); - HSSFCell cell0 = row.createCell(0); - HSSFCell cell1 = row.createCell(1); - HSSFCell cell2 = row.createCell(2); - HSSFCell cell3 = row.createCell(3); - HSSFCell cell4 = row.createCell(4); - HSSFCell cell5 = row.createCell(5); - HSSFCell cell6 = row.createCell(6); - HSSFCell cell7 = row.createCell(7); - HSSFCell cell8 = row.createCell(8); - HSSFCell cell9 = row.createCell(9); - HSSFCell cel10 = row.createCell(10); - HSSFCell cel11 = row.createCell(11); - HSSFCell cel12 = row.createCell(12); - HSSFCell cel13 = row.createCell(13); - HSSFCell cel14 = row.createCell(14); - cell0.setCellStyle(style2); - cell1.setCellStyle(style2); - cell2.setCellStyle(style2); - cell3.setCellStyle(style2); - cell4.setCellStyle(style2); - cell5.setCellStyle(style2); - cell6.setCellStyle(style2); - cell8.setCellStyle(style2); - cell9.setCellStyle(style2); - cel11.setCellStyle(style2); - cel12.setCellStyle(style2); - cel14.setCellStyle(style2); - JSONObject thisAmount =clientAmount.get(i); - NumberFormat percent = NumberFormat.getPercentInstance(); - BigDecimal lastTotal = new BigDecimal(1); - BigDecimal alipayTotal = new BigDecimal(1); - BigDecimal wechatToatl = new BigDecimal(1); - - if(thisAmount.containsKey("old_total")){ - if(thisAmount.getBigDecimal("total").compareTo(BigDecimal.ZERO)==0){ - lastTotal = new BigDecimal(-1); - if(thisAmount.getBigDecimal("old_total").compareTo(BigDecimal.ZERO) == 0){ - lastTotal = BigDecimal.ZERO; - } - } - if(thisAmount.getBigDecimal("total").compareTo(BigDecimal.ZERO)>0 && thisAmount.getBigDecimal("old_total").compareTo(BigDecimal.ZERO)>0) { - lastTotal = (thisAmount.getBigDecimal("total").subtract(thisAmount.getBigDecimal("old_total"))).divide(thisAmount.getBigDecimal("old_total"), 4, RoundingMode.HALF_UP); - } - }else { - if(thisAmount.getBigDecimal("total").compareTo(BigDecimal.ZERO) == 0){ - lastTotal = BigDecimal.ZERO; - } - } - if(thisAmount.containsKey("old_alipay_total")){ - if(thisAmount.getBigDecimal("alipay_total").compareTo(BigDecimal.ZERO)==0){ - alipayTotal = new BigDecimal(-1); - if(thisAmount.getBigDecimal("old_alipay_total").compareTo(BigDecimal.ZERO) == 0){ - alipayTotal = BigDecimal.ZERO; - } - } - if(thisAmount.getBigDecimal("alipay_total").compareTo(BigDecimal.ZERO)>0 && thisAmount.getBigDecimal("old_alipay_total").compareTo(BigDecimal.ZERO)>0){ - alipayTotal = (thisAmount.getBigDecimal("alipay_total").subtract(thisAmount.getBigDecimal("old_alipay_total"))).divide(thisAmount.getBigDecimal("old_alipay_total"),4,RoundingMode.HALF_UP); - } - }else { - if(thisAmount.getBigDecimal("alipay_total").compareTo(BigDecimal.ZERO) == 0){ - alipayTotal = BigDecimal.ZERO; - } - } - - if(thisAmount.containsKey("old_wechat_toatl")){ - if(thisAmount.getBigDecimal("wechat_toatl").compareTo(BigDecimal.ZERO)==0){ - wechatToatl = new BigDecimal(-1); - if(thisAmount.getBigDecimal("old_wechat_toatl").compareTo(BigDecimal.ZERO) == 0){ - wechatToatl = BigDecimal.ZERO; - } - } - if(thisAmount.getBigDecimal("wechat_toatl").compareTo(BigDecimal.ZERO)>0 && thisAmount.getBigDecimal("old_wechat_toatl").compareTo(BigDecimal.ZERO)>0){ - wechatToatl = (thisAmount.getBigDecimal("wechat_toatl").subtract(thisAmount.getBigDecimal("old_wechat_toatl"))).divide(thisAmount.getBigDecimal("old_wechat_toatl"),4,RoundingMode.HALF_UP); - } - }else { - if(thisAmount.getBigDecimal("wechat_toatl").compareTo(BigDecimal.ZERO) == 0){ - wechatToatl = BigDecimal.ZERO; - } - } - if(lastTotal.compareTo(BigDecimal.ZERO)>=0){ - cell7.setCellStyle(style4); - }else { - cell7.setCellStyle(style3); - } - if(alipayTotal.compareTo(BigDecimal.ZERO)>=0){ - cel10.setCellStyle(style4); - }else { - cel10.setCellStyle(style3); - } - if(wechatToatl.compareTo(BigDecimal.ZERO)>=0){ - cel13.setCellStyle(style4); - }else { - cel13.setCellStyle(style3); - } - String industry = getRoyalpayIindustry(thisAmount.getString("royalpayindustry"),jsonArray); - HSSFRichTextString text0 = new HSSFRichTextString(thisAmount.getString("client_moniker")); - HSSFRichTextString text1 = new HSSFRichTextString(thisAmount.getString("short_name")); - HSSFRichTextString text2 = new HSSFRichTextString(thisAmount.getString("bd_user_name")); - HSSFRichTextString text3 = new HSSFRichTextString(thisAmount.getString("state")); - HSSFRichTextString text4 = new HSSFRichTextString(thisAmount.getString("suburb")); - HSSFRichTextString text5 = new HSSFRichTextString(industry == null?"":industry); - HSSFRichTextString text6 = new HSSFRichTextString(thisAmount.getString("total")); - HSSFRichTextString text7 = new HSSFRichTextString(percent.format(lastTotal.doubleValue())); - HSSFRichTextString text8 = new HSSFRichTextString(thisAmount.getString("orders")); - HSSFRichTextString text9 = new HSSFRichTextString(thisAmount.getString("alipay_total")); - HSSFRichTextString text_10 = new HSSFRichTextString(percent.format(alipayTotal.doubleValue())); - HSSFRichTextString text_11 = new HSSFRichTextString(thisAmount.getString("alipay_order")); - HSSFRichTextString text_12 = new HSSFRichTextString(thisAmount.getString("wechat_toatl")); - HSSFRichTextString text_13 = new HSSFRichTextString(percent.format(wechatToatl.doubleValue())); - HSSFRichTextString text_14 = new HSSFRichTextString(thisAmount.getString("wechat_order")); - cell0.setCellValue(text0); - cell1.setCellValue(text1); - cell2.setCellValue(text2); - cell3.setCellValue(text3); - cell4.setCellValue(text4); - cell5.setCellValue(text5); - cell6.setCellValue(text6); - cell7.setCellValue(text7); - cell8.setCellValue(text8); - cell9.setCellValue(text9); - cel10.setCellValue(text_10); - cel11.setCellValue(text_11); - cel12.setCellValue(text_12); - cel13.setCellValue(text_13); - cel14.setCellValue(text_14); - } - JSONObject parmerters = new JSONObject(); - parmerters.put("dateFrom", StringUtils.isNotBlank(queryBean.getBegin()) ? queryBean.getBegin() : ""); - parmerters.put("dateTo", StringUtils.isNotBlank(queryBean.getEnd()) ? queryBean.getEnd() : DateFormatUtils.format(new Date(), "yyyyMMdd")); - response.setContentType("application/vnd.ms-excel"); - String fileName = StringUtils.isEmpty(parmerters.getString("dateFrom")) ? parmerters.getString("dateTo") - : (parmerters.getString("dateFrom") + "~" + parmerters.getString("dateTo")); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); - OutputStream outputStream = response.getOutputStream(); - - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - private JSONObject toAmount(JSONObject cycle, JSONObject amount) { - if(amount != null && cycle!= null){ - amount.putAll(cycle); - } - return amount; - } - private String getRoyalpayIindustry(String industryMccCode,JSONArray jsonArray) { - String industry = null; - for(int i = 0;i getSalesAnalysis(JSONObject jsonObject) { - return listSalesAnalysis(jsonObject); - } - - private List listSalesAnalysis(JSONObject jsonObject) { - List listCountApproved = bdAnalysisMapper.queryBDNewMerchants(jsonObject); - List bdSaleList = bdSalesReportMapper.getBDSaleList(jsonObject); - for (JSONObject countApproved : listCountApproved) { - for (JSONObject saleList : bdSaleList) { - if (countApproved.getString("bd_id").equals(saleList.getString("bd_id"))) { - saleList.put("num", countApproved.getString("num")); - } - } - } - SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); - if (sd.format(jsonObject.getDate("end")).equals(sd.format(DateUtils.addDays(new Date(), 1)))) { - jsonObject.put("begin", DateUtils.addDays(jsonObject.getDate("end"), -1)); - jsonObject.put("end",jsonObject.getDate("end")); - List todaySaleList = bdAnalysisMapper.getBDSaleList(jsonObject); - for (JSONObject todayBDSaleItem : todaySaleList) { - boolean flag = false; - for(JSONObject baSaleItem: bdSaleList){ - if (baSaleItem.getString("bd_id").equals(todayBDSaleItem.getString("bd_id"))) { - BigDecimal newAmount = baSaleItem.getBigDecimal("total").add(todayBDSaleItem.getBigDecimal("total")); - baSaleItem.put("total",newAmount); - flag = true; - } - } - if (!flag) { - bdSaleList.add(todayBDSaleItem); - } - } - } - - return bdSaleList; - } - //单独计算当日数据 - - - @Override - public List getSalesPartnersByBD(JSONObject jsonObject) { - return bdAnalysisMapper.getBDSalePartnerList(jsonObject); - } - - @Override - public List getSalesPartnersReportByBD(JSONObject jsonObject) { - List bdAnalysis = bdAnalysisMapper.getBDSalePartnerReport(jsonObject); - List result = new ArrayList<>(); - String keys_1[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}; - String key_2[] = {"10", "11", "12"}; - result = getPartnerTypes(keys_1, result, 1, 5, bdAnalysis); - return getPartnerTypes(key_2, result, 2, 6, bdAnalysis); - } - - private List getPartnerTypes(String keys[], List result, int short_length, int long_length, List bdAnalysis) { - for (String key : keys) { - int countValue = 0; - int countTotal = 0; - JSONObject object = new JSONObject(); - JSONArray list = new JSONArray(); - for (JSONObject type : bdAnalysis) { - if (type.getString("royalpayindustry") != null && type.getString("royalpayindustry").startsWith(key) && (type.getString("royalpayindustry").length() == short_length || type.getString("royalpayindustry").length() == long_length)) { - countValue += type.getIntValue("partner_counts"); - countTotal += type.getIntValue("total"); - list.add(type); - } - } - if (countValue == 0) { - continue; - } - object.put("count_value", countValue); - object.put("count_total", countTotal); - object.put("mccCode", key); - object.put("children", list); - result.add(object); - } - return result; - } - - @Override - public void exportSalesExcel(AnalysisBean analysisBean, HttpServletResponse httpResponse, JSONObject manager) throws IOException { - httpResponse.setContentType("application/vnd.ms-excel"); - String fileName = analysisBean.getBegin_month() + "~" + analysisBean.getEnd_month(); -// String fileName = new String(URLEncoder.encode(defaultname,"utf8")); - httpResponse.setHeader("Content-Disposition", "attachment;filename=" - + fileName + ".xls"); - - - JSONObject params = analysisBean.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysisBean.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - } -// JSONObject bd_params = new JSONObject(); -// bd_params.put("mask", ManagerRole.BD_USER.getMask()); -// if (analysisBean.getOrg_id() != null){ -// bd_params.put("org_id",analysisBean.getOrg_id()); -// } - List bds = bdAnalysisMapper.getBDSaleList(params); - HSSFWorkbook workbook = new HSSFWorkbook(); - - for (JSONObject bd : bds) { - String bd_id = bd.getString("bd_id"); - String bd_name = bd.getString("bd_name"); - JSONObject monthParams = new JSONObject(); - monthParams.put("bd_id", bd_id); - monthParams.put("begin_month", analysisBean.getBegin_month()); - monthParams.put("end_month", analysisBean.getEnd_month()); - List monthTotalSale = bdAnalysisMapper.getMonthSalesList(monthParams); - for (JSONObject month : monthTotalSale) { - monthParams.put("month", month.getString("y_m")); - List clientsMonthSale = bdAnalysisMapper.getClientsMonthSale(bd_id, analysisBean.getBegin_month(), analysisBean.getEnd_month(), month.getString("y_m")); - month.put("clients", clientsMonthSale); - } - exportExcel(workbook, bd_name, monthTotalSale); - } - OutputStream outputStream = httpResponse.getOutputStream(); - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { - - e.printStackTrace(); - } - - } - - @Override - public List approvedAnalysis(JSONObject params) { - return bdAnalysisMapper.countApproved(params); - } - - /** - * BD销售每日数据统计 - * @param date - */ - @Override - public void generateReport(String date) { - try { - Date beginTime = DateUtils.parseDate(date, new String[]{"yyyy-MM-dd"}); - Date yesterdayEndTime = DateUtils.addDays(beginTime, 1); - String endDate = DateFormatUtils.format(yesterdayEndTime, "yyyy-MM-dd"); - Date endTime = DateUtils.parseDate(endDate, new String[]{"yyyy-MM-dd"}); - JSONObject params = new JSONObject(); - params.put("begin", beginTime); - params.put("end", endTime); - List bdSaleList = bdAnalysisMapper.getOneDayBDSaleList(params); - if (bdSaleList.size() != 0) { - for (JSONObject item : bdSaleList) { - JSONObject existBDSalesReport = bdSalesReportMapper.findByBDIdAndLogDate(item.getString("org_id"),item.getString("bd_id"),date,0); - if(existBDSalesReport==null){ - JSONObject object = new JSONObject(item); - object.put("log_id", UUID.randomUUID().toString()); - object.put("log_date", beginTime); - object.put("create_time", new Date()); - bdSalesReportMapper.save(object); - }else{ - existBDSalesReport.put("pay_amount",item.getString("pay_amount")); - existBDSalesReport.put("refund_amount",item.getString("refund_amount")); - existBDSalesReport.put("net_amount",item.getString("net_amount")); - bdSalesReportMapper.update(existBDSalesReport); - } - } - } - List orgSaleList= transactionAnalysisMapper.getOneDayOrgMerchantSaleList(params); - if (orgSaleList.size() != 0) { - for (JSONObject item : orgSaleList) { - JSONObject existOrgSalesReport = bdSalesReportMapper.findByBDIdAndLogDate(item.getString("org_id"),item.getString("bd_id"), date,1); - if(existOrgSalesReport==null){ - JSONObject object = new JSONObject(item); - object.put("log_id", UUID.randomUUID().toString()); - object.put("log_date", beginTime); - object.put("create_time", new Date()); - bdSalesReportMapper.save(object); - }else{ - existOrgSalesReport.put("pay_amount",item.getString("pay_amount")); - existOrgSalesReport.put("refund_amount",item.getString("refund_amount")); - existOrgSalesReport.put("net_amount",item.getString("net_amount")); - bdSalesReportMapper.update(existOrgSalesReport); - } - - } - } - } catch (ParseException e) { - e.printStackTrace(); - } - } - - @Override - public void exportPartnerExcelByBd(AnalysisBean analysisBean, HttpServletResponse httpResponse, JSONObject manager) throws IOException { - OutputStream ous = null; - try { - JSONObject parmerters = analysisBean.toParams(null); - List listPartnerByBd = bdAnalysisMapper.getBDSalePartnerList(parmerters); - httpResponse.setContentType("application/octet-stream;"); - httpResponse.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_list--" + parmerters.getString("bd_name") + analysisBean.getBegin() + "~" + analysisBean.getEnd() + ".xls"); - ous = httpResponse.getOutputStream(); - HSSFWorkbook wb = new HSSFWorkbook(); - HSSFFont font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 15); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - Sheet sheet = wb.createSheet("Merchant list"); - sheet.createFreezePane(1, 2); - sheet.setDefaultColumnWidth((short) 25); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"Short Name", "Client Moniker", "AUD Amount"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - for (JSONObject partner : listPartnerByBd) { - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("short_name")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("client_moniker")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("total")); - } - wb.write(ous); - ous.flush(); - } catch (IOException e) { - } finally { - IOUtils.closeQuietly(ous); - } - - } - - @Override - public void exportPartnerExcelByData(AnalysisBean analysisBean, HttpServletResponse httpResponse, JSONObject manager) throws IOException { - OutputStream ous = null; - try { - JSONObject parmerters = analysisBean.toParams(null); - List listPartnerByData = listSalesAnalysis(parmerters); - httpResponse.setContentType("application/octet-stream;"); - httpResponse.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_sale" + analysisBean.getBegin() + "~" + analysisBean.getEnd() + ".xls"); - ous = httpResponse.getOutputStream(); - HSSFWorkbook wb = new HSSFWorkbook(); - HSSFFont font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 15); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - Sheet sheet = wb.createSheet("Merchant Sale List"); - sheet.createFreezePane(1, 2); - sheet.setDefaultColumnWidth((short) 25); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"BD Name", "AUD Amount", "Refund Fee", "New Merchants"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - for (JSONObject dataSale : listPartnerByData) { - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(dataSale.getString("bd_name")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(dataSale.getString("total")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(dataSale.getString("refund_fee")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(dataSale.getString("num") == null ? "0" : dataSale.getString("num")); - } - wb.write(ous); - ous.flush(); - } catch (IOException e) { - } finally { - IOUtils.closeQuietly(ous); - } - } - - private void exportExcel(HSSFWorkbook workbook, String title, List monthTotalSale) { - // 声明一个工作薄 - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth((short) 15); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style.setBorderRight(HSSFCellStyle.BORDER_THIN); - style.setBorderTop(HSSFCellStyle.BORDER_THIN); - style.setAlignment(HSSFCellStyle.ALIGN_CENTER); - // 生成一个字体 - HSSFFont font = workbook.createFont(); -// font.setColor(HSSFColor.VIOLET.index); - font.setFontHeightInPoints((short) 12); - font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); - // 把字体应用到当前的样式 - style.setFont(font); - // 生成并设置另一个样式 - HSSFCellStyle style2 = workbook.createCellStyle(); - style2.setFillForegroundColor(HSSFColor.LIGHT_YELLOW.index); - style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style2.setBorderRight(HSSFCellStyle.BORDER_THIN); - style2.setBorderTop(HSSFCellStyle.BORDER_THIN); - style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); - style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); - // 生成另一个字体 - HSSFFont font2 = workbook.createFont(); - font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - -// // 声明一个画图的顶级管理器 -// HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); -// // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); -// // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); -// // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - - //产生表格标题行 - HSSFRow row0 = sheet.createRow(0); - HSSFRow row1 = sheet.createRow(1); - HSSFRow row2 = sheet.createRow(2); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell20 = row2.createCell(0); - HSSFCell cell10 = row1.createCell(0); - HSSFCell cell11 = row1.createCell(1); - HSSFCell cell21 = row2.createCell(1); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell20.setCellStyle(style); - cell10.setCellStyle(style); - cell11.setCellStyle(style); - cell21.setCellStyle(style); - HSSFRichTextString text00 = new HSSFRichTextString("商户简称"); - HSSFRichTextString text01 = new HSSFRichTextString("商家开通时间"); - HSSFRichTextString text20 = new HSSFRichTextString("总交易额"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell20.setCellValue(text20); - - - for (int i = 0; i < monthTotalSale.size(); i++) { - sheet.addMergedRegion(new CellRangeAddress(0, 0, 2 * i + 2, 2 * i + 3)); - HSSFCell cell02 = row0.createCell(i * 2 + 2); - HSSFCell cell12 = row1.createCell(i * 2 + 2); - HSSFCell cell13 = row1.createCell(i * 2 + 3); - HSSFCell cell22 = row2.createCell(i * 2 + 2); - HSSFCell cell23 = row2.createCell(i * 2 + 3); - - cell02.setCellStyle(style); - cell12.setCellStyle(style); - cell13.setCellStyle(style); - cell22.setCellStyle(style2); - cell23.setCellStyle(style2); - HSSFRichTextString text0 = new HSSFRichTextString(monthTotalSale.get(i).getString("y_m")); - HSSFRichTextString text12 = new HSSFRichTextString("交易额"); - HSSFRichTextString text13 = new HSSFRichTextString("增长百分比"); - HSSFRichTextString text22 = new HSSFRichTextString(monthTotalSale.get(i).getString("total")); - double rate = 0; - if (i > 0) { - BigDecimal lastTotal = monthTotalSale.get(i - 1).getBigDecimal("total"); - BigDecimal total = monthTotalSale.get(i).getBigDecimal("total"); - if (lastTotal.compareTo(new BigDecimal(0)) == 0 && total.compareTo(new BigDecimal(0)) != 0) { - rate = 100; - } else if (lastTotal.compareTo(new BigDecimal(0)) == 0 && total.compareTo(new BigDecimal(0)) == 0) { - rate = 0; - } else { - rate = total.subtract(lastTotal).multiply(new BigDecimal(100)).divide(lastTotal, 2, RoundingMode.DOWN).doubleValue(); - } - } - HSSFRichTextString text23 = i == 0 ? new HSSFRichTextString("-") : new HSSFRichTextString(String.valueOf(rate)); - cell02.setCellValue(text0); - cell12.setCellValue(text12); - cell13.setCellValue(text13); - cell22.setCellValue(text22); - cell23.setCellValue(text23); - - } - List partnersSale = (List) monthTotalSale.get(0).get("clients"); - for (int m = 0; m < partnersSale.size(); m++) { - HSSFRow row = sheet.createRow(m + 3); - HSSFCell cell_client_name = row.createCell(0); - HSSFCell cell_approve_time = row.createCell(1); - cell_client_name.setCellStyle(style); - cell_approve_time.setCellStyle(style); - HSSFRichTextString text_client_name = new HSSFRichTextString(partnersSale.get(m).getString("short_name")); - HSSFRichTextString text_approve_time = new HSSFRichTextString(partnersSale.get(m).getString("approve_time")); - cell_client_name.setCellValue(text_client_name); - cell_approve_time.setCellValue(text_approve_time); - for (int n = 0; n < monthTotalSale.size(); n++) { - List clients = (List) monthTotalSale.get(n).get("clients"); - HSSFCell celli2 = row.createCell(n * 2 + 2); - HSSFCell celli3 = row.createCell(n * 2 + 3); - celli2.setCellStyle(style2); - celli3.setCellStyle(style2); - HSSFRichTextString texti2 = new HSSFRichTextString(clients.get(m).getString("month_total")); - double rate = 0; - if (n > 0) { - List lastClients = (List) monthTotalSale.get(n - 1).get("clients"); - BigDecimal lastTotal = lastClients.get(m).getBigDecimal("month_total"); - BigDecimal total = clients.get(m).getBigDecimal("month_total"); - if (lastTotal.compareTo(new BigDecimal(0)) == 0 && total.compareTo(new BigDecimal(0)) != 0) { - rate = 100; - } else if (lastTotal.compareTo(new BigDecimal(0)) == 0 && total.compareTo(new BigDecimal(0)) == 0) { - rate = 0; - } else { - rate = total.subtract(lastTotal).multiply(new BigDecimal(100)).divide(lastTotal, 2, RoundingMode.DOWN).doubleValue(); - } - } - HSSFRichTextString texti3 = new HSSFRichTextString(String.valueOf(rate)); - celli2.setCellValue(texti2); - celli3.setCellValue(texti3); - } - - } - -// for (int i=0;i monthData = (List) partnersSale.get(i).get("months"); -// for (int n = 0; n < monthData.size(); n++) { -// HSSFCell celli2 = row.createCell(n*2+2); -// HSSFCell celli3 = row.createCell(n*2+3); -// celli2.setCellStyle(style2); -// celli3.setCellStyle(style2); -// HSSFRichTextString texti2 = new HSSFRichTextString(monthData.get(n).getString("total")); -// double rate = 0; -// if (n>0){ -// BigDecimal lastTotal = monthData.get(n-1).getBigDecimal("total"); -// BigDecimal total = monthData.get(n).getBigDecimal("total"); -// if (lastTotal.compareTo(new BigDecimal(0))==0 && total.compareTo(new BigDecimal(0)) !=0){ -// rate=100; -// } -// else if (lastTotal.compareTo(new BigDecimal(0))==0 && total.compareTo(new BigDecimal(0)) ==0){ -// rate=0; -// }else { -// rate = total.subtract(lastTotal).multiply(new BigDecimal(100)).divide(lastTotal,2,RoundingMode.DOWN).doubleValue(); -// } -// } -// HSSFRichTextString texti3 = new HSSFRichTextString(String.valueOf(rate)); -// celli2.setCellValue(texti2); -// celli3.setCellValue(texti3); -// } -// } - - - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java deleted file mode 100644 index 1c38e76fd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.core.mappers.MchChannelContractMapper; -import au.com.royalpay.payment.manage.analysis.core.ChannelsAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * Created by yuan on 2017/8/22. - */ -@Service -public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService { - - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - - @Resource - private MchChannelContractMapper mchChannelContractMapper; - - @Override - public List getChannelMount(JSONObject params) { - /*if (!params.containsKey("client_ids") && !params.containsKey("org_id")){ - params.put("client_id",0); - }*/ - List listChannel = new ArrayList<>(); - listChannel.add(putParam(params,"Wechat")); - listChannel.add(putParam(params,"Alipay")); - listChannel.add(putParam(params,"AlipayOnline")); - listChannel.add(putParam(params,"ApsInStore")); - listChannel.add(putParam(params,"ApsCashier")); - listChannel.add(putParam(params,"Rpay")); - listChannel.add(putParam(params,"rpaypmt_card")); - listChannel.add(putParam(params,"rpaypmt_dd")); - return listChannel; - } - - @Override - public List getChannelDate(JSONObject params) { - if (!params.containsKey("client_ids") && !params.containsKey("org_id")){ - params.put("client_id",0); - } - List list = new ArrayList<>(); - Map analysisMap = new TreeMap<>(); - String[] channels = {"Wechat","Alipay","AlipayOnline","Rpay","rpaypmt_card","rpaypmt_dd","ApsCashier","ApsInStore"}; - for (String channel:channels){ - analysisChannelCustomers(params, analysisMap, channel); - } - for (Date date:analysisMap.keySet()){ - JSONObject total = analysisMap.get(date); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd "); - String time = sdf.format(date); - total.put("trade_date",time); - for (String channel:channels){ - if(total.getJSONObject(channel)==null){ - JSONObject mockAnalysis = new JSONObject(); - mockAnalysis.put("total",0); - mockAnalysis.put("single_amount",0); - mockAnalysis.put("orders",0); - mockAnalysis.put("trade_date",time); - total.put(channel,mockAnalysis); - } - } - list.add(total); - } - return list; - } - - @Override - public void exportData(JSONObject params, HttpServletResponse resp) { - params.put("channels", new String []{"Alipay", "AlipayOnline","AlipayAps"}); - String[] title = {"Channel", "Total Amount(AUD)", "Total orders", "Transaction Partners", "Enable Partners"}; - JSONObject count = customerAndOrdersStatisticsMapper.countChannel(params); - int enablePartners = customerAndOrdersStatisticsMapper.countEnableAlipay(params); - String begin = params.getString("begin") == null ? "":DateFormatUtils.format(params.getDate("begin"),"yyyy-MM-dd"); - String end = params.getString("end") == null ? "":DateFormatUtils.format(params.getDate("end"),"yyyy-MM-dd"); - OutputStream ous = null; - try { - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + "Alipay_Data_" + begin + "_" + end + ".xlsx"); - ous = resp.getOutputStream(); - Workbook wb = new XSSFWorkbook(); - Sheet sheet = wb.createSheet(); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Alipay+AlipayOnline"); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(count.getIntValue("total")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(count.getIntValue("orders")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(count.getIntValue("transaction_partners")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(enablePartners); - wb.write(ous); - ous.flush(); - } catch (IOException e) { - e.printStackTrace(); - } finally { - IOUtils.closeQuietly(ous); - } - } - - private void analysisChannelCustomers(JSONObject params, Map analysisMap, String channel) { - params.put("channel", channel); - List customerAnalysis = customerAndOrdersStatisticsMapper.getSumChannelAnalysis(params); - for (JSONObject analysisItem:customerAnalysis){ - Date tradeDate = analysisItem.getDate("trade_date"); - JSONObject dataItem = analysisMap.get(tradeDate); - if(dataItem==null){ - dataItem = new JSONObject(); - analysisMap.put(tradeDate,dataItem); - } - dataItem.put(channel,analysisItem); - } - } - public JSONObject putParam(JSONObject params, String name){ - JSONObject obj = new JSONObject(); - params.put("channel",name); - JSONObject count = customerAndOrdersStatisticsMapper.countChannel(params); - obj.put("total",count.getIntValue("total")); - obj.put("order",count.getIntValue("orders")); - obj.put("channel",name); - obj.put("transaction_partners",count.getIntValue("transaction_partners")); - int enablePartners = 0; - if ("AlipayOnline".equals(name)) { - params.put("gateway_alipay_online", 1); - enablePartners = customerAndOrdersStatisticsMapper.countEnableChannel(params); - params.remove("gateway_alipay_online"); - } - else if("ApsInStore".equals(name)){ - enablePartners=mchChannelContractMapper.sumEnablePartners(name); - } - else if("ApsCashier".equals(name)){ - enablePartners=mchChannelContractMapper.sumEnablePartners(name); - } - else { - params.put("enable_" + name.toLowerCase(), 1); - enablePartners = customerAndOrdersStatisticsMapper.countEnableChannel(params); - params.remove("enable_" + name.toLowerCase()); - } - obj.put("enable_partners", enablePartners); - return obj; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ClientRatesAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ClientRatesAnalysisServiceImpl.java deleted file mode 100644 index 5efa7d811..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ClientRatesAnalysisServiceImpl.java +++ /dev/null @@ -1,227 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.beans.ClientRateQueryBean; -import au.com.royalpay.payment.manage.analysis.core.ClientRatesAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.ClientRatesAnalysisMapper; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import au.com.royalpay.payment.manage.mappers.log.ClientReviewLogMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.web.bind.annotation.RequestParam; - -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-11-08. - */ -@Service -public class ClientRatesAnalysisServiceImpl implements ClientRatesAnalysisService { - @Resource - private ClientRatesAnalysisMapper clientRatesAnalysisMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientReviewLogMapper clientReviewLogMapper; - @Autowired(required = false) - private ClientRateAnalysisEventLoader[] eventLoaders; - - @Resource - private OrgManager orgManager; - - @Resource - private OrgMapper orgMapper; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - - @Override - public JSONObject listAnalysisOfBDUsers(JSONObject manager, String orgId, String orgId2, Date beginDate, Date endDate) { - JSONObject params = new JSONObject(); - if (orgId != null) { - params.put("org_id", orgId); - } - if (StringUtils.isNotEmpty(orgId2)) { - params.put("org_id2", orgId2); - } - - if (ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - } - params.put("begin", DateFormatUtils.format(beginDate, "yyyy-MM-dd")); - params.put("end", DateFormatUtils.format(endDate, "yyyy-MM-dd")); - orgManager.checkOrgIds(manager, params); - JSONObject result = new JSONObject(); - // 原 数据直接查询 -// List bdAnalysis = clientRatesAnalysisMapper.analysisRatesForBDUsers(params); -// result.put("bds", bdAnalysis); - - // 新 数据查询 - // 根据时间查询所有的商户交易量 - List clientOrders = customerAndOrdersStatisticsMapper.findByTime(params); - // 查询所有的组织 - PageBounds sort = new PageBounds(Order.formString("sort_no.asc")); - List orgList = orgMapper.listOrgs(0, sort); - - List bdAnalysis = new ArrayList<>(); - // 查询组织下所有的bd - for (JSONObject org : orgList) { - List bds = managerMapper.findBdById(org.getString("org_id")); - for (JSONObject bd : bds) { - // 查出bd下的所有的商户,不为null的 set进 bdAnalysis - List clients = clientBDMapper.findTotalClientByBdId(bd.getString("manager_id")); - // 遍历商户 查看商户交易量 - if (!clients.isEmpty()) { - for (JSONObject client : clients) { - int i = 0; - for (JSONObject clientOrder : clientOrders) { - if (client.getString("client_id").equals(clientOrder.getString("client_id"))) { - // 判断交易量 - if (clientOrder.getInteger("order_count") != 0) { - bd.put("trade_clients", i++); - } - } - } - } - bd.put("total_clients", clients.size()); - bdAnalysis.add(bd); - } - } - } - result.put("bds", bdAnalysis); - result.put("total", clientRatesAnalysisMapper.analysisTotal(params)); - return result; - } - - @Override - public JSONObject listAllClientRates(Integer orgId, ClientRateQueryBean query) { - JSONObject clientQueryParams = new JSONObject(); - if (orgId != null) { - clientQueryParams.put("org_id", orgId); - } - if (query.getNoactive() != null) { - clientQueryParams.put("noactive", true); - query.getNoactive().initParams(clientQueryParams); - } - if (query.getTransaction() != null) { - clientQueryParams.put("transaction_rate", true); - query.getTransaction().initParams(clientQueryParams); - } - List clientIds = clientRatesAnalysisMapper.listClientsForOrg(clientQueryParams); - return queryAnalysisResults(query, clientIds); - } - - @Override - public JSONObject listClientRatesOfBDUser(String bdId, ClientRateQueryBean query) { - JSONObject manager = managerMapper.findDetail(bdId); - Assert.notNull(manager, "bd not found"); - - JSONObject clientQueryParams = new JSONObject(); - clientQueryParams.put("bd_id", bdId); - if (query.getNoactive() != null) { - clientQueryParams.put("noactive", true); - query.getNoactive().initParams(clientQueryParams); - } - if (query.getTransaction() != null) { - clientQueryParams.put("transaction_rate", true); - query.getTransaction().initParams(clientQueryParams); - } - List clientIds = clientRatesAnalysisMapper.listClientsForBD(clientQueryParams); - - JSONObject result = queryAnalysisResults(query, clientIds); - - result.put("bd_name", manager.getString("display_name")); - return result; - } - - @Override - public void saveReviewEvent(String clientMoniker, String managerId, String reviewDate, String desc) { - try { - Date date = DateUtils.parseDate(reviewDate, new String[]{"yyyyMMdd"}); - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client, "Client Not Exists!"); - int clientId = client.getIntValue("client_id"); - JSONObject review = clientReviewLogMapper.findReviewLog(clientId, date); - if (review != null) { - throw new BadRequestException("商户当天已有回访记录"); - } - review = new JSONObject(); - review.put("client_id", clientId); - review.put("review_date", date); - review.put("manager_id", managerId); - review.put("add_time", new Date()); - review.put("desc", desc); - clientReviewLogMapper.save(review); - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - - } - - private JSONObject queryAnalysisResults(ClientRateQueryBean query, List clientIds) { - JSONObject result = new JSONObject(); - List range = new ArrayList<>(); - Date dt = query.getBegin(); - while (!dt.after(query.getEnd())) { - range.add(DateFormatUtils.format(dt, "yyyy/MM/dd")); - dt = DateUtils.addDays(dt, 1); - } - result.put("days_range", range); - if (clientIds.isEmpty()) { - return result; - } - JSONObject params = new JSONObject(); - params.put("begin", query.getBegin()); - params.put("end", query.getEnd()); - params.put("client_ids", clientIds); -// result.put("total", clientRatesAnalysisMapper.analysisTotal(params)); - - List clients = analysisClientRates(params, query); - result.put("clients", clients); - - - return result; - } - - private List analysisClientRates(JSONObject params, ClientRateQueryBean query) { - - List clients = clientRatesAnalysisMapper.analysisClientRates(params); - for (JSONObject client : clients) { - client.put("sleep_days_limited", Math.min(client.getIntValue("sleep_days"), 30)); - List events = new ArrayList<>(); - for (ClientRateAnalysisEventLoader loader : eventLoaders) { - loader.loadEvents(client, events, query); - } - client.put("events", events); - } - return clients; - } - - public interface ClientRateAnalysisEventLoader { - void loadEvents(JSONObject client, List events, ClientRateQueryBean query); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java deleted file mode 100644 index 4745670b5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java +++ /dev/null @@ -1,444 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import au.com.royalpay.payment.manage.analysis.mappers.OrderAnalysisMapper; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.mappers.log.WechatTemplateMsgSendLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.geo.GeoIPSupport; -import au.com.royalpay.payment.tools.geo.entity.GeoLocation; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Created by yishuqian on 10/11/2016. - */ -@Service -public class CustomersAnalysisServiceImp implements CustomersAnalysisService { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - @Resource - private OrderAnalysisMapper orderAnalysisMapper; - @Resource - private OrderMapper orderMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private CustomerMapper customerMapper; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - - @Resource - private WechatTemplateMsgSendLogMapper wechatTemplateMsgSendLogMapper; - - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - @Resource - private RetailAppService retailAppService; - @Resource - private GeoIPSupport geoIPSupport; - - @Override - public List getCustomersAnalysis(JSONObject params) { - if (!params.containsKey("client_ids") && !params.containsKey("org_id")) { - params.put("client_id", 0); - } - return customerAndOrdersStatisticsMapper.getSumCustomersAnalysis(params); - } - - @Override - public JSONObject getChannelAmountAnalysis(JSONObject params) { - return customerAndOrdersStatisticsMapper.getChannelCommonCount(params); - } - - @Override - public JSONObject getCBBankChannelAmountAnalysis(JSONObject params) { - JSONObject result = new JSONObject(); - List channels = new ArrayList<>(); - if (params.get("channel") == null) { - channels.add("Rpay"); - channels.add("rpaypmt_card"); - channels.add("rpaypmt_dd"); - params.put("channels", channels); - } - result.put("channels", customerAndOrdersStatisticsMapper.getCBBankChannelAmount(params)); - result.put("counts", customerAndOrdersStatisticsMapper.getCBBankChannelCommonCount(params)); - return result; - } - - @Override - public JSONObject getCustomersRanking(JSONObject params, int page, int limit) { - - PageList logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString(params.getString("orderValue")))); - if (!logs.isEmpty()) { - for (JSONObject log : logs) { - generatorUserProfile(log, params); - } - } - JSONObject result = PageListUtils.buildPageListResult(logs); - result.put("analysis", orderAnalysisMapper.listCustomersDataAnalysis(params)); - result.put("openid_type", params.getIntValue("openid_type")); - return result; - } - - @Override - public JSONObject getCustomersTotal(JSONObject params) { - JSONObject result = new JSONObject(); - result.put("analysis", orderAnalysisMapper.listCustomersDataAnalysis(params)); - result.put("openid_type", params.getIntValue("openid_type")); - return result; - } - - @Override - public JSONObject getOrdersByOpenid(JSONObject params, int page, int limit) { - PageList logs = orderMapper.listOrderByCustomer(params, new PageBounds(page, limit, Order.formString("create_time.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - return result; - } - - @Override - public void sendPartnerTransactionDaily(Date analysis_date) { - DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String date = format.format(analysis_date); - List clients = clientMapper.listClients(); - for (JSONObject client : clients) { -// if (client.getIntValue("client_id")!=9){ -// continue; -// } - int clientId = client.getIntValue("client_id"); - JSONObject params = new JSONObject(); - params.put("client_id", clientId); - params.put("trade_date", date); - int counts = setAllClientIds(params, clientId); - List accounts = clientAccountMapper.listAdminAccounts(clientId); - if (accounts == null || accounts.isEmpty()) { - continue; - } - JSONObject tradeInfo = customerAndOrdersStatisticsMapper.getSumOrdersAndCustomersDaily(params); - if (tradeInfo == null) { - continue; - } - - - for (JSONObject account : accounts) { - if (StringUtils.isBlank(account.getString("wxapp_openid"))) { - if (StringUtils.isBlank(account.getString("wechat_openid"))) { - continue; - } - } else { - //todo - if (StringUtils.isBlank(account.getString("wechat_openid"))) { - continue; - } - } - - String openId = account.getString("wechat_openid"); -// if (!openId.equals("o32MzuCpqGQJTlvTK7VQ7m_LVXiQ")){ -// continue; -// } - JSONObject sendLog = new JSONObject(); - sendLog.put("send_time", new Date()); - sendLog.put("open_id", openId); - sendLog.put("client_id", clientId); - sendLog.put("account_id", account.getString("account_id")); - sendLog.put("account_name", account.getString("display_name")); - sendLog.put("msg_type", "daily_notice"); - sendLog.put("status", 0); - sendLog.put("remark", tradeInfo.getString("trade_date")); - wechatTemplateMsgSendLogMapper.save(sendLog); - String logId = sendLog.getString("send_id"); - String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); - try { - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - - TemplateMessage msg = initAccountMsg(tradeInfo, client.getString("short_name"), time, String.valueOf(counts), openId, paymentApi.getTemplateId("transaction-daily")); - paymentApi.sendTemplateMessage(msg); - wechatTemplateMsgSendLogMapper.updateStatus(logId, 2); - } catch (Exception e) { - logger.error(e.getMessage(), e); - wechatTemplateMsgSendLogMapper.updateLog(logId, 1, e.getMessage()); - } - } - try { - retailAppService.sendTransactionDailyMessage(tradeInfo, client.getIntValue("client_id")); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - } - - @Override - public List getCustomersAnalysisMonthly(JSONObject params) { - if (!params.containsKey("client_ids") && !params.containsKey("org_id")) { - params.put("client_id", 0); - } - return customerAndOrdersStatisticsMapper.getSumCustomersAnalysisMonthly(params); - } -// @Override -// public void sendPartnerTransactionDaily(Date date) { -// JSONObject client = new JSONObject(); -// client.put("client_id", 9); -// client.put("short_name", "PINE"); -// JSONObject params = new JSONObject(); -// params.put("client_id", client.getIntValue("client_id")); -// params.put("trade_date", date); -// int counts = setAllClientIds(params, client.getIntValue("client_id")); -// -// JSONObject tradeInfo = customerAndOrdersStatisticsMapper.getSumOrdersAndCustomersDaily(params); -// if (tradeInfo==null){ -// return; -// } -// try { -// retailAppService.sendTransactionDailyMessage(tradeInfo,client.getInteger("client_id")); -// } catch (Exception e) { -// logger.error(e.getMessage(), e); -// } -// String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); -// try { -// TemplateMessage msg = initAccountMsg(tradeInfo, client.getString("short_name"), time, String.valueOf(counts), "o32MzuCpqGQJTlvTK7VQ7m_LVXiQ", tradeDailyTemplateId); -// MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); -// paymentApi.sendTemplateMessage(msg); -// } catch (Exception e) { -// logger.error(e.getMessage(), e); -// } -// -// } - - @Override - public JSONObject getUserEcharts(JSONObject params, JSONObject manager) { - JSONObject graph = new JSONObject(); - List nodes = new ArrayList<>(); - List links = new ArrayList<>(); - initUserInfo(nodes, params); - List clients = orderAnalysisMapper.listClientsByCustomerId(params); - JSONObject total = orderAnalysisMapper.listClientsTotalByCustomerId(params); - int id = 1; - for (JSONObject client : clients) { - BigDecimal clientInTotal = client.getBigDecimal("orders").divide(total.getBigDecimal("orders"), 5, RoundingMode.HALF_UP).multiply(new BigDecimal(300)); - BigDecimal orderInTotal = client.getBigDecimal("orders").divide(total.getBigDecimal("orders"), 5, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); - BigDecimal amountInTotal = client.getBigDecimal("total_amount").divide(total.getBigDecimal("total_amount"), 5, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); - JSONObject node = new JSONObject(); - node.put("id", id); - node.put("category", id); - node.put("name", client.getString("client_moniker")); - node.put("label", client.getString("short_name")); - node.put("value", client.getString("short_name")); - node.put("symbolSize", clientInTotal.compareTo(new BigDecimal(10)) < 0 ? 10 : clientInTotal.toPlainString()); - if (clientInTotal.compareTo(new BigDecimal(300)) == 0) { - node.put("symbolSize", 100); - } - node.put("ignore", true); - node.put("flag", true); - node.put("draggable", true); - nodes.add(node); - JSONObject totalAmountInfo = getClientAmountInfo(id, "x0", "交易金额", client); - totalAmountInfo.put("label", client.getString("total_amount")); - totalAmountInfo.put("value", client.getBigDecimal("total_amount").setScale(2, RoundingMode.HALF_UP)); - totalAmountInfo.put("symbolSize", amountInTotal.compareTo(new BigDecimal(10)) < 0 ? 10 : amountInTotal.toPlainString()); - nodes.add(totalAmountInfo); - JSONObject OrdersInfo = getClientAmountInfo(id, "x1", "订单数", client); - OrdersInfo.put("label", client.getString("orders")); - OrdersInfo.put("value", client.getString("orders")); - OrdersInfo.put("symbolSize", orderInTotal.compareTo(new BigDecimal(10)) < 0 ? 10 : orderInTotal.toPlainString()); - nodes.add(OrdersInfo); - JSONObject priceInfo = getClientAmountInfo(id, "x2", "客单价", client); - BigDecimal price = client.getBigDecimal("total_amount").divide(client.getBigDecimal("orders"), 2, RoundingMode.HALF_UP); - priceInfo.put("label", price.toPlainString()); - priceInfo.put("value", price.toPlainString()); - priceInfo.put("symbolSize", price.divide(new BigDecimal(50), 0, RoundingMode.DOWN).compareTo(new BigDecimal(10)) < 0 ? 5 : price.divide(new BigDecimal(50), 0, RoundingMode.DOWN).toPlainString()); - nodes.add(priceInfo); - id++; - } - for (JSONObject node : nodes) { - JSONObject link = new JSONObject(); - String linkId = node.getString("id"); - link.put("source", linkId); - link.put("target", linkId.indexOf("x") > 0 ? linkId.substring(0, linkId.indexOf("x")) : 0); - links.add(link); - } - graph.put("nodes", nodes); - graph.put("links", links); - return graph; - } - - private int setAllClientIds(JSONObject params, int clientId) { - JSONArray client_ids = clientManager.getAllClientIds(clientId); - if (client_ids.size() > 1) { - String[] arr = new String[client_ids.size()]; - params.put("client_ids", client_ids.toArray(arr)); - } - return client_ids.size(); - - } - -// private void sendDailyWxAccountMessage(JSONObject tradeInfo, String openId,JSONObject client,String clientCounts) { -// String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); -// try { -// TemplateMessage msg = initAccountMsg(tradeInfo,client.getString("short_name"),time,clientCounts, openId, tradeDailyTemplateId); -// MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); -// paymentApi.sendTemplateMessage(msg); -// } catch (Exception e) { -// logger.error(e.getMessage(), e); -// } -// } - -// private void sendDailyWxAppMessage(JSONObject tradeInfo, String openId,JSONObject client,String clientCounts) { -// try { -// TemplateMessage msg = initWxMsg(tradeInfo,client.getString("short_name"),clientCounts, openId, tradeDailyTemplateId,"","0000ff"); -// wechatAppApi.sendTemplateMessage(msg); -// } catch (Exception e) { -// logger.error(e.getMessage(), e); -// } -// } - - private TemplateMessage initAccountMsg(JSONObject tradeInfo, String short_name, String time, String clientCounts, String openId, String templateId) { - - TemplateMessage msg = new TemplateMessage(openId, templateId, null); - String detail = "收款总额:" + tradeInfo.getBigDecimal("total") + "$, 收款笔数:" + tradeInfo.getString("orders") + ", 付款人数:" + tradeInfo.getString("customers"); - msg.put("first", "每日交易汇总数据(" + tradeInfo.getString("trade_date") + ")", "#000000"); - msg.put("keyword1", short_name, "#000000"); - msg.put("keyword2", time, "#000000"); - msg.put("keyword3", clientCounts + "家", "#000000"); - msg.put("keyword4", detail, "#0000ff"); - msg.put("remark", "详情请查看商户后台、APP或皇家支付小程序", "#000000"); - msg.setMiniprogram("wx54445a7c56432d57", "/pages/welcome/welcome"); - return msg; - } - - private void initUserInfo(List nodes, JSONObject params) { - JSONObject userInfo = new JSONObject(); - if (params.getString("customer_id").startsWith("o")) { - userInfo = customerMapper.findCustomerByOpenId(params.getString("customer_id")); - } else { - userInfo = managerCustomerRelationAlipayMapper.findCustomerByUserId(params.getString("customer_id")); - } - JSONObject user = new JSONObject(); - user.put("id", 0); - user.put("category", 0); - if (!userInfo.isEmpty()) { - user.put("name", userInfo.getString("nickname")); - } else { - user.put("name", params.getString("customer_id")); - } - user.put("symbolSize", 80); - user.put("ignore", true); - user.put("flag", true); - user.put("draggable", true); - String imgUrl = StringUtils.isNotBlank(userInfo.getString("headimg")) ? userInfo.getString("headimg") : PlatformEnvironment.getEnv().concatUrl("/static/images/r_logo.svg"); - user.put("symbol", "image://" + imgUrl); - nodes.add(user); - } - - private JSONObject getClientAmountInfo(int oldId, String newId, String name, JSONObject client) { - JSONObject amountInfo = new JSONObject(); - amountInfo.put("ignore", true); - amountInfo.put("flag", true); - amountInfo.put("draggable", true); - amountInfo.put("id", String.valueOf(oldId) + newId); - amountInfo.put("name", name); - return amountInfo; - } - - private void generatorUserProfile(JSONObject customer, JSONObject params) { - List topAddress = new ArrayList<>(); - String topAmountRange = "None"; - String topTimeRange = "None"; - params.put("customer_id", customer.getString("customer_id")); - List mostUseClientsByCustomer = orderAnalysisMapper.mostUseClientsByCustomer(params); - List mostUseIndustryByCustomer = orderAnalysisMapper.mostUseIndustryByCustomer(params); - List mostUseAddressByCustomer = orderAnalysisMapper.mostUseAddressByCustomer(params); - for (JSONObject address : mostUseAddressByCustomer) { - String city = geoIPSupport.getLocation(address.getString("customer_ip")).map(GeoLocation::getCity).orElse(null); - if (topAddress.size() < 3 && !topAddress.contains(city) && StringUtils.isNotBlank(city)) { - topAddress.add(city); - } - } - JSONObject mostUseAmountByCustomer = orderAnalysisMapper.mostUseAmountByCustomer(params); - if (mostUseAmountByCustomer != null) { - int amount = mostUseAmountByCustomer.getIntValue("amount_int"); - if (amount == 0) { - topAmountRange = "0~100"; - } else { - topAmountRange = String.valueOf(amount * 100) + "~" + String.valueOf((amount + 1) * 100); - } - } - JSONObject mostUseTimesByCustomer = orderAnalysisMapper.mostUseTimesByCustomer(params); - if (mostUseTimesByCustomer != null) { - Date orderDate = mostUseTimesByCustomer.getDate("create_time"); - Date nextHourDate = DateUtils.addHours(orderDate, 1); - orderDate = DateUtils.setMinutes(orderDate, 0); - nextHourDate = DateUtils.setMinutes(nextHourDate, 0); - topTimeRange = DateFormatUtils.format(orderDate, "HH:mm") + "-" + DateFormatUtils.format(nextHourDate, "HH:mm"); - } - customer.put("top_clients", getTopInfo(mostUseClientsByCustomer, "client_moniker")); - customer.put("top_industry", getTopInfo(mostUseIndustryByCustomer, "royalpayindustry")); - customer.put("top_citys", String.join(",", topAddress)); - customer.put("amount_range", topAmountRange); - customer.put("hour_range", topTimeRange); - customer.put("price", customer.getBigDecimal("amount").divide(customer.getBigDecimal("orders"), 2, RoundingMode.HALF_UP).toPlainString()); - - - } - - private String getTopInfo(List list, String key) { - if (list != null && !list.isEmpty()) { - List clients = list.stream().map(e -> e.getString(key)).collect(Collectors.toList()); - return String.join(",", clients); - } - return "None"; - } - - -// private TemplateMessage initWxMsg(JSONObject tradeInfo,String short_name,String clientCounts, String openId, String templateId,String path,String color) { -// -// TemplateMessage msg = new TemplateMessage(openId, templateId,path, null, color, "keyword4.DATA"); -// String detail = "收款总额:"+tradeInfo.getBigDecimal("total")+"$, 收款笔数:"+tradeInfo.getString("orders")+", 付款人数:"+tradeInfo.getString("customers"); -// msg.put("first", "每日交易汇总数据(" + tradeInfo.getString("trade_date") + ")", "#000000"); -// msg.put("keyword1", short_name, "#000000"); -// msg.put("keyword2", "2017-08-25", "#000000"); -// msg.put("keyword3", clientCounts+"家", "#000000"); -// msg.put("keyword4", detail, "#0000ff"); -// msg.put("remark", "详情请查看商户后台、APP或皇家支付小程序", "#000000"); -// msg.setMiniprogram("wx54445a7c56432d57","/pages/welcome/welcome"); -// return msg; -// } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java deleted file mode 100644 index fc313b389..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java +++ /dev/null @@ -1,426 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.DailyReport; -import au.com.royalpay.payment.manage.mappers.cashback.CashbackRecordsMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDCommissionConfigMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import au.com.royalpay.payment.manage.mappers.log.DailyReportMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActPartnerLMLogMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.JsonHelper; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 16/11/2017. - */ -@Service -public class DailyReportImp implements DailyReport { - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private DailyReportMapper dailyReportMapper; - @Resource - private CashbackRecordsMapper cashbackRecordsMapper; - @Resource - private ActPartnerLMLogMapper actPartnerLMLogMapper; - @Resource - private ClearingLogMapper clearingLogMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; - @Resource - private FinancialBDCommissionConfigMapper financialBDCommissionConfigMapper; - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private TransactionMapper transactionMapper; - @Resource - private FinancialBDConfigMapper financialBDConfigMapper; - - @Override - public void generateReport(String date, boolean sendMsg) { - try { - Date beginTime = DateUtils.parseDate(date, new String[]{"yyyy-MM-dd"}); - String reportId = DateFormatUtils.format(beginTime, "yyyy-MM-dd"); - Date yesterdayEndTime = DateUtils.addDays(beginTime, 1); - String endDate = DateFormatUtils.format(yesterdayEndTime, "yyyy-MM-dd"); - Date endTime = DateUtils.parseDate(endDate, new String[]{"yyyy-MM-dd"}); - - - JSONObject report = dailyReportMapper.findOne(reportId); - if (report != null) { - dailyReportMapper.delete(reportId); - } - report = new JSONObject(); - report.put("report_id", reportId); - report.put("analysis_date", beginTime); - report.put("report_date", new Date()); - - JSONObject creditReport = getCreditReport(beginTime, endTime); - report.put("credit", creditReport.toJSONString()); - - JSONObject debitReport = getDebitReport(beginTime); - report.put("debit", JSON.toJSONString(debitReport)); - - JSONObject kpiReport = getKPI(beginTime); - report.put("kpi", JSON.toJSONString(kpiReport)); - - dailyReportMapper.save(report); - if (sendMsg) { - List users = managerMapper.getDirectors(); - List financialUsers = managerMapper.listDetailsByRole(null, ManagerRole.FINANCIAL_STAFF.getMask()); - users.addAll(financialUsers); - - publishMessages(users, reportId, reportId); - } - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - - } - - private JSONObject getKPI(Date dt) { - JSONObject report = new JSONObject(); - List kpiList = new ArrayList<>(); - List prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(dt, Calendar.DATE), DateUtils.truncate(DateUtils.addDays(dt, 1), Calendar.DATE), DateUtils.truncate(dt, Calendar.MONTH)); - List prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt, -1), Calendar.DATE), DateUtils.truncate(dt, Calendar.DATE), DateUtils.truncate(DateUtils.addDays(dt, -1), Calendar.MONTH)); - List clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(dt, Calendar.DATE), DateUtils.truncate(DateUtils.addDays(dt, 1), Calendar.DATE), DateUtils.truncate(dt, Calendar.MONTH)); - //BD团队总KPI - BigDecimal total_kpi_amount = BigDecimal.ZERO; - //BD团队当月总销售额 - BigDecimal total_month_amount = BigDecimal.ZERO; - for (JSONObject p : prizeAmountAndBdTypeList) { - JSONObject kpi = new JSONObject(); - kpi.put("bd_group", p.getString("bd_group")); - kpi.put("bd_name", p.getString("bd_name")); - kpi.put("group_name", groupName(p.getIntValue("bd_type"))); - //昨日数据 - kpi.put("total_amount", p.getBigDecimal("total_amount")); - //当月数据 - kpi.put("month_amount", p.getBigDecimal("month_amount")); - BigDecimal kpi_amount = financialBDCommissionConfigMapper.findCurrentCommissionMaxAmount(DateFormatUtils.format(DateUtils.truncate(dt, Calendar.MONTH), "yyyy-MM"), p.getIntValue("bd_type")); - kpi.put("kpi_amount", kpi_amount); - for (JSONObject prize : prizeAmountAndBdTypeListYesterDay) { - if (prize.getString("bd_group").equals(kpi.getString("bd_group"))) { - BigDecimal compare = kpi.getBigDecimal("total_amount").subtract(prize.getBigDecimal("total_amount")); - kpi.put("compare", compare); - kpi.put("compare_value", Math.abs(compare.doubleValue())); - } - } - kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount, 4, RoundingMode.HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0, 5) + "%"); - for (JSONObject clientAmount : clientsAmount) { - if (clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))) { - //查询该领队下所有BD - List teamBDs = financialBDConfigMapper.listGroupBds(kpi.getString("bd_group")); - int bdMonthClientCount = 0; - int bdYesterdayClientCount = 0; - for (int i = 0; i < teamBDs.size(); i++) { - // sys_clients中查询出此bd创建并属于此bd的商户,并且时间是昨天和本月 - JSONObject countByBd = clientMapper.findCountByBd(teamBDs.get(i).getString("manager_id"), DateUtils.truncate(DateUtils.addDays(dt, 1), Calendar.DATE), DateUtils.truncate(dt, Calendar.DATE), DateUtils.truncate(dt, Calendar.MONTH)); - if (countByBd.getInteger("month_count") != null) { - bdMonthClientCount += countByBd.getInteger("month_count"); - } - if (countByBd.getInteger("yesterday_count") != null) { - bdYesterdayClientCount += countByBd.getInteger("yesterday_count"); - } - } - kpi.put("clients_month", bdMonthClientCount); - kpi.put("clients_yesterday", bdYesterdayClientCount); - } - } - total_kpi_amount = total_kpi_amount.add(kpi_amount); - total_month_amount = total_month_amount.add(p.getBigDecimal("month_amount")); - kpiList.add(kpi); - } - report.put("kpiList", kpiList); - report.put("kpi_percent_total", total_month_amount.divide(total_kpi_amount, 4, RoundingMode.HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0, 5) + "%"); - report.put("total_month_amount", total_month_amount); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(dt); - report.put("time_percent", BigDecimal.valueOf(calendar.get(Calendar.DAY_OF_MONTH)).divide(BigDecimal.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH)), 4, RoundingMode.HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0, 5) + "%"); - return report; - } - - private String groupName(int bd_type) { - switch (bd_type) { - case 1: - return "Sydney Team"; - case 2: - return "KA Manager"; - case 6: - return "Melbourne Team"; - case 7: - return "KA Manager"; - default: - return "Unknown Group"; - } - } - - private JSONObject getDebitReport(Date dt) { - JSONObject report = new JSONObject(); - BigDecimal redpack = actPartnerLMLogMapper.getRedpackAmount(dt); - BigDecimal last_redpack = actPartnerLMLogMapper.getRedpackAmount(DateUtils.addDays(dt, -1)); - JSONObject redpackObj = new JSONObject(); - redpackObj.put("value", redpack); - BigDecimal redpack_compare = redpack.subtract(last_redpack); - redpackObj.put("compare", redpack_compare); - redpackObj.put("compare_value", Math.abs(redpack_compare.doubleValue())); - report.put("redpack", redpackObj); - BigDecimal cashback = cashbackRecordsMapper.getSettleDelayDebit(dt); - BigDecimal last_cashback = cashbackRecordsMapper.getSettleDelayDebit(DateUtils.addDays(dt, -1)); - JSONObject cashObj = new JSONObject(); - cashObj.put("value", cashback); - BigDecimal cashback_compare = cashback.subtract(last_cashback); - cashObj.put("compare", cashback_compare); - cashObj.put("compare_value", Math.abs(cashback_compare.doubleValue())); - report.put("cashback", cashObj); -// BigDecimal total_debit=redpack.add(cashback); -// BigDecimal last_debit=last_redpack.add(last_cashback); -// report.put("total_debit",total_debit); -// BigDecimal debit_compare = total_debit.subtract(last_debit); -// report.put("compare",debit_compare); -// report.put("compare_value",Math.abs(debit_compare.doubleValue())); - return report; - } - - private JSONObject getCreditReport(Date beginTime, Date endTime) { - JSONObject report = new JSONObject(); - List settles = transactionMapper.getSettleDataDailyReport(beginTime, endTime); - JSONObject yesterdayTotal = this.computerTotalAmount(settles); - BigDecimal yesterday_settle_amount = yesterdayTotal.getBigDecimal("total_settle_amount"); - BigDecimal yesterday_credit_amount = yesterdayTotal.getBigDecimal("total_credit_amount"); - BigDecimal yesterday_debit_amount = yesterdayTotal.getBigDecimal("total_debit_amount"); - BigDecimal yesterday_net_trading = yesterdayTotal.getBigDecimal("total_net_trading"); - BigDecimal yesterday_total_surcharge = yesterdayTotal.getBigDecimal("total_total_surcharge"); - BigDecimal yesterday_royal_surcharge = yesterdayTotal.getBigDecimal("total_royal_surcharge"); - BigDecimal yesterday_channel_surcharge = yesterdayTotal.getBigDecimal("total_channel_surcharge"); - BigDecimal yesterday_tax_amount = yesterdayTotal.getBigDecimal("total_tax_amount"); - - List last_settle = transactionMapper.getSettleDataDailyReport(DateUtils.addDays(beginTime, -1), DateUtils.addDays(endTime, -1)); - JSONObject lastTotal = this.computerTotalAmount(last_settle); - BigDecimal last_settle_amount = lastTotal.getBigDecimal("total_settle_amount"); - BigDecimal last_total_credit = lastTotal.getBigDecimal("total_credit_amount"); - BigDecimal last_debit_amount = lastTotal.getBigDecimal("total_debit_amount"); - BigDecimal last_net_trading = lastTotal.getBigDecimal("total_net_trading"); - BigDecimal last_total_surcharge = lastTotal.getBigDecimal("total_total_surcharge"); - BigDecimal last_royal_surcharge = lastTotal.getBigDecimal("total_royal_surcharge"); - BigDecimal last_channel_surcharge = lastTotal.getBigDecimal("total_channel_surcharge"); - BigDecimal last_tax_amount = lastTotal.getBigDecimal("total_tax_amount"); - - JSONObject percentage_yesterday_settle_amount = this.percentage(yesterday_settle_amount, last_settle_amount); - JSONObject percentage_yesterday_total_credit = this.percentage(yesterday_credit_amount, last_total_credit); - JSONObject percentage_yesterday_debit_amount = this.percentage(yesterday_debit_amount, last_debit_amount); - JSONObject percentage_yesterday_net_trading = this.percentage(yesterday_net_trading, last_net_trading); - JSONObject percentage_yesterday_total_surcharge = this.percentage(yesterday_total_surcharge, last_total_surcharge); - JSONObject percentage_yesterday_royal_surcharge = this.percentage(yesterday_royal_surcharge, last_royal_surcharge); - JSONObject percentage_yesterday_channel_surcharge = this.percentage(yesterday_channel_surcharge, last_channel_surcharge); - JSONObject percentage_yesterday_tax_amount = this.percentage(yesterday_tax_amount, last_tax_amount); - - report.put("channels", settles); - report.put("total_settle_amount", JsonHelper.newJson(json -> { - json.put("amount", yesterday_settle_amount); - json.put("compare", percentage_yesterday_settle_amount); - })); - report.put("total_credit_amount", JsonHelper.newJson(json -> { - json.put("amount", yesterday_credit_amount); - json.put("compare", percentage_yesterday_total_credit); - })); - report.put("total_debit_amount", JsonHelper.newJson(json -> { - json.put("amount", yesterday_debit_amount); - json.put("compare", percentage_yesterday_debit_amount); - })); - report.put("total_net_trading", JsonHelper.newJson(json -> { - json.put("amount", yesterday_net_trading); - json.put("compare", percentage_yesterday_net_trading); - })); - report.put("total_total_surcharge", JsonHelper.newJson(json -> { - json.put("amount", yesterday_total_surcharge); - json.put("compare", percentage_yesterday_total_surcharge); - })); - report.put("total_royal_surcharge", JsonHelper.newJson(json -> { - json.put("amount", yesterday_royal_surcharge); - json.put("compare", percentage_yesterday_royal_surcharge); - })); - report.put("total_channel_surcharge", JsonHelper.newJson(json -> { - json.put("amount", yesterday_channel_surcharge); - json.put("compare", percentage_yesterday_channel_surcharge); - })); - report.put("total_tax_amount", JsonHelper.newJson(json -> { - json.put("amount", yesterday_tax_amount); - json.put("compare", percentage_yesterday_tax_amount); - })); - - return report; - } - - private JSONObject computerTotalAmount(List settles) { - BigDecimal total_settle_amount = new BigDecimal("0.00"); - BigDecimal total_credit_amount = new BigDecimal("0.00"); - BigDecimal total_debit_amount = new BigDecimal("0.00"); - BigDecimal total_net_trading = new BigDecimal("0.00"); - BigDecimal total_total_surcharge = new BigDecimal("0.00"); - BigDecimal total_royal_surcharge = new BigDecimal("0.00"); - BigDecimal total_channel_surcharge = new BigDecimal("0.00"); - BigDecimal total_tax_amount = new BigDecimal("0.00"); - DecimalFormat df1 = new DecimalFormat("0.00"); - - for (int i = 0; i < settles.size(); i++) { - JSONObject jsonObject = settles.get(i); - - BigDecimal settle_amount = jsonObject.getBigDecimal("settle_amount"); - total_settle_amount = total_settle_amount.add(settle_amount); - jsonObject.put("settle_amount", df1.format(settle_amount)); - - BigDecimal credit_amount = jsonObject.getBigDecimal("credit_amount"); - total_credit_amount = total_credit_amount.add(credit_amount); - jsonObject.put("credit_amount", df1.format(credit_amount)); - - - BigDecimal debit_amount = jsonObject.getBigDecimal("debit_amount"); - total_debit_amount = total_debit_amount.add(debit_amount); - jsonObject.put("debit_amount", df1.format(debit_amount)); - - BigDecimal net_trading = jsonObject.getBigDecimal("net_trading"); - total_net_trading = total_net_trading.add(net_trading); - jsonObject.put("net_trading", df1.format(net_trading)); - - BigDecimal total_surcharge = jsonObject.getBigDecimal("total_surcharge"); - total_total_surcharge = total_total_surcharge.add(total_surcharge); - jsonObject.put("total_surcharge", df1.format(total_surcharge)); - - BigDecimal royal_surcharge = jsonObject.getBigDecimal("royal_surcharge"); - total_royal_surcharge = total_royal_surcharge.add(royal_surcharge); - jsonObject.put("royal_surcharge", df1.format(royal_surcharge)); - - BigDecimal channel_surcharge = jsonObject.getBigDecimal("channel_surcharge"); - total_channel_surcharge = total_channel_surcharge.add(channel_surcharge); - jsonObject.put("channel_surcharge", df1.format(channel_surcharge)); - - BigDecimal tax_amount = jsonObject.getBigDecimal("tax_amount"); - total_tax_amount = total_tax_amount.add(tax_amount); - jsonObject.put("tax_amount", df1.format(tax_amount)); - } - String finalTotal_settle_amount = df1.format(total_settle_amount); - String finalTotal_credit_amount = df1.format(total_credit_amount); - String finalTotal_debit_amount = df1.format(total_debit_amount); - String finalTotal_net_trading = df1.format(total_net_trading); - String finalTotal_total_surcharge = df1.format(total_total_surcharge); - String finalTotal_royal_surcharge = df1.format(total_royal_surcharge); - String finalTotal_channel_surcharge = df1.format(total_channel_surcharge); - String finalTotal_tax_amount = df1.format(total_tax_amount); - return JsonHelper.newJson(json -> { - json.put("total_settle_amount", finalTotal_settle_amount); - json.put("total_credit_amount", finalTotal_credit_amount); - json.put("total_debit_amount", finalTotal_debit_amount); - json.put("total_net_trading", finalTotal_net_trading); - json.put("total_total_surcharge", finalTotal_total_surcharge); - json.put("total_royal_surcharge", finalTotal_royal_surcharge); - json.put("total_channel_surcharge", finalTotal_channel_surcharge); - json.put("total_tax_amount", finalTotal_tax_amount); - }); - } - - private JSONObject percentage(BigDecimal num1, BigDecimal num2) { - boolean positive = true; - double n1 = num1.doubleValue(); - double n2 = num2.doubleValue(); - if (Double.compare(n2, 0) == 0) - throw new RuntimeException("输入有误"); - double ratio = n1 / n2; - if (ratio < 1) { - positive = false; - } - NumberFormat format = NumberFormat.getPercentInstance(); - format.setMaximumFractionDigits(2); - String result = format.format(ratio < 1 ? 1 - ratio : ratio - 1); - - boolean finalPositive = positive; - return JsonHelper.newJson(json -> { - json.put("compare", result); - json.put("positive", finalPositive); - }); - } - - - @Override - public JSONObject getReport(String reportId, String openid) { - JSONObject manager = managerMapper.findByWxOpenId(openid); - if (manager == null || !manager.getBooleanValue("is_valid")) { - throw new ForbiddenException(); - } - JSONObject report = dailyReportMapper.findOne(reportId); - if (report == null) { - throw new NotFoundException("Report Not Exists!"); - } - report.put("credit", JSON.parseObject(report.getString("credit"))); - report.put("debit", JSON.parseObject(report.getString("debit"))); - report.put("kpi", JSON.parseObject(report.getString("kpi"))); - report.put("range", report.getDate("analysis_date")); - report.put("report_date", report.getDate("report_date")); - return report; - } - - private void publishMessages(List users, String reportId, String range) { - ArrayList clean_users = new ArrayList<>(); - String url = PlatformEnvironment.getEnv().concatUrl("/analysis/daily_reports/" + reportId); - String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); - for (JSONObject user : users) { - String openId = user.getString("wx_openid"); - if (openId != null && clean_users.contains(openId)) { - continue; - } - if (openId != null) { - clean_users.add(openId); - try { - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - String templateId = paymentApi.getTemplateId("report-generated"); - TemplateMessage msg = initMsg(range, url, time, openId, templateId); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - } - logger.info("DailyReportUsers {}", clean_users.toString()); - } - - private TemplateMessage initMsg(String range, String url, String time, String openId, String templateId) { - TemplateMessage msg = new TemplateMessage(openId, templateId, url); - msg.put("first", "每日财务报告(" + range + ")生成完毕", "#10b24c"); - msg.put("keyword1", "每日财务报告", "#000000"); - msg.put("keyword2", time, "#000000"); - msg.put("remark", "点击查看详情", "#000000"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java deleted file mode 100644 index 9f81e22c7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ /dev/null @@ -1,672 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.DashboardAnalysisTask; -import au.com.royalpay.payment.manage.analysis.core.DashboardService; -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ExchangeRateMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.defines.TradeType; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.commons.lang3.time.DurationFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.TimeUnit; - -/** - * Created by davep on 2016-07-28. - */ -@Service -public class DashboardServiceImpl implements DashboardService, DashboardAnalysisTask { - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientAnalysisMapper clientAnalysisMapper; - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - @Resource - private ExchangeRateMapper exchangeRateMapper; - - @Resource - private TransactionMapper transactionMapper; - - @Resource - private StringRedisTemplate stringRedisTemplate; - - @Resource - private MerchantInfoProvider merchantInfoProvider; - - - @Override - public JSONObject getCommonAnalysis1(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis1" + params.getString("org_id") + params.getString("begin")).get(); - JSONObject commonAnalysis1 = JSON.parseObject(jsonStr); - if (commonAnalysis1 != null) { - return commonAnalysis1; - } - JSONObject res = new JSONObject(); - if (params.getDate("end").after(new Date())) { - if (params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1)) == 0) { - res = transactionAnalysisMapper.getClientTransaction(params); - } else { - res = customerAndOrdersStatisticsMapper.getCommonCount(params); - } - } else { - res = customerAndOrdersStatisticsMapper.getCommonCount(params); - } - stringRedisTemplate.boundValueOps("org_commonAnalysis1" + params.getString("org_id") + params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES); - return res; - - } - - @Override - public JSONObject getCommonAnalysis3(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis3" + params.getString("org_id") + params.getString("begin")).get(); - JSONObject commonAnalysis3 = JSON.parseObject(jsonStr); - if (commonAnalysis3 != null) { - return commonAnalysis3; - } - JSONObject res = new JSONObject(); - res.put("new_partners", clientAnalysisMapper.countNewClients(params)); - - //res.put("total_partners", clientAnalysisMapper.countClients(params)); - // 统计所有的商户,包括禁用的 - res.put("total_partners", clientAnalysisMapper.countClientsAll(params)); - stringRedisTemplate.boundValueOps("org_commonAnalysis3" + params.getString("org_id") + params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES); - return res; - } - - @Override - public JSONObject getCommonAnalysis2(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis2" + params.getString("org_id") + params.getString("begin")).get(); - JSONObject commonAnalysis2 = JSON.parseObject(jsonStr); - if (commonAnalysis2 != null) { - return commonAnalysis2; - } - JSONObject res = new JSONObject(); - if (params.getDate("end").after(new Date())) { - if (params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1)) == 0) { - res.put("total_customers", transactionAnalysisMapper.countCustomers(params)); - res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params)); - } else { - res = getYesOrLasMonth(params); - } - } else { - res = getYesOrLasMonth(params); - } - stringRedisTemplate.boundValueOps("org_commonAnalysis2" + params.getString("org_id") + params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES); - return res; - } - - private JSONObject getYesOrLasMonth(JSONObject params) { - JSONObject res = new JSONObject(); - res.put("traded_partners", customerAndOrdersStatisticsMapper.countTradedClients(params)); - res.put("total_customers", customerAndOrdersStatisticsMapper.countTotalCustomers(params)); - res.put("old_customers", customerAndOrdersStatisticsMapper.countTotalOldCustomers(params)); - return res; - } - - @Override - public JSONObject getCommonAnalysis4(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis4" + params.getString("org_id") + params.getString("begin")).get(); - JSONObject commonAnalysis4 = JSON.parseObject(jsonStr); - if (commonAnalysis4 != null) { - return commonAnalysis4; - } - JSONObject res = new JSONObject(); - List topOrders = transactionAnalysisMapper.getTopOrders(params); - if (!topOrders.isEmpty()) { - res.put("top_amount_order", topOrders.get(0)); - } - stringRedisTemplate.boundValueOps("org_commonAnalysis4" + params.getString("org_id") + params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES); - return res; - } - - @Override - public List getTradeInTypes(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("tradeInTypes" + params.getString("org_id") + params.getString("begin")).get(); - List tradeInTypes = JSONObject.parseArray(jsonStr, JSONObject.class); - if (tradeInTypes != null) { - return tradeInTypes; - } - if (params.containsKey("client_id")) { - clientManager.queryModifyClientIds(params.getInteger("client_id"), params); - } - List res = transactionAnalysisMapper.getTradeAmountInTypes(params); - stringRedisTemplate.boundValueOps("tradeInTypes" + params.getString("org_id") + params.getString("begin")).set(res.toString(), 5, TimeUnit.MINUTES); - return res; - } - - - @Override - public List getTopTradePartners(JSONObject params, int limit) { - return clientAnalysisMapper.listPartnersTradeAmount(params, - new PageBounds(1, limit, Order.formString("aud_fee.desc"))); - } - - - @Override - public List getTopTradePartnersNew(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("topTradePartnersNew" + params.getString("org_id") + params.getString("begin")).get(); - List topTradePartnersNew = JSONObject.parseArray(jsonStr, JSONObject.class); - if (topTradePartnersNew != null) { - return topTradePartnersNew; - } - params.putIfAbsent("rankType", "aud_fee"); - List res = clientAnalysisMapper.listPartnersTradeAmountNew(params); - stringRedisTemplate.boundValueOps("topTradePartnersNew" + params.getString("org_id") + params.getString("begin")).set(res.toString(), 5, TimeUnit.MINUTES); - return res; - } - - @Override - public List getTradeAnalysisInHours(JSONObject params) { - List totalAnalysis = transactionAnalysisMapper.tradeAnalysisInHours(params); - params.put("gateway", new int[]{TradeType.OFFLINE.getGateway(), TradeType.OFFLINE_QRCODE.getGateway()}); - List offlineAnalysis = transactionAnalysisMapper.tradeAnalysisInHours(params); - params.put("gateway", new int[]{TradeType.GATEWAY_OFFLINE.getGateway(), TradeType.GATEWAY_OFFLINE_QRCODE.getGateway()}); - List offlineQRCodeAnalysis = transactionAnalysisMapper.tradeAnalysisInHours(params); - params.put("gateway", new int[]{TradeType.CLIENT_CODE.getGateway(), TradeType.CLIENT_CODE_QRCODE.getGateway()}); - List clientCodeAnalysis = transactionAnalysisMapper.tradeAnalysisInHours(params); - params.put("gateway", new int[]{TradeType.GATEWAY_QRCODE.getGateway()}); - List gatewayQRCodeAnalysis = transactionAnalysisMapper.tradeAnalysisInHours(params); - params.put("gateway", new int[]{TradeType.GATEWAY_JSAPI.getGateway()}); - List gatewayJsAPIAnalysis = transactionAnalysisMapper.tradeAnalysisInHours(params); - List analysis = new ArrayList<>(); - for (int i = 0; i < 24; i++) { - JSONObject hourItem = new JSONObject(); - hourItem.put("hour", i); - hourItem.put("total_count", 0); - hourItem.put("total_fee", 0); - hourItem.put("offline_count", 0); - hourItem.put("offline_fee", 0); - hourItem.put("offline_qrcode_count", 0); - hourItem.put("offline_qrcode_fee", 0); - hourItem.put("client_code_count", 0); - hourItem.put("client_code_fee", 0); - hourItem.put("gateway_qrcode_count", 0); - hourItem.put("gateway_qrcode_fee", 0); - hourItem.put("gateway_jsapi_count", 0); - hourItem.put("gateway_jsapi_fee", 0); - analysis.add(hourItem); - } - for (JSONObject total : totalAnalysis) { - fixData(analysis, total, "total_count", "total_fee"); - } - for (JSONObject hour : offlineAnalysis) { - fixData(analysis, hour, "offline_count", "offline_fee"); - } - for (JSONObject hour : offlineQRCodeAnalysis) { - fixData(analysis, hour, "offline_api_count", "offline_api_fee"); - } - for (JSONObject hour : clientCodeAnalysis) { - fixData(analysis, hour, "client_code_count", "client_code_fee"); - } - for (JSONObject hour : gatewayQRCodeAnalysis) { - fixData(analysis, hour, "gateway_qrcode_count", "gateway_qrcode_fee"); - } - for (JSONObject hour : gatewayJsAPIAnalysis) { - fixData(analysis, hour, "gateway_jsapi_count", "gateway_jsapi_fee"); - } - return analysis; - } - - - @Override - public List getTradeAnalysisInTime(JSONObject params) { - //"Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5" - List analysis = new ArrayList<>(); - params.put("trade_type", "Online API"); - List onlineApi_ordedrs = transactionAnalysisMapper.getOrdersByGateway(params); - JSONObject onlineApi = new JSONObject(); - onlineApi.put("name", "Online API"); - onlineApi.put("data", onlineApi_ordedrs); - analysis.add(onlineApi); - params.put("trade_type", "QR Code"); - List qRCode_orders = transactionAnalysisMapper.getOrdersByGateway(params); - JSONObject qRCode = new JSONObject(); - qRCode.put("name", "QR Code"); - qRCode.put("data", qRCode_orders); - analysis.add(qRCode); - params.put("trade_type", "Retail API"); - List retailApi_orders = transactionAnalysisMapper.getOrdersByGateway(params); - JSONObject retailApi = new JSONObject(); - retailApi.put("name", "Retail API"); - retailApi.put("data", retailApi_orders); - analysis.add(retailApi); - params.put("trade_type", "Retail In-Store"); - List retailInStore_orders = transactionAnalysisMapper.getOrdersByGateway(params); - JSONObject retailInStore = new JSONObject(); - retailInStore.put("name", "Retail In-Store"); - retailInStore.put("data", retailInStore_orders); - if (!retailInStore_orders.isEmpty()) { - analysis.add(retailInStore); - } - params.put("trade_type", "In-APP H5"); - List wechatHtml5_orders = transactionAnalysisMapper.getOrdersByGateway(params); - JSONObject wechatHtml5 = new JSONObject(); - wechatHtml5.put("name", "In-APP H5"); - wechatHtml5.put("data", wechatHtml5_orders); - analysis.add(wechatHtml5); - return analysis; - } - - @Override - public List getPartnerTradeAnalysisInDays(JSONObject params) { - int date_range = Integer.parseInt(DurationFormatUtils.formatPeriod(params.getDate("begin").getTime(), params.getDate("end").getTime(), "dd")); - List tradeDays = new ArrayList<>(); - Date fitchDate = params.getDate("end"); - for (int dividedays = date_range; dividedays > 0; dividedays--) { - params.put("begin", DateUtils.addDays(fitchDate, -dividedays)); - params.put("end", DateUtils.addDays(fitchDate, -dividedays + 1)); - JSONObject json = transactionAnalysisMapper.tradeAnalysisInDay(params); - tradeDays.add(json); - } - return tradeDays; - } - - @Override - public List getTradeAnalysisInDays(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("tradeAnalysisInDays" + params.getString("org_id") + params.getString("begin")).get(); - List tradeAnalysisInDays = JSONObject.parseArray(jsonStr, JSONObject.class); - if (tradeAnalysisInDays != null) { - return tradeAnalysisInDays; - } - if (!params.containsKey("client_ids") && !params.containsKey("org_id")) { - params.put("client_id", 0); - } - List res = customerAndOrdersStatisticsMapper.getSumCustomersAnalysis(params); - stringRedisTemplate.boundValueOps("tradeAnalysisInDays" + params.getString("org_id") + params.getString("begin")).set(res.toString(), 5, TimeUnit.MINUTES); - return res; - } - - @Override - public List getClientsTradeAnalysisInDays(JSONObject params) { - if (!params.containsKey("client_ids") && !params.containsKey("org_id")) { - params.put("client_id", 0); - } - return clientAnalysisMapper.listNewClients(params); - } - - @Override - public JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - JSONObject res = new JSONObject(); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id")); - params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - params.put("client_id", partner.getIntValue("client_id")); - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - JSONObject today = getTransJSONO(params); - params.put("begin", DateUtils.addDays(params.getDate("begin"), -1)); - params.put("end", DateUtils.addDays(params.getDate("end"), -1)); - JSONObject yes = getTransJSONO(params); - res.put("today", today); - res.put("yes", yes); -// res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); -// params.put("channel", "system"); -// res.put("sys_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); -// params.put("channel", "rpaypmt_card"); -// res.put("rpaypmt_card_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); -// params.put("channel", "rpaypmt_dd"); -// res.put("rpaypmt_dd_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); - res.put("trade_amount_rise", yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO) > 0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"), 4, RoundingMode.HALF_UP) : BigDecimal.ZERO); - res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getBigDecimal("trade_count").subtract(yes.getBigDecimal("trade_count"))).divide(yes.getBigDecimal("trade_count"), 4, RoundingMode.HALF_UP) : 0); - res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, RoundingMode.HALF_UP) : 0); - params.remove("begin"); - params.remove("end"); - List logs = transactionMapper.listSettlementLogTotal(params); - res.put("latest_settle", logs.isEmpty() ? BigDecimal.ZERO : logs.get(0).getBigDecimal("income")); - return res; - } - - /** - * 根据渠道号分别加载未清算金额 - * - * @param partner - * @param partnerAnalysisBean - * @return - */ - @Override - public JSONObject getCommonAnalysisByChannel(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - - JSONObject res = new JSONObject(); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id")); - params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - params.put("client_id", partner.getIntValue("client_id")); - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - params.put("begin", DateUtils.addDays(params.getDate("begin"), -1)); - params.put("end", DateUtils.addDays(params.getDate("end"), -1)); - String key = "not_settled"; - if (StringUtils.isNotEmpty(params.getString("channel"))) { - key = params.getString("channel") + "_not_settled"; - } - res.put(key, new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); - return res; - } - - private JSONObject getTransJSONO(JSONObject params) { - JSONObject res = new JSONObject(); - JSONObject object = transactionAnalysisMapper.getClientTransaction(params); - res.put("trade_amount", object.getBigDecimal("trade_amount")); - res.put("trade_count", object.getIntValue("trade_count")); - res.put("customers", transactionAnalysisMapper.countCustomers(params)); - return res; - } - - @Override - public List getTradeAnalysisInHours(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - return getTradeAnalysisInHours(params); - } - - @Override - public List getTradeAnalysisInDays(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - return getPartnerTradeAnalysisInDays(params); - } - - @Override - public List getPartnersInTypes(JSONObject jsonObject) { - return transactionAnalysisMapper.getTradePartnersInTypes(jsonObject); - } - - @Override - public List getPartnersByTradeType(JSONObject params) { - return transactionAnalysisMapper.getPartnersByTradeType(params); - } - - @Override - @Cacheable(value = ":exchange_rates:", key = "'exchange_rates'+#root.args[0]+#root.args[1]") - public List listExchangeRateHistory(String begin, String end) { - final String[] pattern = {"yyyyMMdd"}; - Date beginDate; - try { - beginDate = DateUtils.parseDate(begin, pattern); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_time"); - } - Date endDate; - try { - endDate = DateUtils.parseDate(end, pattern); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_time"); - } - List listChannelRate = new ArrayList<>(); - Map exchangeRateMap = new TreeMap<>(); - String[] channels = {"Wechat", "Alipay"}; - for (String channel : channels) { - channelsExchangeRate(beginDate, endDate, exchangeRateMap, channel); - } - for (Date date : exchangeRateMap.keySet()) { - JSONObject total = exchangeRateMap.get(date); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd "); - String time = sdf.format(date); - total.put("date", time); - for (String channel : channels) { - if (total.getJSONObject(channel) == null) { - JSONObject mockAnalysis = new JSONObject(); - mockAnalysis.put("exchange_rate", 0); - mockAnalysis.put("date", time); - total.put(channel, mockAnalysis); - } - } - listChannelRate.add(total); - } - return listChannelRate; - } - - public void channelsExchangeRate(Date beginDate, Date endDate, Map exchangeRateMap, String channel) { - - List channelRates = exchangeRateMapper.listExchangeRates(beginDate, endDate, channel); - for (JSONObject analysisItem : channelRates) { - Date date = analysisItem.getDate("date"); - JSONObject dataItem = exchangeRateMap.get(date); - if (dataItem == null) { - dataItem = new JSONObject(); - exchangeRateMap.put(date, dataItem); - } - dataItem.put(channel, analysisItem); - } - } - - @Override - public List getCustomersAndOrdersInDays(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - return customerAndOrdersStatisticsMapper.getSumCustomersAnalysis(params); - } - - @Override - public JSONObject getNewRecord() { - String jsonStr = stringRedisTemplate.boundValueOps("newRecord").get(); - JSONObject newRecord = JSON.parseObject(jsonStr); - if (newRecord != null) { - return newRecord; - } - JSONObject max_amount = customerAndOrdersStatisticsMapper.getMaxAmount(0); - JSONObject max_orders = customerAndOrdersStatisticsMapper.getMaxOrders(0); - JSONObject maxTransactionPartners = customerAndOrdersStatisticsMapper.getMaxTransactionPartners(); - JSONObject res = new JSONObject(); - res.put("max_amount", max_amount); - res.put("max_orders", max_orders); - res.put("max_transaction_partners", maxTransactionPartners); - stringRedisTemplate.boundValueOps("newRecord").set(res.toJSONString(), 5, TimeUnit.MINUTES); - return res; - } - - private void fixData(List analysis, JSONObject data, String countKey, String feeKey) { - int hour = data.getIntValue("h"); - analysis.get(hour).put(countKey, data.getDoubleValue("count")); - analysis.get(hour).put(feeKey, data.getDoubleValue("aud_fee")); - } - - @Override - public void generateCustomersAndOrdersStatistics(Date analysisDate) { - DateFormat format = new SimpleDateFormat("yyyyMMdd"); - String date = format.format(analysisDate); - List clients = clientMapper.listClients(); - for (JSONObject client : clients) { - generateData(format, date, client); - } - JSONObject totalObject = new JSONObject(); - totalObject.put("client_id", 0); - generateData(format, date, totalObject); - logger.info("generate customer and orders statistics on {} done", date); - } - - /** - * 重新生成执行商户下某日消费者数据 - * - * @param analysisDate - * @param clientId - */ - public void generateCustomersAndOrdersStatisticsByClientMoniker(Date analysisDate, String clientId) { - DateFormat format = new SimpleDateFormat("yyyyMMdd"); - String date = format.format(analysisDate); - List clients = clientMapper.listClients(); - for (JSONObject client : clients) { - if (client.getString("client_id").equals(clientId)) { - generateData(format, date, client); - } - } - } - - private void generateData(DateFormat format, String date, JSONObject client) { - if (client.getIntValue("client_id") == 0) { - logger.info("analysising platform customers data", new RuntimeException("debug exception")); - } - JSONObject params = new JSONObject(); - String timezone = client.getString("timezone"); - if (timezone != null) { - format.setTimeZone(TimeZone.getTimeZone(timezone)); - } - try { - params.put("begin", format.parse(date)); - params.put("end", DateUtils.addDays(format.parse(date), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - if (client.getIntValue("client_id") != 0) { - params.put("client_id", client.getIntValue("client_id")); - } - List records = transactionAnalysisMapper.getCustomersAndOrdersInDaysUseInScheduled(params); - if (!records.isEmpty()) { - JSONObject deleteParams = new JSONObject(); - deleteParams.put("begin", params.getDate("begin")); - deleteParams.put("end", params.getDate("end")); - deleteParams.put("client_id", params.getIntValue("client_id")); - customerAndOrdersStatisticsMapper.delete(deleteParams); - for (JSONObject record : records) { - String sdate = format.format(record.getDate("date")); - try { - params.put("begin", format.parse(sdate)); - params.put("end", DateUtils.addDays(format.parse(sdate), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - params.put("channel", record.getString("channel")); - int newCustomers = 0; - int oldCustomers=0; - if (client.getIntValue("client_id") != 0) { - oldCustomers = transactionAnalysisMapper.countOldCustomers(params); - newCustomers = transactionAnalysisMapper.countNewCustomers(params); - } - record.put("new_customers", newCustomers); - record.put("old_customers", oldCustomers); - record.put("client_id", client.getIntValue("client_id")); - if (StringUtils.equalsIgnoreCase("rpaypmt_card", record.getString("channel")) || StringUtils.equalsIgnoreCase("rpaypmt_dd", record.getString("channel"))) { - record.put("single_amount", record.getBigDecimal("total").divide(record.getBigDecimal("orders"), 2, RoundingMode.HALF_UP)); - } - customerAndOrdersStatisticsMapper.save(record); - } - } - } - - @Override - public JSONObject getPlatformAmount(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("org_id") + params.getString("begin")).get(); - JSONObject channelAnalysis = JSON.parseObject(jsonStr); - if (channelAnalysis != null) { - return channelAnalysis; - } else { - JSONObject resp; - if (params.getDate("end").compareTo(new Date()) > 0) { - if (params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1)) == 0) { - resp = getTodayChannelCount(params); - } else { - resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params); - } - } else { - resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params); - } - stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("org_id") + params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES); - return resp; - } - } - - private JSONObject getTodayChannelCount(JSONObject params) { - String[] channels = new String[]{"Wechat", "Alipay", "AlipayOnline", "Rpay", "rpaypmt_card", "rpaypmt_dd","ApsInStore","ApsCashier"}; - JSONObject resp = new JSONObject(); - for (String channel : channels) { - params.put("channel", channel); - resp.put(channel.toLowerCase() + "amount", transactionAnalysisMapper.getPlatformAmount(params).getBigDecimal("amount")); - resp.put(channel.toLowerCase() + "_order_count", transactionAnalysisMapper.getPlatformAmount(params).getIntValue("order_count")); - } - return resp; - } - - @Override - public JSONObject getOrderAndCustomerPerDay(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - return customerAndOrdersStatisticsMapper.getAvgOrderAndCustomerStatistics(params); - } - - @Override - public List getStatisticsCustomersAndOrdersInDays(JSONObject partner, AnalysisBean partnerAnalysisBean) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = partnerAnalysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("Dashboard analysis request including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - clientManager.queryModifyClientIds(partner.getInteger("client_id"), params); - return customerAndOrdersStatisticsMapper.getPartnerCustomerAndOrderStatistics(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java deleted file mode 100644 index 12a699447..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java +++ /dev/null @@ -1,478 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; -import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.core.beans.SettlementLog; -import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService; -import au.com.royalpay.payment.manage.analysis.core.EstimateCacheSupport; -import au.com.royalpay.payment.manage.analysis.mappers.EstimateAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import au.com.royalpay.payment.manage.mappers.log.PlatformSettlementMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * Created by Tayl0r on 2017/7/3. - */ -@Service -public class EstimateAnalysisServiceImpl implements EstimateAnalysisService { - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private MpPaymentApi mpPaymentApi; - - @Resource - private ClientMapper clientMapper; - - @Resource - private ClearingLogMapper clearingLogMapper; - - @Resource - private PlatformSettlementMapper platformSettlementMapper; - - @Resource - private ClearingDetailMapper clearingDetailMapper; - @Resource - private EstimateCacheSupport estimateCacheSupport; - @Resource - private TransactionMapper transactionMapper; - - public static List t1client; - - public static List t2client; - - public static List t3client; - - // @PostConstruct - public void initClient() { - logger.info("开始执行初始化清算商户"); - t1client = getClientByCleanDays(1); - t2client = getClientByCleanDays(2); - t3client = getClientByCleanDays(3); - logger.info("初始化清算商户完毕:" + t1client.size() + " = " + t2client.size() + " = " + t3client.size()); - } - - @Resource - private EstimateAnalysisMapper estimateAnalysisMapper; - - @Override - @Cacheable(value = ":estimate_analysis_future:", key = "''") - public List listFutureInfo() throws Exception { - return listSettlementInfo(); - } - - @Override - public void clearEstimateFutureCache() { - estimateCacheSupport.clearEstimateFutureCache(); - } - - public List listSettlementInfo() throws Exception { - initClient(); - - List settleReport = new ArrayList<>(); - //今天 - Calendar calendar = Calendar.getInstance(); - calendar.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); - - //如果是周一,显示周五的数据 - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date()); - int week = cal.get(Calendar.DAY_OF_WEEK); - if (week == 2) { - cal.add(Calendar.DATE, -3); - } - Date todayDate = new Date(); - Date todayClearDate = cal.getTime(); - String dateStr = DateFormatUtils.format(todayDate, "yyyy/MM/dd"); - if (estimateAnalysisMapper.checkDayIsCleanDay(dateStr) != null) { - JSONObject todaySettle = getDaySettleInfo(todayDate); - JSONObject today = getDayClearInfo(todayClearDate, todaySettle); - try { - JSONObject realToday = todaySettleInfo(todayDate); - today.put("t1", realToday.getBigDecimal("t1")); - today.put("t2", realToday.getBigDecimal("t2")); - today.put("t3", realToday.getBigDecimal("t3")); - today.put("total", realToday.getBigDecimal("total")); - today.put("net_amount", realToday.getBigDecimal("net_amount")); - } catch (Exception e) { - logger.error("今日清算记录未生成,使用自助查询!"); - } - settleReport.add(today); - } - //明天 - Date tomorrowDate = new Date(todayDate.getTime() + 86400000L); - dateStr = DateFormatUtils.format(tomorrowDate, "yyyy/MM/dd"); - if (estimateAnalysisMapper.checkDayIsCleanDay(dateStr) != null) { - JSONObject tomorrow = getDaySettleInfo(tomorrowDate); - settleReport.add(tomorrow); - } - - //后天 - Date afterTomorrowDate = new Date(todayDate.getTime() + 172800000L); - dateStr = DateFormatUtils.format(afterTomorrowDate, "yyyy/MM/dd"); - if (estimateAnalysisMapper.checkDayIsCleanDay(dateStr) != null) { - JSONObject afterTomorrow = getDaySettleInfo(afterTomorrowDate); - settleReport.add(afterTomorrow); - } - - //大后天 - Date afterDate = new Date(todayDate.getTime() + 259200000L); - dateStr = DateFormatUtils.format(afterDate, "yyyy/MM/dd"); - if (estimateAnalysisMapper.checkDayIsCleanDay(dateStr) != null) { - JSONObject after = getDaySettleInfo(afterDate); - settleReport.add(after); - } - return settleReport; - } - - public JSONObject todaySettleInfo(Date settleDate) { - JSONObject dayInfo = new JSONObject(); - dayInfo.put("t1", new BigDecimal(0.00)); - dayInfo.put("t2", new BigDecimal(0.00)); - dayInfo.put("t3", new BigDecimal(0.00)); - dayInfo.put("net_amount", new BigDecimal(0.00)); - //todo 支持多个清算记录 - List logs = clearingLogMapper.findByDate(settleDate); - if (logs == null || logs.size() <= 0) { - throw new NotFoundException(); - } - for (JSONObject log : logs) { - JSONObject details = clearingDetailMapper.listReportsOfSettleCleanDay(log.getIntValue("clearing_id"), t1client); - dayInfo.put("t1", dayInfo.getBigDecimal("t1").add(details.getBigDecimal("total_amount"))); - details.clear(); - - details = clearingDetailMapper.listReportsOfSettleCleanDay(log.getIntValue("clearing_id"), t2client); - dayInfo.put("t2", dayInfo.getBigDecimal("t2").add(details.getBigDecimal("total_amount"))); - details.clear(); - - details = clearingDetailMapper.listReportsOfSettleCleanDay(log.getIntValue("clearing_id"), t3client); - dayInfo.put("t3", dayInfo.getBigDecimal("t3").add(details.getBigDecimal("total_amount"))); - - dayInfo.put("net_amount", dayInfo.getBigDecimal("net_amount").add(log.getBigDecimal("net_amount"))); - } - dayInfo.put("total", dayInfo.getBigDecimal("t1").add(dayInfo.getBigDecimal("t2")).add(dayInfo.getBigDecimal("t3"))); - return dayInfo; - } - - public JSONObject getDaySettleInfo(Date date) throws Exception { - - DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - //T1 ok - JSONObject dayInfo = new JSONObject(); - dayInfo.put("platformGetSettleFee", BigDecimal.ZERO); - String endStr = DateFormatUtils.format(date, "yyyy/MM/dd"); - JSONObject maxDays = estimateAnalysisMapper.findMaxCleanDays(endStr); - String end_date = maxDays.getString("date_str"); - JSONObject cleanDays = estimateAnalysisMapper.findLastCleanDays(endStr, 1); - String start_date = cleanDays.getString("date_str"); - JSONObject totalAmountT1 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t1client); - if (totalAmountT1 != null) { - dayInfo.put("t1", totalAmountT1.getBigDecimal("total_amount")); - } else { - dayInfo.put("t1", 0); - } - - //T2 - maxDays = estimateAnalysisMapper.findLastCleanDays(end_date, 1); - end_date = maxDays.getString("date_str"); - cleanDays = estimateAnalysisMapper.findLastCleanDays(start_date, 1); - start_date = cleanDays.getString("date_str"); - JSONObject totalAmountT2 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t2client); - if (totalAmountT2 != null) { - dayInfo.put("t2", totalAmountT2.getBigDecimal("total_amount")); - } else { - dayInfo.put("t2", 0); - } - - //T3 - maxDays = estimateAnalysisMapper.findLastCleanDays(end_date, 1); - end_date = maxDays.getString("date_str"); - cleanDays = estimateAnalysisMapper.findLastCleanDays(start_date, 1); - start_date = cleanDays.getString("date_str"); - JSONObject totalAmountT3 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t3client); - if (totalAmountT3 != null) { - dayInfo.put("t3", totalAmountT3.getBigDecimal("total_amount")); - } else { - dayInfo.put("t3", 0); - } - dayInfo.put("estimate_date", endStr); - dayInfo.put("total", dayInfo.getBigDecimal("t1").add(dayInfo.getBigDecimal("t2")).add(dayInfo.getBigDecimal("t3"))); - - - //预计到账金额 - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH) - 1, 2, 0, 0); - Date datefrom = cal.getTime(); - - if (DateUtils.isSameDay(new Date(), datefrom)) { - JSONObject params = new JSONObject(); - params.put("datefrom", DateFormatUtils.format(DateUtils.addDays(datefrom, -1), "yyyy-MM-dd HH:mm:ss")); - params.put("dateto", DateFormatUtils.format(datefrom, "yyyy-MM-dd HH:mm:ss")); - - List lastDayClearingAmount = transactionMapper.getLastDaytransAmount(params); - BigDecimal total_clearing = BigDecimal.ZERO; - BigDecimal total_surcharge = BigDecimal.ZERO; - for (JSONObject e : lastDayClearingAmount) { - total_clearing = total_clearing.add(e.getBigDecimal("clearing_amount")); - total_surcharge = total_surcharge.add(e.getBigDecimal("channel_surcharge")); - } - - dayInfo.put("total_clearing", total_clearing.subtract(total_surcharge)); - dayInfo.put("clearing", lastDayClearingAmount); - } - return dayInfo; - } - - //把清算预估和到账金额分离 - public JSONObject getDayClearInfo(Date date, JSONObject dayInfo) { - dayInfo.put("platformGetSettleFee", BigDecimal.ZERO); - String endStr = DateFormatUtils.format(date, "yyyy/MM/dd"); - JSONObject maxDays = estimateAnalysisMapper.findMaxCleanDays(endStr); - String end_date = maxDays.getString("date_str"); - JSONObject cleanDays = estimateAnalysisMapper.findLastCleanDays(endStr, 1); - List tencentSettle = platformSettlementMapper.findBySettleDate(new Date(maxDays.getDate("date_str").getTime() - 86400000L), "Wechat"); - if (tencentSettle != null && !tencentSettle.isEmpty()) { - for (JSONObject logs : tencentSettle) { - dayInfo.put("settlementFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); - if (!dayInfo.containsKey("platformGetSettleFee")) { - dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("settlementFee_" + logs.getString("merchants"))); - } else { - dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("settlementFee_" + logs.getString("merchants")))); - } - } - } else { - List tencentSettleList; - for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()) { - - try { - tencentSettleList = mpPaymentApi.settlementLogs(new Date(maxDays.getDate("date_str").getTime() - 86400000L), new Date(maxDays.getDate("date_str").getTime() - 86400000L), mch.getMerchantId()); - if (tencentSettle == null || tencentSettleList.size() <= 0) { - logger.info("EstimateAnalysisServiceImpl.getDaySettleInfo ======>【" + mch.getMerchantId() + "】下没有清算记录"); - } else { - for (SettlementLog settle : tencentSettleList) { - dayInfo.put("settlementFee_" + mch.getMerchantId(), settle.getSettlementFee()); - if (!dayInfo.containsKey("platformGetSettleFee")) { - dayInfo.put("platformGetSettleFee", settle.getSettlementFee()); - } else { - dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(settle.getSettlementFee())); - } - } - cleanDays.clear(); - } - } catch (Exception e) { - logger.error("EstimateAnalysisServiceImpl.getDaySettleInfo ======>【" + mch.getMerchantId() + "】下没有清算记录", e); - } - } - - } - - List alipaySettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "Alipay"); - for (JSONObject logs : alipaySettleLogs) { - dayInfo.put("aliSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); - dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliSettleFee_" + logs.getString("merchants")))); - } - - List alipayOnlineSettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "AlipayOnline"); - logger.info(" Estimate alipayOnlineSettleLogs is :{}", alipayOnlineSettleLogs.toString()); - for (JSONObject logs : alipayOnlineSettleLogs) { - dayInfo.put("aliOnlineSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); - dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliOnlineSettleFee_" + logs.getString("merchants")))); - } - cleanDays.clear(); - - return dayInfo; - } - - @Override - public void generateSettleAmount() { - String report_date = DateFormatUtils.format(DateUtils.addDays(new Date(), -1), "yyyy/MM/dd"); - logger.info("系统开始生成[ " + report_date + " ]清算总额"); - - JSONObject isClearDay = estimateAnalysisMapper.checkIsClearDay(report_date); - if (isClearDay != null && !isClearDay.isEmpty()) { - JSONObject estimate = getCleanDayAmount(report_date); - estimate.put("log_date", report_date); - estimate.put("last_update_date", new Date()); - estimate.put("log_type", 1); - estimate.put("last_update_by", "System Automatic Generation"); - - JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(report_date, 1); - if (estimateExit != null) { - estimate.put("estimate_id", estimateExit.getString("estimate_id")); - estimateAnalysisMapper.update(estimate); - - logger.info("系统自动生成[ " + report_date + " ]清算总额生成完毕"); - } else { - estimateAnalysisMapper.save(estimate); - - logger.info("系统自动生成[ " + report_date + " ]清算总额更新完毕"); - } - } - } - - @Override - public void generateTransactionData() { - String end_date = DateFormatUtils.format(new Date(), "yyyy/MM/dd"); - String start_date = DateFormatUtils.format(new Date().getTime() - 86400000L, "yyyy/MM/dd"); - logger.info("系统开始生成[ " + start_date + " ]交易总额"); - - JSONObject estimate = getTransactionAmountDaily(start_date, end_date); - estimate.put("log_date", start_date); - estimate.put("last_update_date", new Date()); - estimate.put("log_type", 2); - estimate.put("last_update_by", "System Auto Generat Transaction Logs"); - - JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(start_date, 2); - if (estimateExit != null) { - estimate.put("estimate_id", estimateExit.getString("estimate_id")); - estimateAnalysisMapper.update(estimate); - - logger.info("系统自动生成[ " + start_date + " ]交易总额生成完毕"); - } else { - estimateAnalysisMapper.save(estimate); - - logger.info("系统自动生成[ " + start_date + " ]交易总额更新完毕"); - } - } - - @Override - public List listEstimateLog(int logType, String date) { - Date monthDate; - try { - monthDate = DateUtils.parseDate(date, new String[]{"yyyy-MM"}); - } catch (ParseException e) { - throw new BadRequestException("Invalid month format"); - } - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - - return estimateAnalysisMapper.listEstimateLog(logType, year, month); - } - - - //开发人员触发、期初数据定义 - @Override - public void initSettleAmount(String date) throws Exception { - Date initDate = TimeZoneUtils.beginDate(date); - String report_date = DateFormatUtils.format(initDate, "yyyy/MM/dd"); - - JSONObject estimate = getCleanDayAmount(report_date); - estimate.put("last_update_date", new Date()); - estimate.put("last_update_by", "developer import"); - estimate.put("log_type", 1); - JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(report_date, 1); - - if (estimateExit != null) { - estimate.put("estimate_id", estimateExit.getString("estimate_id")); - estimateAnalysisMapper.update(estimate); - } else { - estimateAnalysisMapper.save(estimate); - } - - } - - @Override - public void initTransactionData(String date) throws Exception { - Date initDate = TimeZoneUtils.beginDate(date); - String start_date = DateFormatUtils.format(initDate, "yyyy/MM/dd"); - String end_date = DateFormatUtils.format(new Date(initDate.getTime() + 86400000L), "yyyy/MM/dd"); - JSONObject estimate = getTransactionAmountDaily(start_date, end_date); - estimate.put("last_update_date", new Date()); - estimate.put("last_update_by", "developer import"); - JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(start_date, 2); - estimate.put("log_type", 2); - if (estimateExit != null) { - estimate.put("estimate_id", estimateExit.getString("estimate_id")); - estimateAnalysisMapper.update(estimate); - } else { - estimateAnalysisMapper.save(estimate); - } - } - - @Override - public List listEstimateLogs(String start_date, String end_date) { - return estimateAnalysisMapper.findCleanLogsByDate(start_date, end_date); - } - - //获取指定日期T1、T2、T3的清算总额 - public JSONObject getCleanDayAmount(String report_date) { - initClient(); - JSONObject estimate = new JSONObject(); - estimate.put("log_date", report_date); - //T+1 - JSONObject totalAmountT1 = estimateAnalysisMapper.findClearAmountByDate(report_date, t1client); - if (totalAmountT1 != null) { - estimate.put("one_clean_amount", totalAmountT1.getBigDecimal("total_amount")); - } else { - estimate.put("one_clean_amount", 0.00); - } - //T+2 - JSONObject totalAmountT2 = estimateAnalysisMapper.findClearAmountByDate(report_date, t2client); - if (totalAmountT2 != null) { - estimate.put("two_clean_amount", totalAmountT2.getBigDecimal("total_amount")); - } else { - estimate.put("two_clean_amount", 0.00); - } - //T+3 - JSONObject totalAmountT3 = estimateAnalysisMapper.findClearAmountByDate(report_date, t3client); - if (totalAmountT3 != null) { - estimate.put("three_clean_amount", totalAmountT3.getBigDecimal("total_amount")); - } else { - estimate.put("three_clean_amount", 0.00); - } - return estimate; - } - - public JSONObject getTransactionAmountDaily(String start_date, String end_date) { - //获取指定日期T1、T2、T3的交易总额 - initClient(); - JSONObject estimate = new JSONObject(); - //T+1 - JSONObject totalAmountT1 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t1client); - if (totalAmountT1 != null) { - estimate.put("one_clean_amount", totalAmountT1.getBigDecimal("total_amount")); - } else { - estimate.put("one_clean_amount", 0.00); - } - //T+2 - JSONObject totalAmountT2 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t2client); - if (totalAmountT2 != null) { - estimate.put("two_clean_amount", totalAmountT2.getBigDecimal("total_amount")); - } else { - estimate.put("two_clean_amount", 0.00); - } - //T+3 - JSONObject totalAmountT3 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t3client); - if (totalAmountT3 != null) { - estimate.put("three_clean_amount", totalAmountT3.getBigDecimal("total_amount")); - } else { - estimate.put("three_clean_amount", 0.00); - } - return estimate; - } - - public List getClientByCleanDays(int clean_days) { - return clientMapper.listClientByCleanDays(clean_days); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateCacheSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateCacheSupportImpl.java deleted file mode 100644 index ca1fab8ff..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateCacheSupportImpl.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.EstimateCacheSupport; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; - -@Service -public class EstimateCacheSupportImpl implements EstimateCacheSupport { - - @Override - @CacheEvict(value = ":estimate_analysis_future:", key = "''") - public void clearEstimateFutureCache() { - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/OrderSuccessRateAnalysis.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/OrderSuccessRateAnalysis.java deleted file mode 100644 index 628c77897..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/OrderSuccessRateAnalysis.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.OrderSuccessRateAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.OrderAnalysisMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * 订单成功率 - * Created by yixian on 2016-11-10. - */ -@Service -public class OrderSuccessRateAnalysis implements OrderSuccessRateAnalysisService { - @Resource - private OrderAnalysisMapper orderAnalysisMapper; - - @Override - public JSONObject analysisOrderSuccessRates(Date beginDate, Date endDate) { - if (beginDate.compareTo(endDate) > 0) { - throw new BadRequestException("Invalid Date Params"); - } - Date dt = new Date(beginDate.getTime()); - List dates = new ArrayList<>(); - while (dt.compareTo(endDate) <= 0) { - dates.add(DateFormatUtils.format(dt, "yyyy-MM-dd")); - dt = DateUtils.addDays(dt, 1); - } - JSONObject params = new JSONObject(); - params.put("begin", beginDate); - params.put("end", endDate); - List ratesInTypes = orderAnalysisMapper.analysisOrderSuccessRateInTypes(params); - JSONObject totalAnalysis = orderAnalysisMapper.analysisOrderSuccessRateOfAll(params); - ratesInTypes.add(totalAnalysis); - JSONObject res = new JSONObject(); - res.put("dates", dates); - res.put("data", ratesInTypes); - return res; - } - - @Override - public JSONObject analysisDateDetail(Date date) { - List clientDetails = orderAnalysisMapper.analysisOrderSuccessRateDetailOfClients(date); - JSONObject globalAnalysis = orderAnalysisMapper.analysisOrderSuccessRateDetailOfGlobal(date); - JSONObject detail = new JSONObject(); - detail.put("clients", clientDetails); - detail.put("global", globalAnalysis); - detail.put("date", DateFormatUtils.format(date, "yyyy-MM-dd")); - return detail; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/OrgAnalysisServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/OrgAnalysisServiceImp.java deleted file mode 100644 index 20f6985ed..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/OrgAnalysisServiceImp.java +++ /dev/null @@ -1,76 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.OrgAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.log.StatisticsBDSalesReportMapper; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.tools.utils.JsonHelper; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 27/02/2017. - */ -@Service -public class OrgAnalysisServiceImp implements OrgAnalysisService { - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - - @Resource - private StatisticsBDSalesReportMapper statisticsBDSalesReportMapper; - - @Resource - private OrgManager orgManager; - - - @Override - public List getSalesAnalysis(JSONObject params, JSONObject manager) { - orgManager.checkOrgIds(manager, params); - params.put("org_type", 0); - List orgTransactions = statisticsBDSalesReportMapper.getPartnerAmountList(params); - List newOrgTransaction = new ArrayList<>(); - orgTransactions.forEach(item -> newOrgTransaction.add(JsonHelper.newJson(json -> { - json.put("org_id", item.getString("org_id")); - json.put("org_name", item.getString("org_name")); - json.put("amount", item.getString("clearing_amount")); - }) - )); - //判断查询的最后一天是否是当日,若是当日,将当日数据添加至结果集内 - SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); - if (sd.format(params.getDate("end")).equals(sd.format(DateUtils.addDays(new Date(), 1)))) { - params.put("begin", DateUtils.addDays(params.getDate("end"), -1)); - params.put("end", params.getDate("end")); - List todayOrgTransaction = transactionAnalysisMapper.getOneDayOrgMerchantSaleList(params); - if (!todayOrgTransaction.isEmpty()) { - for (JSONObject todayOrgTransactionItem : todayOrgTransaction) { - boolean flag = false; - for (JSONObject orgTransaction : newOrgTransaction) { - if (orgTransaction.getString("org_id").equals(todayOrgTransactionItem.getString("org_id"))) { - BigDecimal newAmount = orgTransaction.getBigDecimal("amount").add(todayOrgTransactionItem.getBigDecimal("clearing_amount")); - orgTransaction.put("amount", newAmount); - flag = true; - } - } - if (!flag) { - todayOrgTransactionItem.put("amount", todayOrgTransactionItem.getString("clearing_amount")); - newOrgTransaction.add(todayOrgTransactionItem); - } - } - } - } - return newOrgTransaction; - } - - @Override - public List getPartnersSaleByOrgId(JSONObject params) { - return transactionAnalysisMapper.getPartnersAmountByOrg(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java deleted file mode 100644 index 264b6d7c4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java +++ /dev/null @@ -1,159 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.DashboardService; -import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.math.RoundingMode; -import java.util.Date; -import java.util.List; -import java.util.TimeZone; - -/** - * Created by yishuqian on 20/02/2017. - */ -@Service -public class PartnerCardDashboardServiceImp implements PartnerCardDashboardService { - @Resource - private ClientManager clientManager; - @Resource - private DashboardService dashboardService; - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - @Resource - private TransactionMapper transactionMapper; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private ClientConfigService clientConfigService; - @Resource - private LogSettleMailMapper logSettleMailMapper; - @Resource - private PaymentApi paymentApi; - - @Override - public JSONObject getCommonAnalysis(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id")); - Date data = new Date(); - if (earlistOrder != null) { - client.put("transaction_time", DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyy-MM-dd")); - } - JSONObject res = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data, "Wechat"); - JSONObject ali_pay = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data, "Alipay"); - JSONObject rate_value = new JSONObject(); - if (res != null) { - rate_value.put("wechat_rate_value", res.getBigDecimal("rate_value").setScale(1, RoundingMode.DOWN)); - if (res.getInteger("clean_days") != null) { - client.put("clean_days", res.getIntValue("clean_days")); - } - } - if (ali_pay != null) { - rate_value.put("ali_rate_value", ali_pay.getBigDecimal("rate_value").setScale(1, RoundingMode.DOWN)); - } - client.put("rate_value", rate_value); - return client; - } - - @Override - public JSONObject getTransactionAnalysis(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client, "client not found"); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - return transactionAnalysisMapper.getTransactionCommonAnalysis(params); - } - - @Override - public List getOrderCustomerChartAnalysis(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client, "client not found"); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - return customerAndOrdersStatisticsMapper.getPartnerCustomerAndOrderStatistics(params); - } - - @Override - public List getTransTypesAnalysis(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client, "client not found"); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - return dashboardService.getTradeInTypes(params); - } - - @Override - public JSONObject getOrderAndCustomerPerDay(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client, "client not found"); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - return customerAndOrdersStatisticsMapper.getAvgOrderAndCustomerStatistics(params); - } - - @Override - public List getTradeAnalysisInHours(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client, "client not found"); - JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id")); - String timezone = client.getString("timezone"); - AnalysisBean analysisBean = new AnalysisBean(); - if (earlistOrder != null) { - analysisBean.setBegin(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd")); - } - analysisBean.setEnd(DateFormatUtils.format(new Date(), "yyyyMMdd")); - JSONObject params = analysisBean.toParams(timezone); - params.put("client_id", client.getIntValue("client_id")); - return dashboardService.getTradeAnalysisInHours(params); - } - - @Override - public JSONObject getSettlementLog(String clientMoniker, TradeLogQuery query) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client,"client not found:"+clientMoniker); - int clientId = client.getIntValue("client_id"); - JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(clientId); - if (earlistOrder != null) { - query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd")); - } - query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd")); - JSONObject params = query.toParams(TimeZone.getDefault().getID()); - params.put("client_id", clientId); - PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - if (query.getPage() == 1) { - if (!logs.isEmpty()) { - List sendMailLogs = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time")); - if (sendMailLogs.isEmpty()) { - result.put("padding", true); - } - if (!sendMailLogs.isEmpty() && sendMailLogs.stream().anyMatch(mail -> mail.getIntValue("mail_status") != 1)) { - result.put("padding", true); - } - } - } - return result; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java deleted file mode 100644 index eef793d33..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import au.com.royalpay.payment.manage.analysis.core.PartnersAnalysisService; -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; - -/** - * Created by yishuqian on 08/12/2016. - */ -@Service -public class PartnersAnalysisServiceImpl implements PartnersAnalysisService { - - @Resource - private ClientAnalysisMapper clientAnalysisMapper; - - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - - @Override - public List getNewPartnersAnalysis(JSONObject params) { - return clientAnalysisMapper.countNewClientsHistory(params); - } - - @Override - public List getTradePartnersAnalysis(JSONObject params){ - return customerAndOrdersStatisticsMapper.countTradedClientsByDate(params); - } - - @Override - public List getPartnersTypesAnalysis(JSONObject params) { - List types = clientAnalysisMapper.countClientsTypes(params); - List result = new ArrayList<>(); - String keys_1[] = {"1","2","3","4","5","6","7","8","9"}; - String key_2[] = {"10","11","12"}; - result = getPartnerTypes(keys_1,result,1,5,types); - return getPartnerTypes(key_2,result,2,6,types); - } - - @Override - public List getPartnersSettlementAnalysis(JSONObject params) { - return clientAnalysisMapper.countClientsSettlementCycle(params); - } - - private List getPartnerTypes(String keys[], List result, int short_length, int long_length, List types){ - for(String key : keys){ - int countValue = 0; - JSONObject object = new JSONObject(); - JSONArray list = new JSONArray(); - for(JSONObject type : types){ - if(StringUtils.isEmpty(type.getString("royalpayindustry"))){ - continue; - } - if(type.getString("royalpayindustry").startsWith(key) && (type.getString("royalpayindustry").length()==short_length || type.getString("royalpayindustry").length()==long_length)){ - countValue += type.getIntValue("partner_counts"); - list.add(type); - } - } - if(countValue == 0){ - continue; - } - object.put("count_value",countValue); - object.put("mccCode",key); - object.put("children",list); - result.add(object); - } - return result; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java deleted file mode 100644 index c68b25b11..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.core.ChannelSettleVerify; -import au.com.royalpay.payment.core.beans.SettlementLog; -import au.com.royalpay.payment.manage.analysis.core.PlatformClearService; -import au.com.royalpay.payment.manage.mappers.log.PlatformSettlementMapper; -import au.com.royalpay.payment.tools.defines.PayChannel; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.List; - -@Service -public class PlatformClearAnalysisServiceImpl implements PlatformClearService { - - private Logger logger = LoggerFactory.getLogger(getClass()); - public static final SimpleDateFormat sdfClear = new SimpleDateFormat("yyyy-MM-dd"); - public static final SimpleDateFormat sdfNormal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - @Autowired(required = false) - private ChannelSettleVerify[] channelSettleVerifys; - @Resource - private PlatformSettlementMapper platformSettlementMapper; - - @Override - public JSONObject getPlatformSettleLog(String channel, int page, int limit) { - PageList list = platformSettlementMapper.findSettleLogsAllMerchant(channel, - new PageBounds(page, limit, Order.formString("settle_date.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject getChannelSettleLog(String channel) { - JSONObject sysLogs = new JSONObject(); - Date fromDate = DateTime.parse("2018-04-05T02:00:00+10:00").toDate(); - JSONObject creditLogs = platformSettlementMapper.calculateChannelSysSettleLog(fromDate, new Date(), channel, "Credit"); - sysLogs.put("sys_pay_fee", creditLogs.getBigDecimal("rmb_amount")); - - JSONObject debitLogs = platformSettlementMapper.calculateChannelSysSettleLog(fromDate, new Date(), channel, "Debit"); - sysLogs.put("sys_refund_fee", debitLogs.getBigDecimal("rmb_amount")); - - sysLogs.put("surcharge", creditLogs.getBigDecimal("charge_amount").subtract(debitLogs.getBigDecimal("charge_amount"))); - - sysLogs.put("sys_settle_amount", - sysLogs.getBigDecimal("sys_pay_fee").subtract(sysLogs.getBigDecimal("sys_refund_fee")).subtract(sysLogs.getBigDecimal("surcharge"))); - sysLogs.put("start_date", "2018-04-05"); - sysLogs.put("end_date", sdfClear.format(new Date())); - return sysLogs; - } - - @Override - public void verifySettleLogByDate(String startDate, String endDate, String channel) { - if (channelSettleVerifys == null) { - return; - } - Arrays.stream(channelSettleVerifys).filter(verify -> verify.payChannel().getChannelCode().equalsIgnoreCase(channel)) - .findFirst().ifPresent(verify -> { - try { - Date currentDate = sdfClear.parse(startDate); - Date end = sdfClear.parse(endDate); - while (!end.before(currentDate)) { - saveVerifyResults(currentDate, verify); - currentDate = DateUtils.addDays(currentDate, 1); - } - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - - }); - } - - private void saveVerifyResults(Date date, ChannelSettleVerify verify) { - logger.info("starting verify for channel {} on {}", verify.payChannel(), date); - List logs = verify.verifyResults(date); - logger.info("loaded {} settle logs for channel {} on {}", logs.size(), verify.payChannel(), date); - for (SettlementLog settle : logs) { - JSONObject params = new JSONObject(); - params.put("settle_date", settle.getSettlementDate()); - params.put("start_date", TimeZoneUtils.formatTime(settle.getStart(), TimeZoneUtils.PATTERN_NORMAL, "Asia/Shanghai")); - params.put("end_date", TimeZoneUtils.formatTime(settle.getEnd(), TimeZoneUtils.PATTERN_NORMAL, "Asia/Shanghai")); - if (verify.payChannel() == PayChannel.WECHAT) { - params.put("settle_date", TimeZoneUtils.formatTime(settle.getSettlementDate(), TimeZoneUtils.PATTERN_NORMAL, "Asia/Shanghai")); - } - params.put("channel", verify.payChannel().getChannelCode()); - params.put("last_update_date", new Date()); - JSONObject sysClearData = getSystemClearingAmount(settle, verify.payChannel().getChannelCode()); - if (sysClearData != null && !sysClearData.isEmpty()) { - params.put("sys_pay_fee", sysClearData.getBigDecimal("sys_pay_fee")); - params.put("sys_refund_fee", sysClearData.getBigDecimal("sys_refund_fee")); - params.put("sys_net_fee", sysClearData.getBigDecimal("sys_net_fee")); - params.put("sys_surcharge", sysClearData.getBigDecimal("sys_surcharge")); - params.put("sys_settlement_fee", sysClearData.getBigDecimal("sys_settle_fee")); - } - params.put("merchants", settle.getMerchantId()); - params.put("pay_fee", settle.getPayFee()); - params.put("refund_fee", settle.getRefundFee()); - params.put("net_fee", settle.getPayNetFee()); - if (verify.payChannel() != PayChannel.WECHAT) { - params.put("net_fee", settle.getPayFee().subtract(settle.getRefundFee())); - } - params.put("settlement_fee", settle.getSettlementFee()); - params.put("surcharge", settle.getPoundageFee()); - params.put("unsettle_fee", settle.getUnsettlementFee()); - try { - if (("1500474722".equals(settle.getMerchantId()) && settle.getSettlementDate().before(DateTime.parse("2018-06-02").toDate())) || - ("1492874492".equals(settle.getMerchantId()) && settle.getSettlementDate().after(DateTime.parse("2018-06-05").toDate()))) { - return; - } - JSONObject check = platformSettlementMapper.findByDateMerchant(verify.payChannel() == PayChannel.WECHAT ? TimeZoneUtils.formatTime(settle.getSettlementDate(), TimeZoneUtils.PATTERN_NORMAL, "Asia/Shanghai") : sdfClear.format(settle.getSettlementDate()), verify.payChannel().getChannelCode(), settle.getMerchantId()); - if (check != null) { - params.put("log_id", check.getString("log_id")); - platformSettlementMapper.update(params); - } else { - platformSettlementMapper.save(params); - } - params.clear(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - } - - - @Override - // @Transactional - public void generateSettleLogs() { - if (channelSettleVerifys != null) { - try { - List dateList = TimeZoneUtils.getStatetime(); - for (Date date : dateList) { - for (ChannelSettleVerify verify : channelSettleVerifys) { - try { - saveVerifyResults(date, verify); - } catch (Exception e) { - logger.error("[{}]{} failed to download settle file", date, verify.payChannel(), e); - } - } - } - } catch (ParseException ignored) { - } - - } - } - - private JSONObject getSystemClearingAmount(SettlementLog settlementLog, String channel) { - JSONObject sysLogs = new JSONObject(); - logger.info("{} System Settle Logs:{}<====>{}", channel, settlementLog.getStart(), settlementLog.getEnd()); - try { - JSONObject creditLogs = platformSettlementMapper.calculateSysSettleLog(settlementLog.getStart(), settlementLog.getEnd(), settlementLog.getMerchantId(), channel, "Credit"); - sysLogs.put("sys_pay_fee", creditLogs.getBigDecimal("aud_amount")); - JSONObject debitLogs = platformSettlementMapper.calculateSysSettleLog(settlementLog.getStart(), settlementLog.getEnd(), settlementLog.getMerchantId(), channel, "Debit"); - sysLogs.put("sys_refund_fee", debitLogs.getBigDecimal("aud_amount")); - sysLogs.put("sys_net_fee", creditLogs.getBigDecimal("aud_amount").subtract(debitLogs.getBigDecimal("aud_amount"))); - sysLogs.put("sys_surcharge", creditLogs.getBigDecimal("charge_amount").subtract(debitLogs.getBigDecimal("charge_amount"))); - sysLogs.put("sys_settle_fee", sysLogs.getBigDecimal("sys_net_fee").subtract(sysLogs.getBigDecimal("sys_surcharge"))); - logger.info("calculated system result[{}|{}~{}]:{}", channel, settlementLog.getStart(), settlementLog.getEnd(), sysLogs); - return sysLogs; - - } catch (Exception e) { - //do nothing - logger.error("Error caught on analysising {}", channel, e); - } - return null; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformRevenueImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformRevenueImpl.java deleted file mode 100644 index 4f15d1183..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformRevenueImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.PlatformRevenueService; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeRecordMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by Tayl0r on 2017/5/24. - */ -@Service -public class PlatformRevenueImpl implements PlatformRevenueService { - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - String[] channelArr = { "Wechat", "Alipay" }; - @Resource - private ClearingLogMapper clearingLogMapper; - - @Resource - private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; - - @Resource - private FinancialBDPrizeRecordMapper financialBDPrizeRecordMapper; - - @Override - public JSONObject getPlatformRevenue(int year, int monthOfYear, String month) { - JSONObject platformRevenue = new JSONObject(); - JSONObject platformCharge = getPlatformCharge(year, monthOfYear); - if (platformCharge != null) { - platformRevenue.put("royalpay_charge", platformCharge.get("royalpay_charge")); - } else { - logger.debug("当前时间:" + month + "下 royalpay_charge 为空,请查询 clearingLogMapper.getTotalPlatformCharge(year, monthOfYear)"); - platformRevenue.put("royalpay_charge", 0); - } - - JSONObject partnerCharge = getPartnerCharge(year, monthOfYear); - if (partnerCharge != null) { - platformRevenue.put("partner_charge", partnerCharge.get("partner_charge")); - } else { - logger.debug("当前时间:" + month + "下 partner_charge 为空,请查询 financialPartnerCommissionMapper.getTotalPartnerCharge(year, monthOfYear)"); - platformRevenue.put("partner_charge", 0); - } - JSONObject bdCharge = getBDCharge(month); - if (bdCharge != null) { - platformRevenue.put("bd_charge", bdCharge.get("bd_charge")); - } else { - logger.debug("当前时间:" + month + "下 bd_charge 为空,请查询 financialBDPrizeRecordMapper.getTotalBDCharge(month)"); - platformRevenue.put("bd_charge", 0); - } - List channelsCharge = clearingLogMapper.getSettlementChannelsMonthReport(year, monthOfYear); - JSONObject channels = new JSONObject(); - - for (int i = 0; i < channelArr.length; i++) { - for (JSONObject jsonObject : channelsCharge) { - if (channelArr[i].equals(jsonObject.getString("channel"))) { - channels.put(channelArr[i], jsonObject.getBigDecimal("charge")); - } - } - if (channels.getBigDecimal(channelArr[i]) == null) { - channels.put(channelArr[i], "0"); - } - } - platformRevenue.put("channels", channels); - - platformRevenue.put("charge_date", month); - return platformRevenue; - } - - public JSONObject getPlatformCharge(int year, int monthOfYear) { - return clearingLogMapper.getTotalPlatformCharge(year, monthOfYear); - } - - public JSONObject getPartnerCharge(int year, int monthOfYear) { - return financialPartnerCommissionMapper.getTotalPartnerCharge(year, monthOfYear); - } - - public JSONObject getBDCharge(String month) { - return financialBDPrizeRecordMapper.getTotalBDCharge(month); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/RefundAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/RefundAnalysisServiceImpl.java deleted file mode 100644 index ff4732eac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/RefundAnalysisServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.RefundAnalysisService; -import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSONObject; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Tayl0r on 2017/6/7. - */ -@Service -public class RefundAnalysisServiceImpl implements RefundAnalysisService { - - @Resource - private RefundMapper refundMapper; - - @Override - public JSONObject findRefundInfoListByDay(String begin, String end) throws ParseException { - JSONObject refundReportDay = refundMapper.findRefundInfoByDay(TimeZoneUtils.beginDate(begin), TimeZoneUtils.endDate(end)); - if (refundReportDay.get("max_refund_amount") != null && !"".equals(refundReportDay.get("max_refund_amount"))) { - List partnerInfo = refundMapper.findClientMoniker(TimeZoneUtils.beginDate(begin), TimeZoneUtils.endDate(end), refundReportDay.getBigDecimal("max_refund_amount")); - StringBuilder clientInfo = new StringBuilder(); - for(JSONObject partner:partnerInfo){ - clientInfo.append(partner.getString("client_moniker")).append(" / "); - } - refundReportDay.put("client_moniker",clientInfo.deleteCharAt(clientInfo.length()-2)); - } - return refundReportDay; - } - - @Override - public List findRefundCount(String begin, String end) throws ParseException { - return refundMapper.listRefundCount(TimeZoneUtils.beginDate(begin), TimeZoneUtils.endDate(end)); - } - - @Override - public List listRefundInfoByDay(String begin, String end) throws ParseException { - List dayList = getDayList(begin, end); - List refundInfo = new ArrayList<>(); - for (JSONObject day : dayList) { - String dataStr = day.getString("datelist"); - JSONObject refundReportDay = refundMapper.findRefundInfoByDay(TimeZoneUtils.beginDate(dataStr), TimeZoneUtils.endDate(dataStr)); - refundReportDay.put("dateStr", dataStr); - refundInfo.add(refundReportDay); - } - return refundInfo; - } - - public List getDayList(String begin, String end) throws ParseException { - return refundMapper.listRefundDate(TimeZoneUtils.beginDate(begin), TimeZoneUtils.endDate(end)); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/WeekReporterImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/WeekReporterImpl.java deleted file mode 100644 index 034d0d399..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/WeekReporterImpl.java +++ /dev/null @@ -1,400 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls; - -import au.com.royalpay.payment.manage.analysis.core.BDAnalysisService; -import au.com.royalpay.payment.manage.analysis.core.PartnersAnalysisService; -import au.com.royalpay.payment.manage.analysis.core.WeekReporter; -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.log.WeekReportMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-03-03. - */ -@Service -public class WeekReporterImpl implements WeekReporter { - @Resource - private WeekReportMapper weekReportMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - @Resource - private BDAnalysisService bdAnalysisService; - @Resource - private PartnersAnalysisService partnersAnalysisService; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientAnalysisMapper clientAnalysisMapper; - @Resource - private ClientApplyMapper clientApplyMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public JSONObject getReport(String reportId, String openid) { - JSONObject manager = managerMapper.findByWxOpenId(openid); - if (manager == null || !manager.getBooleanValue("is_valid")) { - throw new ForbiddenException(); - } - JSONObject report = weekReportMapper.findOne(reportId); - if (report == null) { - throw new NotFoundException("Report Not Exists!"); - } - report.put("transaction_report", JSON.parseObject(report.getString("transaction_report"))); - report.put("bd_report", JSON.parseArray(report.getString("bd_report"))); - report.put("new_client_report", JSON.parseObject(report.getString("new_client_report"))); - report.put("partners_report",JSON.parseArray(report.getString("partners_report"))); - report.put("range", generateDateRange(report.getDate("analysis_from"), report.getDate("analysis_to"))); - report.put("range_last", generateDateRange(DateUtils.addDays(report.getDate("analysis_from"), -7), DateUtils.addDays(report.getDate("analysis_to"), -7))); - - Date monthBegin = DateUtils.truncate(report.getDate("analysis_from"), Calendar.MONTH); - Date monthEnd = DateUtils.addDays(DateUtils.addMonths(monthBegin, 1), -1); - report.put("monthrange", generateDateRange(monthBegin, monthEnd)); - return report; - } - - private String generateDateRange(Date from, Date to) { - return DateFormatUtils.format(from, "MM.dd") + "~" + - DateFormatUtils.format(to, "MM.dd"); - } - - @Override - public void generateReport(String date, boolean sendMsg) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyy-MM-dd"}); - Calendar cal = Calendar.getInstance(); - cal.setTime(dt); - cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); - String reportId = cal.get(Calendar.YEAR) + "_" + cal.get(Calendar.WEEK_OF_YEAR); - - JSONObject report = weekReportMapper.findOne(reportId); - if (report != null) { - weekReportMapper.delete(reportId); - } - report = new JSONObject(); - report.put("report_id", reportId); - Date begin = DateUtils.truncate(cal.getTime(), Calendar.DATE); - Date end = DateUtils.addDays(begin, 6); - report.put("analysis_from", begin); - report.put("analysis_to", end); - report.put("report_date", new Date()); - - JSONObject transactionReport = getTransactionReport(begin, end); - report.put("transaction_report", transactionReport.toJSONString()); - - List bdReports = getBDReport(begin, end); - report.put("bd_report", JSON.toJSONString(bdReports)); - - JSONObject newClientReport = newClientsReport(begin, end); - report.put("new_client_report", JSON.toJSONString(newClientReport)); - - List partnersReport = getPartnersReport(begin,end); - report.put("partners_report",JSON.toJSONString(partnersReport)); - - weekReportMapper.save(report); - String dateRange = generateDateRange(begin, end); - if (sendMsg) { - List users = managerMapper.listRoyalPayUsers(); - publishMessages(users, reportId, dateRange); - if (partnersReport != null && !partnersReport.isEmpty()) { - publishPartnersMessages(reportId, dateRange); - } - } - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - } - - private void publishMessages(List users, String reportId, String range) { - String url = PlatformEnvironment.getEnv().concatUrl("/analysis/week_reports/" + reportId); - String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); - for (JSONObject user : users) { - String openId = user.getString("wx_openid"); - if (openId != null) { - MpWechatApi paymentApi = mpWechatApiProvider.getWechatApiForTemplateMessage(openId); - String templateId = paymentApi.getTemplateId("report-generated"); - try { - TemplateMessage msg = initMsg(range, url, time, openId, templateId); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e1) { - try { - TemplateMessage msg = initMsg(range, url, time, openId, templateId); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - } - } - } - - private TemplateMessage initMsg(String range, String url, String time, String openId, String templateId) { - TemplateMessage msg = new TemplateMessage(openId, templateId, url); - msg.put("first", "每周交易报告(" + range + ")生成完毕", "#10b24c"); - msg.put("keyword1", "每周交易报告", "#000000"); - msg.put("keyword2", time, "#000000"); - msg.put("remark", "点击查看详情", "#000000"); - return msg; - } - - /** - * 合伙人周报信息 - * @param reportId - * @param range - */ - private void publishPartnersMessages(String reportId, String range) { - String url = PlatformEnvironment.getEnv().concatUrl("/analysis/week_reports/partners/" + reportId); - String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); - List users = managerMapper.getDirectors(); - for (JSONObject user : users) { - String openId = user.getString("wx_openid"); - if (openId != null) { - MpWechatApi paymentApi = mpWechatApiProvider.getWechatApiForTemplateMessage(openId); - String templateId = paymentApi.getTemplateId("report-generated"); - try { - TemplateMessage msg = initPartnersMsg(range, url, time, openId, templateId); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e1) { - try { - TemplateMessage msg = initPartnersMsg(range, url, time, openId, templateId); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - } - } - } - - private TemplateMessage initPartnersMsg(String range, String url, String time, String openId, String templateId) { - TemplateMessage msg = new TemplateMessage(openId, templateId, url); - msg.put("first", "每周合伙人交易报告(" + range + ")生成完毕", "#10b24c"); - msg.put("keyword1", "每周交易报告(合伙人)", "#000000"); - msg.put("keyword2", time, "#000000"); - msg.put("remark", "点击查看详情", "#000000"); - return msg; - } - - private JSONObject newClientsReport(Date begin, Date end) { - JSONObject newClientReport = new JSONObject(); - JSONObject daily = newClientDailyReport(begin, end, null); - newClientReport.put("daily", daily); -// -// JSONObject melbourne = new JSONObject(); -// melbourne.put("daily", newClientDailyReport(begin, end, "Melbourne")); -// newClientReport.put("melbourne", melbourne); -// -// JSONObject sydney = new JSONObject(); -// sydney.put("daily", newClientDailyReport(begin, end, "Sydney")); -// newClientReport.put("sydney", sydney); - - JSONObject appliesReport = appliesReport(begin, end); - newClientReport.put("applies", appliesReport); - - JSONObject lastWeekApprovedReport = approvedCountForBD(begin, end, null); - newClientReport.put("bd_approved", lastWeekApprovedReport); - - Date monthBegin = DateUtils.truncate(begin, Calendar.MONTH); - Date monthEnd = DateUtils.addMonths(monthBegin, 1); - JSONObject lastMonthApprovedReport = approvedCountForBD(monthBegin, monthEnd, null); - newClientReport.put("bd_approved_month", lastMonthApprovedReport); - - JSONObject distributedApprovedReport = approvedCountForBD(begin, DateUtils.addDays(end, 1), 2); - newClientReport.put("bd_approved_distributed", distributedApprovedReport); - return newClientReport; - } - - private JSONObject approvedCountForBD(Date begin, Date end, Integer source) { - JSONObject params = new JSONObject(); - params.put("org_id", 1); - params.put("begin", begin); - params.put("end", DateUtils.addDays(end, 1)); - if (source != null) { - params.put("source", source); - } - List approvedLastWeek = bdAnalysisService.approvedAnalysis(params); - int total = 0; - for (int i = 0, len = approvedLastWeek.size(); i < len; i++) { - JSONObject detail = approvedLastWeek.get(i); - total += detail.getIntValue("num"); - detail.put("sort", i + 1); - } - JSONObject lastWeekApprovedReport = new JSONObject(); - lastWeekApprovedReport.put("total", total); - lastWeekApprovedReport.put("data", approvedLastWeek); - return lastWeekApprovedReport; - } - - private JSONObject appliesReport(Date begin, Date end) { - List applies = clientApplyMapper.analysisByDate(begin, DateUtils.addDays(end, 1)); - int total = 0; - for (JSONObject applyAnalysis : applies) { - total += applyAnalysis.getIntValue("num"); - } - JSONObject appliesReport = new JSONObject(); - appliesReport.put("total", total); - appliesReport.put("data", applies); - return appliesReport; - } - - private JSONObject newClientDailyReport(Date begin, Date end, String city) { - JSONObject dailyParams = new JSONObject(); - dailyParams.put("begin", begin); - dailyParams.put("end", DateUtils.addDays(end, 1)); - if (city != null) { - dailyParams.put("city", city); - } - List dailyReport = partnersAnalysisService.getNewPartnersAnalysis(dailyParams); - int total = 0; - for (JSONObject rep : dailyReport) { - total += rep.getIntValue("num"); - } - JSONObject daily = new JSONObject(); - daily.put("data", dailyReport); - daily.put("total", total); - return daily; - } - - private List getBDReport(Date begin, Date end) { - List bdReports = analysisBDReport(begin, end); - List reportsLastWeek = analysisBDReport(DateUtils.addDays(begin, -7), DateUtils.addDays(end, -7)); - for (int i = 0, len = bdReports.size(); i < len; i++) { - JSONObject bdReport = bdReports.get(i); - bdReport.put("sort", i + 1); - String bdId = bdReport.getString("bd_id"); - for (int iLast = 0, lenLast = reportsLastWeek.size(); iLast < lenLast; iLast++) { - JSONObject reportLastWeek = reportsLastWeek.get(iLast); - if (reportLastWeek.getString("bd_id").equals(bdId)) { - int compare = iLast - i; - if (compare != 0) { - initCompare(bdReport, compare); - } - break; - } - } - } - return bdReports; - } - - private List getPartnersReport(Date begin, Date end) { - List partnersReports = analysisPartnersReports(begin, end); - List partnersLastWeekReports = analysisPartnersReports(DateUtils.addDays(begin, -7), DateUtils.addDays(end, -7)); - for (int i=0,len=partnersReports.size();i analysisPartnersReports(Date begin, Date end) { - JSONObject params = new JSONObject(); - params.put("begin",begin); - params.put("end",DateUtils.addDays(end, 1)); - return transactionAnalysisMapper.getOrgTransactionAnalysis(params); - } - - private List analysisBDReport(Date begin, Date end) { - JSONObject bdReportParams = new JSONObject(); - bdReportParams.put("begin", begin); - bdReportParams.put("end", DateUtils.addDays(end, 1)); - bdReportParams.put("org_id", 1); - return bdAnalysisService.getSalesAnalysis(bdReportParams); - } - - private JSONObject getTransactionReport(Date begin, Date end) { - JSONObject transactionThisWeek = makeWeekReport(begin, end, null); - JSONObject report = new JSONObject(); - report.put("thisweek", transactionThisWeek); - JSONObject melbourne = new JSONObject(); - melbourne.put("thisweek", makeWeekReport(begin, end, "Melbourne")); - report.put("melbourne", melbourne); - JSONObject sydney = new JSONObject(); - sydney.put("thisweek", makeWeekReport(begin, end, "Sydney")); - report.put("sydney", sydney); - return report; - } - - private JSONObject makeWeekReport(Date begin, Date end, String city) { - JSONObject transactionThisWeek = analysisTransactions(begin, end, city); - JSONObject transactionLastWeek = analysisTransactions(DateUtils.addDays(begin, -7), DateUtils.addDays(end, -7), city); - double compare = transactionThisWeek.getBigDecimal("total").subtract(transactionLastWeek.getBigDecimal("total")).doubleValue(); - initCompare(transactionThisWeek, compare); - return transactionThisWeek; - } - - private void initCompare(JSONObject obj, double compare) { - JSONObject compareObj = new JSONObject(); - compareObj.put("direction", compare); - compareObj.put("value", Math.abs(compare)); - obj.put("compare", compareObj); - } - - private JSONObject analysisTransactions(Date begin, Date end, String city) { - JSONObject analysis = new JSONObject(); - JSONObject params = new JSONObject(); - params.put("begin", begin); - params.put("end", DateUtils.addDays(end, 1)); - if (city != null) { - List clientIds = clientMapper.listCityClientIds(city, end); - params.put("client_ids", clientIds); - } - List transactions = transactionAnalysisMapper.tradeAnalysisInDays(params); - BigDecimal total = BigDecimal.ZERO; - List dailyReport = new ArrayList<>(); - for (JSONObject tranaction : transactions) { - JSONObject report = new JSONObject(); - report.put("date", tranaction.getString("date_str")); - BigDecimal fee = tranaction.getBigDecimal("aud_fee").setScale(2, RoundingMode.DOWN); - report.put("fee", fee); - report.put("order_count", tranaction.getIntValue("order_count")); - dailyReport.add(report); - total = total.add(fee); - } - analysis.put("total", total); - analysis.put("data", dailyReport); - return analysis; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/clientRateSupport/ClientRateCreateEventLoader.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/clientRateSupport/ClientRateCreateEventLoader.java deleted file mode 100644 index bae3ebed6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/clientRateSupport/ClientRateCreateEventLoader.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls.clientRateSupport; - -import au.com.royalpay.payment.manage.analysis.beans.ClientRateQueryBean; -import au.com.royalpay.payment.manage.analysis.core.impls.ClientRatesAnalysisServiceImpl; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yixian on 2017-04-17. - */ -@Service -public class ClientRateCreateEventLoader implements ClientRatesAnalysisServiceImpl.ClientRateAnalysisEventLoader { - @Override - public void loadEvents(JSONObject client, List events, ClientRateQueryBean query) { - JSONObject createEvent = new JSONObject(); - createEvent.put("type", "create"); - createEvent.put("date", client.getString("client_create_time")); - JSONObject complianceEvent = new JSONObject(); - complianceEvent.put("type", "compliance"); - complianceEvent.put("date", client.getString("approve_time")); - events.add(createEvent); - events.add(complianceEvent); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/clientRateSupport/ClientRateReviewEventLoader.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/clientRateSupport/ClientRateReviewEventLoader.java deleted file mode 100644 index 214575d6c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/clientRateSupport/ClientRateReviewEventLoader.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.core.impls.clientRateSupport; - -import au.com.royalpay.payment.manage.analysis.beans.ClientRateQueryBean; -import au.com.royalpay.payment.manage.analysis.core.impls.ClientRatesAnalysisServiceImpl; -import au.com.royalpay.payment.manage.mappers.log.ClientReviewLogMapper; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2017-04-18. - */ -@Service -public class ClientRateReviewEventLoader implements ClientRatesAnalysisServiceImpl.ClientRateAnalysisEventLoader { - @Resource - private ClientReviewLogMapper clientReviewLogMapper; - - @Override - public void loadEvents(JSONObject client, List events, ClientRateQueryBean query) { - List reviews = clientReviewLogMapper.listReviewLogs(client.getIntValue("client_id"), query.getBegin(), query.getEnd()); - for (JSONObject review : reviews) { - JSONObject evt = new JSONObject(); - evt.put("type", "review"); - evt.put("date", DateFormatUtils.format(review.getDate("review_date"), "yyyy/MM/dd")); - JSONObject external = new JSONObject(); - external.put("bd_name", review.getString("display_name")); - external.put("desc", review.getString("desc")); - evt.put("external", external); - events.add(evt); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.java deleted file mode 100644 index 3ab55aaa0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 30/09/2016. - */ -@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id") -public interface BDAnalysisMapper { - List getBDSaleList(JSONObject jsonObject); - - List getBDSalePartnerList(JSONObject jsonObject); - - List getMonthSalesList(JSONObject params); - - List getMonthClientsByBD(@Param("bd_id") int bd_id, @Param("begin_month") String begin_month, @Param("end_month") String end_month); - - List getMonths(@Param("begin_month") String begin_month, @Param("end_month") String end_month); - - List getClientsMonthSale(@Param("bd_id") String bd_id, @Param("begin_month") String begin_month, @Param("end_month") String end_month, @Param("month") String month); - - List countApproved(JSONObject params); - - List getBDSalePartnerReport(JSONObject jsonObject); - - //获取指定一天销售数据 - List getOneDayBDSaleList(JSONObject params); - - //查询时间段范围BD新增商户 - List queryBDNewMerchants(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java deleted file mode 100644 index e1bc95f50..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-07-28. - */ -@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ClientAnalysisMapper { - int countNewClients(JSONObject params); - - List countNewClientsHistory(JSONObject params); - - - int countClients(JSONObject params); - - // 统计所有的商户,包括禁用的 - int countClientsAll(JSONObject params); - - int countValidClientsAll(@Param("industry") String industry); - - // 统计一段时期新增的商户数 - List listNewClients(JSONObject params); - - @AutoSql(SqlType.COUNT) - @AdvanceSelect(addonWhereClause = "sub_merchant_id is not null") - int countTotalPartners(); - - int countTradedPartners(JSONObject params); - - List countTradePartnersHistory(JSONObject params); - - List listPartnersTradeAmountNew(JSONObject params); - - List listPartnersTradeAmount(JSONObject params, PageBounds pageBounds); - - List countClientsTypes(JSONObject params); - - List notTradeSubMerchantId(); - - List tradeSubMerchantIdBy60Days(@Param("begin") Date begin); - - List countClientsSettlementCycle(JSONObject params); - - List listSecurePayMchs(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientRatesAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientRatesAnalysisMapper.java deleted file mode 100644 index 518aa7ca7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientRatesAnalysisMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2016-11-08. - */ -public interface ClientRatesAnalysisMapper { - List analysisRatesForBDUsers(JSONObject params); - - JSONObject analysisTotal(JSONObject params); - - List analysisClientRates(JSONObject params); - - List listClientsForBD(JSONObject params); - - List listClientsForOrg(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java deleted file mode 100644 index bdc4efe2e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java +++ /dev/null @@ -1,79 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.yixsoft.support.mybatis.paginator.annotations.CountRef; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 09/11/2016. - */ -@AutoMapper(tablename = "statistics_customer_order", pkName = "id") -public interface CustomerAndOrdersStatisticsMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject jsonObject); - - List getCustomerAndOrderStatistics(JSONObject params); - - void delete(JSONObject params); - - JSONObject getSumOrdersAndCustomersDaily(JSONObject params); - - List getSumCustomersAnalysis(JSONObject params); - - List getSumCustomersAnalysisMonthly(JSONObject params); - - List getSumChannelAnalysis(JSONObject params); - - - JSONObject getSumCustomersChannelAnalysis(JSONObject params); - - JSONObject getAvgOrderAndCustomerStatistics(JSONObject params); - - List getPartnerCustomerAndOrderStatistics(JSONObject params); - - JSONObject getMaxAmount(@Param("client_id") int client_id); - - JSONObject getMaxOrders(@Param("client_id") int client_id); - - JSONObject getMaxTransactionPartners(); - - List getByConditions(JSONObject params); - - JSONObject countChannel(JSONObject params); - - JSONObject getChannelCommonCount(JSONObject params); - - List getCBBankChannelAmount(JSONObject params); - - JSONObject getCBBankChannelCommonCount(JSONObject params); - - JSONObject getCommonCount(JSONObject params); - - @CountRef(".countAreaMerchantTradeAnalysis") - PageList getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds); - - int countAreaMerchantTradeAnalysis(JSONObject params); - - List countTradedClientsByDate(JSONObject parasm); - - List getAreaMerchantTradeByLastCycle(JSONObject parasm); - - int countTradedClients(JSONObject params); - - int countTotalCustomers(JSONObject params); - - int countTotalOldCustomers(JSONObject params); - - int countEnableChannel(JSONObject params); - - int countEnableAlipay(JSONObject params); - - List findByTime(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/EstimateAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/EstimateAnalysisMapper.java deleted file mode 100644 index 64871bf53..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/EstimateAnalysisMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by Tayl0r on 2017/7/4. - */ -@AutoMapper(tablename = "log_clearing_estimate", pkName = "estimate_id") -public interface EstimateAnalysisMapper { - - JSONObject findLastCleanDays(@Param("date") String date, @Param("num") int num); - - JSONObject findMaxCleanDays(@Param("date") String date); - - JSONObject checkDayIsCleanDay(@Param("date") String date); - - JSONObject findAllTransactionByDate(@Param("start") String start, @Param("end") String end, @Param("client_list") List client_list); - - JSONObject findClearAmountByDate(@Param("report_date") String report_date, @Param("client_list") List client_list); - - @AutoSql(SqlType.INSERT) - void save(JSONObject estimate); - - JSONObject findByLogDate(@Param("date") String date, @Param("log_type") int log_type); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject estimate); - - JSONObject getCleanAmount(@Param("start_date") String start_date, @Param("end") String end_date); - - List listEstimateLog(@Param("log_type") int log_type, @Param("year") int year, @Param("month") int month); - - List findCleanLogsByDate(@Param("start_date") String start_date, @Param("end_date") String end_date); - - JSONObject checkIsClearDay(@Param("datelist") String datelist); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java deleted file mode 100644 index ba15b6022..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.yixsoft.support.mybatis.paginator.annotations.CountRef; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2016-11-10. - */ -public interface OrderAnalysisMapper { - - List analysisOrderSuccessRateInTypes(JSONObject params); - - JSONObject analysisOrderSuccessRateOfAll(JSONObject params); - - List analysisOrderSuccessRateDetailOfClients(@Param("date") Date date); - - JSONObject analysisOrderSuccessRateDetailOfGlobal(@Param("date") Date date); - - PageList listCustomersData(JSONObject params, PageBounds pageBounds); - - int countCustomersData(JSONObject params); - - JSONObject listCustomersDataAnalysis(JSONObject params); - - List listClientsByCustomerId(JSONObject params); - - JSONObject listClientsTotalByCustomerId(JSONObject params); - - List mostUseClientsByCustomer(JSONObject params); - - List mostUseIndustryByCustomer(JSONObject params); - - List mostUseAddressByCustomer(JSONObject params); - - JSONObject mostUseAmountByCustomer(JSONObject params); - - JSONObject mostUseTimesByCustomer(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java deleted file mode 100644 index bb494a90e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java +++ /dev/null @@ -1,111 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.mappers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.paginator.annotations.CountRef; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-07-28. - */ -@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id") -public interface TransactionAnalysisMapper { - BigDecimal analysisTotalAmount(JSONObject params); - - BigDecimal analysisTotalAmountProvisionService (JSONObject params); - - double analysisTotalCount(JSONObject params); - - double analysisRefundAmount(JSONObject params); - - Double analysisNotSettled(JSONObject params); - - int countCustomers(JSONObject params); - - int countNewCustomers(JSONObject params); - - int countOldCustomers(JSONObject params); - - Double analysisPreAmount(JSONObject params); - - JSONObject getEarliestOrder(@Param("client_id") int client_id); - - List getTopOrders(JSONObject params); - - List getTradeAmountInTypes(JSONObject params); - - List tradeAnalysisInHours(JSONObject params); - - List tradeAnalysisInDays(JSONObject params); - - JSONObject tradeAnalysisInDay(JSONObject params); - - List getTradePartnersInTypes(JSONObject jsonObject); - - List getPartnersByTradeType(JSONObject jsonObject); - - List getOrdersByGateway(JSONObject jsonObject); - - List listExchangeRates(@Param("begin") Date begin, @Param("end") Date end, @Param("channel") String channel); - - List getCustomersAndOrdersInDaysUseInScheduled(JSONObject jsonObject); - - JSONObject getTransactionCommonAnalysis(JSONObject params); - - List getOrgTransactionAnalysis(JSONObject params); - - List getPartnersAmountByOrg(JSONObject params); - - JSONObject getPlatformAmount(JSONObject params); - - int countAmountRangeAnalysis(JSONObject params); - - JSONObject getAmountRangeAnalysis(JSONObject params); - - @CountRef(".countAmountRangeOrders") - PageList listAmountRangeOrders(JSONObject params, PageBounds pagination); - - int countAmountRangeOrders(JSONObject params); - - BigDecimal getOneOrder(@Param("order_id") String order_id); - - int getCountCustomers(@Param("date") Date date); - - JSONObject getClientTransaction(JSONObject params); - - List getWeekClientTransaction(JSONObject params); - - - @CountRef(".countAreaMerchantAmountAnalysis") - PageList getAreaMerchantAmountAnalysis(JSONObject params, PageBounds pagination); - - int countAreaMerchantAmountAnalysis(JSONObject params); - - List getAreaMerchantAmountByCycle(JSONObject params); - - JSONObject getOrderClearAmount(@Param("order_id") String orderId); - - /** - * 获取到cny_amount字段 - * - * @param params - * @return - */ - BigDecimal getCnyAmount(JSONObject params); - - List getOneDayOrgMerchantSaleList(JSONObject params); - - List getRpIndustryEchartsData(@Param("from") String from, @Param("to") String to, @Param("industry") String industry, - @Param("bd_user") String bdUser); - - PageList getTopRpIndustryData(@Param("transDate") String transDate, - @Param("industry") String industry, - PageBounds pageBounds, - @Param("bd_user") String bdUser); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/package-info.java b/src/main/java/au/com/royalpay/payment/manage/analysis/package-info.java deleted file mode 100644 index a1ff74442..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * payment analysis - * Created by davep on 2016-07-25. - */ -package au.com.royalpay.payment.manage.analysis; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/AmountAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/AmountAnalysisController.java deleted file mode 100644 index fbfac63d7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/AmountAnalysisController.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.AmountAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 27/10/2017. - */ -@RestController -@RequestMapping(value = "/analysis/amount", method = RequestMethod.GET) -public class AmountAnalysisController { - @Resource - private AmountAnalysisService amountAnalysisService; - - @ManagerMapping("") - @ReadOnlyConnection - public List getAmountList(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - if (manager.getIntValue("org_id") > 0) { - throw new ForbiddenException("You have no permission"); - } - JSONObject params = analysis.toParams(null); - return amountAnalysisService.getAmountRangeAnalysis(params); - } - - @ManagerMapping("/orders") - @ReadOnlyConnection - public JSONObject getRangeOrders(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - if (manager.getIntValue("org_id") > 0) { - throw new ForbiddenException("You have no permission"); - } - return amountAnalysisService.getAmountRangeOrders(analysis); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/AreaMerchantTradeController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/AreaMerchantTradeController.java deleted file mode 100644 index f9c48e8c7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/AreaMerchantTradeController.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AreaMerchantTradeQueryBean; -import au.com.royalpay.payment.manage.analysis.core.AreaMerchantTradeAnalysis; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yuan on 2018/6/5. - */ -@RestController -@RequestMapping("/area/merchant") -public class AreaMerchantTradeController { - - @Resource - private AreaMerchantTradeAnalysis areaMerchantTradeAnalysis; - - @ManagerMapping(value = "",method = RequestMethod.GET,role = ManagerRole.ADMIN) - @ReadOnlyConnection - public JSONObject listClientAmount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,AreaMerchantTradeQueryBean queryBean){ - return areaMerchantTradeAnalysis.listAreaMerchantTrade(manager,queryBean); - } - - @ManagerMapping(value = "/excel",method = RequestMethod.GET,role = ManagerRole.ADMIN) - @ReadOnlyConnection - public void exportExcel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,AreaMerchantTradeQueryBean queryBean,HttpServletResponse httpResponse)throws Exception{ - areaMerchantTradeAnalysis.importTradeExcel(manager,queryBean,httpResponse); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/BDSaleAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/BDSaleAnalysisController.java deleted file mode 100644 index 56cefd696..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/BDSaleAnalysisController.java +++ /dev/null @@ -1,71 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.BDAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yishuqian on 30/09/2016. - */ -@RequestMapping(value = "/analysis/bd", method = RequestMethod.GET) -@RestController -public class BDSaleAnalysisController { - @Resource - private BDAnalysisService bdAnalysisService; - - @ManagerMapping("/sales") - @ReadOnlyConnection - public List getSalesAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - } - return bdAnalysisService.getSalesAnalysis(params); - } - - @ManagerMapping("/sales/partners") - @ReadOnlyConnection - public List getSalesPartnerAnalysis(AnalysisBean analysis) { - return bdAnalysisService.getSalesPartnersByBD(analysis.toParams(null)); - } - - @ManagerMapping("/sales/partners/excel") - @ReadOnlyConnection - public void exportExcel(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - bdAnalysisService.exportSalesExcel(analysis, httpResponse, manager); - } - - @ManagerMapping("/sales/partners/report") - @ReadOnlyConnection - public List getBDSalePartnerReport(AnalysisBean analysis) { - return bdAnalysisService.getSalesPartnersReportByBD(analysis.toParams(null)); - } - - @ManagerMapping("/sales/partners/excel_bd") - @ReadOnlyConnection - public void exportPartnerExcelByBd(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - bdAnalysisService.exportPartnerExcelByBd(analysis, httpResponse, manager); - } - - @ManagerMapping("/sales/partners/excel_data") - @ReadOnlyConnection - public void exportPartnerExcelByData(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - bdAnalysisService.exportPartnerExcelByData(analysis, httpResponse, manager); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/ChannelsAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/ChannelsAnalysisController.java deleted file mode 100644 index 8b767158a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/ChannelsAnalysisController.java +++ /dev/null @@ -1,73 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.ChannelsAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yuan on 2017/8/22. - */ -@RequestMapping(value = "/analysis/channels",method = RequestMethod.GET) -@RestController -public class ChannelsAnalysisController { - - @Resource - private ChannelsAnalysisService channelsAnalysisService; - - @ManagerMapping("/list") - public List getChannelAmount(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - return channelsAnalysisService.getChannelMount(params); - } - @ManagerMapping("line") - public List getChannelDate(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - return channelsAnalysisService.getChannelDate(params); - } - - @ManagerMapping(value = "/alipay/data/export") - @ReadOnlyConnection - public void exportAlipayData(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse reps) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - channelsAnalysisService.exportData(params, reps); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/ClientRatesController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/ClientRatesController.java deleted file mode 100644 index 016289979..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/ClientRatesController.java +++ /dev/null @@ -1,100 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.analysis.beans.ClientRateQueryBean; -import au.com.royalpay.payment.manage.analysis.core.ClientRatesAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.text.ParseException; -import java.util.Date; - -/** - * 商户开通率统计 - * Created by yixian on 2016-11-08. - */ -@RestController -@ManagerMapping(value = "/analysis/client_rates", method = RequestMethod.GET, role = {ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.DIRECTOR}) -public class ClientRatesController { - private static final String[] PARSE_PATTERNS = {"yyyyMMdd"}; - @Resource - private ClientRatesAnalysisService clientRatesAnalysisService; - @Resource - private ManagerAccountsService managerAccountsService; - - @RequestMapping("/bd_users") - @ReadOnlyConnection - public JSONObject listAnalysisOfBDUsers(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam(name = "org_id", required = false) String orgId, - @RequestParam(name = "org_id2", required = false) String orgId2, - @RequestParam String begin, @RequestParam String end) { - Date beginDate; - try { - beginDate = DateUtils.parseDate(begin, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - Date endDate; - try { - endDate = DateUtils.parseDate(end, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - return clientRatesAnalysisService.listAnalysisOfBDUsers(manager,orgId, orgId2, beginDate, endDate); - } - - @RequestMapping("/orgs/all") - @ReadOnlyConnection - public JSONObject analysisAllClientsRates(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @Valid ClientRateQueryBean query, Errors errors) { - if (manager.getIntValue("org_id") > 0) { - throw new ForbiddenException("You have no permission to view this chart"); - } - HttpUtils.handleValidErrors(errors); - return clientRatesAnalysisService.listAllClientRates(null, query); - } - - @RequestMapping("/orgs/{orgId}") - public JSONObject analysisClientsRatesOfOrg(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable int orgId, - @Valid ClientRateQueryBean query, Errors errors) { - if (manager.getIntValue("org_id") > 0 && manager.getIntValue("org_id") != orgId) { - throw new ForbiddenException("You have no permission to view this chart"); - } - HttpUtils.handleValidErrors(errors); - return clientRatesAnalysisService.listAllClientRates(orgId, query); - } - - @RequestMapping("/bd_users/{bdId}") - @ReadOnlyConnection - public JSONObject analysisClientsOfBdUser(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String bdId, - @Valid ClientRateQueryBean query, Errors errors) { - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !manager.getString("manager_id").equals(bdId) ) { - if (!ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))){ - throw new ForbiddenException("You have no permission to view this chart"); - } - JSONObject bd = managerAccountsService.getBDConfig(bdId); - if (bd != null && bd.getString("bd_group") != manager.getString("manager_id")) { - throw new ForbiddenException("You have no permission to view this chart"); - } - } - HttpUtils.handleValidErrors(errors); - return clientRatesAnalysisService.listClientRatesOfBDUser(bdId, query); - } - - @ManagerMapping(value = "/clients/{clientMoniker}/review_events", method = RequestMethod.POST) - public void newReviewEvent(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, - @RequestBody JSONObject review) { - clientRatesAnalysisService.saveReviewEvent(clientMoniker, manager.getString("manager_id"), review.getString("review_date"), review.getString("desc")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java deleted file mode 100644 index 501db3123..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java +++ /dev/null @@ -1,139 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 10/11/2016. - */ -@RequestMapping(value = "/analysis/customers", method = RequestMethod.GET) -@RestController -public class CustomersAnalysisController { - @Resource - private CustomersAnalysisService customersAnalysisService; - - @ManagerMapping("/sys") - @ReadOnlyConnection - public List getCustomersAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return customersAnalysisService.getCustomersAnalysis(params); - } - - @ManagerMapping("/sys/monthly") - @ReadOnlyConnection - public List getCustomersAnalysisMonthly(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return customersAnalysisService.getCustomersAnalysisMonthly(params); - } - - - @ManagerMapping("/sys/channel") - @ReadOnlyConnection - public JSONObject getCustomersChannelAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return customersAnalysisService.getChannelAmountAnalysis(params); - } - - @ManagerMapping("/sys/cbbank_channel") - @ReadOnlyConnection - public JSONObject getCBBankChannelAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return customersAnalysisService.getCBBankChannelAmountAnalysis(params); - } - - @ManagerMapping(value = "/ranking/{openid_type}", role = ManagerRole.DEVELOPER) - @ReadOnlyConnection - public JSONObject getCustomersRanking(@PathVariable int openid_type, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - params.put("openid_type", openid_type); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - - return customersAnalysisService.getCustomersRanking(params, analysis.getPage(), analysis.getLimit()); - } - - @ManagerMapping(value = "/ranking/{openid_type}/total", role = ManagerRole.RISK_MANAGER) - @ReadOnlyConnection - public JSONObject getCustomersTotal(@PathVariable int openid_type, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - params.put("openid_type", openid_type); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - - return customersAnalysisService.getCustomersTotal(params); - } - - @ManagerMapping(value = "/{customer_id}/orders", role = ManagerRole.DEVELOPER) - @ReadOnlyConnection - public JSONObject getCustomerOrders(@PathVariable String customer_id, TradeLogQuery tradeLogQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = tradeLogQuery.toParams(null); - params.put("customer_id", customer_id); - params.put("status", 5); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - return customersAnalysisService.getOrdersByOpenid(params, tradeLogQuery.getPage(), tradeLogQuery.getLimit()); - } - - @ManagerMapping(value = "/{customer_id}/user_echarts") - @ReadOnlyConnection - public JSONObject getUserEcharts(@PathVariable String customer_id, AnalysisBean analysisBean, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysisBean.toParams(null); - params.put("customer_id", customer_id); - params.put("status", 5); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - return customersAnalysisService.getUserEcharts(params, manager); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DailyReportController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DailyReportController.java deleted file mode 100644 index 3283dab27..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DailyReportController.java +++ /dev/null @@ -1,112 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.core.DailyReport; -import au.com.royalpay.payment.manage.application.core.SimpleClientService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Created by yishuqian on 16/11/2017. - */ -@RestController -@RequestMapping("/analysis/daily_reports") -public class DailyReportController { - - @Resource - private DailyReport dailyReport; - @Resource - private SimpleClientService simpleClientService; - - @WechatMapping(value = "/{reportId}", method = RequestMethod.GET) - public ModelAndView reportDailyView(@PathVariable String reportId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) { - ModelAndView mav = new ModelAndView("reports/daily_report"); - JSONObject report = dailyReport.getReport(reportId, wxUser.getString("openid")); - mav.addObject("report", report); - return mav; - } - - @ManagerMapping(value = "/generate", method = RequestMethod.POST, role = ManagerRole.ADMIN) - public void generateDailyReport(@RequestBody JSONObject date) { - dailyReport.generateReport(date.getString("date"), date.getBooleanValue("send_msg")); - } - - @WechatMapping(value = "/greenChannel", method = RequestMethod.GET) - @ReadOnlyConnection - public ModelAndView greenChannel(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) { - Map clients = simpleClientService.getGreenChannelClients(null); - List resultWaringClients = new ArrayList<>(); - List resultTimeoutClients = new ArrayList<>(); - for (Map.Entry entry : clients.entrySet()) { - JSONObject j = entry.getValue(); - JSONArray waringArr = j.getJSONArray("waring"); - JSONObject resultWaringElement = new JSONObject(); - resultWaringElement.put("total", waringArr.size()); - String waringCode = ""; - for (Object o : waringArr) { - waringCode += ((JSONObject) o).getString("client_moniker") + ";"; - } - if(!CollectionUtils.isEmpty(waringArr)) { - resultWaringElement.put("client_moniker", waringCode); - resultWaringElement.put("display_name", ((JSONObject) waringArr.get(0)).getString("display_name")); - resultWaringClients.add(resultWaringElement); - } - - JSONArray timeoutArr = j.getJSONArray("timeout"); - JSONObject resultTimeoutElement = new JSONObject(); - String timeoutCode = ""; - resultTimeoutElement.put("total", timeoutArr.size()); - for (Object o : timeoutArr) { - timeoutCode += ((JSONObject) o).getString("client_moniker") + ";"; - } - if(!CollectionUtils.isEmpty(timeoutArr)) { - resultTimeoutElement.put("client_moniker", timeoutCode); - resultTimeoutElement.put("display_name", ((JSONObject) timeoutArr.get(0)).getString("display_name")); - resultTimeoutClients.add(resultTimeoutElement); - } - } - JSONObject result = new JSONObject(); - result.put("waring", resultWaringClients); - result.put("timeout", resultTimeoutClients); - ModelAndView mav = new ModelAndView("reports/green_channel"); - mav.addObject("clients", result); - return mav; - } - - @WechatMapping(value = "/greenChannelBD/{manager_id}", method = RequestMethod.GET) - @ReadOnlyConnection - public ModelAndView greenChanneasdl(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, @PathVariable String manager_id) { - Map clients = simpleClientService.getGreenChannelClients(manager_id); - String resultWaringClients = ""; - String resultTimeoutClients = ""; - for (Map.Entry entry : clients.entrySet()) { - JSONObject j = entry.getValue(); - JSONArray waringArr = j.getJSONArray("waring"); - JSONArray timeoutArr = j.getJSONArray("timeout"); - for (Object o : waringArr) { - resultWaringClients += ((JSONObject) o).getString("client_moniker") + ";"; - } - for (Object o : timeoutArr) { - resultTimeoutClients += ((JSONObject) o).getString("client_moniker") + ";"; - } - } - JSONObject result = new JSONObject(); - result.put("waring", resultWaringClients); - result.put("timeout", resultTimeoutClients); - ModelAndView mav = new ModelAndView("reports/green_channel_bd"); - mav.addObject("clients", result); - return mav; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java deleted file mode 100644 index 9c2f13c1d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java +++ /dev/null @@ -1,198 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.DashboardService; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by davep on 2016-07-27. - */ -@RequestMapping(value = "/dashboard/system", method = RequestMethod.GET) -@RestController -public class DashboardController { - @Resource - private DashboardService dashboardService; - @Resource - private OrgManager orgManager; - - @Resource - private SysConfigManager sysConfigManager; - - - @ManagerMapping("/common_analysis_1") - @ReadOnlyConnection - public JSONObject commonAnalysis1(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - return dashboardService.getCommonAnalysis1(params); - } - - @ManagerMapping("/common_analysis_3") - @ReadOnlyConnection - public JSONObject commonAnalysis3(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - return dashboardService.getCommonAnalysis3(params); - } - - @ManagerMapping("/common_analysis_4") - @ReadOnlyConnection - public JSONObject commonAnalysis4(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - return dashboardService.getCommonAnalysis4(params); - } - - @ManagerMapping("/common_analysis_2") - @ReadOnlyConnection - public JSONObject commonAnalysis2(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - return dashboardService.getCommonAnalysis2(params); - } - - @ManagerMapping("/trade_in_types") - @ReadOnlyConnection - public List tradeInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - return dashboardService.getTradeInTypes(params); - } - - @ManagerMapping("/top_trade_partners") - @ReadOnlyConnection - public List topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam(defaultValue = "10") int limit) { - - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - params.put("limit", limit); - return dashboardService.getTopTradePartnersNew(params); - } - - @ManagerMapping("/rank_trade_partners") - @ReadOnlyConnection - public List rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager, params); - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return dashboardService.getTopTradePartnersNew(params); - } - - @ManagerMapping("/trade_in_hours") - @ReadOnlyConnection - public List tradeInHours(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager, params); - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return dashboardService.getTradeAnalysisInHours(params); - } - - @ManagerMapping("/fee_analysis") - @ReadOnlyConnection - public List tradeInDays(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager, params); - return dashboardService.getTradeAnalysisInDays(params); - } - - @ManagerMapping("/new_clients") - @ReadOnlyConnection - public List clientsTradeInDays(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager, params); - return dashboardService.getClientsTradeAnalysisInDays(params); - } - - @ManagerMapping("/partners_in_types") - @ReadOnlyConnection - public List partnersInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - } - return dashboardService.getPartnersInTypes(params); - } - - @ManagerMapping("/gateway/{trade_type}/partners") - @ReadOnlyConnection - public List getPartnersByTradeType(@PathVariable String trade_type, AnalysisBean analysis, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - params.put("trade_type", trade_type); - orgManager.checkOrg(manager, params); - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd() > 0) { - params.put("bd_group_bd", analysis.getGroup_bd()); - } - - } - return dashboardService.getPartnersByTradeType(params); - } - - @ManagerMapping("/trade_in_time") - @ReadOnlyConnection - public List tradeInTime(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager, params); - return dashboardService.getTradeAnalysisInTime(params); - } - - @ManagerMapping("/exchange_rates") - @ReadOnlyConnection - @RequirePartner - public List getExchangeRateHistory(@RequestParam String begin, @RequestParam String end) { - return dashboardService.listExchangeRateHistory(begin, end); - } - - @ManagerMapping("/max_record") - @ReadOnlyConnection - public JSONObject getMaxRecord(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return dashboardService.getNewRecord(); - } - - @ManagerMapping("/Total_platform_amount") - @ReadOnlyConnection - public JSONObject getPlatformAmount(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager, params); - return dashboardService.getPlatformAmount(params); - } - - @ManagerMapping(value = "/dashboard_base", method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject getDashBoardBaseConfig() { - JSONObject config = sysConfigManager.getSysConfig(); - JSONObject limits = new JSONObject(); - limits.put("payment.wechat.per_order_limit", config.getString("payment.wechat.per_order_limit")); - limits.put("payment.wechat.individual_daily_limit", config.getString("payment.wechat.individual_daily_limit")); - limits.put("payment.wechat.individual_yearly_limit", config.getString("payment.wechat.individual_yearly_limit")); - return limits; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/EstimateAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/EstimateAnalysisController.java deleted file mode 100644 index 55b92b058..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/EstimateAnalysisController.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by Tayl0r on 2017/7/3. - */ -@RequestMapping(value = "/analysis/estimate") -@RestController -public class EstimateAnalysisController { - - @Resource - private EstimateAnalysisService estimateAnalysisService; - - @ManagerMapping(value = "/future",method = RequestMethod.GET) - @ReadOnlyConnection - public List getFutureSettleInfo() throws Exception { - return estimateAnalysisService.listFutureInfo(); - } - - @ManagerMapping(value = "/future/refresh", method = RequestMethod.PUT) - public void clearEstimateFutureCache() { - estimateAnalysisService.clearEstimateFutureCache(); - } - - @ManagerMapping(value = "/log/{date}", method = RequestMethod.GET) - @ReadOnlyConnection - public List getEstimateLogInfo(@PathVariable String date) throws Exception { - - return estimateAnalysisService.listEstimateLog(1, date); - } - - @ManagerMapping(value = "/transaction/log/{date}",method = RequestMethod.GET) - @ReadOnlyConnection - public List getTransactionLogInfo(@PathVariable String date) throws Exception { - return estimateAnalysisService.listEstimateLog(2,date); - } - - @ManagerMapping(value = "/query", method = RequestMethod.GET) - @ReadOnlyConnection - public List queryEstimateLogInfo(@RequestParam String start_date, @RequestParam String end_date) throws Exception { - return estimateAnalysisService.listEstimateLogs(start_date,end_date); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/FinancialAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/FinancialAnalysisController.java deleted file mode 100644 index cb20baab0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/FinancialAnalysisController.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * Created by yixian on 2017-04-20. - */ -@RestController -@ManagerMapping(role = ManagerRole.FINANCIAL_STAFF, value = "/analysis/financial",method = RequestMethod.GET) -public class FinancialAnalysisController { - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/OrderSuccessRateController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/OrderSuccessRateController.java deleted file mode 100644 index 5f0f9a578..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/OrderSuccessRateController.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.analysis.core.OrderSuccessRateAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.util.Date; - -/** - * 订单成功率 - * Created by yixian on 2016-11-10. - */ -@ManagerMapping(role = {ManagerRole.ADMIN}, value = "/analysis/success_rates", method = RequestMethod.GET) -@RestController -public class OrderSuccessRateController { - private static final String[] PARSE_PATTERNS = {"yyyyMMdd"}; - @Resource - private OrderSuccessRateAnalysisService orderSuccessRateAnalysisService; - - @RequestMapping("/chart_view") - @ReadOnlyConnection - public JSONObject analysisAllInTypes(@RequestParam String begin, @RequestParam String end) { - Date beginDate; - try { - beginDate = DateUtils.parseDate(begin, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - Date endDate; - try { - endDate = DateUtils.parseDate(end, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - return orderSuccessRateAnalysisService.analysisOrderSuccessRates(beginDate, endDate); - } - - @RequestMapping("/dates/{pattern}/detail") - @ReadOnlyConnection - public JSONObject getDetailOfDate(@PathVariable String pattern) { - Date dt = null; - try { - dt = DateUtils.parseDate(pattern, PARSE_PATTERNS); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - - return orderSuccessRateAnalysisService.analysisDateDetail(dt); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/OrgSaleAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/OrgSaleAnalysisController.java deleted file mode 100644 index 1d0b219c6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/OrgSaleAnalysisController.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.OrgAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 27/02/2017. - */ -@RestController -@RequestMapping(value = "/analysis/org", method = RequestMethod.GET) -public class OrgSaleAnalysisController { - @Resource - private OrgAnalysisService orgAnalysisService; - - @ManagerMapping(value = "/sales", role = {ManagerRole.DIRECTOR, ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF}) - @ReadOnlyConnection - public List getSalesAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - return orgAnalysisService.getSalesAnalysis(params, manager); - } - - @ManagerMapping(value = "/{org_id}/partners", role = {ManagerRole.DIRECTOR, ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF}) - @ReadOnlyConnection - public List getPartnersSales(@PathVariable String org_id, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - analysis.setOrg_id(org_id); - JSONObject params = analysis.toParams(null); - return orgAnalysisService.getPartnersSaleByOrgId(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java deleted file mode 100644 index 80cb363ed..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java +++ /dev/null @@ -1,106 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService; -import au.com.royalpay.payment.manage.logview.beans.ClientLoginLogQueryBean; -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.signin.core.ClientLoginLogRepository; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -/** - * Created by yishuqian on 20/02/2017. - */ -@RestController -@ManagerMapping(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.FINANCIAL_STAFF}, - value = "/analysis/partner_card", method = RequestMethod.GET) -public class PartnerCardDashboardController { - - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private PartnerCardDashboardService partnerCardDashboardService; - @Resource - private ClientLoginLogRepository clientLoginLogRepository; - @Resource - private CleanService cleanService; - - @RequestMapping("{client_moniker}/basic_info") - @ReadOnlyConnection - public JSONObject commonAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getCommonAnalysis(client_moniker); - } - - @RequestMapping("{client_moniker}/trans_common") - @ReadOnlyConnection - public JSONObject getTransactionAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getTransactionAnalysis(client_moniker); - } - - @RequestMapping("{client_moniker}/order_customer_chart") - @ReadOnlyConnection - public List getOrderCustomerChartAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getOrderCustomerChartAnalysis(client_moniker); - } - - - @RequestMapping("{client_moniker}/trans_type_analysis") - @ReadOnlyConnection - public List getTransTypesAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getTransTypesAnalysis(client_moniker); - } - - @RequestMapping("{client_moniker}/avg_order_customer") - @ReadOnlyConnection - public JSONObject getAvgOrderAndCustomer(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getOrderAndCustomerPerDay(client_moniker); - } - - @RequestMapping("{client_moniker}/trade_in_hours") - @ReadOnlyConnection - public List getTradeAnalysisInHours(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getTradeAnalysisInHours(client_moniker); - } - - @RequestMapping("{client_moniker}/settlement_logs") - @ReadOnlyConnection - public JSONObject getPartnerSettlementLog(@PathVariable String client_moniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return partnerCardDashboardService.getSettlementLog(client_moniker, query); - } - - @RequestMapping("{client_moniker}/login_logs") - @ReadOnlyConnection - public JSONObject getPartnerLoginLog(@PathVariable String client_moniker, ClientLoginLogQueryBean query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientLoginLogRepository.listClientLoginLogs(client_moniker, query.getPage(), query.getLimit()); - } - - @RequestMapping("/{client_id}/settlement_logs/{detailId}") - @ReadOnlyConnection - public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable int detailId,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getCleanLogTransactions(detailId, manager); - } - - @RequestMapping("/{client_id}/settlement_logs/report_date/{reportDate}") - @ReadOnlyConnection - public JSONObject listClearingTransactionsOfMergeSettle(@PathVariable int client_id, @PathVariable String reportDate,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getCleanLogTransactionsOfMergeSettle(client_id,reportDate, manager); - } - - @RequestMapping("/settlement_logs/{detailId}/analysis/{channel}") - @ReadOnlyConnection - public Map getDayAndChannelOfAnalysisMap(@PathVariable int detailId, - @PathVariable String channel, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getDayAndChannelOfAnalysisMap(detailId,channel, manager); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java deleted file mode 100644 index bd6395e23..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.DashboardService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 9/19/16. - */ -@RequestMapping(value = "/dashboard/partner",method = RequestMethod.GET) -@RestController -public class PartnerDashboardController { - @Resource - private DashboardService dashboardService; - @PartnerMapping("/common_analysis") - @ReadOnlyConnection - public JSONObject commonAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) { - return dashboardService.getCommonAnalysis(partner,partnerAnalysisBean); - } - @PartnerMapping("/common_analysis_channel") - @ReadOnlyConnection - public JSONObject commonAnalysisByChannel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) { - return dashboardService.getCommonAnalysisByChannel(partner,partnerAnalysisBean); - } - - @PartnerMapping("/trade_in_hours") - @ReadOnlyConnection - public List tradeInHours(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) { - return dashboardService.getTradeAnalysisInHours(partner,partnerAnalysisBean); - } - - @PartnerMapping("/fee_analysis") - @ReadOnlyConnection - public List tradeInDays(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) { - return dashboardService.getStatisticsCustomersAndOrdersInDays(partner,partnerAnalysisBean); - } - - @PartnerMapping("/customers") - @ReadOnlyConnection - public List customersInDays(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) { - return dashboardService.getCustomersAndOrdersInDays(partner,partnerAnalysisBean); - } - @PartnerMapping("/trans_type_analysis") - @ReadOnlyConnection - public List getTransTypesAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) { - JSONObject params = partnerAnalysisBean.toParams("timezone"); - params.put("client_id",partner.getString("client_id")); - return dashboardService.getTradeInTypes(params); - } - - @PartnerMapping("/avg_order_customer") - @ReadOnlyConnection - public JSONObject getAvgOrderAndCustomer(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) { - return dashboardService.getOrderAndCustomerPerDay(partner,partnerAnalysisBean); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnersAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnersAnalysisController.java deleted file mode 100644 index b4e30981c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnersAnalysisController.java +++ /dev/null @@ -1,89 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.analysis.core.PartnersAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -@RequestMapping(value = "/analysis/partners",method = RequestMethod.GET) -@RestController -public class PartnersAnalysisController { - @Resource - private PartnersAnalysisService partnersAnalysisService; - - @ManagerMapping("/new") - @ReadOnlyConnection - public List getNewPartnersAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - return partnersAnalysisService.getNewPartnersAnalysis(params); - } - - @ManagerMapping("/trade") - @ReadOnlyConnection - public List getTradePartnersAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - return partnersAnalysisService.getTradePartnersAnalysis(params); - } - @ManagerMapping("/types") - @ReadOnlyConnection - public List getPartnersTypesAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - return partnersAnalysisService.getPartnersTypesAnalysis(params); - } - - @ManagerMapping("/settlement") - @ReadOnlyConnection - public List getPartnersSettlementAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ - params.put("bd_group_bd",analysis.getGroup_bd()); - } - } - return partnersAnalysisService.getPartnersSettlementAnalysis(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PlatformClearAController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PlatformClearAController.java deleted file mode 100644 index 32eada5e7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PlatformClearAController.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.core.PlatformClearService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.text.ParseException; - -@RestController -@RequestMapping(value = "/platform/analysis") -public class PlatformClearAController { - - @Resource - private PlatformClearService platformClearService; - - @ManagerMapping(value = "/settle/log", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) - @ReadOnlyConnection - public JSONObject getPlatformSettleLog(@RequestParam String channel, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int limit) { - return platformClearService.getPlatformSettleLog(channel, page, limit); - } - - @ManagerMapping(value = "/settle/{channel}",method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) - @ReadOnlyConnection - public JSONObject getChannelSettleLog(@PathVariable String channel) { - return platformClearService.getChannelSettleLog(channel); - } - - @ManagerMapping(value = "/settle/verify",method = RequestMethod.GET,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) - @ReadOnlyConnection - public void verifySettleLogByDate(@RequestParam("start_date") String start_date, @RequestParam("end_date") String end_date, @RequestParam("channel") String channel) throws ParseException { - platformClearService.verifySettleLogByDate(start_date,end_date,channel); - } - - @ManagerMapping(value = "/generate/settle/log", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) - @ReadOnlyConnection - public void generateSettleLogs() { - platformClearService.generateSettleLogs(); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PlatformRevenueController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PlatformRevenueController.java deleted file mode 100644 index 91da1c1dc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PlatformRevenueController.java +++ /dev/null @@ -1,70 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.analysis.core.PlatformRevenueService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * Created by Tayl0r on 2017/5/24. - */ -@ManagerMapping(value = "/analysis/platform") -@RestController -public class PlatformRevenueController { - - @Resource - PlatformRevenueService platformRevenueService; - - @GetMapping("/revenue/month_reports/{month}") - @ReadOnlyConnection - public JSONObject getMonthPlatformRevenueReport(@PathVariable String month) { - try { - Date dt = DateUtils.parseDate(month, new String[]{"yyyy-MM"}); - DateTime monthDate = new DateTime(dt); - JSONObject platformRevenueReport = platformRevenueService.getPlatformRevenue(monthDate.getYear(),monthDate.getMonthOfYear(),month); - - return platformRevenueReport; - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/revenue/year_reports/{year}") - @ReadOnlyConnection - public List getYearPlatformRevenueReport(@PathVariable int year) { - List platformRevenueYearReport = new ArrayList(); - int MonthIndex = 13; - Calendar cal = Calendar.getInstance(); - int yearCheck = cal.get(Calendar.YEAR); - if (yearCheck == year) { - MonthIndex = cal.get(Calendar.MONTH) + 2; - } else if(year > yearCheck){ - MonthIndex = 1; - } - for (int month = 1; month < MonthIndex; month++) { - String monthStr; - if (month < 10) { - monthStr = year + "-0" + month; - platformRevenueYearReport.add(getMonthPlatformRevenueReport(monthStr)); - } else { - monthStr = year + "-" + month; - platformRevenueYearReport.add(getMonthPlatformRevenueReport(monthStr)); - } - } - return platformRevenueYearReport; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/RefundAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/RefundAnalysisController.java deleted file mode 100644 index f0a4c58ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/RefundAnalysisController.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.core.RefundAnalysisService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -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 javax.annotation.Resource; -import java.text.ParseException; -import java.util.List; - -/** - * Created by Tayl0r on 2017/6/7. - */ -@ManagerMapping(value = "/analysis/refund", method = RequestMethod.GET) -@RestController -public class RefundAnalysisController { - @Resource - private RefundAnalysisService refundAnalysisService; - - @RequestMapping("/report") - @ReadOnlyConnection - public JSONObject findRefundInfoListByDay(@RequestParam String begin, @RequestParam String end) throws ParseException { - return refundAnalysisService.findRefundInfoListByDay(begin, end); - } - - @RequestMapping("/report/refundCount") - @ReadOnlyConnection - public List findRefundCount(@RequestParam String begin, @RequestParam String end) throws ParseException { - return refundAnalysisService.findRefundCount(begin, end); - } - - @RequestMapping("/report/dayList") - @ReadOnlyConnection - public List listRefundInfoByDay(@RequestParam String begin, @RequestParam String end) throws ParseException { - return refundAnalysisService.listRefundInfoByDay(begin, end); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/WeekReportController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/WeekReportController.java deleted file mode 100644 index 79e6bd2f5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/WeekReportController.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.analysis.web; - -import au.com.royalpay.payment.manage.analysis.core.WeekReporter; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-03-03. - */ -@RestController -@RequestMapping("/analysis/week_reports") -public class WeekReportController { - @Resource - private WeekReporter weekReporter; - - @WechatMapping(value = "/{reportId}", method = RequestMethod.GET) - @ReadOnlyConnection - public ModelAndView reportView(@PathVariable String reportId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) { - ModelAndView mav = new ModelAndView("reports/week_report"); - JSONObject report = weekReporter.getReport(reportId, wxUser.getString("openid")); - mav.addObject("report", report); - return mav; - } - - @WechatMapping(value = "/partners/{reportId}", method = RequestMethod.GET) - @ReadOnlyConnection - public ModelAndView reportPartnersView(@PathVariable String reportId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) { - ModelAndView mav = new ModelAndView("reports/week_report_partners"); - JSONObject report = weekReporter.getReport(reportId, wxUser.getString("openid")); - mav.addObject("report", report); - return mav; - } - - @ManagerMapping(value = "/generate", method = RequestMethod.POST, role = ManagerRole.ADMIN) - public void generateWeekReport(@RequestBody JSONObject week) { - weekReporter.generateReport(week.getString("date"), week.getBooleanValue("send_msg")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/ApiClientAccountLoginInfo.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/ApiClientAccountLoginInfo.java deleted file mode 100644 index e23e1c1cf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/ApiClientAccountLoginInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import au.com.royalpay.payment.manage.permission.utils.GeekLoginDESUtil; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.tools.utils.PasswordUtils; - -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-12-14. - */ -public class ApiClientAccountLoginInfo { - @NotEmpty(message = "error.payment.valid.param_missing") - private String loginId; - @NotEmpty(message = "error.payment.valid.param_missing") - private String password; - - public LoginInfo ClientAccountLoginInfo(){ - LoginInfo info = new LoginInfo(); - info.setLoginId(loginId); - info.setPassword(GeekLoginDESUtil.getDecryptString(password)); - return info; - } - - public String getPasswordHashed(String salt) { - return PasswordUtils.hashPwd(password, salt); - } - - public String getLoginId() { - return loginId.toLowerCase(); - } - - public void setLoginId(String loginId) { - this.loginId = loginId; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public String toString() { - return "ApiClientAccountLoginInfo{" + - "loginId='" + loginId + '\'' + - ", password='" + password + '\'' + - '}'; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java deleted file mode 100644 index c4d663f31..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java +++ /dev/null @@ -1,257 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -import javax.validation.constraints.Pattern; - -/** - * Created by yishuqian on 16/05/2017. - */ -public class AppClientBean { - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - @Pattern(regexp = "^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$", message = "error.payment.valid.invalid_timezone") - private String timezone; - @JSONField(name = "customer_surcharge_rate") - private Double customerSurchargeRate; - private String company_phone; - private String address; - private String suburb; - private String postcode; - private String state; - @JSONField(name = "legal_person") - private String legalPerson; - @JSONField(name = "legal_phone") - private String legalPhone; - @JSONField(name = "legal_email") - private String legalEmail; - @JSONField(name = "legal_job_title") - private String legalJobTitle; - @JSONField(name = "contact_job") - private String contactJob; - - private String registered_address; - private String registered_suburb; - private String registered_state; - private String registered_postcode; - - public JSONObject updateObject() { - JSONObject res = new JSONObject(); - if (contactPerson != null) { - res.put("contact_person", contactPerson); - } - if (contactPhone != null) { - res.put("contact_phone", contactPhone); - } - if (contactEmail != null) { - res.put("contact_email", contactEmail); - } - if (timezone != null) { - res.put("timezone", timezone); - } - if (company_phone != null) { - res.put("company_phone", company_phone); - } - if (address != null) { - res.put("address", address); - } - if (suburb != null) { - res.put("suburb", suburb); - } - if (postcode != null) { - res.put("postcode", postcode); - } - if (state != null) { - res.put("state", state); - } - if (contactJob != null) { - res.put("contact_job", contactJob); - } - return res; - } - - public JSONObject legalObject() { - JSONObject res = new JSONObject(); - if (legalPerson != null) { - res.put("representative_person", legalPerson); - } - if (legalPhone != null) { - res.put("phone", legalPhone); - } - if (legalEmail != null) { - res.put("email", legalEmail); - } - if (legalJobTitle != null) { - res.put("job_title", legalJobTitle); - } - if (registered_address != null) { - res.put("registered_address", registered_address); - } - if (registered_suburb != null) { - res.put("registered_suburb", registered_suburb); - } - if (registered_state != null) { - res.put("registered_state", registered_state); - } - if (registered_postcode != null) { - res.put("registered_postcode", registered_postcode); - } - return res; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public void setCustomerSurchargeRate(Double customerSurchargeRate) { - this.customerSurchargeRate = customerSurchargeRate; - } - public Double getCustomerSurchargeRate(){ - return customerSurchargeRate; - } - - public String getCompany_phone() { - return company_phone; - } - - public void setCompany_phone(String company_phone) { - this.company_phone = company_phone; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getContactJob() { - return contactJob; - } - - public String getLegalEmail() { - return legalEmail; - } - - public String getLegalJobTitle() { - return legalJobTitle; - } - - public String getLegalPerson() { - return legalPerson; - } - - public String getLegalPhone() { - return legalPhone; - } - - public void setContactJob(String contactJob) { - this.contactJob = contactJob; - } - - public void setLegalEmail(String legalEmail) { - this.legalEmail = legalEmail; - } - - public void setLegalJobTitle(String legalJobTitle) { - this.legalJobTitle = legalJobTitle; - } - - public void setLegalPerson(String legalPerson) { - this.legalPerson = legalPerson; - } - - public void setLegalPhone(String legalPhone) { - this.legalPhone = legalPhone; - } - - public String getRegistered_address() { - return registered_address; - } - - public void setRegistered_address(String registered_address) { - this.registered_address = registered_address; - } - - public String getRegistered_suburb() { - return registered_suburb; - } - - public void setRegistered_suburb(String registered_suburb) { - this.registered_suburb = registered_suburb; - } - - public String getRegistered_state() { - return registered_state; - } - - public void setRegistered_state(String registered_state) { - this.registered_state = registered_state; - } - - public String getRegistered_postcode() { - return registered_postcode; - } - - public void setRegistered_postcode(String registered_postcode) { - this.registered_postcode = registered_postcode; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppMerchantBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppMerchantBean.java deleted file mode 100644 index bb77faa37..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppMerchantBean.java +++ /dev/null @@ -1,492 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -public class AppMerchantBean { - private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - private String textType; - private String searchText; - private String client_moniker; - private String state; - private String suburb; - private String short_name; - private String sub_merchant_id; - private String org_id; - private String org_ids; - private String bd; - private String business_structure; - private String industry; - private Integer clean_day; - private String bd_city; - private String surcharge_start_rate; - private String surcharge_end_rate; - private String create_start_time; - private String approve_start_time; - private String create_end_time; - private String approve_end_time; - private String transaction_start_time; - private String transaction_end_time; - private boolean approving = false; - private int page = 1; - private int limit = 10; - private boolean onlyMe = false; - private boolean tempMchId = false; - private boolean quickPass = false; - private boolean greenChannel = false; - private boolean greenChannelBdTodo = false; - private boolean pass = false; - private boolean completed_contract = false; - private boolean apply_to_back = false; - private boolean bd_upload_material = false; - private boolean is_valid = false; - private String merchant_id; - private int status; - private boolean bd_upload_and_completed = false; - - public String getClient_moniker() { - return StringUtils.isEmpty(client_moniker) ? null : client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getShort_name() { - return short_name; - } - - public void setShort_name(String short_name) { - this.short_name = short_name; - } - - public String getSub_merchant_id() { - return sub_merchant_id; - } - - public void setSub_merchant_id(String sub_merchant_id) { - this.sub_merchant_id = sub_merchant_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(client_moniker)) { - param.put("client_moniker", getClient_moniker()); - } - if (StringUtils.isNotBlank(short_name)) { - param.put("short_name", short_name); - } - if (StringUtils.isNotBlank(sub_merchant_id)) { - param.put("sub_merchant_id", sub_merchant_id); - } - if (StringUtils.isNotBlank(state)) { - param.put("state", state); - } - if (StringUtils.isNotBlank(suburb)) { - param.put("suburb", suburb); - } - if (StringUtils.isNotBlank(searchText)) { - param.put("search_text", searchText); - if (StringUtils.isNotBlank(textType)) { - param.put("text_type", textType); - } else { - param.put("text_type", "all"); - } - } - if (approving) { - param.put("approving", true); - } - if (org_id != null) { - param.put("org_id", org_id); - } - if (org_ids != null) { - param.put("org_ids", org_ids); - } - if (StringUtils.isNotBlank(bd)) { - param.put("bd_user", bd); - } - if (quickPass){ - param.put("quickPass",true); - } - if (greenChannel){ - param.put("greenChannel",true); - } - if (business_structure!=null && !business_structure.equals("")){ - param.put("business_structure",business_structure); - } - if (industry!=null && !industry.equals("")){ - param.put("industry",industry); - } - if (bd_city!=null && !bd_city.equals("")){ - param.put("bd_city",bd_city); - } - if (clean_day!=null){ - param.put("clean_day",clean_day); - } - if (surcharge_start_rate!=null) { - param.put("surcharge_start_rate",surcharge_start_rate); - } - if (surcharge_end_rate!=null){ - param.put("surcharge_end_rate",surcharge_end_rate); - } - if (transaction_start_time != null) { - try { - param.put("transaction_start_time", format.parse(transaction_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("transaction_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (transaction_end_time != null) { - try { - param.put("transaction_end_time", DateUtils.addDays(format.parse(transaction_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("transaction_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (create_start_time != null) { - try { - param.put("create_start_time", format.parse(create_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("create_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (create_end_time != null) { - try { - param.put("create_end_time", DateUtils.addDays(format.parse(create_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("create_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (approve_start_time != null) { - try { - param.put("approve_start_time", format.parse(approve_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("approve_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (approve_end_time != null) { - try { - param.put("approve_end_time", DateUtils.addDays(format.parse(approve_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("approve_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (greenChannelBdTodo){ - param.put("greenChannelBdTodo",true); - } - if (is_valid){ - param.put("is_valid",true); - } - if (pass){ - param.put("pass",true); - } - if (completed_contract){ - param.put("completed_contract",true); - } - if (apply_to_back){ - param.put("apply_to_back",true); - } - if (bd_upload_material){ - param.put("bd_upload_material",true); - } - if (merchant_id != null){ - param.put("merchant_id",merchant_id); - } - if (bd_upload_and_completed) { - param.put("bd_upload_and_completed", true); - } - return param; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getTextType() { - return textType; - } - - public void setTextType(String textType) { - this.textType = textType; - } - - public String getSearchText() { - return searchText; - } - - public void setSearchText(String searchText) { - this.searchText = searchText; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public void setOnlyMe(boolean onlyMe) { - this.onlyMe = onlyMe; - } - - public boolean getOnlyMe() { - return onlyMe; - } - - public boolean isTempMchId() { - return tempMchId; - } - - public void setTempMchId(boolean tempMchId) { - this.tempMchId = tempMchId; - } - - public String getBusiness_structure() { - return business_structure; - } - - public void setBusiness_structure(String business_structure) { - this.business_structure = business_structure; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public Integer getClean_day() { - return clean_day; - } - - public void setClean_day(Integer clean_day) { - this.clean_day = clean_day; - } - - public String getBd_city() { - return bd_city; - } - - public void setBd_city(String bd_city) { - this.bd_city = bd_city; - } - - public String getCreate_start_time() { - return create_start_time; - } - - public void setCreate_start_time(String create_start_time) { - this.create_start_time = create_start_time; - } - - public String getApprove_start_time() { - return approve_start_time; - } - - public void setApprove_start_time(String approve_start_time) { - this.approve_start_time = approve_start_time; - } - - public String getCreate_end_time() { - return create_end_time; - } - - public void setCreate_end_time(String create_end_time) { - this.create_end_time = create_end_time; - } - - public String getApprove_end_time() { - return approve_end_time; - } - - public void setApprove_end_time(String approve_end_time) { - this.approve_end_time = approve_end_time; - } - - public String getSurcharge_start_rate() { - return surcharge_start_rate; - } - - public void setSurcharge_start_rate(String surcharge_start_rate) { - this.surcharge_start_rate = surcharge_start_rate; - } - - public String getTransaction_start_time() { - return transaction_start_time; - } - - public void setTransaction_start_time(String transaction_start_time) { - this.transaction_start_time = transaction_start_time; - } - - public String getTransaction_end_time() { - return transaction_end_time; - } - - public void setTransaction_end_time(String transaction_end_time) { - this.transaction_end_time = transaction_end_time; - } - - public String getSurcharge_end_rate() { - return surcharge_end_rate; - } - - public void setSurcharge_end_rate(String surcharge_end_rate) { - this.surcharge_end_rate = surcharge_end_rate; - } - - public boolean isOnlyMe() { - return onlyMe; - } - - public boolean isApproving() { - return approving; - } - - public void setApproving(boolean approving) { - this.approving = approving; - } - - public boolean isQuickPass() { - return quickPass; - } - - public void setQuickPass(boolean quickPass) { - this.quickPass = quickPass; - } - - public boolean isGreenChannel() { - return greenChannel; - } - - public void setGreenChannel(boolean greenChannel) { - this.greenChannel = greenChannel; - } - public void setGreenChannelAndBDtodo(boolean bDTodo){ - this.greenChannelBdTodo = bDTodo; - } - public void setIs_valid(boolean is_valid){ - this.is_valid=is_valid; - } - - public DateFormat getFormat() { - return format; - } - - public boolean isGreenChannelBdTodo() { - return greenChannelBdTodo; - } - - public void setGreenChannelBdTodo(boolean greenChannelBdTodo) { - this.greenChannelBdTodo = greenChannelBdTodo; - } - - public boolean isPass() { - return pass; - } - - public void setPass(boolean pass) { - this.pass = pass; - } - - public boolean isCompleted_contract() { - return completed_contract; - } - - public void setCompleted_contract(boolean completed_contract) { - this.completed_contract = completed_contract; - } - - public boolean isApply_to_back() { - return apply_to_back; - } - - public void setApply_to_back(boolean apply_to_back) { - this.apply_to_back = apply_to_back; - } - - public boolean isBd_upload_material() { - return bd_upload_material; - } - - public void setBd_upload_material(boolean bd_upload_material) { - this.bd_upload_material = bd_upload_material; - } - - public boolean isIs_valid() { - return is_valid; - } - - public String getOrg_ids() { - return org_ids; - } - - public void setOrg_ids(String org_ids) { - this.org_ids = org_ids; - } - - public void setBd(String bd) { - this.bd = bd; - } - - public String getMerchant_id() { - return merchant_id; - } - - public void setMerchant_id(String merchant_id) { - this.merchant_id = merchant_id; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public void setStatus(int status) { - this.status = status; - } - - public int getStatus() { - return status; - } - - public boolean isBd_upload_and_completed() { - return bd_upload_and_completed; - } - - public void setBd_upload_and_completed(boolean bd_upload_and_completed) { - this.bd_upload_and_completed = bd_upload_and_completed; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppPaymentConfigBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppPaymentConfigBean.java deleted file mode 100644 index 2be37bb50..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppPaymentConfigBean.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import com.alibaba.fastjson.annotation.JSONField; - -public class AppPaymentConfigBean { - @JSONField(name="api_surcharge") - private Boolean apiSurcharge; - @JSONField(name="retail_surcharge") - private Boolean retailSurcharge; - @JSONField(name="qrcode_surcharge") - private Boolean qrcodeSurcharge; - @JSONField(name = "require_remark") - private Boolean requireRemark; - @JSONField(name = "require_custinfo") - private Boolean requireCustinfo; - - public Boolean getApiSurcharge() { - return apiSurcharge; - } - - public void setApiSurcharge(Boolean apiSurcharge) { - this.apiSurcharge = apiSurcharge; - } - - public Boolean getRetailSurcharge() { - return retailSurcharge; - } - - public void setRetailSurcharge(Boolean retailSurcharge) { - this.retailSurcharge = retailSurcharge; - } - - public Boolean getQrcodeSurcharge() { - return qrcodeSurcharge; - } - - public void setQrcodeSurcharge(Boolean qrcodeSurcharge) { - this.qrcodeSurcharge = qrcodeSurcharge; - } - - public Boolean getRequireCustinfo() { - return requireCustinfo; - } - - public Boolean getRequireRemark() { - return requireRemark; - } - - public void setRequireCustinfo(Boolean requireCustinfo) { - this.requireCustinfo = requireCustinfo; - } - - public void setRequireRemark(Boolean requireRemark) { - this.requireRemark = requireRemark; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java deleted file mode 100644 index 6ba0d197d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java +++ /dev/null @@ -1,190 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import au.com.royalpay.payment.core.beans.OrderStatus; -import au.com.royalpay.payment.core.beans.PayChannelSearch; -import au.com.royalpay.payment.tools.defines.TradeType; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.TimeZone; - -/** - * Created by yishuqian on 28/03/2017. - */ -public class AppQueryBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private String begin; - private String end; - private String[] client_ids; - private String app_client_ids; - private OrderStatus status = OrderStatus.ALL; - private PayChannelSearch channel = PayChannelSearch.ALL; - private int[] gateway; - private int clearing_status=-1; - private String gateway_app; - private int page = 1; - private int limit = 20; - private String timezone = "Australia/Melbourne"; - private String order_id; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (begin != null) { - DateTime fromDate = DateTime.parse(begin, DateTimeFormat.forPattern("yyyyMMdd")) - .withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone)?timezone:"Australia/Melbourne"))).withZone(DateTimeZone.getDefault()); - params.put("begin", fromDate.toDate()); - params.put("from", fromDate.toDate()); - } - if (end != null) { - DateTime toDate = DateTime.parse(end, DateTimeFormat.forPattern("yyyyMMdd")).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timezone))).plusDays(1).withZone(DateTimeZone.getDefault()); - params.put("end", toDate.toDate()); - params.put("to", toDate.toDate()); - - } - if (gateway != null && gateway.length > 0) { - List tradeTypes = new ArrayList<>(); - for (int typeCode : gateway) { - TradeType type = TradeType.fromGatewayNumber(typeCode); - if (type != null) { - tradeTypes.add(type.getGateway()); - } - } - if (!tradeTypes.isEmpty()) { - params.put("trade_type", tradeTypes); - } - } - if (gateway_app != null && gateway_app.length() > 0) { - String[] gateway_app_array = gateway_app.split(","); - List tradeTypes = new ArrayList<>(); - for (String typeCode : gateway_app_array) { - TradeType type = TradeType.fromGatewayNumber(Integer.parseInt(typeCode)); - if (type != null) { - tradeTypes.add(type.getGateway()); - } - } - if (!tradeTypes.isEmpty()) { - params.put("trade_type", tradeTypes); - } - } - - params.put("status", status.getStatus()); - params.put("channel", channel.getChannels()); - if (client_ids != null) { - params.put("client_ids", client_ids); - } - if (app_client_ids != null && !app_client_ids.isEmpty()) { - params.put("client_ids", app_client_ids.split(",")); - } - if (clearing_status != -1) { - params.put("clearing_status", clearing_status); - } - if (StringUtils.isNotBlank(order_id)) { - params.put("order_id", order_id); - } - return params; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public void setClient_ids(String[] client_ids) { - this.client_ids = client_ids; - } - - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public OrderStatus getStatus() { - return status; - } - - public void setStatus(OrderStatus status) { - this.status = status; - } - - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public void setGateway(int[] gateway) { - this.gateway = gateway; - } - - public String getGateway_app() { - return gateway_app; - } - - public void setGateway_app(String gateway_app) { - this.gateway_app = gateway_app; - } - - public String getApp_client_ids() { - return app_client_ids; - } - - public void setApp_client_ids(String app_client_ids) { - this.app_client_ids = app_client_ids; - } - - public PayChannelSearch getChannel() { - return channel; - } - - public void setChannel(PayChannelSearch channel) { - this.channel = channel; - } - - public int getClearing_status() { - return clearing_status; - } - - public void setClearing_status(int clearing_status) { - this.clearing_status = clearing_status; - } - - public void setOrder_id(String order_id) { - this.order_id = order_id; - } - - public String getOrder_id() { - return order_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppleLoginBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppleLoginBean.java deleted file mode 100644 index 34f3474e7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppleLoginBean.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Getter; -import lombok.Setter; - -import javax.validation.constraints.NotEmpty; - -/** - * @author taylor.dang - * @date 2020-04-20 21:26 - */ -@Getter -@Setter -public class AppleLoginBean { - @JSONField(name = "identityToken") - @NotEmpty - private String identityToken; - @JSONField(name = "user") - @NotEmpty - private String user; - @JSONField(name = "devId") - @NotEmpty - private String devId; - @JSONField(name = "authorizationCode") - @NotEmpty - private String authorizationCode; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/MobileLoginInfo.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/MobileLoginInfo.java deleted file mode 100644 index db009ec6c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/MobileLoginInfo.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; - -import javax.validation.constraints.NotEmpty; - -/** - * @Author DuLingLing - * @create 2019/10/18 0018 18:14 - */ -public class MobileLoginInfo { - - public String getVerifyCode() { - return verifyCode; - } - - public void setVerifyCode(String verifyCode) { - this.verifyCode = verifyCode; - } - - @NotEmpty(message = "error.payment.valid.param_missing") - private String verifyCode; - private String devId; - - - public LoginInfo toLoginInfo(String username){ - LoginInfo info = new LoginInfo(); - info.setLoginId(username); -// info.setPassword(password); - info.setVerifyCode(verifyCode); - return info; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RSvcMchBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RSvcMchBean.java deleted file mode 100644 index 94e3bb9f0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RSvcMchBean.java +++ /dev/null @@ -1,105 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class RSvcMchBean { - /** - * 商户账号 - */ - private String merchantNumber; - - /** - * 支付参数:partnerCode - */ - private String partnerCode; - - /** - * 支付参数:CredentialCode - */ - private String credentialCode; - - /** - * 支付Host:payHost - */ - private String payHost; - - /** - * 商户logo地址 - */ - private String logo; - - /** - * 行业编号 - */ - private String industryCode; - - /** - * 行业名称 - */ - private String industryName; - - /** - * 商户名称 - */ - private String merchantName; - /** - * 商户shortname名称 - */ - private String shortName; - /** - * 公司地址 address - */ - private String address; - - /** - * 联系人 contact_person - */ - private String contactPerson; - - /** - * 联系人电话 contact_phone - */ - private String contactPhone; - - /** - * 联系人邮箱 contact_email - */ - private String contactEmail; - - /** - * 银行账户名称 - */ - private String accountName; - - /** - * bsb - */ - private String bsbNumber; - - /** - * 银行账户号码 - */ - private String accountNo; - - /** - * 银行注册地址 - */ - private String registeredAddress; - - /** - * 银行电话 - */ - private String telNumber; - - /** - * abn - */ - private String abn; - - private String acn; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java deleted file mode 100644 index 0160843e3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java +++ /dev/null @@ -1,72 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; -import au.com.royalpay.payment.manage.pushMessage.bean.AppMessageType; -import au.com.royalpay.payment.tools.device.message.AppMessage; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import java.util.Date; - -/** - * Create by davep at 2019-10-23 17:17 - */ -public class RetailAppMessage { - private String title; - private String body; - private JSONObject data; - - public JSONObject forSave(String appid, int clientId) { - JSONObject msg = new JSONObject(); - msg.put("appid", appid); - msg.put("client_id", clientId); - msg.put("role", PartnerRole.ADMIN.getCode()); - msg.put("title", title); - msg.put("body", body); - msg.put("send_time", new Date()); - msg.put("from_ip", RequestEnvironment.getClientIp()); - return msg; - } - - public AppMessage initAppMessage(String msgId) { - JSONObject sendType = new JSONObject(); - sendType.put("send_type", AppMessageType.MESSAGE.name()); - sendType.put("id", msgId); - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", title); - managerMsg.put("body", body); - managerMsg.put("type", sendType); - managerMsg.put("data", data == null ? new JSONObject() : data); - managerMsg.put("msgType", AppMessageType.MESSAGE.name()); - return new AppManagerMessageBuilder(managerMsg).buildMessage(); - } - - public String getTitle() { - return title; - } - - public RetailAppMessage setTitle(String title) { - this.title = StringUtils.substring(title, 0, 50); - return this; - } - - public String getBody() { - return body; - } - - public RetailAppMessage setBody(String body) { - this.body = StringUtils.substring(body, 0, 500); - return this; - } - - public JSONObject getData() { - return data; - } - - public RetailAppMessage setData(JSONObject data) { - this.data = data; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailLoginInfo.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailLoginInfo.java deleted file mode 100644 index d833cde07..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailLoginInfo.java +++ /dev/null @@ -1,83 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.beans; - -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-12-14. - */ -public class RetailLoginInfo { - @NotEmpty(message = "error.payment.valid.param_missing") - private String loginId; - @NotEmpty(message = "error.payment.valid.param_missing") - private String password; - @NotEmpty(message = "error.payment.valid.param_missing") - private String verifyCode; - @NotEmpty(message = "error.payment.valid.param_missing") - private String captchaKey; - private String devId; - - public LoginInfo toLoginInfo(){ - LoginInfo info = new LoginInfo(); - info.setLoginId(loginId); - info.setPassword(password); - info.setVerifyCode(verifyCode); - return info; - } - - public String getPasswordHashed(String salt) { - return PasswordUtils.hashPwd(password, salt); - } - - public String getLoginId() { - return loginId.toLowerCase(); - } - - public void setLoginId(String loginId) { - this.loginId = loginId; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getVerifyCode() { - return verifyCode; - } - - public void setVerifyCode(String verifyCode) { - this.verifyCode = verifyCode; - } - - public String getCaptchaKey() { - return captchaKey; - } - - public void setCaptchaKey(String captchaKey) { - this.captchaKey = captchaKey; - } - - public String getDevId() { - return devId; - } - - public void setDevId(String devId) { - this.devId = devId; - } - - @Override - public String toString() { - return "RetailLoginInfo{" + - "loginId='" + loginId + '\'' + - ", password='" + password + '\'' + - ", verifyCode='" + verifyCode + '\'' + - ", captchaKey='" + captchaKey + '\'' + - ", devId='" + devId + '\'' + - '}'; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java deleted file mode 100644 index dbc27dfa4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ /dev/null @@ -1,87 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.core; - -import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; -import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -public interface ManageAppService { - - void updateDevToken(JSONObject device, String devToken); - - void updateDevTokenStatus(String devId, int status); - - JSONObject getDevTokenByDevId(String dev_id); - - void sign_out(JSONObject device); - - void changeAccountPassword(JSONObject device, ChangePwdBean change, String manager_id); - - List getReferrerList(JSONObject device); - - JSONObject registerClient(JSONObject device, ClientRegisterInfo registery); - - void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info); - - void disableClientRegisterInfo(JSONObject device, String clientMoniker); - - JSONObject listPartners(JSONObject device, AppMerchantBean query); - - JSONObject clientDetail(JSONObject device, String clientMoniker); - - JSONObject clientBankAccount(JSONObject device, String clientMoniker); - - void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount); - - void newConfigRate(JSONObject device, String clientMoniker, JSONObject config); - - void commitToGreenChannel(JSONObject device, String clientMoniker); - - void commitToDoAgreeFile(JSONObject device, String clientMoniker); - - void commitToCompliance(JSONObject device, String clientMoniker); - - JSONObject getAuthFiles(JSONObject device, String clientMoniker); - - void uploadAuthFiles(JSONObject device, String clientMoniker, ClientAuthFilesInfo filesInfo); - - Map> getRates(JSONObject device, String clientMoniker); - - JSONObject getConfigRates(JSONObject device); - - JSONObject getNewVersion(JSONObject device); - - JSONObject getCommons(JSONObject device); - - List getOrgPrizeList(JSONObject device); - - JSONObject getBdConfigKpi(JSONObject device); - - List getBdPrizeList(JSONObject device); - - JSONObject getPrizeRulesUrl(JSONObject device); - - JSONObject listProduct(JSONObject device, ProductBean productBean); - - void saveProduct(JSONObject device, ProductBean productBean); - - void updateProduct(JSONObject device, ProductBean productBean); - - void deleteProduct(JSONObject device, String commodity_id); - - void bindAccountEmail(JSONObject device,JSONObject email); - - void updateAccountEmail(JSONObject device,JSONObject codekey); - - void bindAccountPhone(JSONObject device,JSONObject phone); - - void updateAccountPhone(JSONObject device,JSONObject codekey); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java deleted file mode 100644 index 56a2fe3af..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ /dev/null @@ -1,263 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.core; - -import au.com.royalpay.payment.manage.appclient.beans.*; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo; -import au.com.royalpay.payment.manage.notice.beans.NoticeInfo; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - - -/** - * Created by yishuqian on 28/03/2017. - */ -public interface RetailAppService { - JSONObject getTransactionCommonData(JSONObject device, AppQueryBean appQueryBean); - - List getTransactionCommonWeekData(JSONObject device, AppQueryBean appQueryBean); - - JSONObject getClientSettlementLog(JSONObject device, AppQueryBean appQueryBean); - - JSONObject getTransactionLogsByClearingDetailId(JSONObject device, int clearingDetailId, String timezone); - - List getCustomersAndOrdersInDays(JSONObject device, AppQueryBean appQueryBean); - - JSONObject listOrders(JSONObject device, AppQueryBean query); - - JSONObject listOrdersNew(JSONObject device, AppQueryBean query); - - JSONObject listOrdersShareCode(JSONObject device, AppQueryBean query); - - void updateDevToken(JSONObject device, String devToken); - - void updateDevTokenStatus(String devId, int status); - - void signOut(JSONObject device); - - void sendOrderAppMessage(JSONObject order, int clientId); - - void sendRefundAppMessage(String refundAmount, JSONObject order); - - void sendNoticeMessage(NoticeInfo notice, String[] clientMonikers); - - void sendCashbackMessage(String cashback, JSONObject order); - - void sendCleanMessage(JSONObject logClearingDetail, int clientId); - - void sendTransactionDailyMessage(JSONObject tradeInfo, int clientId); - - void sendRServicesApplyMessage(JSONObject applyInfo, JSONObject client); - - void updateReadStatus(JSONObject device, String noticeId); - - JSONObject getDevTokenByDevId(String devId); - - JSONObject listNotices(JSONObject device, JSONObject params); - - JSONObject getNoticeDetailById(JSONObject device, String noticeId); - - List getLatestNotice(JSONObject device, int clientId); - - void changeAccountPassword(JSONObject device, ChangePwdBean change, String accountId); - - JSONObject bankAccountInfo(JSONObject device); - - JSONObject getClientCurrentRate(JSONObject device); - - JSONObject getClientCurrentRateNew(JSONObject device); - - JSONObject getClientCurrentRateNewByMoniker(JSONObject device, String clientMoniker); - - JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device, String appClientIds); - - JSONObject getActivities(JSONObject device, String activityPage, int page, int limit); - - JSONObject getActivityDetail(JSONObject device, String articleId); - - JSONObject getNewVersion(JSONObject device); - - List listSubClients(JSONObject device); - - JSONObject getTradeCommonDate(JSONObject device, AppQueryBean appQueryBean); - - void updateClient(JSONObject device, AppClientBean appClientBean); - - void updateClientByMoniker(JSONObject device, String clientMoniker, AppClientBean appClientBean); - - JSONObject getClientInfo(JSONObject device); - - JSONObject getClientInfoByMoniker(JSONObject device, String clientMoniker); - - JSONObject getClientInfoRealtime(JSONObject device); - - JSONObject getQRCodePaySurChargeByMoniker(JSONObject device, String clientMoniker); - - JSONObject getClientInfoMe(JSONObject device); - - JSONObject updateRetailConfig(JSONObject device, boolean paySurcharge); - - JSONObject setRequireRemarkConfig(JSONObject device, boolean enabled); - - JSONObject setRequireCustInfoConfig(JSONObject device, boolean enabled); - - JSONObject userInfo(JSONObject device); - - JSONObject getCashbackCommData(JSONObject device, AppQueryBean appQueryBean); - - JSONObject getCashbackRecords(JSONObject device, AppQueryBean appQueryBean); - - JSONObject getCashbackDrawLogs(JSONObject device, AppQueryBean appQueryBean); - - void drawDeposits(JSONObject device, BigDecimal drawAmount, String clientId); - - JSONObject getCashbackCleanInfo(JSONObject device, String clientId); - - void sendMassageByCode(JSONObject params); - - JSONObject checkT1Client(JSONObject device); - - JSONObject getCoupons(JSONObject device, int page, int limit); - - JSONObject getCouponById(JSONObject device, String couponLogId); - - void useCoupon(JSONObject device, String couponLogId); - - JSONObject getAd(); - - JSONObject getAdDetail(String articleId); - - JSONObject getCheckClientInfo(JSONObject device); - - void changeManualSettle(JSONObject device, boolean manualSettle); - - JSONObject getTradeCommonDateNew(JSONObject device, AppQueryBean appQueryBean); - - JSONObject getQrcode(JSONObject device, QRCodeConfig config, int clientId); - - void changeSurchargeEnable(JSONObject device, AppPaymentConfigBean appPaymentConfigBean); - - void changePaymentConfigByMoniker(JSONObject device, String clientMoniker, AppPaymentConfigBean appPaymentConfigBean); - - JSONObject getInvoiceData(JSONObject device, AppQueryBean appQueryBean) throws Exception; - - void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception; - - Map channelAndDayOfAnalysis(int clientId, String clearingDetailId, String channel, JSONObject device); - - JSONObject getAuthFiles(JSONObject device); - - JSONObject getAuthFilesByMoniker(JSONObject device, String clientMoniker); - - void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo); - - void updateMerchantInfo(JSONObject device, ClientUpdateInfo clientUpdateInfo); - - void applyToCompliance(JSONObject device); - - JSONObject sendVerifyEmail(JSONObject device); - - JSONObject openimCheck(JSONObject device); - - void addUnreadMsg(JSONObject device, JSONObject param); - - JSONObject getRefunds(JSONObject device, AppQueryBean appQueryBean); - - JSONObject ctripCheck(JSONObject device); - - JSONObject ctripCouponInfo(JSONObject device, String couponId); - - JSONObject getCouponCusCouponLog(String clientMoniker, AppQueryBean appQueryBean); - - void saveCouponAccuessLog(int clientId, String couponId, String remark); - - JSONObject getStyle(); - - void cancelCouponAccuessLog(String accuessId, String remark); - - void submitMaterial(JSONObject material, JSONObject device); - - void bindAccountEmail(JSONObject device, JSONObject email); - - void updateAccountEmail(JSONObject device, JSONObject codekey); - - void sendBindAccountPhone(JSONObject device,JSONObject phone); - - void sendUnbindAccountPhone(JSONObject device); - - JSONObject updateAccountPhone(JSONObject device,JSONObject codekey); - - void updateLoginClientAccountPhone(JSONObject account,String contactPhone, String nationCode); - - void updateLoginClientAccountOpenId(JSONObject client,JSONObject params); - - void updateLoginClientAccountAppleId(JSONObject client,JSONObject params); - /** - * 退款密码 - */ - void verifyRefundPassword(JSONObject device, JSONObject json); - - /** - * 退款密码 - */ - void resetRefundPassword(JSONObject device, JSONObject json); - - JSONObject toggleCBBankChannel(JSONObject device, String noticeId); - - JSONObject toggleCBBankCustomerSurcharge(JSONObject device, boolean customerSurcharge); - - JSONObject getClientAuthFileStatus(JSONObject device); - - JSONObject getClientAuthFileStatusAggregate(JSONObject device); - - JSONObject getKycFiles(JSONObject device); - - void getCBBankAggregateFile(JSONObject device, HttpServletResponse httpResponse); - - JSONObject getSourceAggregateFile(JSONObject device); - - JSONObject getClientAggregateFile(JSONObject device, MultipartFile file, String ua) throws IOException; - - List uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo filesInfo); - - List uploadKycAuthFiles(JSONObject device, ClientKycFilesInfo filesInfo); - - void uploadKycAuthFilesForApp(JSONObject device, JSONObject filesInfo,String fileType); - - void deleteGreenChannelAuthFiles(JSONObject device, String filesInfo); - - void commitAuthFilesToCompliance(JSONObject device, JSONObject photoInfo); - - void commitAuthFilesToKyc(JSONObject device,JSONObject params); - - JSONObject getClientSubManage(JSONObject device); - - JSONObject getCustomerInfo(JSONObject device); - - boolean isSubPartner(JSONObject device, String clientMoniker); - - JSONObject unbindAccountPhone(JSONObject device, JSONObject params); - - JSONObject unbindAccountWechat(JSONObject device); - - JSONObject bindAccountWechat(JSONObject device, JSONObject params); - - JSONObject unbindAccountApple(JSONObject device); - - JSONObject bindAccountApple(JSONObject device, AppleLoginBean appleLoginBean); - - JSONObject getAccountBindInfos(JSONObject device); - - JSONObject postAppMessage(JSONObject device, RetailAppMessage message); - - void submitEmailCertificate(JSONObject material, JSONObject device); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailRSvcService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailRSvcService.java deleted file mode 100644 index 1cf057525..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailRSvcService.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.core; - -import com.alibaba.fastjson.JSONObject; - -public interface RetailRSvcService { - /** - * App通过service code获取用户信息 - * - * @param device - * @param sourceCode - * @return - */ - JSONObject findMchInfoBySourceCode(JSONObject device, String sourceCode, boolean debug); - - JSONObject enterIntoServiceBySourceCode(String sourceCode, JSONObject params); - - JSONObject setUpShopBySourceCode(String sourceCode, JSONObject params); - - JSONObject appNotifyBySourceCode(String sourceCode, JSONObject params); - - JSONObject getGeekSsoTokenInfo(String sourceCode, String clientMoniker); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java deleted file mode 100644 index b971de222..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ /dev/null @@ -1,560 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.core.impls; - -import au.com.royalpay.payment.core.exceptions.EmailException; -import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; -import au.com.royalpay.payment.manage.appclient.core.ManageAppService; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeRecordMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import au.com.royalpay.payment.manage.product.core.ClientProduct; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.support.sms.SmsSender; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import au.com.royalpay.payment.tools.device.ManageDeviceSupport; -import au.com.royalpay.payment.tools.device.support.DeviceRegister; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.Duration; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -@Service -public class ManageAppServiceImp implements ManageAppService { - private final Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private ManageDeviceSupport manageDeviceSupport; - @Resource - private OrgMapper orgMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - @Resource - private SignInAccountService signInAccountService; - @Resource - private ManageDeviceTokenMapper manageDeviceTokenMapper; - @Resource - private FinancialBDPrizeRecordMapper financialBDPrizeRecordMapper; - @Resource - private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; - @Resource - private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; - @Resource - private FinancialBDConfigMapper financialBDConfigMapper; - @Resource - private ClientProduct clientProduct; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private MailService mailService; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private SmsSender smsSender; - private final String BIND_MANAGE_EMAIL_PREFIX = "BIND_MANAGE_EMAIL"; - private final String BIND_MANAGE_PHONE_PREFIX = "BIND_MANAGE_PHONE"; - - - @Override - public void updateDevToken(JSONObject device, String devToken) { - manageDeviceSupport.updateDeviceMessageToken(device, devToken); - } - - @Override - public void sign_out(JSONObject device) { - String clientType = device.getString("client_type"); - DeviceRegister register = manageDeviceSupport.findRegister(clientType); - register.manageSignout(device); - } - - @Override - public void changeAccountPassword(JSONObject device, ChangePwdBean change, String manager_id) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - // JSONObject client = signInAccountService.getClient(account_id); - if (!manager_id.equals(device.getString("manager_id"))) { - throw new ForbiddenException("You have no permission"); - } - signInAccountService.changeManagerPassword(device, change); - updateDevTokenStatus(device.getString("dev_id"), 0); - } - - @Override - public List getReferrerList(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - return orgMapper.listOrgs(1, new PageBounds()); - } - - @Override - public JSONObject registerClient(JSONObject device, ClientRegisterInfo registery) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return clientManager.registerClient(null, registery, manager); - } - - @Override - public void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - if (StringUtils.isNotBlank(info.getClient_pay_type()) && StringUtils.isNotBlank(info.getClient_pay_desc())) { - info.setClient_pay_type(""); - info.setClient_pay_desc(""); - } - clientManager.updateClientRegisterInfo(manager, clientMoniker, info); - } - - @Override - public void disableClientRegisterInfo(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.disableClient(clientMoniker, manager); - } - - @Override - public JSONObject listPartners(JSONObject device, AppMerchantBean query) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - switch (query.getStatus()) { - case 0: - query.setIs_valid(true); - break; - case 1: - query.setPass(true); - break; - case 2: - query.setApproving(true); - break; - case 3: - query.setBd_upload_and_completed(true); - break; - case 4: - break; - case 5: - query.setApply_to_back(true); - break; - case 6: - query.setGreenChannel(true); - break; - case 7: - query.setQuickPass(true); - break; - } - query.setOnlyMe(true); - return clientManager.listClientsByApp(manager, query); - } - - @Override - public JSONObject clientDetail(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return clientManager.clientDetail(manager, clientMoniker); - } - - @Override - public JSONObject clientBankAccount(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return clientManager.listClientBankAccounts(manager, clientMoniker); - } - - @Override - public void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.saveBankAccount(manager, clientMoniker, bankAccount); - } - - @Override - public Map> getRates(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - List rates = clientManager.clientRates(clientMoniker, true); - return rates.stream().collect(Collectors.groupingBy(e -> e.getString("rate_name"), HashMap::new, Collectors.toList())); - } - - @Override - public JSONObject getConfigRates(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - return clientManager.getSysRateConfig(); - } - - @Override - public void newConfigRate(JSONObject device, String clientMoniker, JSONObject config) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.newConfigRate(manager, clientMoniker, config); - } - - @Override - public void commitToGreenChannel(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.commitToGreenChannel(clientMoniker, manager); - } - - @Override - public void commitToDoAgreeFile(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.commitToDoAgreeFile(clientMoniker, manager); - } - - @Override - public void commitToCompliance(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.commitToCompliance(clientMoniker, manager); - } - - @Override - public JSONObject getAuthFiles(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return clientManager.getAuthFiles(manager, clientMoniker); - } - - @Override - public void uploadAuthFiles(JSONObject device, String clientMoniker, ClientAuthFilesInfo filesInfo) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientManager.uploadAuthFiles(manager, clientMoniker, filesInfo); - } - - @Override - public void updateDevTokenStatus(String devId, int status) { - JSONObject devTokenObj = getDevTokenByDevId(devId); - if (devTokenObj != null) { - devTokenObj.put("is_valid", status); - manageDeviceTokenMapper.update(devTokenObj); - } - } - - @Override - @Cacheable(value = ":manage_dev_message_token:", key = "#dev_id") - public JSONObject getDevTokenByDevId(String dev_id) { - return manageDeviceTokenMapper.findByDevId(dev_id); - } - - @Override - public JSONObject getNewVersion(JSONObject device) { - String version = device.getString("version"); - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - String newAppVersion = PlatformEnvironment.getEnv().getNewVersion(clientType); - Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType); - String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType); - int update_type = 0;// 0:不更新 1:更新 2:强制更新 - String[] oldVersion = version.split("\\."); - String[] newVersion = newAppVersion.split("\\."); - JSONObject res = new JSONObject(); - res.put("update_content", updateContent); - for (int i = 0; i < newVersion.length; i++) { - if (Integer.valueOf(newVersion[i]) > Integer.valueOf(oldVersion[i])) { - update_type = 1; - if (isUpdate) { - update_type = 2; - } - res.put("update_type", update_type); - return res; - } else if (Integer.valueOf(newVersion[i]) < Integer.valueOf(oldVersion[i])) { - res.put("update_type", update_type); - return res; - } - } - res.put("update_type", update_type); - return res; - } - - @Override - public JSONObject getCommons(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - JSONObject countBdClients = clientMapper.countBdApproveClients(manager.getString("manager_id")); - - if (countBdClients == null) { - countBdClients = new JSONObject(); - countBdClients.put("approving", 0); - countBdClients.put("pass", 0); - countBdClients.put("this_months_pass", 0); - } - JSONObject result; - - switch (manager.getIntValue("org_id")) { - case 1: - result = bdCommons(manager); - break; - default: - result = orgCommons(manager); - break; - } - result.putAll(countBdClients); - return result; - } - - private JSONObject bdCommons(JSONObject manager) { - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(new Date()); - monthCal.set(Calendar.MONTH, (monthCal.get(Calendar.MONTH) - 1)); - Date date = monthCal.getTime(); - JSONObject totalDetail = new JSONObject(); - totalDetail.put("date", DateFormatUtils.format(date, "yyyy-MM")); - totalDetail.put("total_amount", BigDecimal.ZERO); - totalDetail.put("total_prize", BigDecimal.ZERO); - totalDetail.put("total_donation", BigDecimal.ZERO); - totalDetail.put("send_prize", BigDecimal.ZERO); - totalDetail.put("hold_prize", BigDecimal.ZERO); - totalDetail.put("last_punish", BigDecimal.ZERO); - - JSONObject report = financialBDPrizeRecordMapper.getReport(DateFormatUtils.format(date, "yyyy-MM")); - if (report != null) { - JSONObject currentBDDetail = financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), manager.getString("manager_id")); - if (currentBDDetail != null) { - totalDetail.putAll(currentBDDetail); - } - } - return totalDetail; - } - - private JSONObject orgCommons(JSONObject manager) { - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(new Date()); - monthCal.set(Calendar.MONTH, (monthCal.get(Calendar.MONTH) - 1)); - JSONObject total = financialPartnerCommissionMapper.findTotalByOrg(monthCal.get(Calendar.YEAR), monthCal.get(Calendar.MONTH) + 1, manager.getString("org_id")); - if (total == null) { - total = new JSONObject(); - total.put("total_amount", BigDecimal.ZERO); - total.put("total_prize", BigDecimal.ZERO); - } - total.put("date", DateFormatUtils.format(monthCal.getTime(), "yyyy-MM")); - return total; - } - - @Override - public List getOrgPrizeList(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - List orgPrizeList = financialPartnerCommissionMapper.getOrgPrizeList(manager.getString("org_id")); - for (JSONObject params : orgPrizeList) { - params.put("data", financialPartnerCommissionMapper.find(params.getIntValue("year"), params.getIntValue("month"), manager.getString("org_id"))); - } - return orgPrizeList; - } - - @Override - public JSONObject getBdConfigKpi(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return financialBDConfigMapper.getBDConfigById(manager.getString("manager_id")); - } - - @Override - public List getBdPrizeList(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - List listBdPrizeLogByOne = financialBDPrizeLogMapper.listBdPrizeLogByOne(manager.getString("manager_id")); - for (JSONObject log : listBdPrizeLogByOne) { - log.put("data", financialBDPrizeLogMapper.findReportByOne(log.getString("record_id"), manager.getString("manager_id"))); - } - return listBdPrizeLogByOne; - } - - @Override - public JSONObject getPrizeRulesUrl(JSONObject device) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - JSONObject result = new JSONObject(); - if (manager.getIntValue("org_id") == 1) { - result.put("url", PlatformEnvironment.getEnv().concatUrl("/app/rules/bd")); - } else { - result.put("url", PlatformEnvironment.getEnv().concatUrl("/app/rules/org")); - } - return result; - } - - @Override - public JSONObject listProduct(JSONObject device, ProductBean productBean) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return clientProduct.listAllProduct(manager, productBean); - } - - @Override - public void saveProduct(JSONObject device, ProductBean productBean) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientProduct.saveProduct(manager, productBean); - } - - @Override - public void updateProduct(JSONObject device, ProductBean productBean) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientProduct.updateProduct(manager, productBean); - } - - @Override - public void deleteProduct(JSONObject device, String commodity_id) { - String clientType = device.getString("client_type"); - manageDeviceSupport.findRegister(clientType); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - clientProduct.deleteProduct(manager, commodity_id); - } - - @Override - public void bindAccountEmail(JSONObject device, JSONObject email) { - String codeKey = device.getString("manager_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateManageEmailKey(codeKey)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your email or try again in 5 minutes."); - } - String codeKeyValue = RandomStringUtils.random(6, false, true); - logger.debug("send sms code : {} ", codeKeyValue); - Context ctx = new Context(); - JSONObject manager = managerMapper.findById(device.getString("manager_id")); - ctx.setVariable("account", manager); - ctx.setVariable("captcha", codeKeyValue); - final String content = thymeleaf.process("mail/account_bind_email.html", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - mailService.sendEmail("Your account is in the process of binding a mailbox", email.getString("contact_email"), - "", content); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - }); - stringRedisTemplate.boundValueOps(getUpdateManageEmailKey(codeKey)).set(codeKeyValue + "&" + email.getString("contact_email"), 5, TimeUnit.MINUTES); - } - - @Override - public void updateAccountEmail(JSONObject device, JSONObject params) { - String key = stringRedisTemplate.boundValueOps(getUpdateManageEmailKey(device.getString("manager_id"))).get(); - if (key == null) { - throw new BadRequestException("Captcha has expired"); - } - String captcha = key.split("&")[0]; - String email = key.split("&")[1]; - if (!StringUtils.equals(captcha, params.getString("captcha"))) { - throw new BadRequestException("Verification code is wrong"); - } - JSONObject account = new JSONObject(); - account.put("manager_id", device.getString("manager_id")); - account.put("email", email); - managerMapper.update(account); - deleteManageEmailKey(device.getString("manager_id")); - } - - @Override - public void bindAccountPhone(JSONObject device, JSONObject phone) { - String codeKey = device.getString("manager_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateManagePhoneKey(codeKey)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 5 minutes."); - } - String codeKeyValue = RandomStringUtils.random(6, false, true); - logger.debug("send sms code : {} ", codeKeyValue); - String nationCode = phone.getString("nation_code"); - String phoneNumber = phone.getString("contact_phone"); - try { - smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("Binding mobile number", codeKeyValue, 5)); - } catch (Exception e) { - e.printStackTrace(); - throw new ServerErrorException("Phone number is wrong.Please try again."); - } - stringRedisTemplate.boundValueOps(getUpdateManagePhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Duration.ofMinutes(5)); - } - - @Override - public void updateAccountPhone(JSONObject device, JSONObject params) { - String key = stringRedisTemplate.boundValueOps(getUpdateManagePhoneKey(device.getString("manager_id"))).get(); - if (key == null) { - throw new BadRequestException("Captcha has expired"); - } - String captcha = key.split("&")[0]; - String nation_code = key.split("&")[1]; - String contact_phone = key.split("&")[2]; - if (!StringUtils.equals(captcha, params.getString("captcha"))) { - throw new BadRequestException("Verification code is wrong"); - } - JSONObject account = new JSONObject(); - account.put("manager_id", device.getString("manager_id")); - account.put("contact_phone", contact_phone); - account.put("nation_code", "+" + nation_code); - managerMapper.update(account); - deleteManagePhoneKey(device.getString("manager_id")); - } - - private void deleteManageEmailKey(String codeKey) { - stringRedisTemplate.delete(getUpdateManageEmailKey(codeKey)); - } - - private void deleteManagePhoneKey(String codeKey) { - stringRedisTemplate.delete(getUpdateManagePhoneKey(codeKey)); - } - - private String getUpdateManageEmailKey(String codeKey) { - return BIND_MANAGE_EMAIL_PREFIX + codeKey; - } - - private String getUpdateManagePhoneKey(String codeKey) { - return BIND_MANAGE_PHONE_PREFIX + codeKey; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java deleted file mode 100644 index a5adc3359..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ /dev/null @@ -1,3193 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.core.impls; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.exceptions.EmailException; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; -import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.appclient.beans.*; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.appclient.extend.GatewayOAuthRegister; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.customers.core.CouponValidateService; -import au.com.royalpay.payment.manage.device.core.DeviceManager; -import au.com.royalpay.payment.manage.fund.core.impls.XPlanFundConfigServiceImpl; -import au.com.royalpay.payment.manage.kyc.core.KycService; -import au.com.royalpay.payment.manage.kyc.enums.FilesAuthStatusEnum; -import au.com.royalpay.payment.manage.kyc.enums.FilesAuthTypeEnum; -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.mappers.client.AuthAppMessageMapper; -import au.com.royalpay.payment.manage.mappers.log.*; -import au.com.royalpay.payment.manage.mappers.notice.ActPartnerReadMapper; -import au.com.royalpay.payment.manage.mappers.notice.NoticePartnerMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; -import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify; -import au.com.royalpay.payment.manage.notice.beans.NoticeInfo; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.notice.core.NoticeManage; -import au.com.royalpay.payment.manage.notice.core.NoticePartner; -import au.com.royalpay.payment.manage.openim.core.CustomerServiceService; -import au.com.royalpay.payment.manage.pushMessage.APNSMessageHelper; -import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; -import au.com.royalpay.payment.manage.pushMessage.bean.AppMessageType; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.signin.core.impls.SignInAccountServiceImpl; -import au.com.royalpay.payment.manage.support.sms.SmsSender; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.manage.tradelog.refund.RefundService; -import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.connections.mpsupport.MpClientAppWechatApiProvider; -import au.com.royalpay.payment.tools.device.DeviceSupport; -import au.com.royalpay.payment.tools.device.message.AppMessage; -import au.com.royalpay.payment.tools.device.message.AppMsgSender; -import au.com.royalpay.payment.tools.device.support.DeviceRegister; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import au.com.royalpay.payment.tools.utils.*; -import au.com.royalpay.payment.tools.utils.apple.AppleAuthUtils; -import au.com.royalpay.payment.tools.utils.apple.UserClaim; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.RandomUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.context.MessageSource; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.springframework.web.multipart.MultipartFile; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.Duration; -import java.util.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -/** - * Created by yishuqian on 28/03/2017. - */ -@Service -public class RetailAppServiceImp implements RetailAppService { - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - @Resource - private TransactionMapper transactionMapper; - @Resource - private ClientManager clientManager; - @Resource - private NoticeManage noticeManage; - @Resource - private NoticePartner noticePartner; - @Resource - private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; - @Resource - private ClearingDetailMapper clearingDetailMapper; - @Resource - private OrderMapper orderMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private AppMessageLogMapper appMessageLogMapper; - @Resource - private SignInAccountService signInAccountService; - @Resource - private CashbackService cashbackService; - @Resource - private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper; - @Resource - private ClientSettleDelayConfMapper clientSettleDelayConfMapper; - @Resource - private XPlanFundConfigServiceImpl xPlanFundConfigService; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private RoyalPayCMSSupport royalPayCMSSupport; - @Resource - private PaymentApi paymentApi; - @Resource - private DeviceSupport deviceSupport; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - @Resource - private CustomerMapper customerMapper; - @Resource - private APNSMessageHelper apnsMessageHelper; - @Resource - private ClientDeviceTokenMapper clientDeviceTokenMapper; - @Resource - private NoticePartnerMapper noticePartnerMapper; - @Resource - private TradeLogService tradeLogService; - @Resource - private AppActService appActService; - @Resource - private LogSettleMailMapper logSettleMailMapper; - @Resource - private CleanService cleanService; - @Resource - private ClientConfigService clientConfigService; - @Resource - private ClientMapper clientMapper; - @Resource - private RefundService refundService; - @Resource - private ClientModifySupport clientModifySupport; - @Resource - private ClearingLogMapper clearingLogMapper; - @Resource - private CustomerServiceService customerServiceService; - @Resource - private CouponAccuessLogMapper couponAccuessLogMapper; - @Resource - private CouponValidateService couponValidateService; - @Resource - private RiskProcessLogService riskProcessLogService; - @Resource - private RiskBusinessService riskBusinessService; - @Resource - private RiskUploadService riskUploadService; - @Resource - private MailService mailService; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private AttachmentClient attachmentClient; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private SysClientLegalPersonMapper sysClientLegalPersonMapper; - @Resource - private AuthAppMessageMapper authAppMessageMapper; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private MpClientAppWechatApiProvider mpClientAppWechatApiProvider; - @Resource - private KycService kycService; - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource - private MessageSource messageSource; - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private RetailAppService retailAppService; - @Resource - private ActPartnerReadMapper actPartnerReadMapper; - @Resource - private DeviceManager deviceManager; - private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf"; -// private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2020/04/08/1586313342533_41vI3w9R8OHrhAVYWvdv7S2IyQra4z.pdf"; - private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2021/09/07/1630997571126_fqWcLQ5Rx0wFm8pVwpKuI1gjf6FmwX.pdf"; - - @Resource - private SmsSender smsSender; - private final String BIND_ACCOUNT_EMAIL_PREFIX = "BIND_ACCOUNT_EMAIL"; - private final String BIND_ACCOUNT_PHONE_PREFIX = "BIND_ACCOUNT_PHONE"; - private final String UNBIND_ACCOUNT_PHONE_PREFIX = "UHBIND_ACCOUNT_PHONE"; - private Map senderMap = new HashMap<>(); - - private final String fileName[] = {"client_bank_file", "client_id_file", "client_company_file"}; - - @Resource - public void setAppMsgSenders(AppMsgSender[] senders) { - Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender)); - } - - private ThreadPoolExecutor sendingAppleMsgPool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - @Resource - private CouponValidateService couponVerificationService; - - // 若app未传client_ids,检测是否包含子商户,若包含查询全部 - private void setAllClientIds(JSONObject params, int clientId) { - if (params.containsKey("client_ids")) { - return; - } - JSONArray clientIds = clientManager.getAllClientIds(clientId); - if (clientIds.size() > 1) { - String[] arr = new String[clientIds.size()]; - params.put("client_ids", clientIds.toArray(arr)); - } - } - - @Override - public JSONObject getTransactionCommonData(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - JSONObject res = transactionAnalysisMapper.getClientTransaction(params); - // res.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params)); - // res.put("trade_count", transactionAnalysisMapper.analysisTotalCount(params)); - // res.put("refund_amount", transactionAnalysisMapper.analysisRefundAmount(params)); - res.put("not_settled", transactionAnalysisMapper.analysisNotSettled(params)); - res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params)); - // 微信小程序不查询汇率 - if (!StringUtils.equals(device.getString("client_type"), "wxapp")) { - res.put("rate", paymentApi.channelApi("Wechat").queryExchangeRateDecimal(clientId)); - res.put("alipay_rate", paymentApi.channelApi("Alipay").queryExchangeRateDecimal(clientId)); - } - params.put("channel", "system"); - res.put("sys_not_settled", transactionAnalysisMapper.analysisNotSettled(params)); - params.put("channel", "rpaypmt_card"); - res.put("rpaypmt_card_not_settled", transactionAnalysisMapper.analysisNotSettled(params)); - params.put("channel", "rpaypmt_dd"); - res.put("rpaypmt_dd_not_settled",transactionAnalysisMapper.analysisNotSettled(params)); - return res; - } - - @Override - public List getTransactionCommonWeekData(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int client_id = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(client_id); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, client_id); - params.put("client_id", client_id); - List res = transactionAnalysisMapper.getWeekClientTransaction(params); - res.forEach(r -> r.put("date", r.getDate("date").toString())); - res.remove(res.size() - 1); - return res; - } - - @Override - public JSONObject getTradeCommonDate(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - JSONObject res = transactionAnalysisMapper.getClientTransaction(params); - // res.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params)); - // res.put("trade_count", transactionAnalysisMapper.analysisTotalCount(params)); - res.put("not_settled", transactionAnalysisMapper.analysisNotSettled(params)); - return res; - } - - @Override - public JSONObject getTradeCommonDateNew(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - return transactionMapper.analysisTransFlow(params); - } - - @Override - public JSONObject getQrcode(JSONObject device, QRCodeConfig config, int clientId) { - JSONObject client = merchantInfoProvider.getClientInfo(clientId); - String url = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/payment/partners/" + client.getString("client_moniker")); - if (config.isCNY()) { - url += "_CNY"; - } - url += config.extension(); - JSONObject res = new JSONObject(); - res.put("url", url); - res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false)); - // res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, - // config,clientAccountMapper.findById(device.getString("account_id")),"APP")); - res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config)); - return res; - } - - @Override - public void changeSurchargeEnable(JSONObject device, AppPaymentConfigBean appPaymentConfigBean) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - if (appPaymentConfigBean.getApiSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "api_surcharge", appPaymentConfigBean.getApiSurcharge())); - } - if (appPaymentConfigBean.getQrcodeSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "qrcode_surcharge", appPaymentConfigBean.getQrcodeSurcharge())); - } - if (appPaymentConfigBean.getRetailSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", appPaymentConfigBean.getRetailSurcharge())); - } - - if (appPaymentConfigBean.getRequireRemark() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", appPaymentConfigBean.getRequireRemark())); - } - - if (appPaymentConfigBean.getRequireCustinfo() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "require_custinfo", appPaymentConfigBean.getRequireCustinfo())); - } - } - - @Override - public void changePaymentConfigByMoniker(JSONObject device, String clientMoniker, AppPaymentConfigBean appPaymentConfigBean) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - boolean isSubPartner = isSubPartner(device, clientMoniker); - if (!isSubPartner) { - throw new ForbiddenException("You have no permission"); - } - if (appPaymentConfigBean.getApiSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, clientMoniker, "api_surcharge", appPaymentConfigBean.getApiSurcharge())); - } - if (appPaymentConfigBean.getQrcodeSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, clientMoniker, "qrcode_surcharge", appPaymentConfigBean.getQrcodeSurcharge())); - } - if (appPaymentConfigBean.getRetailSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, clientMoniker, "retail_surcharge", appPaymentConfigBean.getRetailSurcharge())); - } - - if (appPaymentConfigBean.getRequireRemark() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, clientMoniker, "require_remark", appPaymentConfigBean.getRequireRemark())); - } - - if (appPaymentConfigBean.getRequireCustinfo() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, clientMoniker, "require_custinfo", appPaymentConfigBean.getRequireCustinfo())); - } - } - - @Override - public JSONObject getInvoiceData(JSONObject device, AppQueryBean appQueryBean) throws Exception { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - appQueryBean.setTimezone(timezone); - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - clientManager.validateClients(clientId, params); - params.put("client_id", clientId); - JSONObject analysis = transactionMapper.analysisTransFlow(params); - BigDecimal totalSurcharge = analysis.getBigDecimal("total_surcharge").add(analysis.getBigDecimal("tax_amount")); - analysis.put("total_surcharge", totalSurcharge); - return analysis; - } - - @Override - public void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - TradeLogQuery tradeLogQuery = new TradeLogQuery(); - tradeLogQuery.setDatefrom(appQueryBean.getBegin()); - tradeLogQuery.setDateto(appQueryBean.getEnd()); - tradeLogQuery.setClearing_status(appQueryBean.getClearing_status()); - if (appQueryBean.getApp_client_ids() == null) { - appQueryBean.setApp_client_ids(String.valueOf(clientId)); - } - tradeLogQuery.setClient_ids(appQueryBean.getApp_client_ids().split(",")); - JSONObject client = clientManager.getClientInfo(Integer.parseInt(tradeLogQuery.getClient_ids()[0])); - if (client == null) { - throw new NotFoundException("Client Not Exists"); - } - device.put("client_moniker", client.getString("client_moniker")); - device.put("client", client); - tradeLogService.exportTransFlow(tradeLogQuery, device, httpResponse); - } - - @Override - public Map channelAndDayOfAnalysis(int clientId, String clearingDetailId, String channel, JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - return cleanService.channelAndDayOfAnalysis(clientId, clearingDetailId, channel, device.getJSONObject("client")); - } - - @Override - public JSONObject getAuthFiles(JSONObject device) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - return clientManager.getAuthFiles(account, client.getString("client_moniker")); - } - - @Override - public JSONObject getAuthFilesByMoniker(JSONObject device, String clientMoniker) { - if (!isSubPartner(device, clientMoniker)) { - throw new ForbiddenException("You have no permission"); - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - return clientManager.getAllAuthFiles(null, clientMoniker); - } - - @Override - public void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientAuthFilesInfo.setAuthStatus(0); - clientAuthFilesInfo.setFile_agreement_info(null); - clientAuthFilesInfo.setFile_apply_info(null); - clientManager.uploadAuthFiles(account, client.getString("client_moniker"), clientAuthFilesInfo); - } - - @Override - public void updateMerchantInfo(JSONObject device, ClientUpdateInfo clientRegisterInfo) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4) { - JSONObject record = clientRegisterInfo.appClientInfo(); - record.put("client_moniker", client.getString("client_moniker")); - clientManager.updateClientRegisterInfoV2(null, client.getString("client_moniker"), record); - } else { - throw new BadRequestException("已通过审核,暂不能提交和修改"); - } - } - - @Override - public void applyToCompliance(JSONObject device) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (client == null) { - throw new NotFoundException("Merchant Not Found"); - } - if (account == null) { - throw new NotFoundException("Account Not Found"); - } - clientManager.applyToCompliance(client.getString("client_moniker"), account, null); - - } - - @Override - public JSONObject sendVerifyEmail(JSONObject device) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (client == null) { - throw new NotFoundException("Merchant Not Found"); - } - if (account == null) { - throw new NotFoundException("Account Not Found"); - } - clientManager.sendVerifyEmail(client, account.getString("account_id")); - JSONObject result = new JSONObject(); - result.put("email", client.getString("contact_email")); - return result; - } - - @Override - public JSONObject openimCheck(JSONObject device) { - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - return customerServiceService.checkAndSavePartner(account); - } - - // 暂不使用 - @Override - public void addUnreadMsg(JSONObject device, JSONObject param) { - customerServiceService.addUnreadMsg(param); - } - - @Override - public JSONObject getRefunds(JSONObject device, AppQueryBean appQueryBean) { - JSONObject appParam = appQueryBean.toParams(); - JSONObject param = new JSONObject(); - if (appParam.get("client_ids") == null) { - param.put("client_id", device.getIntValue("client_id")); - } - param.put("start_time", appParam.getDate("begin")); - param.put("end_time", appParam.getDate("end")); - return refundService.listUnionAllApply(param, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit())); - } - - @Override - public JSONObject ctripCheck(JSONObject deivce) { - return couponVerificationService.ctripCheck(deivce.getIntValue("client_id")); - } - - @Override - public JSONObject ctripCouponInfo(JSONObject device, String couponId) { - return couponVerificationService.ctripCouponInfo(couponId, device.getIntValue("client_id"), true); - - } - - @Override - public JSONObject getCouponCusCouponLog(String clientMoniker, AppQueryBean appQueryBean) { - String keyword = "CTRIP_"; - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("Partner not exists"); - } - PageList cusCouponLogs = couponAccuessLogMapper.getCouponAccuessLog( - client.getIntValue("client_id"), keyword, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc"))); - HashMap couponMap = new HashMap<>(); - for (JSONObject cusCouponLog : cusCouponLogs) { - cusCouponLog.put("client_moniker", clientMoniker); - if (couponMap.containsKey(cusCouponLog.getString("coupon_id"))) { - cusCouponLog.put("coupon", couponMap.get(cusCouponLog.getString("coupon_id"))); - continue; - } - JSONObject coupon = couponValidateService.ctripCouponInfo(cusCouponLog.getString("coupon_id"), cusCouponLog.getIntValue("client_id"), false); - couponMap.put(cusCouponLog.getString("coupon_id"), coupon); - cusCouponLog.put("coupon", coupon); - } - return PageListUtils.buildPageListResult(cusCouponLogs); - } - - @Override - public void saveCouponAccuessLog(int clientId, String couponId, String remark) { - JSONObject client = clientMapper.findClient(clientId); - if (client == null) { - throw new BadRequestException("Partner not exists"); - } - JSONObject couponAccuessLog = new JSONObject(); - Date date = new Date(); - couponAccuessLog.put("client_id", clientId); - couponAccuessLog.put("order_id", "NON_PLATFORM_ORDER"); - couponAccuessLog.put("coupon_id", "CTRIP_" + couponId); - couponAccuessLog.put("customer_openid", "NON_PLATFORM_ORDER"); - couponAccuessLog.put("coupon_deal_amount", 0); - couponAccuessLog.put("currency", "AUD"); - couponAccuessLog.put("creation_date", date); - couponAccuessLog.put("last_update_date", date); - couponAccuessLog.put("is_valid", 1); - couponAccuessLog.put("remark", remark); - couponAccuessLogMapper.save(couponAccuessLog); - } - - @Override - public JSONObject getStyle() { - return royalPayCMSSupport.getStyle(); - } - - @Override - public void cancelCouponAccuessLog(String accuessId, String remark) { - JSONObject couponAccuessLog = new JSONObject(); - couponAccuessLog.put("accuess_id", accuessId); - couponAccuessLog.put("is_valid", 0); - couponAccuessLog.put("last_update_date", new Date()); - if (StringUtils.isNotEmpty(remark)) { - couponAccuessLog.put("remark", remark); - } - couponAccuessLogMapper.update(couponAccuessLog); - } - - @Override - public void updateClient(JSONObject device, AppClientBean appClientBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new ForbiddenException("You have no permission"); - } - clientManager.updateAppClient(account, device.getIntValue("client_id"), appClientBean); - } - - @Override - public void updateClientByMoniker(JSONObject device, String clientMoniker, AppClientBean appClientBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new ForbiddenException("You have no permission"); - } - if (!isSubPartner(device, clientMoniker)) { - throw new ForbiddenException("You have no permission"); - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - clientManager.updateAppClient(account, client.getIntValue("client_id"), appClientBean); - } - - @Override - public JSONObject getClientInfo(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject clientWithConfig = clientMapper.findClient(device.getIntValue("client_id")); - clientWithConfig.putAll(clientConfigService.find(device.getIntValue("client_id"))); - JSONObject res = getClientBaseInfo(clientWithConfig); - if (clientType.equals("iphone")) { - res.put("skip_clearing", !res.getBoolean("skip_clearing")); - } - sysClientLegalPersonMapper.findRepresentativeInfo(device.getIntValue("client_id")); - res.put("representative_info", sysClientLegalPersonMapper.findRepresentativeInfo(device.getIntValue("client_id"))); - return res; - } - - @Override - public JSONObject getClientInfoByMoniker(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - if (!isSubPartner(device, clientMoniker)) { - throw new ForbiddenException("You have no permission"); - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - JSONObject res = getClientBaseInfo(client); - if (clientType.equals("iphone")) { - res.put("skip_clearing", !res.getBoolean("skip_clearing")); - } - return res; - } - - @Override - public JSONObject getClientInfoRealtime(JSONObject device) { - JSONObject clientWithConfig = clientManager.getClientInfo(device.getIntValue("client_id")); - clientWithConfig.putAll(clientConfigService.find(device.getIntValue("client_id"))); - JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(device.getIntValue("client_id")); - if (legalInfo != null) { - clientWithConfig.put("representative_person", legalInfo.getString("representative_person")); - clientWithConfig.put("representative_phone", legalInfo.getString("phone")); - clientWithConfig.put("representative_email", legalInfo.getString("email")); - clientWithConfig.put("representative_job_title", legalInfo.getString("job_title")); - clientWithConfig.put("registered_address", legalInfo.getString("address")); - clientWithConfig.put("registered_suburb", legalInfo.getString("suburb")); - clientWithConfig.put("registered_state", legalInfo.getString("state")); - clientWithConfig.put("registered_postcode", legalInfo.getString("postcode")); - } - return clientWithConfig; - } - - @Override - public JSONObject getQRCodePaySurChargeByMoniker(JSONObject device, String clientMoniker) { - if (!isSubPartner(device, clientMoniker)) { - throw new ForbiddenException("You have no permission"); - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - JSONObject result = new JSONObject(); - result.put("qrcode_surcharge", client.getBooleanValue("qrcode_surcharge")); - result.put("retail_surcharge", client.getBooleanValue("retail_surcharge")); - result.put("api_surcharge", client.getBooleanValue("api_surcharge")); - result.put("require_custinfo", client.getBooleanValue("require_custinfo")); - result.put("require_remark", client.getBooleanValue("require_remark")); - return result; - } - - @Override - public JSONObject getClientInfoMe(JSONObject device) { - JSONObject result = new JSONObject(); - result.put("base_info_lack", false); - result.put("legal_info_lack", false); - result.put("compliance_info_lack", false); - JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); - if (StringUtils.isEmpty(client.getString("business_structure")) || StringUtils.isEmpty(client.getString("logo_url")) - || StringUtils.isEmpty(client.getString("description")) - || ("Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("acn"))) - || (!"Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("abn"))) - || (StringUtils.isEmpty(client.getString("company_website")) && StringUtils.isEmpty(client.getString("company_photo")) - && StringUtils.isEmpty(client.getString("store_photo")))) { - result.put("base_info_lack", true); - } - JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(device.getIntValue("client_id")); - if (StringUtils.isEmpty(legalInfo.getString("representative_person")) || StringUtils.isEmpty(legalInfo.getString("job_title")) - || StringUtils.isEmpty(legalInfo.getString("phone")) - || StringUtils.isEmpty(legalInfo.getString("email")) - || StringUtils.isEmpty(legalInfo.getString("address")) - || StringUtils.isEmpty(legalInfo.getString("suburb")) - || StringUtils.isEmpty(legalInfo.getString("state")) - || StringUtils.isEmpty(legalInfo.getString("postcode"))) { - result.put("legal_info_lack", true); - } - JSONObject file = clientManager.getAuthFiles(null, client.getString("client_moniker")); - for (String s : fileName) { - if (file.getString(s) == null) { - result.put("compliance_info_lack", true); - } - } - result.putAll(file); - result.put("approve_result", client.getString("approve_result")); - result.put("mail_confirm", client.getBoolean("mail_confirm")); - return result; - } - - @Override - public JSONObject updateRetailConfig(JSONObject device, boolean clientPaySurcharge) { - JSONObject user = userInfo(device); - clientManager.changeRetailPaySurcharge(user, clientPaySurcharge); - return userInfo(device); - } - - @Override - public JSONObject setRequireRemarkConfig(JSONObject device, boolean enabled) { - JSONObject user = userInfo(device); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientManager.switchPermission(account, user.getString("client_moniker"), "require_remark", enabled); - return userInfo(device); - } - - @Override - public JSONObject setRequireCustInfoConfig(JSONObject device, boolean enabled) { - JSONObject user = userInfo(device); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientManager.switchPermission(account, user.getString("client_moniker"), "require_custinfo", enabled); - return userInfo(device); - } - - @Override - public JSONObject userInfo(JSONObject device) { - String accountId = device.getString("account_id"); - if (accountId != null) { - JSONObject user = signInAccountService.getClient(accountId); - user.put("terminal_id", device.getString("client_dev_id")); - user.put("dev_type", device.getString("client_type")); - user.put("dev_name", device.getString("remark")); - user = JSON.parseObject(user.toJSONString()); - return user; - } else { - JSONObject clientWithConfig = clientManager.getClientInfo(device.getIntValue("client_id")); - clientWithConfig.putAll(clientConfigService.find(device.getIntValue("client_id"))); - clientWithConfig = SignInAccountServiceImpl.clientInfoWithNoSecretInfo(clientWithConfig); - clientWithConfig.put("terminal_id", device.getString("client_dev_id")); - clientWithConfig.put("dev_type", device.getString("client_type")); - clientWithConfig.put("dev_name", device.getString("remark")); - return clientWithConfig; - } - } - - @Override - public JSONObject getClientSettlementLog(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - appQueryBean.setTimezone(TimeZone.getDefault().getID()); - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - PageList logs = clearingDetailMapper.listClientSettlementLog(params, - new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc"))); - logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount")))); - logs.forEach(log -> log.put("padding", log.getBooleanValue("editable"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable"))); - return result; - } - - @Override - public JSONObject getTransactionLogsByClearingDetailId(JSONObject device, int clearingDetailId, String timezone) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezoneClient = client.getString("timezone"); - if (timezoneClient != null && !timezone.isEmpty()) { - timezone = timezoneClient; - } - List transactions = transactionMapper.listTransactionsOfClearingOrder(clearingDetailId, new PageBounds(Order.formString("order_id.asc"))); - if (timezone != null) { - TimeZoneUtils.switchTimeZone(transactions, timezone, "transaction_time"); - } - List channels = clearingDetailAnalysisMapper.listReportChannels(String.valueOf(clearingDetailId)); - JSONObject channelsObj = new JSONObject(); - for (JSONObject channel : channels) { - channel.put("total_charge", channel.getBigDecimal("total_charge").add(channel.getBigDecimal("tax_amount"))); - channelsObj.put(channel.getString("channel"), channel); - } - List credit = new ArrayList<>(); - List debit = new ArrayList<>(); - for (JSONObject transaction : transactions) { - String clearingAmount = transaction.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString(); - transaction.put("clearing_amount", clearingAmount); - if (transaction.getString("transaction_type").equals("Credit")) { - credit.add(transaction); - } else { - debit.add(transaction); - } - } - JSONObject res = new JSONObject(); - res.put("credit", credit); - res.put("debit", debit); - res.put("channels", channelsObj); - return res; - } - - @Override - public List getCustomersAndOrdersInDays(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, device.getIntValue("client_id")); - params.put("client_id", device.getIntValue("client_id")); - return customerAndOrdersStatisticsMapper.getPartnerCustomerAndOrderStatistics(params); - } - - /** - * Retail-inStore - * - * @param device - * @param query - * @return - */ - @Override - public JSONObject listOrders(JSONObject device, AppQueryBean query) { - String clientType = device.getString("client_type"); - DeviceRegister register = deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - query.setTimezone(timezone); - } - JSONObject params = query.toParams(); - setAllClientIds(params, clientId); - if (register.includeDevId()) { - params.put("dev_id", device.getString("dev_id")); - } - params.put("client_id", clientId); - - PageList orders = orderMapper.listOrdersByClients(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - TimeZoneUtils.switchTimeZone(orders, query.getTimezone(), "create_time", "transaction_time", "confirm_time"); - ArrayList dateContains = new ArrayList<>(); - for (JSONObject order : orders) { - // Date tradeDate = order.getDate("confirm_time") == null ? (order.getDate("transaction_time") == null ? - // order.getDate("create_time") : order.getDate("transaction_time")) : order.getDate("confirm_time"); - Calendar calendar = (Calendar) order.get("create_time"); - String tradeDate = DateFormatUtils.format(calendar, "yyyy-MM-dd"); - String tradeTime = DateFormatUtils.format(calendar, "HH:mm:ss"); - order.put("trade_date", tradeDate); - order.put("trade_time", tradeTime); - if (!dateContains.contains(tradeDate)) { - String reDate = tradeDate.replace("-", ""); - TradeLogQuery dateQuery = new TradeLogQuery(); - dateQuery.setDatefrom(reDate); - dateQuery.setDateto(reDate); - // date_query.setStatus(OrderStatus.ALL); - if (params.containsKey("client_ids")) { - dateQuery.setClient_ids((String[]) params.get("client_ids")); - } - JSONObject dateParams = dateQuery.toParams(query.getTimezone()); - dateParams.put("client_id", device.getIntValue("client_id")); - JSONObject analysis = orderMapper.analysisOrders(dateParams); - order.put("date_total", analysis); - dateContains.add(tradeDate); - } - } - return PageListUtils.buildPageListResult(orders); - } - - @Override - public JSONObject listOrdersNew(JSONObject device, AppQueryBean query) { - String clientType = device.getString("client_type"); - DeviceRegister register = deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - query.setTimezone(timezone); - } - JSONObject params = query.toParams(); - setAllClientIds(params, clientId); - if (register.includeDevId()) { - params.put("dev_id", device.getString("dev_id")); - } - params.put("client_id", clientId); - params.put("after_limit", (query.getPage() - 1) * query.getLimit()); - params.put("limit", query.getLimit()); - List orders = orderMapper.listTransactionsForApp(params); - TimeZoneUtils.switchTimeZone(orders, query.getTimezone(), "create_time", "transaction_time", "confirm_time"); - ArrayList dateContains = new ArrayList<>(); - for (JSONObject order : orders) { - order.put("geek_apply_deduction", order.getBooleanValue("geek_apply_deduction")); - Calendar calendar = (Calendar) order.get("transaction_time"); - String tradeDate=null; - String tradeTime=null; - if (calendar!=null&&timezone != null) { - calendar.setTimeZone(TimeZone.getTimeZone(timezone)); - tradeDate = DateFormatUtils.format(calendar, "yyyy-MM-dd", calendar.getTimeZone()); - tradeTime = DateFormatUtils.format(calendar, "HH:mm:ss", calendar.getTimeZone()); - } - order.put("trade_date", tradeDate); - order.put("trade_time", tradeTime); - // todo - if ("Debit".equals(order.getString("transaction_type"))) { - order.put("currency", "AUD"); - } - if ("CNY".equals(order.getString("currency"))) { - order.put("clearing_amount", order.getBigDecimal("total_amount")); - } - if("ApsInStore".equalsIgnoreCase(order.getString("channel"))){ - order.put("channel", "Alipay+"); - } - if("ApsCashier".equalsIgnoreCase(order.getString("channel"))){ - order.put("channel", "Alipay+(Online)"); - } - if (!dateContains.contains(tradeDate)) { - String reDate = tradeDate.replace("-", ""); - AppQueryBean dateQuery = new AppQueryBean(); - dateQuery.setBegin(reDate); - dateQuery.setEnd(reDate); - if (timezone != null && !timezone.isEmpty()) { - dateQuery.setTimezone(timezone); - } - // date_query.setStatus(OrderStatus.ALL); - if (params.containsKey("client_ids")) { - dateQuery.setClient_ids((String[]) params.get("client_ids")); - } - JSONObject dateParams = dateQuery.toParams(); - dateParams.put("begin", dateParams.getDate("from")); - dateParams.put("end", dateParams.getDate("to")); - dateParams.put("client_id", device.getIntValue("client_id")); - JSONObject analysis = transactionAnalysisMapper.getClientTransaction(dateParams); - order.put("date_total", analysis); - dateContains.add(tradeDate); - } - String customerId = order.getString("customer_id"); - if (StringUtils.isEmpty(customerId)) { - continue; - } - switch (order.getString("channel")) { - case "Alipay": - JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customerId); - if (alipayUser != null) { - order.put("nickname", alipayUser.getString("nickname")); - order.put("headimg", alipayUser.getString("headimg")); - } - break; - case "Wechat": - JSONObject weUser; - if (customerId.startsWith("olH")) { - weUser = customerMapper.findCustomerGlobalpayByOpenId(customerId); - } else { - weUser = customerMapper.findCustomerByOpenId(customerId); - } - if (weUser != null && !weUser.isEmpty()) { - order.put("nickname", weUser.getString("nickname")); - order.put("headimg", weUser.getString("headimg")); - } - break; - default: - break; - } - } - JSONObject result = new JSONObject(); - result.put("data", orders); - return result; - } - - @Override - public JSONObject listOrdersShareCode(JSONObject device, AppQueryBean query) { - query.setGateway_app("11"); - String clientType = device.getString("client_type"); - DeviceRegister register = deviceSupport.findRegister(clientType); - Assert.notNull(register, "Device is not registered"); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - query.setTimezone(timezone); - } - JSONObject params = query.toParams(); - setAllClientIds(params, clientId); - if (register.includeDevId()) { - params.put("dev_id", device.getString("dev_id")); - } - params.put("client_id", clientId); - PageList orders = orderMapper.listOrdersByClients(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - TimeZoneUtils.switchTimeZone(orders, query.getTimezone(), "create_time", "transaction_time", "confirm_time"); - for (JSONObject order : orders) { - Calendar calendar = (Calendar) order.get("create_time"); - String tradeDate = DateFormatUtils.format(calendar, "yyyy-MM-dd"); - String tradeTime = DateFormatUtils.format(calendar, "HH:mm:ss"); - order.put("trade_date", tradeDate); - order.put("trade_time", tradeTime); - String customerId = order.getString("customer_id"); - if (StringUtils.isEmpty(customerId)) { - continue; - } - switch (order.getString("channel")) { - case "Alipay": - JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customerId); - order.put("nickname", alipayUser.getString("nickname")); - order.put("headimg", alipayUser.getString("headimg")); - break; - case "Wechat": - JSONObject weUser = customerMapper.findCustomerByOpenId(customerId); - order.put("nickname", weUser.getString("nickname")); - order.put("headimg", weUser.getString("headimg")); - break; - default: - break; - - } - } - return PageListUtils.buildPageListResult(orders); - } - - @Override - public void updateDevToken(JSONObject device, String devToken) { - deviceSupport.updateDeviceMessageToken(device, devToken); - } - - @Override - public void updateDevTokenStatus(String devId, int status) { - JSONObject devTokenObj = getDevTokenByDevId(devId); - if (devTokenObj != null) { - devTokenObj.put("is_valid", status); - clientDeviceTokenMapper.update(devTokenObj); - } - } - - @Override - public void signOut(JSONObject device) { - String clientType = device.getString("client_type"); - DeviceRegister register = deviceSupport.findRegister(clientType); - register.signout(device); - deviceManager.deviceOffline(device.getString("account_id")); - } - - @Override - public void sendOrderAppMessage(final JSONObject order, int clientId) { - logger.debug("sendOrderAppMessage-{}-{}", clientId, order.getString("order_id")); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(clientId); - for (final JSONObject devToken : tokens) { - Runnable task = () -> { - String token = devToken.getString("token"); - if (token == null) { - return; - } - logger.info("Device Token:{}", token); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "payment", token, - order.getString("order_id")); - try { - order.put("send_type", "payment"); - JSONObject type = new JSONObject(); - type.put("send_type", "payment"); - type.put("id", order.getString("order_id")); - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.payment")); - managerMsg.put("body", - LocaleSupport.localeMessage("app.message.body.payment") + order.getString("currency") + order.getDoubleValue("total_amount")); - managerMsg.put("type", type); - managerMsg.put("data", order); - managerMsg.put("msgType", "payment"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage(), e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e); - } - }; - sendingAppleMsgPool.execute(task); - } - - } - - @Override - public void sendRefundAppMessage(String refundAmount, JSONObject order) { - logger.debug("sendRefundAppMessage-{}-{}", order.getIntValue("client_id"), order.getString("order_id")); - int clientId = order.getIntValue("client_id"); - refundMessage(refundAmount, order, clientId); - JSONObject client = clientManager.getClientInfo(clientId); - if (client.getInteger("parent_client_id") != null) { - int parentClientId = client.getIntValue("parent_client_id"); - refundMessage(refundAmount, order, parentClientId); - } - - } - - private void refundMessage(final String refundAmount, final JSONObject order, int clientId) { - List tokens = clientDeviceTokenMapper.listTokensByClient_id(clientId); - if (!tokens.isEmpty()) { - for (final JSONObject devToken : tokens) { - sendingAppleMsgPool.execute(() -> { - String token = devToken.getString("token"); - if (token == null) { - return; - } - logger.info("Device Token:{}", token); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "refund", token, - order.getString("order_id")); - try { - order.put("send_type", "refund"); - JSONObject type = new JSONObject(); - type.put("send_type", "refund"); - type.put("id", order.getString("order_id")); - - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", "Refund Message"); - managerMsg.put("body", LocaleSupport.localeMessage("app.message.body.refund") + refundAmount); - managerMsg.put("type", type); - managerMsg.put("data", order); - managerMsg.put("msgType", "refund"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage(), e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - } - }); - } - } - } - - @Override - public void sendNoticeMessage(final NoticeInfo notice, final String[] clientMonikers) { - for (String clientMoniker : clientMonikers) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - continue; - } - sendingAppleMsgPool.execute(() -> { - List tokens = clientDeviceTokenMapper.listAllTokensByClient_id(client.getIntValue("client_id")); - if (!tokens.isEmpty()) { - for (JSONObject devToken : tokens) { - String token = devToken.getString("token"); - if (token == null) { - continue; - } - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "notice", token, - "notice_id:" + notice.getNotice_id()); - try { - notice.setContent(null); - JSONObject noticeObj = notice.toJson(); - noticeObj.put("send_type", "notice"); - JSONObject type = new JSONObject(); - type.put("send_type", "notice"); - type.put("id", notice.getNotice_id()); - - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.notice")); - managerMsg.put("body", notice.getTitle()); - managerMsg.put("type", type); - managerMsg.put("data", noticeObj); - managerMsg.put("msgType", "notice"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:", e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - } - } - } - }); - } - } - - @Override - public void sendCashbackMessage(final String cashbackAmount, final JSONObject order) { - logger.debug("sendCashbackMessage-{}-{}", cashbackAmount, order.getString("order_id")); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(order.getIntValue("client_id")); - for (final JSONObject devToken : tokens) { - sendingAppleMsgPool.execute(() -> { - String token = devToken.getString("token"); - if (token == null) { - return; - } - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "cashback", token, - order.getString("order_id") + "返现" + cashbackAmount); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "cashback"); - type.put("id", order.getString("order_id")); - - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.notice")); - managerMsg.put("body", LocaleSupport.localeMessage("app.message.body.cashback") + PlatformEnvironment.getEnv().getForeignCurrency() - + " " + cashbackAmount); - managerMsg.put("type", type); - managerMsg.put("data", order); - managerMsg.put("msgType", "cashback"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:", e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e); - } - }); - - } - } - - @Override - public void sendCleanMessage(JSONObject logClearingDetail, int clientId) { - String clearingAmount = logClearingDetail.getBigDecimal("clearing_amount").setScale(2, RoundingMode.HALF_DOWN).toString(); - String settleDateFrom = DateFormatUtils.format(logClearingDetail.getDate("settle_date_from"), "MM/dd/yyyy"); - String settleDateTo = DateFormatUtils.format(logClearingDetail.getDate("settle_date_to"), "MM/dd/yyyy"); - logger.debug("sendCleanMessage-{}-{} {}({}}-{}})", - logClearingDetail.getString("client_moniker"), - PlatformEnvironment.getEnv().getForeignCurrency(), - clearingAmount, - settleDateFrom, - settleDateTo); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(clientId); - for (JSONObject devToken : tokens) { - String token = devToken.getString("token"); - if (token == null) { - continue; - } - String logClearingDetailId = logClearingDetail.getString("clear_detail_id"); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "clean", token, - "本次清算" + logClearingDetailId + ",$" + clearingAmount + "(" + settleDateFrom + "-" + settleDateTo + ")"); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "clean"); - type.put("id", logClearingDetailId); - - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.clean")); - managerMsg.put("body", LocaleSupport.localeMessage("app.message.body.clean") + PlatformEnvironment.getEnv().getForeignCurrency() + " " - + clearingAmount + " (" + settleDateFrom + "-" + settleDateTo + ")"); - managerMsg.put("type", type); - managerMsg.put("data", logClearingDetail); - managerMsg.put("msgType", "clean"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:", e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e); - } - } - } - - @Override - public void sendTransactionDailyMessage(JSONObject tradeInfo, int clientId) { - String tradeDate = tradeInfo.getString("trade_date"); - String totalAmount = tradeInfo.getString("total"); - String totalOrders = tradeInfo.getString("orders"); - String customers = tradeInfo.getString("customers"); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(clientId); - for (JSONObject devToken : tokens) { - String token = devToken.getString("token"); - if (token == null) { - continue; - } - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "daily_notice", token, - "Trade Date:" + tradeDate); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "daily_notice"); - type.put("id", tradeDate); - apnsMessageHelper.sendAppleMessageDetail( - LocaleSupport.localeMessage("app.message.title.daily_notice"), tradeDate + ": 总交易额 " - + PlatformEnvironment.getEnv().getForeignCurrency() + totalAmount + ", 订单数:" + totalOrders + ", 付款人数:" + customers, - token, tradeInfo, type); - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.daily_notice")); - managerMsg.put("body", tradeDate + ": 总交易额 " + PlatformEnvironment.getEnv().getForeignCurrency() + totalAmount + ", 订单数:" + totalOrders - + ", 付款人数:" + customers); - managerMsg.put("type", type); - managerMsg.put("data", tradeInfo); - managerMsg.put("msgType", "daily_notice"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:", e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e); - } - } - } - - @Override - public void sendRServicesApplyMessage(JSONObject applyInfo, JSONObject client) { - String amount = applyInfo.getBigDecimal("amount").setScale(2, RoundingMode.HALF_DOWN).toString(); - String title = applyInfo.getString("title"); - String remark = title + "已扣款成功!" + ",$" + amount + ".感谢您的使用,如有疑问或需帮助,请拨打我们的客服电话:1300 107 750或添加RoyalPay官方客服号:royalpay_1详询."; - String operatorTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"); - logger.debug("sendRServicesMessage-{}-{} {}({}}-{}})", - client.getString("client_moniker"), - PlatformEnvironment.getEnv().getForeignCurrency(), - amount, - title, - operatorTime); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id")); - for (JSONObject devToken : tokens) { - String token = devToken.getString("token"); - if (token == null) { - continue; - } - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "notice", token, remark); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "notice"); - type.put("id", applyInfo.getString("apply_id")); - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.notice")); - managerMsg.put("body", LocaleSupport.localeMessage("app.message.rservices.body", title, amount)); - managerMsg.put("type", type); - managerMsg.put("data", type); - managerMsg.put("msgType", "notice"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:", e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e); - } - } - } - - @Override - public void updateReadStatus(JSONObject device, String noticeId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - try { - noticePartner.updateReadStatus(device, noticeId); - } catch (Exception e) { - logger.error(e.getMessage()); - } - } - - @Override - @Cacheable(value = ":dev_message_token:", key = "#devId") - public JSONObject getDevTokenByDevId(String devId) { - return clientDeviceTokenMapper.findByDevId(devId); - } - - @Override - public JSONObject listNotices(JSONObject device, JSONObject params) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - params.put("is_to_app", 1); - JSONObject res = noticePartner.listNotices(device, params); - List data = res.getJSONArray("data").toJavaList(JSONObject.class); - for (JSONObject notice : data) { - notice.remove("content"); - } - return res; - - } - - @Override - public JSONObject getNoticeDetailById(JSONObject device, String noticeId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject res = noticeManage.getNoticeById(noticeId); - res.remove("status"); - Document doc = Jsoup.parse(res.getString("content")); - String father = "
    "; - String html = doc.body().children().wrap(father).html(); - logger.debug("wrapped html---->{}", html); - if (res.getIntValue("type") == 2) { - List buttons = JSON.parseArray(res.getString("buttons"), JSONObject.class); - res.put("buttons", buttons); - } else { - res.put("content", doc.html()); - } - return res; - } - - @Override - public List getLatestNotice(JSONObject device, int clientId) { - JSONObject clientConfig = clientConfigService.find(clientId); - JSONObject notice = new JSONObject(); - JSONObject latestNotice = noticeManage.getLatestWindowNotice(clientId); - if (latestNotice != null) { - latestNotice.put("id", latestNotice.getString("notice_id")); - latestNotice.remove("notice_id"); - notice.put("data", latestNotice); - } - JSONObject unReadParams = new JSONObject(); - unReadParams.put("client_id", clientId); - unReadParams.put("status", 0); - unReadParams.put("is_to_app", 1); - unReadParams.put("type", 1); - int counts = noticePartnerMapper.countNoticePartner(unReadParams); - notice.put("unReadCounts", counts); - notice.put("type", "notice"); - List result = new ArrayList<>(); - result.add(notice); - - JSONObject confirmNotice = new JSONObject(); - JSONObject latestConfirmNotice = noticeManage.getLatestWindowConfirmNotice(clientId); - if (latestConfirmNotice != null) { - latestConfirmNotice.put("id", latestConfirmNotice.getString("notice_id")); - latestConfirmNotice.remove("notice_id"); - List buttons = JSON.parseArray(latestConfirmNotice.getString("buttons"), JSONObject.class); - latestConfirmNotice.put("buttons", buttons); - String content = latestConfirmNotice.getString("content"); - if (content.contains("%excharge_rate%")) { - JSONObject rate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "CB_BankPay"); - if (rate != null) { - content = content.replace("%excharge_rate%", (rate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN).toPlainString() + "%")); - } else { - content = content.replace("%excharge_rate%", "(暂未配置)"); - } - } - if (StringUtils.isNotBlank(latestConfirmNotice.getString("aggregate_file"))) { - JSONObject rate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "CB_BankPay"); - JSONArray rateInfo = new JSONArray(); - if (rate != null) { - String cleanDays = "T+" + rate.getIntValue("clean_days"); - String rateValue = rate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN).toPlainString() + "%"; - String endDate = DateFormatUtils.format(rate.getDate("expiry_date"), "yyyy-MM-dd"); - String[] rateName = {"清算时间", "签约费率", "结束时间"}; - String[] rateKey = {cleanDays, rateValue, endDate}; - for (int i = 0; i < rateName.length; i++) { - JSONObject b = new JSONObject(); - b.put("name", rateName[i]); - b.put("value", rateKey[i]); - b.put("type", "string"); - rateInfo.add(b); - } - if (clientConfig != null) { - JSONObject customerSurcharge = new JSONObject(); - customerSurcharge.put("name", "客户支付手续费"); - customerSurcharge.put("value", String.valueOf(clientConfig.getBooleanValue("cbbank_surcharge"))); - customerSurcharge.put("type", "button"); - customerSurcharge.put("method", "PUT"); - customerSurcharge.put("key", "customerSurcharge"); - customerSurcharge.put("link", PlatformEnvironment.getEnv().concatUrl("api/v1.0/retail/app/cbbank_pay/toggleCustomerSurcharge")); - rateInfo.add(customerSurcharge); - } - - - latestConfirmNotice.put("rate_info", rateInfo); - } - - } - latestConfirmNotice.put("content", content); - confirmNotice.put("data", latestConfirmNotice); - } - unReadParams.put("type", 2); - counts = noticePartnerMapper.countNoticePartner(unReadParams); - confirmNotice.put("unReadCounts", counts); - confirmNotice.put("type", "confirm_notice"); - result.add(confirmNotice); - - JSONObject latestAct = appActService.getAppActPopup(); - if (latestAct != null) { - if (StringUtils.isNotBlank(latestAct.getString("partner_black_list"))) { - JSONObject client = clientManager.getClientInfo(clientId); - String[] blackList = latestAct.getString("partner_black_list").split(","); - if (client == null || Arrays.asList(blackList).contains(client.getString("client_moniker"))) { - return result; - } - } - latestAct.put("id", latestAct.getString("act_id")); - latestAct.put("url", latestAct.getString("act_url")); - latestAct.put("title", latestAct.getString("act_name")); - latestAct.put("img", latestAct.getString("act_img")); - JSONObject act = new JSONObject(); - act.put("data", latestAct); - act.put("type", "popup"); - if (StringUtils.equalsIgnoreCase("跨境商城", latestAct.getString("act_name"))) { - boolean geekPopupShow = clientConfig != null - && !clientConfig.getBooleanValue("geek_shop_status") - && geekShowActVersion(device.getString("version")); - if (!geekPopupShow) { - return result; - } - } - if (accountIsRead(device.getString("account_id"), latestAct)) { - return result; - } - latestAct.remove("act_id"); - latestAct.remove("act_name"); - latestAct.remove("act_url"); - latestAct.remove("display_count"); - result.add(act); - } - return result; - } - - @Override - public void changeAccountPassword(JSONObject device, ChangePwdBean change, String accountId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - // JSONObject client = signInAccountService.getClient(account_id); - if (!accountId.equals(device.getString("account_id"))) { - throw new ForbiddenException("You have no permission"); - } - signInAccountService.changeAccountPassword(device, change); - updateDevTokenStatus(device.getString("dev_id"), 0); - } - - @Override - public JSONObject bankAccountInfo(JSONObject device) { - String clientType = device.getString("client_type"); - DeviceRegister register = deviceSupport.findRegister(clientType); - JSONObject bankInfo = clientManager.getBankAccountByClientId(device.getIntValue("client_id")); - if (register.hideBankDetails()) { - bankInfo.put("account_no", "***" + StringUtils.substring(bankInfo.getString("account_no"), -4)); - } - return bankInfo; - } - - @Override - public JSONObject getClientCurrentRate(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - Date now = new Date(); - JSONObject res = merchantInfoProvider.clientCurrentRate(clientId, now, "Wechat"); - JSONObject client = clientManager.getClientInfo(clientId); - Assert.notNull(client, "Client is null"); - JSONObject clientConfig = clientConfigService.find(clientId); - JSONObject[] channels = new JSONObject[3]; - if (clientConfig.getBigDecimal("customer_surcharge_rate") != null) { - res.put("customer_surcharge_rate", clientConfig.getBigDecimal("customer_surcharge_rate")); - } - - res.put("max_customer_surcharge_rate", PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()); - - channels[0] = getChannel(clientId, now, "Wechat"); - channels[1] = getChannel(clientId, now, "Alipay"); - - res.put("channels", channels); - return res; - } - - @Override - public JSONObject getClientCurrentRateNew(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - return getClientRateByClientId(clientId); - } - - @Override - public JSONObject getClientCurrentRateNewByMoniker(JSONObject device, String clientMoniker) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - if (!isSubPartner(device, clientMoniker)) { - throw new ForbiddenException("You have no permission"); - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - return getClientRateByClientId(client.getIntValue("client_id")); - } - - private JSONObject getChannel(int clientId, Date date, String channel) { - JSONObject perChannel = new JSONObject(); - JSONObject res = null; - try { - res = merchantInfoProvider.clientCurrentRate(clientId, date, channel); - } catch (BadRequestException ignored) { - - } - DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - - if (null != res) { - perChannel.put("channel", res.getString("rate_name")); - perChannel.put("rate", res.getBigDecimal("rate_value")); - perChannel.put("from", format.format(res.getDate("active_date"))); - perChannel.put("to", format.format(res.getDate("expiry_date"))); - } - return perChannel; - } - - @Override - public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device, String appClientIds) { - try { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - if (client == null) { - return null; - } - timezone = client.getString("timezone"); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); - dateFormat.setTimeZone(TimeZone.getTimeZone(client.getString("timezone"))); - Date date = dateFormat.parse(dateStr); - String clientType = device.getString("client_type"); - DeviceRegister register = deviceSupport.findRegister(clientType); - String devId = null; - if (register.includeDevId() || thisDevOnly) { - devId = device.getString("dev_id"); - } - Date to = DateUtils.addDays(date, 1); - String[] paramClientIds = null; - if (StringUtils.isEmpty(appClientIds)) { - JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id")); - if (clientIds.size() > 1) { - paramClientIds = new String[clientIds.size()]; - clientIds.toArray(paramClientIds); - } - } else { - paramClientIds = appClientIds.split(","); - } - List transactions = transactionMapper.listDailyTransactions(date, to, devId, device.getIntValue("client_id"), paramClientIds); - if (transactions.isEmpty()) { - throw new BadRequestException("No Transactions in date " + dateStr + " at " + timezone); - } - TimeZoneUtils.switchTimeZoneToString(transactions, timezone, "HH:mm:ss", Collections.singletonList("transaction_time")); - BigDecimal displayAmount = BigDecimal.ZERO; - BigDecimal cnyDisplayAmount = BigDecimal.ZERO; - for (JSONObject transaction : transactions) { - if (PlatformEnvironment.getEnv().getForeignCurrency().equals(transaction.getString("currency"))) { - if ("Credit".equals(transaction.getString("transaction_type"))) { - displayAmount = displayAmount.add(transaction.getBigDecimal("display_amount")); - } - } else { - if ("Credit".equals(transaction.getString("transaction_type"))) { - cnyDisplayAmount = cnyDisplayAmount.add(transaction.getBigDecimal("display_amount")); - } - } - } - JSONObject res = new JSONObject(); - res.put("transactions", transactions); - - JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"), paramClientIds); - analysis.put("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone)); - analysis.put("display_amount", displayAmount); - analysis.put("cny_display_amount", cnyDisplayAmount); - res.put("analysis", analysis); - return res; - } catch (ParseException e) { - throw new BadRequestException("Invalid Date String"); - } - } - - @Override - public JSONObject getActivities(JSONObject device, String activityPage, int page, int limit) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject res = royalPayCMSSupport.listArticles("app_activity", false, true, page, limit); - if (activityPage.equalsIgnoreCase("home_page")) { - JSONArray acts = res.getJSONArray("data"); - List newActs = new ArrayList<>(); - for (JSONObject act : JSON.parseArray(acts.toJSONString(), JSONObject.class)) { - if (act.getString("page_desc") != null && !act.getString("page_desc").equals("0")) { - if (StringUtils.equalsIgnoreCase(act.getString("page_keywords"), "RYCBSM")) { - if (geekShowActVersion(device.getString("version"))) { - newActs.add(act); - } - } else { - newActs.add(act); - } - } - } - res.put("data", newActs); - } - // 手续费返还活动 - List acts = res.getJSONArray("data").toJavaList(JSONObject.class); - for (JSONObject act : acts) { - if (StringUtils.isNotBlank(act.getString("page_keywords")) && act.getString("page_keywords").equalsIgnoreCase("native")) { - JSONObject clientRate = merchantInfoProvider.clientCurrentRate(device.getIntValue("client_id"), new Date(), "Wechat"); - if (clientRate.getIntValue("clean_days") != 1) { - acts.remove(act); - } - } - } - return res; - } - - @Override - public JSONObject getActivityDetail(JSONObject device, String articleId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject res = royalPayCMSSupport.getArticle("app_activity", articleId); - Document doc = Jsoup.parse(res.getString("content")); - res.put("content", doc.html()); - res.put("publish_time_format", TimeZoneUtils.formatTime(res.getDate("publish_time"), "yyyy-MM-dd HH:mm:ss", "Australia/Melbourne")); - return res; - } - - @Override - public JSONObject getNewVersion(JSONObject device) { - String version = device.getString("version"); - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - String newAppVersion = PlatformEnvironment.getEnv().getNewVersion(clientType); - boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType); - String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType); - int updateType = 0;// 0:不更新 1:更新 2:强制更新 - String[] oldVersion = version.split("\\."); - String[] newVersion = newAppVersion.split("\\."); - JSONObject res = new JSONObject(); - res.put("update_content", updateContent); - for (int i = 0; i < newVersion.length; i++) { - if (Integer.parseInt(newVersion[i]) > Integer.parseInt(oldVersion[i])) { - updateType = 1; - if (isUpdate) { - updateType = 2; - } - res.put("update_type", updateType); - return res; - } else if (Integer.valueOf(newVersion[i]) < Integer.parseInt(oldVersion[i])) { - res.put("update_type", updateType); - return res; - } - } - res.put("update_type", updateType); - return res; - } - - @Override - public List listSubClients(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - return clientManager.listSubClients(device.getIntValue("client_id")); - } - - private JSONObject saveAppMessageLog(String devId, int clientId, String messageType, String devToken, String remark) { - JSONObject log = new JSONObject(); - log.put("dev_id", devId); - log.put("client_id", clientId); - log.put("msg_type", messageType); - log.put("dev_token", devToken); - log.put("remark", remark); - log.put("send_time", new Date()); - appMessageLogMapper.save(log); - return log; - - } - - @Override - public JSONObject getCashbackCommData(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - JSONObject res = cashbackService.getCashbackAmount(params); - JSONObject rate = merchantInfoProvider.clientCurrentRate(device.getIntValue("client_id"), new Date(), "Wechat"); - if (rate.getInteger("clean_days") == null) { - JSONObject clientConfig = clientConfigService.find(device.getIntValue("client_id")); - rate.put("clean_days", clientConfig.getIntValue("clean_days")); - } - res.put("clean_days", rate.getIntValue("clean_days")); - return res; - } - - @Override - public JSONObject getCashbackRecords(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - JSONObject res = cashbackService.getCashbackRecores(params, appQueryBean.getPage(), appQueryBean.getLimit()); - List list = res.getJSONArray("data").toJavaList(JSONObject.class); - TimeZoneUtils.switchTimeZone(list, appQueryBean.getTimezone(), "create_time"); - List dateContains = new ArrayList<>(); - for (JSONObject cashRecord : list) { - Date tradeDate = cashRecord.getDate("create_time"); - String tradeDateStr = DateFormatUtils.format(tradeDate, "yyyy-MM-dd"); - String tradeTimeStr = DateFormatUtils.format(tradeDate, "HH:mm:ss"); - cashRecord.put("trade_date", tradeDateStr); - cashRecord.put("trade_time", tradeTimeStr); - if (!dateContains.contains(tradeDateStr)) { - String reDate = tradeDateStr.replace("-", ""); - AppQueryBean dateQuery = new AppQueryBean(); - dateQuery.setBegin(reDate); - dateQuery.setEnd(reDate); - if (params.containsKey("client_ids")) { - dateQuery.setClient_ids((String[]) params.get("client_ids")); - } - if (timezone != null && !timezone.isEmpty()) { - dateQuery.setTimezone(timezone); - } - JSONObject dateParams = dateQuery.toParams(); - dateParams.put("client_id", device.getIntValue("client_id")); - JSONObject analysis = cashbackService.analysisCashback(dateParams); - cashRecord.put("date_total", analysis); - dateContains.add(tradeDateStr); - } - } - return res; - } - - @Override - public JSONObject getCashbackDrawLogs(JSONObject device, AppQueryBean appQueryBean) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - int clientId = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } - JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, clientId); - params.put("client_id", clientId); - return cashbackService.getDrawDeposits(params, appQueryBean.getPage(), appQueryBean.getLimit()); - - } - - @Override - public void drawDeposits(JSONObject device, BigDecimal drawAmount, String clientId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - JSONObject operator = new JSONObject(); - operator.put("account_id", device.getString("account_id")); - operator.put("display_name", account.getString("display_name")); - JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id")); - if (!clientIds.contains(clientId)) { - throw new ForbiddenException("partner has no permission"); - } - cashbackService.drawDeposits(drawAmount, Integer.parseInt(clientId), operator); - } - - @Override - public JSONObject getCashbackCleanInfo(JSONObject device, String clientId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id")); - if (!clientIds.contains(clientId)) { - throw new ForbiddenException("partner has no permission"); - } - JSONObject res = clientManager.getBankAccountByClientId(Integer.parseInt(clientId)); - JSONObject rate = merchantInfoProvider.clientCurrentRate(Integer.parseInt(clientId), new Date(), "Wechat"); - if (rate.getInteger("clean_days") == null) { - JSONObject clientConfig = clientConfigService.find(Integer.parseInt(clientId)); - rate.put("clean_days", clientConfig.getIntValue("clean_days")); - } - res.put("clean_days", rate.getIntValue("clean_days")); - return res; - } - - @Override - public JSONObject checkT1Client(JSONObject device) { - JSONObject res = new JSONObject(); - res.put("show", false); - JSONObject clientRate = merchantInfoProvider.clientCurrentRate(device.getIntValue("client_id"), new Date(), "Wechat"); - if (clientRate.getIntValue("clean_days") == 1) { - JSONObject config = clientSettleDelayConfMapper.findClientConf(device.getIntValue("client_id")); - if (config == null) { - res.put("interest_rate", xPlanFundConfigService.configuration().getInterestRate().setScale(2, RoundingMode.DOWN)); - } - - } - return res; - } - - @Override - public void sendMassageByCode(final JSONObject params) { - try { - String code = params.getString("code"); - String[] codes = code.split(","); - if (params.getString("type").equals("Merchant")) { - for (String partner_code : codes) { - JSONObject client = clientManager.getClientInfoByMoniker(partner_code); - Assert.notNull(client, "Client is null"); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(client.getInteger("client_id")); - if (!tokens.isEmpty()) { - for (final JSONObject devToken : tokens) { - final String token = devToken.getString("token"); - sendingAppleMsgPool.execute(() -> { - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "dev", token, - "Param:partner_code,自定义推送消息"); - sending(token, params, log); - }); - } - } else { - logger.error("出错了:{}无token", client.getString("short_name")); - throw new ServerErrorException(client.getString("short_name") + "无token"); - } - } - } - if (params.getString("type").equals("Personal")) { - for (final String dev_token : codes) { - sendingAppleMsgPool.execute(() -> { - JSONObject log = saveAppMessageLog("0", 0, "dev", dev_token, "Param:devToken,自定义推送消息"); - sending(dev_token, params, log); - }); - } - } - } catch (ServerErrorException s) { - throw new ServerErrorException(s.getMessage()); - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage(), e); - throw new ServerErrorException("Send App Message Failed", e); - } - - } - - public void sending(String devToken, JSONObject params, JSONObject log) { - try { - JSONObject devTokenJson = new JSONObject(); - devTokenJson.put("token", devToken); - AppMsgSender sender = senderMap.get(params.getString("client_type")); - if (devToken == null || sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", params.getString("title")); - managerMsg.put("body", params.getString("content")); - managerMsg.put("type", new JSONObject()); - managerMsg.put("data", new JSONObject()); - managerMsg.put("msgType", "payment"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devTokenJson); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage(), e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + params.getString("client_type") + " Failed", e); - } - } - - @Override - public JSONObject getCoupons(JSONObject device, int page, int limit) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - - return couponVerificationService.getCoupon(device.getJSONObject("client"), page, limit); - } - - @Override - public JSONObject getCouponById(JSONObject device, String couponLogId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - if (!matchLetterorNum(couponLogId)) { - throw new BadRequestException("非RP优惠券二维码"); - } - return couponVerificationService.getCouponById(device.getJSONObject("client"), couponLogId); - } - - @Override - public void useCoupon(JSONObject device, String couponLogId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - if (!matchLetterorNum(couponLogId)) { - throw new BadRequestException("非RP优惠券二维码"); - } - couponVerificationService.useCoupon(couponLogId); - } - - @Override - public JSONObject getAd() { - JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); - JSONArray acts = res.getJSONArray("data"); - if (!acts.isEmpty()) { - int selectNo = RandomUtils.nextInt(0, acts.size()); - JSONObject getActs = acts.getJSONObject(selectNo); - getActs.put("ad_cover", getActs.getString("page_desc")); - getActs.put("ad_mode", getActs.getString("page_keywords")); - getActs.put("ad_link", getActs.getString("summery")); - getActs.put("publish_date", DateFormatUtils.format(getActs.getDate("publish_time"), "yyyy/MM/dd HH:mm:ss")); - String reference = getActs.getString("reference"); - JSONObject referenceObj = JSON.parseObject(reference); - if (reference != null) { - if (referenceObj.getString("ad_type") != null) { - getActs.put("ad_type", referenceObj.getString("ad_type")); - } - if (referenceObj.getString("expire_date") != null) { - getActs.put("expire_date", referenceObj.getString("expire_date")); - } - if (referenceObj.getString("duration_time") != null) { - getActs.put("duration_time", referenceObj.getString("duration_time")); - } - } else { - getActs.put("message", "mess : (ad_type && expire_date && duration_time) not set"); - } - getActs.remove("reference"); - getActs.remove("page_desc"); - getActs.remove("page_keywords"); - getActs.remove("summery"); - getActs.remove("publish_time"); - return getActs; - } - return null; - - } - - @Override - public JSONObject getAdDetail(String articleId) { - JSONObject res = royalPayCMSSupport.getArticle("app_ad", articleId); - Document doc = Jsoup.parse(res.getString("content")); - String father = "
    "; - String html = doc.body().children().wrap(father).html(); - logger.debug("html:{}", html); - res.put("content", doc.html()); - res.put("publish_time_format", TimeZoneUtils.formatTime(res.getDate("publish_time"), "yyyy-MM-dd HH:mm:ss", "Australia/Melbourne")); - return res; - } - - @Override - public JSONObject getCheckClientInfo(JSONObject device) { - return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"), "App"); - } - - @Override - public void changeManualSettle(JSONObject device, boolean manualSettle) { - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientManager.changeManualSettle(account, device.getIntValue("client_id"), manualSettle, device.getString("account_id"), 1, - "商户" + (manualSettle ? "打开" : "关闭") + "手动清算"); - } - - private static boolean matchLetterorNum(String str) { - String regex = "[A-Za-z0-9]{8}"; - return str.matches(regex); - } - - private String editContractOrdinaryWaring(String[] key, String sourceStr) { - if (StringUtils.isEmpty(sourceStr) || ArrayUtils.isEmpty(key)) { - return ""; - } - for (int i = 0; i < key.length; i++) { - sourceStr = sourceStr.replace("{" + i + "}", key[i]); - } - return sourceStr; - } - - @Override - public void submitMaterial(JSONObject material, JSONObject device) { - riskUploadService.submitMaterial(material); - JSONObject event = riskBusinessService.getRiskEventDetail(material.getString("risk_id")); - //材料审核通过后可以重新提交 - if (event.getIntValue("result_type") == 3) { - return; - } - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (account == null) { - account = new JSONObject(); - } - riskProcessLogService.addRiskProcessLog(material.getString("risk_id"), - account.getString("account_id"), - account.getString("display_name"), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getRemark(), - RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - } - - @Override - public void bindAccountEmail(JSONObject device, JSONObject email) { - String codeKey = device.getString("account_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountEmailKey(codeKey)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your email or try again in 5 minutes."); - } - String codeKeyValue = RandomStringUtils.random(6, false, true); - logger.debug("send sms code : {} ", codeKeyValue); - Context ctx = new Context(); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - ctx.setVariable("account", account); - ctx.setVariable("captcha", codeKeyValue); - final String content = thymeleaf.process("mail/account_bind_email.html", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - mailService.sendEmail("Your account is in the process of binding a mailbox", email.getString("contact_email"), - "", content); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - }); - stringRedisTemplate.boundValueOps(getUpdateAccountEmailKey(codeKey)).set(codeKeyValue + "&" + email.getString("contact_email"), 5, TimeUnit.MINUTES); - } - - @Override - public void updateAccountEmail(JSONObject device, JSONObject params) { - String key = stringRedisTemplate.boundValueOps(getUpdateAccountEmailKey(device.getString("account_id"))).get(); - if (key == null) { - throw new BadRequestException("Captcha has expired"); - } - String captcha = key.split("&")[0]; - String email = key.split("&")[1]; - if (!StringUtils.equals(captcha, params.getString("captcha"))) { - throw new BadRequestException("Verification code is wrong"); - } - JSONObject account = new JSONObject(); - account.put("account_id", device.getString("account_id")); - account.put("contact_email", email); - clientAccountMapper.update(account); - deleteAccountEmailKey(device.getString("account_id")); - } - - @Override - public void sendBindAccountPhone(JSONObject device, JSONObject phone) { - String codeKey = device.getString("account_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes."); - } - String codeKeyValue = RandomStringUtils.random(6, false, true); - logger.debug("send sms code : {} ", codeKeyValue); - String nationCode = phone.getString("nation_code").contains("+") ? phone.getString("nation_code").substring(1) : phone.getString("nation_code"); - String phoneNumber = phone.getString("contact_phone"); - try { - smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("Binding mobile number", codeKeyValue, 1)); - } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new BadRequestException("Phone number is wrong.Please try again."); - } - stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Duration.ofMinutes(1)); - } - - @Override - public void sendUnbindAccountPhone(JSONObject device) { - String codeKey = device.getString("account_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes."); - } - JSONObject client = clientAccountMapper.findById(device.getString("account_id")); - String codeKeyValue = RandomStringUtils.random(6, false, true); - String nationCode = client.getString("nation_code").contains("+") ? client.getString("nation_code").substring(1) : client.getString("nation_code"); - String phoneNumber = client.getString("contact_phone"); - try { - smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("Unbind mobile number", codeKeyValue, 1)); - } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new BadRequestException("Phone number is wrong.Please try again."); - } - stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Duration.ofMinutes(1)); - } - - @Override - public JSONObject updateAccountPhone(JSONObject device, JSONObject params) { - String key = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(device.getString("account_id"))).get(); - if (key == null) { - throw new BadRequestException("Captcha has expired"); - } - String captcha = key.split("&")[0]; - String nationCode = key.split("&")[1]; - String contactPhone = key.split("&")[2]; - - if (!StringUtils.equals(captcha, params.getString("captcha"))) { - throw new BadRequestException("Verification code is wrong"); - } - List account = clientAccountMapper.findByPhone(contactPhone, "+" + nationCode); - if (account != null && !account.isEmpty()) { - throw new BadRequestException("Mobile phone number has been bound to other users, please unbind it before binding"); - } - - JSONObject updateAccount = new JSONObject(); - updateAccount.put("account_id", device.getString("account_id")); - updateAccount.put("contact_phone", contactPhone); - updateAccount.put("nation_code", "+" + nationCode); - clientAccountMapper.update(updateAccount); - deleteAccountPhoneKey(device.getString("account_id")); - JSONObject result = new JSONObject(); - result.put("status", "success"); - return result; - } - - @Override - public void updateLoginClientAccountPhone(JSONObject account, String contactPhone, String nationCode) { - JSONObject updateAccount = new JSONObject(); - updateAccount.put("account_id", account.getString("account_id")); - updateAccount.put("contact_phone", contactPhone); - updateAccount.put("nation_code", "+" + nationCode); - clientAccountMapper.update(updateAccount); - } - - @Override - public void updateLoginClientAccountOpenId(JSONObject account, JSONObject params) { - JSONObject updateAccount = new JSONObject(); - updateAccount.put("account_id", account.getString("account_id")); - updateAccount.put("wechat_openid", params.getString("wechat_openid")); - updateAccount.put("wechat_name", params.getString("nick_name")); - updateAccount.put("wx_unionid", params.getString("union_id")); - clientAccountMapper.update(updateAccount); - } - - @Override - public void updateLoginClientAccountAppleId(JSONObject account, JSONObject params) { - JSONObject updateAccount = new JSONObject(); - updateAccount.put("account_id", account.getString("account_id")); - updateAccount.put("apple_userid", params.getString("apple_userid")); - clientAccountMapper.update(updateAccount); - } - - @Override - public JSONObject unbindAccountPhone(JSONObject device, JSONObject params) { - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(device.getString("account_id"))).get(); - if (codeKeyValueRedis == null) { - throw new BadRequestException("Captcha has expired"); - } - String captcha = codeKeyValueRedis.split("&")[0]; - if (!StringUtils.equals(captcha, params.getString("captcha"))) { - throw new BadRequestException("Verification code is wrong"); - } - JSONObject account = new JSONObject(); - account.put("account_id", device.getString("account_id")); - account.put("contact_phone", null); - account.put("nation_code", null); - clientAccountMapper.update(account); - deleteAccountPhoneKey(device.getString("account_id")); - JSONObject result = new JSONObject(); - result.put("status", "success"); - return result; - } - - @Override - public JSONObject unbindAccountWechat(JSONObject device) { - JSONObject account = new JSONObject(); - account.put("account_id", device.getString("account_id")); - account.put("wechat_openid", null); - account.put("wechat_name", null); - account.put("wx_unionid", null); - clientAccountMapper.update(account); - JSONObject result = new JSONObject(); - result.put("status", "success"); - return result; - } - - @Override - public JSONObject bindAccountWechat(JSONObject device, JSONObject params) { - JSONObject user = mpClientAppWechatApiProvider.getApi("merchant-app").appLoginUser(params.getString("code")); - if (user == null) { - throw new BadRequestException("WeChat users do not exist"); - } - String openId = user.getString("openid"); - JSONObject account = clientAccountMapper.findByOpenId(openId); - if (account != null) { - throw new BadRequestException("WeChat ID has been bound to other accounts, please unbind it before binding"); - } - JSONObject wechatUserInfo = mpClientAppWechatApiProvider.getApi("merchant-app").appUserInfo(openId, user.getString("access_token")); - JSONObject updateAccount = new JSONObject(); - updateAccount.put("account_id", device.getString("account_id")); - updateAccount.put("wechat_openid", openId); - updateAccount.put("wechat_name", wechatUserInfo.getString("nickname")); - updateAccount.put("wx_unionid", wechatUserInfo.getString("unionid")); - clientAccountMapper.update(updateAccount); - JSONObject result = new JSONObject(); - result.put("status", "success"); - return result; - } - - @Override - public JSONObject unbindAccountApple(JSONObject device) { - JSONObject account = new JSONObject(); - account.put("account_id", device.getString("account_id")); - account.put("apple_userid", null); - clientAccountMapper.update(account); - JSONObject result = new JSONObject(); - result.put("status", "success"); - return result; - } - - @Override - public JSONObject bindAccountApple(JSONObject device, AppleLoginBean appleLoginBean) { - UserClaim userClaim = AppleAuthUtils.verifyIdentifyToken(appleLoginBean.getIdentityToken()); - if (!StringUtils.equalsIgnoreCase(userClaim.getSub(), appleLoginBean.getUser())) { - throw new ForbiddenException("apple userinfo is error"); - } - JSONObject account = clientAccountMapper.findByAppleUserId(userClaim.getSub()); - if (account != null) { - throw new BadRequestException("Apple UserID has been bound to other accounts, please unbind it before binding"); - } - JSONObject updateAccount = new JSONObject(); - updateAccount.put("account_id", device.getString("account_id")); - updateAccount.put("apple_userid", userClaim.getSub()); - clientAccountMapper.update(updateAccount); - JSONObject result = new JSONObject(); - result.put("status", "success"); - return result; - } - - @Override - public JSONObject getAccountBindInfos(JSONObject device) { - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - JSONObject result = new JSONObject(); - result.put("phone_bind_status", account.containsKey("contact_phone")); - if (account.containsKey("contact_phone")) { - result.put("contact_phone", account.getString("contact_phone")); - String contact_phone = account.getString("contact_phone").replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"); - result.put("remark_contact_phone", contact_phone); - result.put("nation_code", account.getString("nation_code")); - } - result.put("wechat_bind_status", account.containsKey("wx_unionid")); - result.put("apple_bind_status", account.containsKey("apple_userid")); - if (account.containsKey("wx_unionid")) { - result.put("wechat_name", account.getString("wechat_name")); - } - return result; - } - - @Override - public void verifyRefundPassword(JSONObject device, JSONObject json) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject clientConfig = clientConfigService.find(device.getIntValue("client_id")); - String needVerifyPassword = json.getString("refund_password"); - String refundPwdSalt = clientConfig.getString("refund_pwd_salt"); - if (!StringUtils.equals(clientConfig.getString("refund_pwd"), PasswordUtils.hashPwd(needVerifyPassword, refundPwdSalt))) { - throw new BadRequestException("Incorrect refund password"); - } - } - - @Override - @Transactional - public void resetRefundPassword(JSONObject device, JSONObject json) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new BadRequestException("You have no permission"); - } - verifyRefundPassword(device, json); - String newSalt = PasswordUtils.newSalt(); - String newPassWord = json.getString("new_refund_password"); - if (!StringUtils.isNumeric(newPassWord)) { - throw new BadRequestException("Refund password must be pure number"); - } - String newPwdHash = PasswordUtils.hashPwd(newPassWord, newSalt); - if (StringUtils.equals(newPwdHash, PasswordUtils.hashPwd(json.getString("refund_password"), newSalt))) { - throw new BadRequestException("Old and new passwords cannot be duplicated"); - } - JSONObject update = new JSONObject(); - update.put("client_id", device.getIntValue("client_id")); - update.put("refund_pwd", newPwdHash); - update.put("refund_pwd_salt", newSalt); - clientConfigService.update(update); - } - - @Override - public JSONObject toggleCBBankChannel(JSONObject device, String noticeId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new BadRequestException("You have no permission"); - } - JSONObject result = new JSONObject(); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - try { - clientManager.switchChannelPermission(account, client.getString("client_moniker"), "cb_bankpay", true); - } catch (Exception e) { - result.put("status", "Fail"); - result.put("message", "开通大额支付渠道失败,失败原因:" + e.getMessage()); - return result; - } - updateReadStatus(device, noticeId); - result.put("status", "Success"); - result.put("message", "开通大额支付渠道成功!"); - return result; - } - - @Override - public JSONObject toggleCBBankCustomerSurcharge(JSONObject device, boolean customerSurcharge) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new BadRequestException("You have no permission"); - } - JSONObject result = new JSONObject(); - try { - clientManager.changeCBBankPaySurcharge(account, customerSurcharge); - } catch (Exception e) { - JSONObject clientConfig = clientConfigService.find(device.getIntValue("client_id")); - result.put("status", "Fail"); - if (customerSurcharge) { - result.put("message", "开启客户支付手续费失败,失败原因:" + e.getMessage()); - } else { - result.put("message", "关闭客户支付手续费失败,失败原因:" + e.getMessage()); - - } - result.put("customerSurcharge", String.valueOf(clientConfig.getBooleanValue("cbbank_surcharge"))); - return result; - } - result.put("status", "Success"); - if (customerSurcharge) { - result.put("message", "开启客户支付手续费成功!"); - } else { - result.put("message", "关闭客户支付手续费成功!"); - } - result.put("customerSurcharge", String.valueOf(customerSurcharge)); - return result; - } - - @Override - public void getCBBankAggregateFile(JSONObject device, HttpServletResponse httpResponse) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - client.put("now", DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - String clientName = client.getString("business_name"); - if (StringUtils.isNotBlank(client.getString("acn"))) { - clientName += "(" + client.getString("acn") + ")"; - client.put("client_acn", client.getString("acn")); - } - client.put("client_name", clientName); - client.put("bd_name", client.getString("bd_user_name")); - client.put("client_phone", client.getString("contact_phone")); - client.put("client_email", client.getString("contact_email")); - client.put("client_address", (client.getString("address") + "\n" + client.getString("suburb") + ' ' + client.getString("state") + ' ' + client.getString("postcode"))); - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay"); - if (rate != null) { - client.put("client_rate", (rate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN).toPlainString() + "%")); - int cleanDays = rate.getIntValue("clean_days"); - client.put("clean_days", ("T+" + cleanDays)); - client.put("days", cleanDays); - } - JSONObject bankAccount = clientManager.getBankAccountByClientId(client.getIntValue("client_id")); - if (bankAccount != null) { - client.put("bank_name", bankAccount.getString("bank")); - client.put("bank_country", bankAccount.getString("city")); - client.put("bank_account_number", bankAccount.getString("account_no")); - client.put("bank_account_name", bankAccount.getString("account_name")); - } - exportCBBankAggregateFile(client, httpResponse); - } - - @Override - public JSONObject getClientAuthFileStatus(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - JSONObject authFileStatus = signInAccountService.checkAuthFileStatus(client); - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - authFileStatus.put("client_less_file", false); - } - JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")); - if (compliance != null) { - if (compliance.getIntValue("status") == 0 || compliance.getIntValue("status") == 1) { - authFileStatus.put("client_less_file", false); - } - } - return authFileStatus; - } - - @Override - public JSONObject getClientAuthFileStatusAggregate(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - - JSONObject authFileStatus = new JSONObject(); - authFileStatus.put("title", messageSource.getMessage("client.auth.file.aggregate.title", null, RequestEnvironment.getLocale())); - authFileStatus.put("content", messageSource.getMessage("client.auth.file.title", null, RequestEnvironment.getLocale())); - - List supplement_array = new ArrayList<>(); - JSONObject complianceFilesNotice = complianceFilesNotice(client, account); - JSONObject kycFilesNotice = kycFilesNotice(client, account); - - if (complianceFilesNotice != null && kycFilesNotice != null) { - if (!kycFilesNotice.getBoolean("client_less_file") && !complianceFilesNotice.getBoolean("client_less_file")) { - authFileStatus.put("isNeedShowKycAlert", false); - } else { - authFileStatus.put("isNeedShowKycAlert", true); - } - } - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - return null; - } - if (complianceFilesNotice != null) { - JSONObject complianceStatus = retailAppService.getClientAuthFileStatus(device); - complianceFilesNotice.putAll(complianceStatus); - supplement_array.add(complianceFilesNotice); - } - if (kycFilesNotice != null) { - supplement_array.add(kycFilesNotice); - } - authFileStatus.put("supplement_array", supplement_array); - - //todo debug - authFileStatus.put("isNeedShowKycAlert", false); - if ("PINE".equals(client.getString("client_moniker")) || "LEOH".equals(client.getString("client_moniker"))) { - if (kycFilesNotice.getBoolean("client_less_file") || complianceFilesNotice.getBoolean("client_less_file")) { - authFileStatus.put("isNeedShowKycAlert", true); - } - } - return authFileStatus; - } - - @Override - public JSONObject getKycFiles(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); - - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject file = checkKycFileStatusForApp(client); - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(device.getIntValue("client_id")); - file.put("file_company", compliance); - if (compliance != null) { - file.putAll(compliance); - } - return file; - } - - public JSONObject checkKycFileStatusForApp(JSONObject client) { - JSONObject result = new JSONObject(); - boolean lessKycFiles = true; - JSONObject kycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id")); - if (kycFilesAuth != null) { - lessKycFiles = false; - } - result.put("help_confirm", messageSource.getMessage("client.auth.file.help_confirm", null, RequestEnvironment.getLocale())); - result.put("help_success", messageSource.getMessage("client.auth.file.help_success", null, RequestEnvironment.getLocale())); - result.put("beneficiary_id_title_list", "Ultimate beneficiary owner,CEO,Director,General Manager,Other"); - - result.put("client_less_file", lessKycFiles); - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (lessKycFiles || compliance != null) { - List kycFiles = new ArrayList<>(); - kycFiles = clientFilesMapper.findKycClientFileByClient(client.getIntValue("client_id")); - for (JSONObject file : kycFiles) { - result.put(file.getString("file_name"), file.getString("file_value")); - } - List clientFileUrl = kycFiles.stream() - .filter(json -> ("kyc_utility_bill_file".equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("status", json.getString("status")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (!clientFileUrl.isEmpty()) { - result.put("kyc_utility_bill_file", clientFileUrl); - } - } - return result; - } - - - public JSONObject complianceFilesNotice(JSONObject client, JSONObject account) { - - JSONObject complianceFilesNotice = new JSONObject(); - JSONObject complianceFileStatus = signInAccountService.checkAuthFileStatus(client); - JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")); - - complianceFilesNotice.put("auth_type", FilesAuthTypeEnum.COMPLIANCE.getAuthType()); - complianceFilesNotice.put("type", messageSource.getMessage("client.auth.file.compliance.type", null, RequestEnvironment.getLocale())); - complianceFilesNotice.put("client_less_file", complianceFileStatus.getBoolean("client_less_file")); - if (compliance != null) { - if (compliance.getIntValue("status") == 0 || compliance.getIntValue("status") == 1) { - complianceFilesNotice.put("client_less_file", false); - } - if (complianceFileStatus.getBoolean("client_less_file")) { - complianceFilesNotice.put("client_refuse_reason", compliance.getString("description")); - } - complianceFilesNotice.put("status", compliance.getString("status")); - complianceFilesNotice.put("status_type", FilesAuthStatusEnum.STATUS.getAuthStatus(compliance.getIntValue("status"))); - } else if (!complianceFileStatus.getBoolean("client_less_file")) { - complianceFilesNotice.put("status_type", FilesAuthStatusEnum.STATUS.getAuthStatus(1)); - } else { - complianceFilesNotice.put("status_type", FilesAuthStatusEnum.STATUS.getAuthStatus(-1)); - } - complianceFilesNotice.put("status_type_description", messageSource.getMessage("client.auth.file.status." + complianceFilesNotice.getString("status_type").toLowerCase(), null, RequestEnvironment.getLocale())); - return complianceFilesNotice; - - } - - public JSONObject kycFilesNotice(JSONObject client, JSONObject account) { - JSONObject kycFilesNotice = new JSONObject(); - JSONObject kycFileStatus = signInAccountService.checkKycFileStatusForApp(client, account); - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id")); - - /* if(!kycFileStatus.getBoolean("client_less_file")){ - return null; - }*/ - - kycFilesNotice.put("auth_type", FilesAuthTypeEnum.KYC.getAuthType()); - kycFilesNotice.put("type", messageSource.getMessage("client.auth.file.kyc.type", null, RequestEnvironment.getLocale())); - kycFilesNotice.put("client_less_file", kycFileStatus.getBoolean("client_less_file")); - if (compliance != null) { - if (kycFilesNotice.getBoolean("client_less_file")) { - kycFilesNotice.put("client_refuse_reason", compliance.getString("description")); - } - kycFilesNotice.put("status", compliance.getString("status")); - kycFilesNotice.put("status_type", FilesAuthStatusEnum.STATUS.getAuthStatus(compliance.getIntValue("status"))); - } else { - kycFilesNotice.put("status_type", FilesAuthStatusEnum.STATUS.getAuthStatus(-1)); - } - kycFilesNotice.put("status_type_description", messageSource.getMessage("client.auth.file.status." + kycFilesNotice.getString("status_type").toLowerCase(), null, RequestEnvironment.getLocale())); - return kycFilesNotice; - } - - - @Override - public JSONObject getSourceAggregateFile(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(',')).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(',') + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - client.put("located_country", "Australia"); - if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){ -// clean_1 clean_1_friday clean_1_saturday - // second, third or fourth - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - }else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){ - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - }else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){ - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); - JSONObject sysConfigRate = JSON.parseObject(rateConfig); - - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject cbBankPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay"); - if (cbBankPayRate != null) { - client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - } catch (Exception ignored) { - throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service"); - } - - JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); - if (bankAccount == null || bankAccount.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", bankAccount.getString("bank")); - client.put("bsb_no", bankAccount.getString("bsb_no")); - client.put("account_no", bankAccount.getString("account_no")); - client.put("account_name", bankAccount.getString("account_name")); - String startDateStr = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", startDateStr); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String endDateStr = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", endDateStr); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } - return exportClientAggregateFile(client); - } - - @Override - public JSONObject getClientAggregateFile(JSONObject device, MultipartFile file, String userAgent) throws IOException { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - - if (StringUtils.isBlank(file.getOriginalFilename())) { - throw new BadRequestException("Please Enter Full Name"); - } - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - account.put("signature_ip", RequestEnvironment.getClientIp()); - account.put("user_agent", userAgent); - return clientManager.getClientAggregateFile(account, file); - } - - @Override - public List uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientAuthFilesInfo.setAuthStatus(0); - clientAuthFilesInfo.setFile_agreement_info(null); - clientAuthFilesInfo.setFile_apply_info(null); - return clientManager.uploadAuthFilesForWaitCompliance(account, client.getString("client_moniker"), clientAuthFilesInfo); - } - - @Override - public List uploadKycAuthFiles(JSONObject device, ClientKycFilesInfo clientKycFilesInfo) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientKycFilesInfo.setAuthStatus(0); - return clientManager.uploadKycFilesForWaitCompliance(account, client.getString("client_moniker"), clientKycFilesInfo); - } - - @Override - public void uploadKycAuthFilesForApp(JSONObject device, JSONObject filesInfo, String fileType) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientManager.uploadKycFilesForWaitComplianceForApp(account, client.getString("client_moniker"), filesInfo, fileType); - } - - - @Override - public void deleteGreenChannelAuthFiles(JSONObject device, String fileId) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - clientManager.deleteAuthFiles(fileId); - } - - @Override - public void commitAuthFilesToCompliance(JSONObject device, JSONObject photoInfo) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - account.put("photo_info", photoInfo); - clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account, "App"); - } - - @Override - public void commitAuthFilesToKyc(JSONObject device, JSONObject params) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - account.putAll(params); - kycService.commitAuthKycFilesToCompliance(client.getString("client_moniker"), account, "App"); - } - - @Override - public JSONObject getClientSubManage(JSONObject device) { - JSONObject result = new JSONObject(); - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - result.put("sub_manage", client.getBooleanValue("sub_manage")); - return result; - } - - @Override - public JSONObject getCustomerInfo(JSONObject device) { - JSONObject result = new JSONObject(); - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - result.put("contact_email", client.getString("contact_email")); - result.put("client_id", client.getString("client_id")); - result.put("contact_person", client.getString("contact_person")); - result.put("country", client.getString("country")); - result.put("state", client.getString("state")); - return result; - } - - @Override - public boolean isSubPartner(JSONObject device, String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - if (device.getIntValue("client_id") == client.getIntValue("client_id")) { - return true; - } - JSONObject deviceClient = clientManager.getClientInfo(device.getIntValue("client_id")); - JSONArray listSubClients = clientManager.getAllClientIds(device.getIntValue("client_id")); - return (listSubClients.contains(client.getString("client_id")) && deviceClient.getBooleanValue("sub_manage")); - } - - @Override - public JSONObject postAppMessage(JSONObject device, RetailAppMessage message) { - String clientType = device.getString("client_type"); - if (!GatewayOAuthRegister.CLIENT_TYPE.equals(clientType)) { - throw new ForbiddenException("Invalid Client Type:" + clientType); - } - int clientId = device.getIntValue("client_id"); - String appid = device.getString("appid"); - JSONObject msg = message.forSave(appid, clientId); - authAppMessageMapper.save(msg); - String msgId = msg.getString("message_id"); - List tokens = clientDeviceTokenMapper.listTokensByAccountId(device.getString("account_id")); - final String[] supportedClientTypes = {"android", "iphone", "ipad"}; - long successCount = tokens.parallelStream().filter(devToken -> ArrayUtils.contains(supportedClientTypes, devToken.getString("client_type"))) - .filter(devToken -> { - String token = devToken.getString("token"); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), AppMessageType.MESSAGE.name(), token, - "Message from app:" + appid); - try { - - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (sender == null) { - return false; - } - AppMessage appMessage = message.initAppMessage(msgId); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - return true; - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage(), e); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - return false; - } - }).count(); - JSONObject resp = new JSONObject(); - resp.put("message_id", msgId); - resp.put("success_count", successCount); - return resp; - } - - @Override - public void submitEmailCertificate(JSONObject material, JSONObject device) { - riskUploadService.submitEmailCertificate(material); - JSONObject event = riskBusinessService.getRiskEventDetail(material.getString("risk_id")); - //材料审核通过后可以重新提交 - if (event.getIntValue("result_type") == 3) { - return; - } - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - if (account == null) { - account = new JSONObject(); - } - riskProcessLogService.addRiskProcessLog(material.getString("risk_id"), - account.getString("account_id"), - account.getString("display_name"), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getRemark(), - RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - } - - private void exportCBBankAggregateFile(JSONObject client, HttpServletResponse httpResponse) { - httpResponse.setContentType("application/pdf"); - httpResponse.setHeader("content-disposition", "attachment;filename=" + client.getString("client_moniker") + "_AGREEMENT_" + new Date() + ".pdf"); - ServletOutputStream sos = null; - try { - sos = httpResponse.getOutputStream(); - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(CBBANK_AGGREGATE_FILE); - pdu.setPdfTemplate(client); - File file = new File(client.getString("client_moniker") + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - sos.write(bos.toByteArray()); - sos.close(); - } catch (Exception ignore) { - - } - } - - private JSONObject exportClientAggregateFile(JSONObject client) { - InputStream stream = null; - JSONObject result = new JSONObject(); - try { - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE); - pdu.setPdfTemplate(client); - File file = new File(client.getString("client_moniker") + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileInfo = attachmentClient.uploadFile(stream, client.getString("client_moniker") + "_" + System.currentTimeMillis() + "_agreement_source.pdf", false); - result.put("file_value", fileInfo.getString("url")); - } catch (Exception e) { - throw new BadRequestException("获取合同文件失败"); - } - return result; - } - - private void deleteAccountEmailKey(String codeKey) { - stringRedisTemplate.delete(getUpdateAccountEmailKey(codeKey)); - } - - private void deleteAccountPhoneKey(String codeKey) { - stringRedisTemplate.delete(getUpdateAccountPhoneKey(codeKey)); - } - - private String getUpdateAccountEmailKey(String codeKey) { - return BIND_ACCOUNT_EMAIL_PREFIX + codeKey; - } - - private String getUpdateAccountPhoneKey(String codeKey) { - return BIND_ACCOUNT_PHONE_PREFIX + codeKey; - } - - private JSONObject getBankAccountByClientId(int clientId) { - List list = clientBankAccountMapper.clientBankAccounts(clientId); - return list.isEmpty() ? new JSONObject() : list.get(0); - } - - private JSONObject getClientBaseInfo(JSONObject clientWithConfig) { - JSONObject res = SignInAccountServiceImpl.clientInfoWithNoSecretInfo(clientWithConfig); - res.put("is_skip_clearing", res.getBoolean("skip_clearing")); - JSONObject clientLegalInfo = null; - if ("4".equals(clientWithConfig.getString("source"))) { - res.put("refuse_remark", clientWithConfig.getString("refuse_remark")); - res.put("base_info_lack", false); - res.put("legal_info_lack", false); - res.put("compliance_info_lack", false); - if (StringUtils.isEmpty(clientWithConfig.getString("business_structure")) || StringUtils.isEmpty(clientWithConfig.getString("logo_url")) - || StringUtils.isEmpty(clientWithConfig.getString("description")) - || ("Company".equals(clientWithConfig.getString("business_structure")) && StringUtils.isEmpty(clientWithConfig.getString("acn"))) - || (!"Company".equals(clientWithConfig.getString("business_structure")) && StringUtils.isEmpty(clientWithConfig.getString("abn"))) - || (StringUtils.isEmpty(clientWithConfig.getString("company_website")) && StringUtils.isEmpty(clientWithConfig.getString("company_photo")) - && StringUtils.isEmpty(clientWithConfig.getString("store_photo")))) { - res.put("base_info_lack", true); - } - clientLegalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(res.getIntValue("client_id")); - if (clientLegalInfo == null || StringUtils.isEmpty(clientLegalInfo.getString("representative_person")) || StringUtils.isEmpty(clientLegalInfo.getString("job_title")) - || StringUtils.isEmpty(clientLegalInfo.getString("phone")) - || StringUtils.isEmpty(clientLegalInfo.getString("email")) - || StringUtils.isEmpty(clientLegalInfo.getString("address")) - || StringUtils.isEmpty(clientLegalInfo.getString("suburb")) - || StringUtils.isEmpty(clientLegalInfo.getString("state")) - || StringUtils.isEmpty(clientLegalInfo.getString("postcode"))) { - res.put("legal_info_lack", true); - } - JSONObject file = clientManager.getAuthFiles(null, clientWithConfig.getString("client_moniker")); - for (String s : fileName) { - if (file.getString(s) == null) { - res.put("compliance_info_lack", true); - } - } - } - if (clientLegalInfo != null) { - res.put("legal_person", clientLegalInfo.getString("representative_person")); - res.put("legal_job_title", clientLegalInfo.getString("job_title")); - res.put("legal_phone", clientLegalInfo.getString("phone")); - res.put("legal_email", clientLegalInfo.getString("email")); - } - return res; - } - - private JSONObject getClientRateByClientId(int clientId) { - Date now = new Date(); - JSONObject res = merchantInfoProvider.clientCurrentRate(clientId, now, "Wechat"); - JSONObject client = clientManager.getClientInfo(clientId); - Assert.notNull(client, "Client is null"); - JSONObject clientConfig = clientConfigService.find(clientId); - ArrayList channels = new ArrayList<>(); - if (clientConfig.getBigDecimal("customer_surcharge_rate") != null) { - res.put("customer_surcharge_rate", clientConfig.getBigDecimal("customer_surcharge_rate")); - } - res.put("max_customer_surcharge_rate", PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()); - JSONObject wechat = getChannel(clientId, now, "Wechat"); - if (wechat.containsKey("channel")) { - channels.add(wechat); - } - JSONObject alipay = getChannel(clientId, now, "Alipay"); - if (alipay.containsKey("channel")) { - channels.add(alipay); - } - JSONObject alipayOnline = getChannel(clientId, now, "AlipayOnline"); - if (alipayOnline.containsKey("channel")) { - channels.add(alipayOnline); - } - JSONObject cbBankPay = getChannel(clientId, now, "CB_BankPay"); - if (cbBankPay.containsKey("channel")) { - channels.add(cbBankPay); - } - JSONObject cardPaymentPay = getChannel(clientId, now, "rpaypmt_card"); - if (cardPaymentPay.containsKey("channel")) { - channels.add(cardPaymentPay); - } - - JSONObject apsInStore = getChannel(clientId, now, "ApsInStore"); - if (apsInStore.containsKey("channel")) { - apsInStore.put("channel","Alipay+"); - channels.add(apsInStore); - } - JSONObject apsCashier = getChannel(clientId, now, "ApsCashier"); - if (apsCashier.containsKey("channel")) { - apsCashier.put("channel","Alipay+(Online)"); - - channels.add(apsCashier); - } - res.put("channels", channels); - if (res.containsKey("rate_value")) { - BigDecimal minRate = res.getBigDecimal("rate_value").add(BigDecimal.valueOf(0.01)).setScale(2, RoundingMode.DOWN); - res.put("customer_rage_title", (minRate.toPlainString() + "~" + res.getString("max_customer_surcharge_rate"))); - } - return res; - } - - private boolean geekShowActVersion(String version) { - boolean result = false; - String geekShowVersion = "2.12.10"; - String[] nowAppVersion = version.split("\\."); - String[] geekVersion = geekShowVersion.split("\\."); - for (int i = 0; i < geekVersion.length; i++) { - if (Integer.parseInt(nowAppVersion[i]) > Integer.parseInt(geekVersion[i])) { - result = true; - } - } - return result; - } - - private boolean accountIsRead(String accountId, JSONObject act) { - int displayCount = act.getIntValue("display_count"); - //0为显示无数次 - if (displayCount == 0) { - return false; - } - JSONObject account = clientAccountMapper.findById(accountId); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN - && PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.MANAGER) { - return true; - } - String actId = act.getString("act_id"); - int clientId = account.getIntValue("client_id"); - JSONObject displayInfo = actPartnerReadMapper.displayInfo(actId, clientId, accountId); - if (displayInfo == null) { - displayInfo = JsonHelper.newJson(json -> { - json.put("display_client_id", UUID.randomUUID().toString()); - json.put("act_id", actId); - json.put("client_id", clientId); - json.put("account_id", accountId); - json.put("last_read_time", new Date()); - json.put("display_count", 1); - }); - actPartnerReadMapper.save(displayInfo); - return false; - } - int accountDisplayCount = displayInfo.getIntValue("display_count"); - if (accountDisplayCount < displayCount) { - displayInfo.put("last_read_time", new Date()); - displayInfo.put("display_count", (accountDisplayCount + 1)); - actPartnerReadMapper.update(displayInfo); - return false; - } - return true; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java deleted file mode 100644 index eb74c75fb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java +++ /dev/null @@ -1,311 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean; -import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService; -import au.com.royalpay.payment.manage.appclient.extend.JWTUtil; -import au.com.royalpay.payment.manage.mappers.log.AppMessageLogMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientServicesApplyMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; -import au.com.royalpay.payment.tools.codec.AESCrypt; -import au.com.royalpay.payment.tools.device.DeviceSupport; -import au.com.royalpay.payment.tools.device.message.AppMessage; -import au.com.royalpay.payment.tools.device.message.AppMsgSender; -import au.com.royalpay.payment.tools.encryptalgorithm.SignUtils; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.mappers.CommonIncrementalChannelMapper; -import au.com.royalpay.payment.tools.utils.JsonHelper; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.parser.Feature; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.nio.charset.StandardCharsets; -import java.security.Key; -import java.util.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -@Service -public class RetailRSvcServiceImpl implements RetailRSvcService { - private final Logger logger = LoggerFactory.getLogger(getClass()); - private final Map senderMap = new HashMap<>(); - @Resource - private ClientManager clientManager; - @Resource - private DeviceSupport deviceSupport; - @Resource - private CommonIncrementalChannelMapper commonIncrementalChannelMapper; - @Resource - private ClientServicesApplyMapper clientServicesApplyMapper; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private ClientDeviceTokenMapper clientDeviceTokenMapper; - @Resource - private AppMessageLogMapper appMessageLogMapper; - - private final ThreadPoolExecutor sendingAppleMsgPool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - @Resource - public void setAppMsgSenders(AppMsgSender[] senders) { - Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender)); - } - - @Override - public JSONObject findMchInfoBySourceCode(JSONObject device, String sourceCode, boolean debug) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); - - JSONObject svcInfo = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(sourceCode); - if (svcInfo == null || StringUtils.isEmpty(svcInfo.getString("channel_pub_key")) - || StringUtils.isEmpty(svcInfo.getString("platform_pub_key")) || StringUtils.isEmpty("platform_pri_key")) { - throw new BadRequestException("this channel config is wrong"); - } - RSvcMchBean svcMchBean = clientManager.findSvcMchByAccountId(device.getString("account_id")); - String aesKeyStr = Base64.encodeBase64String(AESCrypt.randomKey().getEncoded()); - Key key = AESCrypt.fromKeyString(Base64.decodeBase64(aesKeyStr)); - JSONObject result = (JSONObject) JSON.toJSON(svcMchBean); - result.put("sign_type", "RSA2"); - result.put("enc_data", JsonHelper.newJson(json -> { - json.put("credentialCode", encData(svcMchBean.getCredentialCode(), key, svcInfo.getString("channel_pub_key"))); - json.put("payHost", encData(svcMchBean.getPayHost(), key, svcInfo.getString("channel_pub_key"))); - json.put("partnerCode", encData(svcMchBean.getPartnerCode(), key, svcInfo.getString("channel_pub_key"))); - json.put("merchantNumber", encData(svcMchBean.getMerchantNumber(), key, svcInfo.getString("channel_pub_key"))); - } - )); - result.remove("credentialCode"); - result.remove("payHost"); - result.remove("partnerCode"); - result.remove("merchantNumber"); - result.put("nonce_str", aesKeyStr); - result.put("timestamp", System.currentTimeMillis()); - result = JSON.parseObject(JSON.toJSONString(result), Feature.OrderedField); - result.put("sign", SignUtils.buildSign(result.toJSONString(), svcInfo.getString("platform_pri_key"))); - logger.info("svc [{}] info:{}", sourceCode, result.toJSONString()); - return result; - } - - @Override - public JSONObject enterIntoServiceBySourceCode(String sourceCode, JSONObject params) { - JSONObject result = new JSONObject(); - JSONObject svcInfo = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(sourceCode); - try { - if (svcInfo == null || StringUtils.isEmpty(svcInfo.getString("channel_pub_key")) - || StringUtils.isEmpty(svcInfo.getString("platform_pub_key")) || StringUtils.isEmpty("platform_pri_key")) { - throw new BadRequestException("this channel config is wrong"); - } - logger.debug("{} new services apply :{}", params.getString("signClient"), params.toJSONString()); - String signa = params.getString("sign"); - params.remove("sign"); - params = JSON.parseObject(JSON.toJSONString(params), Feature.OrderedField); - boolean checkSign = SignUtils.validSign(params.toJSONString(), signa, svcInfo.getString("channel_pub_key")); - if (!checkSign) { - throw new BadRequestException("sign is wrong"); - } - JSONObject client = clientManager.getClientInfoByMoniker(params.getString("signClient")); - if (client == null) { - throw new InvalidShortIdException(); - } - Key key = AESCrypt.fromKeyString(Base64.decodeBase64(params.getString("nonce_str"))); - String signPrice = "0"; - String signRate = "0"; - if (params.get("signPrice") != null) { - logger.debug("{} new services apply amount origin:{}", params.getString("signClient"), params.getString("signPrice")); - signPrice = decData(params.getString("signPrice"), key, svcInfo.getString("platform_pri_key")); - logger.debug("{} new services apply amount now:{}", params.getString("signClient"), signPrice); - } - if (params.get("signRate") != null) { - logger.debug("{} new services apply rate origin:{}", params.getString("signClient"), params.getString("signRate")); - signRate = decData(params.getString("signRate"), key, svcInfo.getString("platform_pri_key")); - logger.debug("{} new services apply rate origin:{}", params.getString("signClient"), signRate); - } - JSONObject serviceApply = new JSONObject(); - serviceApply.put("apply_id", UUID.randomUUID().toString()); - serviceApply.put("service_code", sourceCode); - serviceApply.put("client_id", client.getIntValue("client_id")); - serviceApply.put("title", params.getString("signData")); - serviceApply.put("amount", signPrice); - serviceApply.put("surcharge_rate", signRate); - serviceApply.put("apply_username", params.getString("signName")); - serviceApply.put("status", 0); - serviceApply.put("is_valid", 1); - serviceApply.put("create_time", new Date()); - clientServicesApplyMapper.save(serviceApply); - result.put("result_status", "PROCESSING"); - } catch (Exception e) { - logger.error("enter R services fail:{} - {}", sourceCode, e.getMessage()); - result.put("result_status", "SYSTEMERROR"); - result.put("result_msg", e.getMessage()); - } - return result; - } - - @Override - public JSONObject setUpShopBySourceCode(String sourceCode, JSONObject params) { - JSONObject result = new JSONObject(); - JSONObject svcInfo = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(sourceCode); - try { - if (svcInfo == null || StringUtils.isEmpty(svcInfo.getString("channel_pub_key")) - || StringUtils.isEmpty(svcInfo.getString("platform_pub_key")) || StringUtils.isEmpty("platform_pri_key")) { - throw new BadRequestException("this channel config is wrong"); - } - Key key = AESCrypt.fromKeyString(Base64.decodeBase64(params.getString("nonce_str"))); - String signa = params.getString("sign"); - params.remove("sign"); - params = JSON.parseObject(JSON.toJSONString(params), Feature.OrderedField); - boolean checkSign = SignUtils.validSign(params.toJSONString(), signa, svcInfo.getString("channel_pub_key")); - if (!checkSign) { - throw new BadRequestException("sign is wrong"); - } - String clientMoniker = decData(params.getString("partnerCode"), key, svcInfo.getString("platform_pri_key")); - logger.debug("{} new shop set up :{}", clientMoniker, params.toJSONString()); - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - clientConfig.put("geek_shop_status", 1); - clientConfigMapper.update(clientConfig); - result.put("result_status", "SUCCESS"); - } catch (Exception e) { - logger.error("set up geek shop fail:{} - {}", sourceCode, e.getMessage()); - result.put("result_status", "SYSTEMERROR"); - result.put("result_msg", e.getMessage()); - } - return result; - } - - @Override - public JSONObject appNotifyBySourceCode(String sourceCode, JSONObject params) { - JSONObject result = new JSONObject(); - JSONObject svcInfo = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(sourceCode); - try { - if (svcInfo == null || StringUtils.isEmpty(svcInfo.getString("channel_pub_key")) - || StringUtils.isEmpty(svcInfo.getString("platform_pub_key")) || StringUtils.isEmpty("platform_pri_key")) { - throw new BadRequestException("this channel config is wrong"); - } - Key key = AESCrypt.fromKeyString(Base64.decodeBase64(params.getString("nonce_str"))); - String signa = params.getString("sign"); - params.remove("sign"); - params = JSON.parseObject(JSON.toJSONString(params), Feature.OrderedField); - boolean checkSign = SignUtils.validSign(params.toJSONString(), signa, svcInfo.getString("channel_pub_key")); - if (!checkSign) { - throw new BadRequestException("sign is wrong"); - } - String clientMoniker = decData(params.getString("partnerCode"), key, svcInfo.getString("platform_pri_key")); - logger.debug("geek {} app notify info :{}", clientMoniker, params.toJSONString()); - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String title = params.getString("title"); - String body = params.getString("body"); - String url = decData(params.getString("url"), key, svcInfo.getString("platform_pri_key")); - sendRServiceNotifyMessage(client, title, body, url); - result.put("result_status", "SUCCESS"); - } catch (Exception e) { - logger.error("geek notify app fail:{} - {}", sourceCode, e.getMessage()); - result.put("result_status", "SYSTEMERROR"); - result.put("result_msg", e.getMessage()); - } - return result; - } - - @Override - public JSONObject getGeekSsoTokenInfo(String sourceCode, String clientMoniker) { - JSONObject svcInfo = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(sourceCode); - if (svcInfo == null || StringUtils.isEmpty(svcInfo.getString("channel_pub_key")) - || StringUtils.isEmpty(svcInfo.getString("platform_pub_key")) || StringUtils.isEmpty("platform_pri_key")) { - throw new BadRequestException("this channel config is wrong"); - } - String aesKeyStr = org.apache.commons.codec.binary.Base64.encodeBase64String(AESCrypt.randomKey().getEncoded()); - Key key = AESCrypt.fromKeyString(org.apache.commons.codec.binary.Base64.decodeBase64(aesKeyStr)); - JSONObject result = new JSONObject(); - result.put("sign_type", "RSA2"); - result.put("partnerCode", encData(clientMoniker, key, svcInfo.getString("channel_pub_key"))); - result.put("nonce_str", aesKeyStr); - result.put("timestamp", System.currentTimeMillis()); - result = JSON.parseObject(JSON.toJSONString(result), Feature.OrderedField); - result.put("sign", SignUtils.buildSign(result.toJSONString(), svcInfo.getString("platform_pri_key"))); - - String encryptedStrInfo = JSON.toJSONString(result); - String jwtResult = JWTUtil.sign(encryptedStrInfo, JWTUtil.SECRET); - logger.info("clientMoniker:{} - json:{} - token:{}", clientMoniker, encryptedStrInfo, jwtResult); - return JsonHelper.newJson(json -> json.put("token", jwtResult)); - } - - private void sendRServiceNotifyMessage(JSONObject client, String title, String body, String url) { - logger.debug("sendGeekMessage Begin"); - List clientTokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id")); - for (JSONObject tokenJson : clientTokens) { - Runnable task = () -> { - String token = tokenJson.getString("token"); - JSONObject log = saveAppMessageLog(tokenJson.getString("dev_id"), - tokenJson.getIntValue("client_id"), - "annual_bill" + tokenJson.getString("client_type"), - token, - "跨境商城推送" - ); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "annual_bill"); - type.put("id", tokenJson.getString("dev_token_id")); - AppMsgSender sender = senderMap.get((tokenJson.getString("client_type"))); - if (StringUtils.isBlank(token) || sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", title); - managerMsg.put("body", body); - managerMsg.put("type", type); - JSONObject messageData = new JSONObject(); - messageData.put("url", url); - managerMsg.put("data", messageData); - managerMsg.put("msgType", "annual_bill"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, tokenJson); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage()); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - } - }; - sendingAppleMsgPool.execute(task); - } - } - - private String encData(String data, Key key, String publicKey) { - String pubKeyEncData = SignUtils.encData(data, publicKey); - return org.apache.commons.codec.binary.Base64.encodeBase64String(AESCrypt.encrypt(pubKeyEncData.getBytes(StandardCharsets.UTF_8), key)); - } - - private String decData(String data, Key key, String privateKey) { - String aesData = new String(AESCrypt.decrypt(Base64.decodeBase64(data), key), StandardCharsets.UTF_8); - return SignUtils.decData(aesData, privateKey); - } - - private JSONObject saveAppMessageLog(String devId, int clientId, String messageType, String devToken, String remark) { - JSONObject log = new JSONObject(); - log.put("dev_id", devId); - log.put("client_id", clientId); - log.put("msg_type", messageType); - log.put("dev_token", devToken); - log.put("remark", remark); - log.put("send_time", new Date()); - appMessageLogMapper.save(log); - return log; - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/extend/GatewayOAuthRegister.java b/src/main/java/au/com/royalpay/payment/manage/appclient/extend/GatewayOAuthRegister.java deleted file mode 100644 index 70a489f66..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/extend/GatewayOAuthRegister.java +++ /dev/null @@ -1,125 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.extend; - -import au.com.royalpay.payment.manage.mappers.client.AuthHistoryMapper; -import au.com.royalpay.payment.tools.device.entity.DeviceInfo; -import au.com.royalpay.payment.tools.device.support.DeviceRegister; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; -import java.time.Duration; - -/** - * Create by davep at 2019-09-19 12:07 - */ -@Service -public class GatewayOAuthRegister implements DeviceRegister { - private Logger logger = LoggerFactory.getLogger(getClass()); - public static final String CLIENT_TYPE = "oauthclient"; - private MerchantInfoProvider provider; - private AuthHistoryMapper authHistoryMapper; - private StringRedisTemplate redisTemplate; - private String prefix; - - public GatewayOAuthRegister(MerchantInfoProvider provider, AuthHistoryMapper authHistoryMapper, - StringRedisTemplate redisTemplate, @Value("${app.redis.prefix}") String prefix) { - this.provider = provider; - this.authHistoryMapper = authHistoryMapper; - this.redisTemplate = redisTemplate; - this.prefix = prefix; - } - - @Override - public String getDevType() { - return CLIENT_TYPE; - } - - @Override - public boolean hideBankDetails() { - return false; - } - - @Override - public JSONObject register(String encrypted, int type) { - return null; - } - - @Override - public DeviceInfo checkDeviceRequest(HttpServletRequest request) { - return null; - } - - @Override - public JSONObject fillDeviceInfo(HttpServletRequest request, String devId, String devType, String accountId) { - JSONObject auth = findAuthDetail(devId); - int clientId = auth.getIntValue("client_id"); - JSONObject client = provider.getClientInfo(clientId); - auth.put("client_moniker", client.getString("client_moniker")); - auth.put("client", client); - return auth; - } - - private JSONObject findAuthDetail(String authId) { - String authStr = redisTemplate.boundValueOps(authDetailCacheKey(authId)).get(); - if (authStr == null) { - JSONObject authObj = authHistoryMapper.find(authId); - if (authObj == null || !authObj.getBooleanValue("is_valid")) { - throw new ForbiddenException("Auth Expired"); - } - JSONObject auth = new JSONObject(); - auth.put("dev_id", authId); - auth.put("client_type", CLIENT_TYPE); - auth.put("appid", authObj.getString("appid")); - int clientId = authObj.getIntValue("client_id"); - auth.put("client_id", clientId); - auth.put("auth_time", authObj.getDate("auth_time")); - auth.put("account_id", authObj.getString("account_id")); - auth.put("authorize_ip", authObj.getString("authorize_ip")); - auth.put("scope", authObj.getString("scope")); - auth.put("grant_scene", authObj.getString("grant_scene")); - redisTemplate.boundValueOps(authDetailCacheKey(authId)).set(auth.toJSONString(), Duration.ofMinutes(10)); - return auth; - } - return JSON.parseObject(authStr); - } - - private String authDetailCacheKey(String authId) { - return prefix + ":oauth:auth_dev_detail_cache:" + authId; - } - - - @Override - public JSONObject checkManageDeviceSign(HttpServletRequest request, String sign, String deviceId, String devVersion) { - return null; - } - - @Override - public boolean includeDevId() { - return false; - } - - @Override - public void signout(JSONObject device) { - - } - - @Override - public void manageSignout(JSONObject device) { - - } - - @Override - public void checkClient(Integer clientId) { - JSONObject client = provider.getClientInfo(clientId); - if (client == null || !client.getBooleanValue("is_valid")) { - throw new ForbiddenException("Client Not Exists"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/extend/JWTUtil.java b/src/main/java/au/com/royalpay/payment/manage/appclient/extend/JWTUtil.java deleted file mode 100755 index 3ead06721..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/extend/JWTUtil.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.extend; - -import com.auth0.jwt.JWT; -import com.auth0.jwt.JWTVerifier; -import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.exceptions.JWTDecodeException; -import com.auth0.jwt.interfaces.DecodedJWT; - -import java.util.Date; - -public class JWTUtil { - - // 过期时间5分钟 - private static final long EXPIRE_TIME = 5 * 60 * 1000; - - public static final String SECRET = "GeeK!@#$%"; - - /** - * 校验token是否正确 - * - * @param token 密钥 - * @param secret 用户的密码 - * @return 是否正确 - */ - public static boolean verify(String token, String userId, String secret) { - try { - Algorithm algorithm = Algorithm.HMAC256(secret); - JWTVerifier verifier = JWT.require(algorithm) - .withClaim("userId", userId) - .build(); - DecodedJWT jwt = verifier.verify(token); - return true; - } catch (Exception exception) { - return false; - } - } - - /** - * 获得token中的信息无需secret解密也能获得 - * - * @return token中包含的用户名 - */ - public static String getUserId(String token) { - try { - DecodedJWT jwt = JWT.decode(token); - return jwt.getClaim("userId").asString(); - } catch (JWTDecodeException e) { - return null; - } - } - - /** - * 生成签名,5min后过期 - * - * @param userId 用户id - * @param secret 用户的密码 - * @return 加密的token - */ - public static String sign(String userId, String secret) { - Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME); - Algorithm algorithm = Algorithm.HMAC256(secret); - // 附带username信息 - return JWT.create() - .withClaim("userId", userId) - .withExpiresAt(date) - .sign(algorithm); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/package-info.java b/src/main/java/au/com/royalpay/payment/manage/appclient/package-info.java deleted file mode 100644 index 57536fa87..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * app资源 - * - */ -package au.com.royalpay.payment.manage.appclient; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java deleted file mode 100644 index fc613e98f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ /dev/null @@ -1,238 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; -import au.com.royalpay.payment.manage.appclient.core.ManageAppService; -import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.device.manageadvise.AppClientController; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.List; -import java.util.Map; - - -@AppClientController -@RequestMapping("/api/v1.0/manage/app") -public class ManageAppController { - - @Resource - private ManageAppService manageAppService; - @Resource - private AttachmentClient attachmentClient; - - @PutMapping("/token") - public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { - manageAppService.updateDevToken(device, token.getString("devToken")); - } - - @PutMapping("/sign_out") - public void signOut(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.sign_out(device); - } - - @PutMapping("/manager_password/{manager_id}") - public void changePassword(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @PathVariable String manager_id, - @RequestBody @Valid ChangePwdBean change, Errors errors) { - HttpUtils.handleValidErrors(errors); - manageAppService.changeAccountPassword(device, change, manager_id); - } - - @GetMapping("/referrer") - public List getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getReferrerList(device); - } - - @PostMapping("/attachment/files") - public JSONObject uploadImage(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestParam MultipartFile file) throws Exception { - return attachmentClient.uploadFile(file, false); - } - - @PostMapping("/merchant/register") - public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody @Valid ClientRegisterInfo registery, - Errors errors) { - HttpUtils.handleValidErrors(errors); - return manageAppService.registerClient(device, registery); - } - - @PutMapping("/merchant/{clientMoniker}/update") - public void updatePartnerInfo(@PathVariable String clientMoniker, @RequestBody ClientRegisterInfo info, - @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.updateClientRegisterInfo(device, clientMoniker, info); - } - - @PutMapping("/merchant/{clientMoniker}/delete") - public void disablePartnerInfo(@PathVariable String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.disableClientRegisterInfo(device, clientMoniker); - } - - @GetMapping("/merchants") - public JSONObject listPartners(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, AppMerchantBean query) { - return manageAppService.listPartners(device, query); - } - - @GetMapping("/merchant/{clientMoniker}/detail") - public JSONObject getClientByMoniker(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.clientDetail(device, clientMoniker); - } - - @GetMapping("/merchant/{clientMoniker}/bank_account") - public JSONObject getBankAccount(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.clientBankAccount(device, clientMoniker); - } - - @PutMapping("/merchant/{clientMoniker}/bank_account") - public void saveBankAccount(@PathVariable String clientMoniker, @RequestBody @Valid BankAccountInfo bankAccount, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - HttpUtils.handleValidErrors(errors); - manageAppService.saveBankAccount(device, clientMoniker, bankAccount); - } - - @GetMapping("/merchant/{clientMoniker}/rates") - public Map> getRates(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getRates(device, clientMoniker); - } - - @GetMapping("/merchant/rate_config") - public JSONObject getConfigRates(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getConfigRates(device); - } - - @PostMapping("/merchant/{clientMoniker}/rates") - public void newRate(@PathVariable String clientMoniker, @RequestBody JSONObject config, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - HttpUtils.handleValidErrors(errors); - manageAppService.newConfigRate(device, clientMoniker, config); - } - - @PutMapping("/merchant/{clientMoniker}/compliance/green_channel") - public void commitToGreenChannel(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.commitToGreenChannel(device, clientMoniker); - } - - @PutMapping("/merchant/{clientMoniker}/make_agree_file") - public void commitToDoAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.commitToDoAgreeFile(device, clientMoniker); - } - - @PutMapping("/merchant/{clientMoniker}/to_compliance") - public void commitToCompliance(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.commitToCompliance(device, clientMoniker); - } - - @GetMapping("/merchant/{clientMoniker}/file") - public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getAuthFiles(device, clientMoniker); - } - - @PutMapping("/merchant/{clientMoniker}/file") - public void uploadAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientAuthFilesInfo filesInfo, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - manageAppService.uploadAuthFiles(device, clientMoniker, filesInfo); - } - - @GetMapping("/version") - public JSONObject getAppVersion(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getNewVersion(device); - } - - @GetMapping("/commons") - public JSONObject getCommons(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getCommons(device); - } - - @GetMapping("/org_prize/list") - public List getOrgPrizeList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getOrgPrizeList(device); - } - - @GetMapping("/bd/kpi") - public JSONObject getBdConfigKpi(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getBdConfigKpi(device); - } - - @GetMapping("/bd/list") - public List getBdPrizeList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getBdPrizeList(device); - } - - @GetMapping("/prize/rules") - public JSONObject getPrizeRulesUrl(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { - return manageAppService.getPrizeRulesUrl(device); - } - - @GetMapping("/product/list") - public JSONObject listProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, ProductBean productBean) { - return manageAppService.listProduct(device, productBean); - } - - @PostMapping("/product/save") - public void saveProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody ProductBean productBean) { - manageAppService.saveProduct(device, productBean); - } - - @PutMapping("/product/update") - public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody ProductBean productBean) { - manageAppService.updateProduct(device, productBean); - } - - @PutMapping("/product/delete/{commodity_id}") - public void deleteProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @PathVariable String commodity_id) { - manageAppService.deleteProduct(device, commodity_id); - } - - /** - * 接收关联邮箱的验证码 - * @param device - * @param email contact_email - * @throws Exception - */ - @RequestMapping(value = "/account/email",method = RequestMethod.PUT) - public void bindAccountEmail(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody JSONObject email){ - manageAppService.bindAccountEmail(device,email); - } - - /** - * 关联邮箱 - * @param device - * @param params 验证码 - * @throws Exception - */ - @RequestMapping(value = "/account/email/bind",method = RequestMethod.PUT) - public void updateAccountEmail(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody JSONObject params){ - manageAppService.updateAccountEmail(device,params); - } - - /** - * 接收关联手机的验证码 - * @param device - * @param phone contact_phone - * @throws Exception - */ - @RequestMapping(value = "/account/phone",method = RequestMethod.PUT) - public void bindAccountPhone(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody JSONObject phone) { - manageAppService.bindAccountPhone(device,phone); - } - - /** - * 关联手机 - * @param device - * @param params 验证码 - * @throws Exception - */ - @RequestMapping(value = "/account/phone/bind",method = RequestMethod.PUT) - public void updateAccountPhone(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody JSONObject params){ - manageAppService.updateAccountPhone(device,params); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java deleted file mode 100644 index bb5047d13..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ /dev/null @@ -1,1028 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; -import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleService; -import au.com.royalpay.payment.manage.appclient.beans.*; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.bill.bean.NewBillBean; -import au.com.royalpay.payment.manage.bill.bean.QueryBillBean; -import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean; -import au.com.royalpay.payment.manage.bill.core.BillOrderService; -import au.com.royalpay.payment.manage.bill.core.BillService; -import au.com.royalpay.payment.manage.kyc.core.KycService; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; -import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.manage.system.core.ClientContractService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.device.advise.AppClientController; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import static au.com.royalpay.payment.tools.CommonConsts.RETAIL_DEVICE; - -/** - * Created by yishuqian on 28/03/2017. - */ -@AppClientController -@RequestMapping("/api/v1.0/retail/app") -public class RetailAppController { - Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private RetailAppService retailAppService; - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private BillOrderService billOrderService; - @Resource - private BillService billService; - @Resource - private ActMonDelaySettleService actMonDelaySettleService; - @Resource - private AppActService appActService; - @Resource - private ClientContractService clientContractService; - @Resource - private ManualSettleSupport manualSettleSupport; - @Resource - private AttachmentClient attachmentClient; - @Resource - private KycService kycService; - - @Resource - private ClientAccountMapper clientAccountMapper; - - @Resource - private ClientManager clientManager; - - - @Autowired - private RiskBusinessService riskBusinessService; - - @Autowired - private RiskUploadService riskUploadService; - - @PutMapping("/token") - public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) { - retailAppService.updateDevToken(device, token.getString("devToken")); - } - - @GetMapping("/sub_partners") - public List listSubPartners(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.listSubClients(device); - } - - - @GetMapping("/common") - public JSONObject getTransactionCommonData(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getTransactionCommonData(device, appQueryBean); - } - - // 查询7天的交易金额 - @GetMapping("/common/week") - public List getTransactionCommonWeekData(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getTransactionCommonWeekData(device, appQueryBean); - } - - /** - * 流水页今日数据 - * - * @param device - * @param appQueryBean - * @return - */ - @GetMapping("/trade_common") - public JSONObject getTradeCommonData(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getTradeCommonDate(device, appQueryBean); - } - - @GetMapping("/trade/refund") - public JSONObject getRefunds(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getRefunds(device, appQueryBean); - } - - @GetMapping("/trade_common_new") - public JSONObject getTradeCommonDataNew(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getTradeCommonDateNew(device, appQueryBean); - } - - @RequestMapping("/transactions_customers") - public List getOrdersAndCustomersInDays(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getCustomersAndOrdersInDays(device, appQueryBean); - } - - @GetMapping("/orders") - public JSONObject listOrders(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean query) { - return retailAppService.listOrders(device, query); - } - - @GetMapping("/orders_new") - public JSONObject listOrdersNew(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean query) { - return retailAppService.listOrdersNew(device, query); - } - - @GetMapping("/orders/share_code") - public JSONObject listOrdersShareCode(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean query) { - return retailAppService.listOrdersShareCode(device, query); - } - - @RequestMapping("/settlement_log") - public JSONObject getClientSettlementLog(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getClientSettlementLog(device, appQueryBean); - } - - @RequestMapping("/transaction_log/{clearing_detail_id}") - public JSONObject getTransactionLogByClearingDetailId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable int clearing_detail_id, - @RequestParam(required = false) String timezone) { - return retailAppService.getTransactionLogsByClearingDetailId(device, clearing_detail_id, timezone); - } - - @RequestMapping("/{client_id}/settlement_logs/{clearingDetailId}/analysis/{channel}") - public Map channelAndDayOfAnalysis(@PathVariable int client_id, @PathVariable String clearingDetailId, - @PathVariable String channel, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - if ("all".equals(channel)) { - channel = "null"; - } - return retailAppService.channelAndDayOfAnalysis(client_id, clearingDetailId, channel, device); - } - - /* 消息模块begin */ - @GetMapping("/notice") - public JSONObject listNotices(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam Map params) { - return retailAppService.listNotices(device, (JSONObject) JSON.toJSON(params)); - } - - @PutMapping("/notice/{noticeId}") - public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId, - @RequestBody JSONObject account_param) { - if (!device.getString("account_id").equals(account_param.getString("account_id"))) { - throw new ForbiddenException("You have no permission"); - } - retailAppService.updateReadStatus(device, noticeId); - } - - @PutMapping("/notice/{noticeId}/stopNotice") - public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId) { - retailAppService.updateReadStatus(device, noticeId); - } - - @GetMapping("/notice/{noticeId}") - public JSONObject getNoticeId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId) { - return retailAppService.getNoticeDetailById(device, noticeId); - } - - @GetMapping("/notice/unread") - public List latestNotice(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getLatestNotice(device, device.getIntValue("client_id")); - } - /* 消息模块end */ - - /* 我的页面begin */ - @PutMapping("/partner_password/{account_id}") - public void changePassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String account_id, - @RequestBody @Valid ChangePwdBean change, Errors errors) { - HttpUtils.handleValidErrors(errors); - retailAppService.changeAccountPassword(device, change, account_id); - } - - @GetMapping("/bank_account") - public JSONObject getBankAccountInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.bankAccountInfo(device); - } - - @GetMapping("/current_rate") - public JSONObject getClientRate(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientCurrentRate(device); - } - - @PostMapping("/app_messages") - public JSONObject postAppMessages(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody RetailAppMessage message) { - return retailAppService.postAppMessage(device, message); - } - - @GetMapping("/current_rate_new") - public JSONObject getClientCurrentRateNew(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientCurrentRateNew(device); - } - - @GetMapping("/current_rate_new/{clientMoniker}") - public JSONObject getClientCurrentRateNew(@ModelAttribute("RETAIL_DEVICE") JSONObject device, @PathVariable String clientMoniker) { - return retailAppService.getClientCurrentRateNewByMoniker(device, clientMoniker); - } - - @PutMapping("/sign_out") - public void signOut(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - retailAppService.signOut(device); - } - /* 我的页面end */ - - /* 活动页面 begin */ - @GetMapping("/activities") - public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(defaultValue = "activity_page") String type, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) { - return retailAppService.getActivities(device, type, page, limit); - } - - @GetMapping("/activities/{article_id}") - public JSONObject getActivityDetail(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String article_id) { - return retailAppService.getActivityDetail(device, article_id); - } - - @GetMapping("/activities/window") - public JSONObject getActivityDetail(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.checkT1Client(device); - } - - /* 活动页面 end */ - - /** - * 获取最新版本 - * - * @param device - * @return - */ - @GetMapping("/version") - public JSONObject getAppVersion(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getNewVersion(device); - } - - @GetMapping("/client") - public JSONObject getClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientInfo(device); - } - - @GetMapping("/client/{clientMoniker}") - public JSONObject getClientInfoByMoniker(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String clientMoniker) { - return retailAppService.getClientInfoByMoniker(device, clientMoniker); - } - - @PutMapping("/client/apply") - @ResponseBody - public void updatePartnerInfo(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody ClientUpdateInfo info) { - logger.info(info.toString()); - retailAppService.updateMerchantInfo(device, info); - } - - @PostMapping("/client/compliance_audit") - @ResponseBody - public void commitAudit(@ModelAttribute(RETAIL_DEVICE) JSONObject device) { - retailAppService.applyToCompliance(device); - } - - @GetMapping("/client/realtime") - public JSONObject getClientInfoRealtime(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientInfoRealtime(device); - } - - @GetMapping("/client/me") - public JSONObject getClientMyInfoRealtime(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientInfoMe(device); - } - - @PutMapping("/client/verify/email") - @ResponseBody - public JSONObject sendVerifyEmail(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.sendVerifyEmail(device); - } - - @GetMapping("/client/check") - public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - JSONObject defaultResult = new JSONObject(); - defaultResult.put("rate_expire", false); - defaultResult.put("rate_waring", false); - defaultResult.put("old_contract", false); - return defaultResult; - } - - @GetMapping("/client/checkContract") - public JSONObject getCheckClientInfoV2(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - String version = device.getString("version"); - if ("2.9.3".equals(version)) { - throw new BadRequestException("test"); - } - return retailAppService.getCheckClientInfo(device); - } - - @PutMapping("/client") - public void updateClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody AppClientBean appClientBean) { - retailAppService.updateClient(device, appClientBean); - } - - @PutMapping("/client/{clientMoniker}") - public void updateClientByMoniker(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String clientMoniker, @RequestBody AppClientBean appClientBean) { - retailAppService.updateClientByMoniker(device, clientMoniker, appClientBean); - } - - @GetMapping("/client/file") - public JSONObject getAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getAuthFiles(device); - } - - @PutMapping("/client/file") - public void uploadAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody ClientAuthFilesInfo filesInfo) { - retailAppService.uploadAuthFiles(device, filesInfo); - } - - @PutMapping("/client/file/{clientMoniker}") - public JSONObject getAuthFilesByMoniker(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String clientMoniker) { - return retailAppService.getAuthFilesByMoniker(device, clientMoniker); - } - - @GetMapping("/daily_transactions/date/{dateStr}") - public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone, @RequestParam(required = false) String app_client_ids, - @RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device, app_client_ids); - } - - @PutMapping("/modify/retail_surcharge") - public JSONObject setCustomerPayForSurcharge(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject config) { - return retailAppService.updateRetailConfig(device, config.getBooleanValue("retail_surcharge")); - } - - @PutMapping("/modify/require_remark") - public JSONObject setRequireRemarkConfig(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject enable) { - return retailAppService.setRequireRemarkConfig(device, enable.getBooleanValue("enabled")); - } - - @PutMapping("/modify/require_custinfo") - public JSONObject setRequireCustInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject enable) { - return retailAppService.setRequireCustInfoConfig(device, enable.getBooleanValue("enabled")); - } - - @GetMapping("/current_user") - public JSONObject currentDeviceUser(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.userInfo(device); - } - - @GetMapping("/cash_back/common") - public JSONObject getCashbackCommData(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getCashbackCommData(device, appQueryBean); - } - - @GetMapping("/cash_back/records") - public JSONObject getCashbackRecords(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getCashbackRecords(device, appQueryBean); - } - - @GetMapping("/cash_back/drawlogs") - public JSONObject getCashbackDrawLogs(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) { - return retailAppService.getCashbackDrawLogs(device, appQueryBean); - } - - @PutMapping("/cash_back/draw_deposits") - public void drawDeposits(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject cashObj) { - try { - BigDecimal draw_amount = cashObj.getBigDecimal("draw_amount"); - retailAppService.drawDeposits(device, draw_amount, cashObj.getString("client_id")); - } catch (NumberFormatException e) { - throw new ParamInvalidException("draw_amount", "draw_amount is invalid"); - } - } - - @GetMapping("/cash_back/clean_info") - public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, - @RequestParam(value = "client_id", required = false) String client_id) { - if (client_id == null) { - client_id = device.getString("client_id"); - } - return retailAppService.getCashbackCleanInfo(device, client_id); - } - - @GetMapping("/partner_signin_app_qrcode/{codeId}") - public void partnerAppSigninViaQRCode(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String codeId, - @RequestParam(required = false) String source) { - signInStatusManager.clientQRCodeAppSignIn(device, codeId, source); - } - - /* 优惠券Begin */ - - @GetMapping("/coupon/used") - public JSONObject getCoupons(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(value = "page", defaultValue = "1") int page, - @RequestParam(value = "limit", defaultValue = "10") int limit) { - return retailAppService.getCoupons(device, page, limit); - } - - @GetMapping("/coupon/{coupon_log_id}") - public JSONObject getCouponDetail(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String coupon_log_id) { - return retailAppService.getCouponById(device, coupon_log_id); - } - - @PutMapping("/coupon/use/{coupon_log_id}") - public void useCoupon(@PathVariable String coupon_log_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - retailAppService.useCoupon(device, coupon_log_id); - } - /* 优惠券End */ - - @GetMapping("/bills/{bill_id}") - public JSONObject getBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return billService.getBillDetail(bill_id, device.getIntValue("client_id")); - } - - @GetMapping("/bills/list") - public JSONObject getBills(QueryBillBean queryBillBean, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return billService.queryBills(device.getIntValue("client_id"), queryBillBean); - } - - @PutMapping("/bills") - public JSONObject addBill(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody NewBillBean newBillBean) { - JSONObject result = billService.save(device.getIntValue("client_id"), newBillBean); - result.remove("bill"); - return result; - } - - @PostMapping("/bills/{bill_id}/close") - public void closeBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - billService.updateBillStatus(bill_id, "2", device.getIntValue("client_id")); - } - - @GetMapping("/bills/orders/{bill_id}") - public JSONObject getBillOrders(@PathVariable("bill_id") String bill_id, QueryBillOrderBean queryBillOrderBean, - @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - JSONObject result = billOrderService.query(bill_id, device.getIntValue("client_id"), queryBillOrderBean); - result.put("analysis", billOrderService.analysis(bill_id, device.getIntValue("client_id"), queryBillOrderBean)); - return result; - } - - - @GetMapping("/acts") - public List getIndexAct(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return appActService.listAppActs(); - } - - @GetMapping("/act/mondelay/desc") - public ModelAndView getActDetail(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - ModelAndView mav = new ModelAndView("activity/mondelay/mondelay"); - mav.addAllObjects(actMonDelaySettleService.getActDetail(device)); - return mav; - } - - @PostMapping("/act/mondelay/apply") - public void apply(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - actMonDelaySettleService.actApply(device); - } - - @PutMapping("/act/mondelay/cancel") - public void cancel(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - actMonDelaySettleService.cancelAct(device); - } - - - @GetMapping("/file/agree") - public JSONObject generateSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - JSONObject file = clientContractService.getSourceAgreement(device.getIntValue("client_id")); - JSONObject result = new JSONObject(); - result.put("file_url", file.getString("file_value")); - return result; - } - - @PostMapping("/file/agree/confirm") - public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - clientContractService.confirmSourceAgreement(device.getIntValue("client_id"), device.getString("account_id"), "App"); - } - - @GetMapping("/manual_settle") - public JSONObject getManualSettleStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return manualSettleSupport.findCurrentSettle(device.getIntValue("client_id"), true); - } - - @PutMapping("/manual_settle") - public JSONObject requestManualSettle(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject data) { - String settleToStr = data.getString("settle_to"); - if (settleToStr == null) { - throw new ParamInvalidException("settle_to", "error.payment.valid.param_missing"); - } - try { - Date setteTo = DateUtils.parseDate(settleToStr, "yyyy-MM-dd"); - return manualSettleSupport.requestManualSettle(setteTo, device.getString("account_id")); - } catch (ParseException e) { - throw new ParamInvalidException("settle_to", "error.payment.valid.invalid_time"); - } - } - - @PutMapping("/client/manual_settle") - @ResponseBody - public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject data) { - retailAppService.changeManualSettle(device, data.getBoolean("manual_settle")); - } - - @GetMapping("/qrcode") - public JSONObject getQrcode(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestParam(required = false, defaultValue = "0") int client_id, QRCodeConfig config, @RequestParam(required = false, defaultValue = "0") int app_client_ids) { - if (client_id == 0) { - client_id = device.getIntValue("client_id"); - } - if (app_client_ids != 0) { - client_id = app_client_ids; - } - return retailAppService.getQrcode(device, config, client_id); - } - - @PutMapping("/surcharge") - @ResponseBody - public void changeQRCodePaySurCharge(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody AppPaymentConfigBean appPaymentConfigBean) { - retailAppService.changeSurchargeEnable(device, appPaymentConfigBean); - } - - @PutMapping("/surcharge/{clientMoniker}") - @ResponseBody - public void changeQRCodePaySurChargeByMoniker(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @PathVariable String clientMoniker, @RequestBody AppPaymentConfigBean appPaymentConfigBean) { - retailAppService.changePaymentConfigByMoniker(device, clientMoniker, appPaymentConfigBean); - } - - @GetMapping("/invoice") - public JSONObject getInvoiceData(@ModelAttribute(RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) throws Exception { - return retailAppService.getInvoiceData(device, appQueryBean); - } - - @GetMapping("/invoice/file") - public void getInvoiceFile(@ModelAttribute(RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception { - retailAppService.getInvoiceFile(device, appQueryBean, httpResponse); - } - - @GetMapping("/surcharge") - public JSONObject changeQRCodePaySurCharge(@ModelAttribute(RETAIL_DEVICE) JSONObject device) { - JSONObject client = retailAppService.getClientInfoRealtime(device); - JSONObject result = new JSONObject(); - result.put("qrcode_surcharge", client.getBooleanValue("qrcode_surcharge")); - result.put("retail_surcharge", client.getBooleanValue("retail_surcharge")); - result.put("api_surcharge", client.getBooleanValue("api_surcharge")); - result.put("require_custinfo", client.getBooleanValue("require_custinfo")); - result.put("require_remark", client.getBooleanValue("require_remark")); - return result; - } - - @GetMapping("/surcharge/{clientMoniker}") - public JSONObject changeQRCodePaySurChargeByMoniker(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @PathVariable String clientMoniker) { - return retailAppService.getQRCodePaySurChargeByMoniker(device, clientMoniker); - } - - @PostMapping("/attachment/files") - public JSONObject uploadImage(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestParam MultipartFile file) throws Exception { - return attachmentClient.uploadFile(file, false); - } - - @PostMapping("/openim/check") - public JSONObject openimCheck(@ModelAttribute(RETAIL_DEVICE) JSONObject device) { - return retailAppService.openimCheck(device); - } - - @PostMapping("/openim/chat") - public void openimChat(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject param) { - retailAppService.addUnreadMsg(device, param); - } - - @GetMapping("/ctrip/check") - public JSONObject ctripCheck(@ModelAttribute(RETAIL_DEVICE) JSONObject device) { - return retailAppService.ctripCheck(device); - } - - @GetMapping("/ctrip/coupon/{couponId}") - public JSONObject ctripCheck(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @PathVariable String couponId) { - return retailAppService.ctripCouponInfo(device, couponId); - } - - @GetMapping("/cus/coupon_accuess_log/{client_moniker}") - public JSONObject getCouponLogByClientMoniker(@PathVariable String client_moniker, AppQueryBean appQueryBean) { - return retailAppService.getCouponCusCouponLog(client_moniker, appQueryBean); - } - - @PostMapping("/cus/coupon_accuess_log/{coupon_id}") - public void saveCouponAccuessLog(@PathVariable String coupon_id, @RequestParam int client_id, String remark) { - retailAppService.saveCouponAccuessLog(client_id, coupon_id, remark); - } - - @GetMapping("/style") - public JSONObject getStyle() { - return retailAppService.getStyle(); - } - - @PutMapping("/cus/coupon_accuess_log/{accuess_id}") - public void updateCouponAccuessLog(@PathVariable String accuess_id, String remark) { - retailAppService.cancelCouponAccuessLog(accuess_id, remark); - } - - /** - * app端获取风控通知信息 - * - * @param clientId - * @return - */ - @GetMapping(value = "/risk/business/notice") - public JSONObject riskNotice(@RequestParam("client_id") int clientId) { - return riskBusinessService.getNoticeInfo(clientId); - } - - /** - * app端风控事件列表接口 - * - * @param riskEventQuery - * @return - */ - @GetMapping(value = "/risk/business/events") - public JSONObject getRiskEvents(RiskEventQuery riskEventQuery) { - JSONObject params = riskEventQuery.toJSON(); - params.put("client_moniker", riskEventQuery.getClientMoniker()); - params.put("is_send_client", 1); - params.putIfAbsent("page", 1); - List resultTypes = Arrays.asList(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType(), - RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType(), - RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType(), - RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - params.put("result_types", resultTypes); - return riskBusinessService.getRiskEventsByPage(params, null); - } - - /** - * app端风控事件详情接口 - * - * @param riskId - * @return - */ - @GetMapping(value = "/risk/business/events/{risk_id}") - public JSONObject getRiskEventDetail(@PathVariable("risk_id") String riskId) { - JSONObject riskEvent = riskBusinessService.getRiskEventDetail(riskId); - List tradeLogs = riskBusinessService.getRiskEventOrderList(riskEvent); - riskEvent.put("tradeLogs", tradeLogs); - return riskEvent; - } - - /** - * app端获取风控事件上传的材料信息 - * - * @param riskId - * @return - */ - @GetMapping(value = "/risk/business/events/{risk_id}/materials") - public JSONObject getRiskEventMaterialsRemark(@PathVariable("risk_id") String riskId) { - return riskBusinessService.getRiskEventMaterialsRemark(riskId); - } - - /** - * app端获取风控事件上传的材料信息 - * - * @param riskId - * @return - */ - @GetMapping(value = "/risk/business/events/{risk_id}/emailscreenshot") - public JSONObject getEmailScreenshot(@PathVariable("risk_id") String riskId) { - return riskBusinessService.getEmailScreenshot(riskId); - } - - /** - * app端上传调单材料接口 - * - * @param material - */ - @PostMapping(value = "/risk/business/events") - public void uploadMaterial(@RequestBody JSONObject material, @ModelAttribute(RETAIL_DEVICE) JSONObject device) { - retailAppService.submitMaterial(material, device); - } - - /** - * 提交邮件截图 - * - * @param material - * @param device - */ - @PostMapping(value = "/risk/business/events/emailscreenshot") - public void uploadEmailCertificate(@RequestBody JSONObject material, @ModelAttribute(RETAIL_DEVICE) JSONObject device) { - retailAppService.submitEmailCertificate(material, device); - } - - @PostMapping("/risk/business/upload/files") - public JSONObject uploadImage(@RequestParam MultipartFile file) throws Exception { - return attachmentClient.uploadFile(file, false); - } - - /** - * 接收关联邮箱的验证码 - * - * @param device - * @param email contact_email - * @throws Exception - */ - @PutMapping("/account/email") - public void bindAccountEmail(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject email) throws Exception { - retailAppService.bindAccountEmail(device, email); - } - - /** - * 关联邮箱 - * - * @param device - * @param params 验证码 - * @throws Exception - */ - @PutMapping("/account/email/bind") - public void updateAccountEmail(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject params) throws Exception { - retailAppService.updateAccountEmail(device, params); - } - - /** - * 接收关联手机的验证码 - * - * @param device - * @param phone contact_phone - * @throws Exception - */ - @PutMapping("/account/phone_verify/bind") - public JSONObject sendBindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject phone) throws Exception { - retailAppService.sendBindAccountPhone(device, phone); - return new JSONObject(); - } - - /** - * 接收解绑手机的验证码 - * - * @param device - * @throws Exception - */ - @PutMapping("/account/phone_verify/unbind") - public JSONObject unBindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device) throws Exception { - retailAppService.sendUnbindAccountPhone(device); - return new JSONObject(); - } - - /** - * 关联手机 - * - * @param device - * @param params 验证码 - * @throws Exception - */ - @PutMapping("/account/phone/bind") - public JSONObject updateAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject params) throws Exception { - return retailAppService.updateAccountPhone(device, params); - } - - /** - * 解绑关联手机 - * - * @param device - * @param params 验证码 - * @throws Exception - */ - @PutMapping("/account/phone/unbind") - public JSONObject unbindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject params) throws Exception { - return retailAppService.unbindAccountPhone(device, params); - } - - /** - * 微信绑定 - * - * @param device - * @param params - */ - @PutMapping("/account/wechat/bind") - public JSONObject bindAccountWechat(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject params) { - return retailAppService.bindAccountWechat(device, params); - } - - - /** - * 微信解绑 - * - * @param device - */ - @PutMapping("/account/wechat/unbind") - public JSONObject unbindAccountWechat(@ModelAttribute(RETAIL_DEVICE) JSONObject device) { - return retailAppService.unbindAccountWechat(device); - } - - /** - * Apple绑定 - * - * @param device - */ - @PutMapping("/account/apple/bind") - public JSONObject bindAccountApple(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @Valid @RequestBody AppleLoginBean appleLoginBean) { - return retailAppService.bindAccountApple(device, appleLoginBean); - } - - - /** - * Apple解绑 - * - * @param device - */ - @PutMapping("/account/apple/unbind") - public JSONObject unbindAccountApple(@ModelAttribute(RETAIL_DEVICE) JSONObject device) { - return retailAppService.unbindAccountApple(device); - } - - - /** - * 验证退款密码 - */ - @PutMapping("/refund/passwd/verify") - public void verifyRefundPassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject json) { - retailAppService.verifyRefundPassword(device, json); - } - - /** - * 重置退款密码 - */ - @PutMapping("/refund/passwd/reset") - public void resetRefundPassWord(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject json) { - retailAppService.resetRefundPassword(device, json); - } - - @PutMapping("/{notice_id}/toggleCBBankChannel") - public JSONObject toggleCBBankChannel(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable("notice_id") String noticeId) { - return retailAppService.toggleCBBankChannel(device, noticeId); - } - - @PutMapping("/cbbank_pay/toggleCustomerSurcharge") - public JSONObject toggleCBBankCustomerSurcharge(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject customerSurcharge) { - return retailAppService.toggleCBBankCustomerSurcharge(device, customerSurcharge.getBooleanValue("customerSurcharge")); - } - - @GetMapping("/cbbank_pay/aggregate_file") - public void getCBBankAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, HttpServletResponse httpResponse) { - retailAppService.getCBBankAggregateFile(device, httpResponse); - } - - @GetMapping("/client/auth_file/status") - public JSONObject getClientAuthFileStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientAuthFileStatus(device); - } - - @GetMapping("/client/auth_file/status/aggregate") - public JSONObject getClientAuthFileStatusAggregate(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientAuthFileStatusAggregate(device); - } - - /** - * 原合同文件 - * - * @param device - */ - @GetMapping("/client/aggregate_file") - public JSONObject getSourceAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getSourceAggregateFile(device); - } - - /** - * 合成后的合同文件 - * - * @param device - * @param file 签名的url图片 - */ - @PostMapping("/client/aggregate_file") - public JSONObject getClientAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam MultipartFile file, @RequestHeader("User-Agent") String ua) throws IOException { - return retailAppService.getClientAggregateFile(device, file, ua); - } - - /** - * 提交待审核文件 - * - * @param device - * @param filesInfo 合规文件url - */ - @PutMapping("/client/auth_file") - public List uploadGreenChannelAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody ClientAuthFilesInfo filesInfo) { - return retailAppService.uploadGreenChannelAuthFiles(device, filesInfo); - } - - /** - * 删除待审核文件 - * - * @param device - * @param fileId 合规文件Id - */ - @PutMapping("/client/auth_file/{fileId}/delete") - public void deleteGreenChannelAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String fileId) { - retailAppService.deleteGreenChannelAuthFiles(device, fileId); - } - - - /** - * 提交审核 - * - * @param device - */ - @PostMapping("/client/auth_file/commit_to_compliance") - public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - retailAppService.commitAuthFilesToCompliance(device, null); - } - - /** - * 提交审核 - * - * @param device - * @params photoInfo 图片或网站 - */ - @PostMapping("/client/auth_file/commit_to_compliance_new") - public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject photoInfo) { - retailAppService.commitAuthFilesToCompliance(device, photoInfo); - } - - @GetMapping("/client/kyc_auth_file/clientViewFiles") - public JSONObject getkycFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getKycFiles(device); - } - - /** - * 提交待审核KYC文件 - * - * @param device - */ - @PostMapping("/client/kyc_auth_file") - public JSONObject uploadKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam MultipartFile file, @RequestParam("fileType") String fileType) throws Exception { - JSONObject fileInfo = attachmentClient.uploadFile(file, false); - retailAppService.uploadKycAuthFilesForApp(device, fileInfo, fileType); - return fileInfo; - } - - /** - * 提交审核Kyc - * - * @param device - */ - @PostMapping("/client/auth_file/commit_to_kyc") - public void commitToKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject params) { - retailAppService.commitAuthFilesToKyc(device, params); - } - - @PutMapping(value = "/notifyBd") - public void clientKycBdIntervention(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - kycService.kycNotifyBd(account, "app"); - } - - @PutMapping("/client/kyc_auth_file") - public List uploadKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody ClientKycFilesInfo filesInfo) { - return retailAppService.uploadKycAuthFiles(device, filesInfo); - } - - @GetMapping("/client/sub_manage") - public JSONObject getClientSubManage(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getClientSubManage(device); - } - - @GetMapping("/client/customer") - public ModelAndView redirectClientCustomer(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - ModelAndView model = new ModelAndView("app/app_customer"); - JSONObject client = retailAppService.getCustomerInfo(device); - model.addObject("client", client); - return model; - } - - /** - * 登录用户绑定信息(手机、第三方) - * - * @param device - * @return - */ - @GetMapping("/client/account/bind/infos") - public JSONObject findClientAccountBindStatusInfos(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getAccountBindInfos(device); - } - - @GetMapping(value = "/{clientMoniker}/aps_kyc") - public JSONObject getApsKycClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject account, @PathVariable("clientMoniker") String clientMoniker) { - return clientManager.getApsKycClient(account, clientMoniker); - } - - @PutMapping(value = "/aps_kyc") - public void updateApsKycClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject account, @RequestBody JSONObject item) { - clientManager.updateApsKycClient(account, item); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppFundController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppFundController.java deleted file mode 100644 index 11061ff02..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppFundController.java +++ /dev/null @@ -1,119 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.fund.core.FundsConfigService; -import au.com.royalpay.payment.manage.fund.core.XPlanFundConfigService; -import au.com.royalpay.payment.manage.fund.core.XPlanFundProcesor; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.device.advise.AppClientController; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.List; - -/** - * Create by yixian at 2017-09-14 9:38 - */ -@AppClientController -@RequestMapping("/api/v1.0/retail/app/funds") -public class RetailAppFundController { - @Resource - private FundsConfigService fundsConfigService; - @Resource - private XPlanFundConfigService xPlanFundConfigService; - @Resource - private XPlanFundProcesor xPlanFundProcesor; - - @GetMapping - public List listFunds(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return fundsConfigService.listAvailableFunds(); - } - - @GetMapping("/xplan/desc") - public JSONObject checkXPlanStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return xPlanFundConfigService.fundDesc(getMoniker(device)); - } - - @GetMapping("/xplan/status") - public JSONObject checkClientStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return xPlanFundConfigService.clientAnalysis(getMoniker(device)); - } - - @PutMapping("/xplan/status/join") - public void joinPlan(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - xPlanFundConfigService.clientJoinRequest(getMoniker(device), device.getString("account_id")); - } - - private String getMoniker(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return device.getJSONObject("client").getString("client_moniker"); - } - - @PutMapping("/xplan/status/auto_deposit") - public void configAutoDeposit(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject enable) { - xPlanFundConfigService.switchAutoDeposit(getMoniker(device), device.getString("account_id"), enable.getBooleanValue("enable")); - } - - @PutMapping("/xplan/status/auto_deposit_amount") - public void configAutoDepositAmount(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject amount) { - BigDecimal limit = null; - try { - limit = amount.getBigDecimal("amount"); - } catch (NumberFormatException ignored) { - } - if (limit == null) { - throw new ParamInvalidException("amount", "Invalid Number Format"); - } - xPlanFundConfigService.configAutoDepositLimitAmount(getMoniker(device), device.getString("account_id"), limit); - } - - @GetMapping("/xplan/transactions") - public JSONObject listTransactions(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(required = false) String type, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int limit) { - return xPlanFundProcesor.listTransactionHistory(getMoniker(device),type, page, limit); - } - - @GetMapping("/xplan/transactions/{transactionId}") - public JSONObject transactionStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String transactionId) { - return xPlanFundProcesor.transactionStatus(getMoniker(device), transactionId); - } - - @GetMapping("/xplan/deposit") - public JSONObject depositPreCheck(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return xPlanFundProcesor.depositCheck(device.getString("account_id")); - } - - @PutMapping("/xplan/deposit/{requestId}") - public JSONObject deposit(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String requestId, @RequestBody JSONObject deposit) { - BigDecimal amount = null; - try { - amount = deposit.getBigDecimal("amount"); - } catch (NumberFormatException ignore) { - } - if (amount == null) { - throw new ParamInvalidException("amount", "Invalid Number Format"); - } - return xPlanFundProcesor.deposit(requestId, device.getString("account_id"), device.getString("dev_id"), amount); - } - - @GetMapping("/xplan/withdraw") - public JSONObject withdrawCheck(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return xPlanFundProcesor.withdrawCheck(device.getString("account_id")); - } - - @PutMapping("/xplan/withdraw/{requestId}") - public JSONObject withdraw(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String requestId, @RequestBody JSONObject withdraw) { - BigDecimal amount = null; - try { - amount = withdraw.getBigDecimal("amount"); - } catch (NumberFormatException ignore) { - } - if (amount == null) { - throw new ParamInvalidException("amount", "Invalid Number Format"); - } - return xPlanFundProcesor.withdraw(requestId, device.getString("account_id"), device.getString("dev_id"), amount); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailClientController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailClientController.java deleted file mode 100644 index 832409575..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailClientController.java +++ /dev/null @@ -1,77 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.manage.appclient.beans.ApiClientAccountLoginInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.manage.signin.events.ClientLoginEvent; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.JsonHelper; -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * @Author DuLingLing - * @create 2019/11/27 0027 14:30 - */ -@RestController -@RequestMapping("/api/v1.0/royalpay/client") -public class RetailClientController implements ApplicationEventPublisherAware { - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private ClientManager clientManager; - private ApplicationEventPublisher publisher; - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @PostMapping("/sigIn") - public JSONObject signIn(@RequestBody @Valid ApiClientAccountLoginInfo loginInfo) { - try { - String signKey = signInStatusManager.partnerSignIn(loginInfo.ClientAccountLoginInfo()); - JSONObject account = signInStatusManager.getCurrentClient(signKey); - JSONObject clientAllInfo = clientManager.getClientInfo(account.getInteger("client_id")); - publisher.publishEvent( - new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "GEEK_PASSWORD")); - return convertResponseClientInfo(clientAllInfo); - } catch (BadRequestException be) { - return responseError(be.getMessage()); - } catch (Exception e) { - return responseError(e.getMessage()); - } - } - - private JSONObject convertResponseClientInfo(JSONObject clientAllInfo) { - JSONObject response = new JSONObject(); - response.put("status", "SUCCESS"); - JSONObject industryInfo = clientManager.findByLookupCode(clientAllInfo.getString("industry")); - response.put("clientInfo", JsonHelper.newJson(json -> { - json.put("partner_code", clientAllInfo.getString("client_moniker")); - json.put("company_name", clientAllInfo.getString("company_name")); - json.put("logo", clientAllInfo.getString("client_moniker")); - json.put("gateway_credential", clientAllInfo.getString("credential_code")); - json.put("industry_code", clientAllInfo.getString("industry")); - json.put("industry_value", industryInfo.getString("lookup_value")); - })); - return response; - } - - private JSONObject responseError(String message) { - JSONObject response = new JSONObject(); - response.put("status", "FAIL"); - response.put("message", message); - return response; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java deleted file mode 100644 index 190508339..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.device.advise.AppClientController; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@AppClientController -@RequestMapping("/api/v1.0/retail/rsvc") -public class RetailRSvcController { - - @Resource - private RetailRSvcService retailRSvcService; - - @GetMapping(value = "/{source_code}/userinfo") - public JSONObject findUserInfoBySourceCode(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, - @PathVariable String source_code, - @RequestParam(defaultValue = "false", required = false) boolean debug) { - return retailRSvcService.findMchInfoBySourceCode(device, source_code, debug); - } - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java deleted file mode 100644 index 55f5acd0f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ /dev/null @@ -1,338 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.manage.appclient.beans.AppleLoginBean; -import au.com.royalpay.payment.manage.appclient.beans.RetailLoginInfo; -import au.com.royalpay.payment.manage.appclient.core.ManageAppService; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.manage.signin.events.ClientLoginEvent; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.device.DeviceSupport; -import au.com.royalpay.payment.tools.device.ManageDeviceSupport; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.code.kaptcha.Producer; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.RandomStringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.http.HttpEntity; -import org.springframework.util.Assert; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -/** - * Created by yixian on 2016-09-29. - */ -@RestController -@RequestMapping("/api/v1.0/retail_valid") -public class RetailValidationController implements ApplicationEventPublisherAware { - Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private Producer captchaProducer; - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private DeviceSupport deviceSupport; - @Resource - private ManageDeviceSupport manageDeviceSupport; - @Resource - private RetailAppService retailAppService; - @Resource - private SimpleClientApplyService simpleClientApplyService; - private ApplicationEventPublisher publisher; - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @PostMapping("/devices/{devType}/register") - public JSONObject register(HttpEntity registerationEntity, @PathVariable String devType) { - Assert.notNull(registerationEntity.getBody(), "Registeration is Empty"); - return deviceSupport.register(devType, registerationEntity.getBody()); - } - - @PostMapping("/devices/{devType}/manage/register") - public JSONObject manageRegister(HttpEntity registerationEntity, @PathVariable String devType) { - Assert.notNull(registerationEntity.getBody(), "Registeration is Empty"); - return manageDeviceSupport.register(devType, registerationEntity.getBody()); - } - - @PostMapping("/sign_in_check") - public JSONObject signIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { - HttpUtils.handleValidErrors(errors); - String codeValue = signInStatusManager.getVerifyCode(loginInfo.getCaptchaKey()); - if (codeValue == null) { - logger.error("异常商户信息:{}", loginInfo); - throw new BadRequestException("Verification code has expired"); - } - if (!codeValue.equals(loginInfo.getVerifyCode())) { - throw new BadRequestException("Verification code is not correct"); - } else { - signInStatusManager.deleteVerifyCodeKey(loginInfo.getCaptchaKey()); - } - String signKey = signInStatusManager.partnerSignIn(loginInfo.toLoginInfo()); - JSONObject client = signInStatusManager.getCurrentClient(signKey); - client = JSON.parseObject(client.toJSONString()); - if (loginInfo.getDevId() != null) { - deviceSupport.validDeviceWithClient(client, loginInfo.getDevId()); - } - client.put("sign_key", signKey); - return client; - } - - @PostMapping("/manage/sign_in_check") - public JSONObject manageSignIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { - HttpUtils.handleValidErrors(errors); - String codeValue = signInStatusManager.getVerifyCode(loginInfo.getCaptchaKey()); - if (codeValue == null) { - throw new BadRequestException("Verification code has expired"); - } - if (!codeValue.equals(loginInfo.getVerifyCode())) { - throw new BadRequestException("Verification code is not correct"); - } else { - signInStatusManager.deleteVerifyCodeKey(loginInfo.getCaptchaKey()); - } - String signKey = signInStatusManager.managerSignIn(loginInfo.toLoginInfo()); - JSONObject manager = signInStatusManager.getCurrentManager(signKey); - manager = JSON.parseObject(manager.toJSONString()); - if (!ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); - } -// if (loginInfo.getDevId() != null) { -// deviceSupport.validDeviceWithClient(manager, loginInfo.getDevId()); -// } - manager.put("sign_key", signKey); - manager.remove("available_func_ids"); - manager.remove("available_func_names"); - manager.remove("modules"); - manager.remove("module_names"); - return manager; - } - - @PostMapping("/wechat_app_signin") - public JSONObject partnerWechatAppSignIn(@RequestBody JSONObject data) { - JSONObject res = signInStatusManager.partnerWechatAppSignIn(data.getString("code")); - if (!res.getBooleanValue("not_exists")) { - deviceSupport.validDeviceWithClient(res, res.getString("app_openid")); - } - return res; - } - - @PostMapping("/apple_signin") - public JSONObject mchAppleSignIn(@Valid @RequestBody AppleLoginBean appleLoginBean) { - return signInStatusManager.mchAppleSignIn(appleLoginBean); - } - - /** - * 微信绑定登录账号 - * - * @param params - * @return - */ - @PostMapping("/login/apple_bind") - public JSONObject appleLoginBind(@RequestBody JSONObject params) { - LoginInfo loginInfo = new LoginInfo(); - loginInfo.setLoginId(params.getString("loginId")); - loginInfo.setPassword(params.getString("password")); - String signKey = signInStatusManager.verifyClientAccountLogin(loginInfo, "apple"); - JSONObject account = signInStatusManager.getCurrentClient(signKey); - retailAppService.updateLoginClientAccountAppleId(account, params); - account = JSON.parseObject(account.toJSONString()); - JSONObject result = new JSONObject(); - account.put("sign_key", signKey); - result.put("account", account); - result.put("bind_status", true); - result.put("status", "success"); - this.publisher.publishEvent(new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return result; - } - - @GetMapping("/captcha") - public JSONObject getCaptchaForDevice(@RequestParam(defaultValue = "false") boolean imgurl) throws IOException { - String capText = RandomStringUtils.random(4, false, true); - System.out.println("登陆验证码: " + capText); - // - // session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); - - String statusKey = signInStatusManager.addVerifyCode(capText); - - BufferedImage bi = captchaProducer.createImage(capText); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ImageIO.write(bi, "jpeg", bos); - bos.flush(); - JSONObject res = new JSONObject(); - res.put("key", statusKey); - if (imgurl) { - res.put("img", "data:image/jpeg;base64," + Base64.encodeBase64String(bos.toByteArray())); - } else { - res.put("img", Base64.encodeBase64URLSafeString(bos.toByteArray())); - } - return res; - } - - /** - * 广告位 - */ - @GetMapping("/ads") - public JSONObject getAd() { - return retailAppService.getAd(); - } - - @GetMapping("/ads/{article_id}") - public JSONObject getAdDetail(@PathVariable String article_id) { - return retailAppService.getAdDetail(article_id); - } - - - /** - * 登录发送手机验证码 - * - * @param phoneNumber - * @param nationCode - * @param request - * @return - */ - @PostMapping("/send/{phone_number}/verify_code") - @ResponseBody - public JSONObject sendLoginMobileVerifyCode(@PathVariable("phone_number") String phoneNumber, - @RequestParam("nation_code") @NotEmpty(message = "nation code can't be null") String nationCode, - HttpServletRequest request) { - simpleClientApplyService.getAndSendLoginSmsCode(phoneNumber, nationCode, request); - return new JSONObject(); - } - - /** - * 登录校验手机验证 - * - * @param contactPhone - * @param nationCode - * @param params - */ - @PostMapping("/login/verify/{contact_phone}/verify_code") - public JSONObject verifyLoginMobileCode(@PathVariable("contact_phone") String contactPhone, - @RequestParam("nation_code") @NotEmpty(message = "nation code can't be null") String nationCode, - @RequestBody JSONObject params, - @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, - Errors errors) { - HttpUtils.handleValidErrors(errors); - JSONObject result = new JSONObject(); - simpleClientApplyService.verifyLoginSMSCode(params.getString("verify_code"), contactPhone); - String signKey = signInStatusManager.getClientInfoByPhoneStatusKey(contactPhone, nationCode); - if (signKey != null) { - JSONObject account = signInStatusManager.getCurrentClient(signKey); - account = JSON.parseObject(account.toJSONString()); - if (params.getString("devId") != null) { - deviceSupport.validDeviceWithClient(account, params.getString("devId")); - } - account.put("sign_key", signKey); - result.put("account", account); - result.put("status", "success"); - result.put("bind_status", true); - this.publisher.publishEvent(new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "MOBILE")); - } else { - result.put("status", "success"); - result.put("bind_status", false); - result.put("contact_phone", contactPhone); - result.put("nation_code", nationCode); - } - return result; - } - - /** - * 手机登录-绑定账号 - * - * @param contactPhone - * @param nationCode - * @param params - */ - @PostMapping("/login/mobile/{contact_phone}/bind") - public JSONObject mobileLoginBind(@PathVariable("contact_phone") String contactPhone, - @RequestParam("nation_code") @NotEmpty(message = "nation code can't be null") String nationCode, - @RequestBody JSONObject params, - Errors errors) { - HttpUtils.handleValidErrors(errors); - - LoginInfo loginInfo = new LoginInfo(); - loginInfo.setLoginId(params.getString("loginId")); - loginInfo.setPassword(params.getString("password")); - String signKey = signInStatusManager.verifyClientAccountLogin(loginInfo, "phone"); - signInStatusManager.verifyClientLoginPhoneBindCode(contactPhone, nationCode); - JSONObject account = signInStatusManager.getCurrentClient(signKey); - retailAppService.updateLoginClientAccountPhone(account, contactPhone, nationCode); - account.put("sign_key", signKey); - account = JSON.parseObject(account.toJSONString()); - JSONObject result = new JSONObject(); - result.put("account", account); - result.put("bind_status", true); - this.publisher.publishEvent(new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "MOBILE")); - return result; - } - - /** - * 商戶端App微信授权登录 - * - * @param params - * @return - */ - @PostMapping("/client_app_wechat_signin") - public JSONObject clientAppWechatSignIn(@RequestBody JSONObject params, - Errors errors) { - HttpUtils.handleValidErrors(errors); - JSONObject account = signInStatusManager.clientAppWechatSignIn(params.getString("code")); - if (!account.getBoolean("bind_status")) { - deviceSupport.validDeviceWithClient(account, params.getString("app_openid")); - return account; - } - this.publisher.publishEvent(new ClientLoginEvent(this, account.getJSONObject("account").getIntValue("client_id"), account.getJSONObject("account").getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return account; - } - - /** - * 微信绑定登录账号 - * - * @param params - * @return - */ - @PostMapping("/login/wechat_bind") - public JSONObject wechatLoginBind(@RequestBody JSONObject params) { - LoginInfo loginInfo = new LoginInfo(); - loginInfo.setLoginId(params.getString("loginId")); - loginInfo.setPassword(params.getString("password")); - String signKey = signInStatusManager.verifyClientAccountLogin(loginInfo, "wechat"); - JSONObject wechatInfo = signInStatusManager.verifyClientLoginWechatBindCode(params.getString("wechat_openid")); - JSONObject account = signInStatusManager.getCurrentClient(signKey); - params.put("nick_name", wechatInfo.getString("nick_name")); - params.put("union_id", wechatInfo.getString("union_id")); - retailAppService.updateLoginClientAccountOpenId(account, params); - account = JSON.parseObject(account.toJSONString()); - JSONObject result = new JSONObject(); - account.put("sign_key", signKey); - result.put("account", account); - result.put("bind_status", true); - result.put("status", "success"); - this.publisher.publishEvent(new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return result; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RsvcServiceController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RsvcServiceController.java deleted file mode 100644 index 099ec8609..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RsvcServiceController.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.appclient.web; - -import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@RequestMapping("/api/v1.0/server/rsvc") -public class RsvcServiceController { - - @Resource - private RetailRSvcService retailRSvcService; - - @PostMapping(value = "/{source_code}/enterService") - public JSONObject enterIntoServiceBySourceCode(@PathVariable String source_code, @RequestBody JSONObject params) { - return retailRSvcService.enterIntoServiceBySourceCode(source_code, params); - } - - @PostMapping(value = "/{source_code}/setUpShop") - public JSONObject setUpShopBySourceCode(@PathVariable String source_code, @RequestBody JSONObject params) { - return retailRSvcService.setUpShopBySourceCode(source_code, params); - } - - @PostMapping(value = "/{source_code}/appNotify") - public JSONObject appNotifyBySourceCode(@PathVariable String source_code, @RequestBody JSONObject params) { - return retailRSvcService.appNotifyBySourceCode(source_code, params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/AddHandleLogDetail.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/AddHandleLogDetail.java deleted file mode 100644 index 3c86497c9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/AddHandleLogDetail.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.application.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yuan on 2018/6/27. - */ -public class AddHandleLogDetail { - private String client_pre_apply_id; - - private String remark; - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public String getClient_pre_apply_id() { - return client_pre_apply_id; - } - - public void setClient_pre_apply_id(String client_pre_apply_id) { - this.client_pre_apply_id = client_pre_apply_id; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientApplyQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientApplyQueryBean.java deleted file mode 100644 index 520c9dfe3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientApplyQueryBean.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.application.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yuan on 2018/6/4. - */ -public class ClientApplyQueryBean { - private int page = 1; - private int limit = 10; - private String agree; - private String status; - - public JSONObject insertObject() { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(agree)){ - params.put("agree",agree); - } - if(StringUtils.isNotEmpty(status)){ - params.put("status",status); - } - return params; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getAgree() { - return agree; - } - - public void setAgree(String agree) { - this.agree = agree; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java deleted file mode 100644 index 84d814bea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java +++ /dev/null @@ -1,303 +0,0 @@ -package au.com.royalpay.payment.manage.application.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.StringUtils; -import javax.validation.constraints.NotEmpty; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by yuan on 2018/5/23. - */ -public class ClientPreApplyBean { - @NotEmpty(message = "username can't be null") - private String username; - @NotEmpty(message = "password can't be null") - private String password; - @NotEmpty(message = "contact_person can't be null") - private String contact_person; - @NotEmpty(message = "contact_phone can't be null") - private String contact_phone; - @NotEmpty(message = "contact_email can't be null") - private String contact_email; - @NotEmpty(message = "company_name can't be null") - private String company_name; - @NotEmpty(message = "company_phone can't be null") - private String company_phone; - @NotEmpty(message = "abn can't be null") - private String abn; - @NotEmpty(message = "short_name can't be null") - private String short_name; - @NotEmpty(message = "address can't be null") - private String address; - @NotEmpty(message = "suburb can't be null") - private String suburb; - @NotEmpty(message = "state can't be null") - private String state; - @NotEmpty(message = "postcode can't be null") - private String postcode; - @NotEmpty(message = "industry can't be null") - private String industry; - @NotEmpty(message = "bank_no can't be null") - private String bank_no; - @NotEmpty(message = "bank_name can't be null") - private String bank_name; - @NotEmpty(message = "bsb_no can't be null") - private String bsb_no; - @NotEmpty(message = "clean_days can't be null") - private String clean_days; - @NotEmpty(message = "codeKey can't be null") - private String codeKey; - private boolean agree; - private String nation_code; - private String client_pay_type = "2"; - private String client_pay_desc = "201"; - private String company_website; - private String company_photo; - private String alipayindustry; - private String wechatindustry; - private String store_photo; - - - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - List keys = new ArrayList<>(); - res.keySet().forEach(p-> { - if (StringUtils.isBlank(res.getString(p))) { - keys.add(p); - } - }); - keys.forEach(p->{ - res.remove(p); - }); - return res; - } - public String getCompany_name() { - return company_name; - } - - public void setCompany_name(String company_name) { - this.company_name = company_name; - } - - public String getAbn() { - return abn; - } - - public void setAbn(String abn) { - this.abn = abn; - } - - public String getShort_name() { - return short_name; - } - - public void setShort_name(String short_name) { - this.short_name = short_name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getBank_no() { - return bank_no; - } - - public void setBank_no(String bank_no) { - this.bank_no = bank_no; - } - - public String getBank_name() { - return bank_name; - } - - public void setBank_name(String bank_name) { - this.bank_name = bank_name; - } - - public String getBsb_no() { - return bsb_no; - } - - public void setBsb_no(String bsb_no) { - this.bsb_no = bsb_no; - } - - public String getClean_days() { - return clean_days; - } - - public void setClean_days(String clean_days) { - this.clean_days = clean_days; - } - - public boolean isAgree() { - return agree; - } - - public void setAgree(boolean agree) { - this.agree = agree; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getContact_person() { - return contact_person; - } - - public void setContact_person(String contact_person) { - this.contact_person = contact_person; - } - - public String getContact_phone() { - return contact_phone; - } - - public void setContact_phone(String contact_phone) { - this.contact_phone = contact_phone; - } - - public String getContact_email() { - return contact_email; - } - - public void setContact_email(String contact_email) { - this.contact_email = contact_email; - } - - public String getCompany_phone() { - return company_phone; - } - - public void setCompany_phone(String company_phone) { - this.company_phone = company_phone; - } - - public String getCodeKey() { - return codeKey; - } - - public void setCodeKey(String codeKey) { - this.codeKey = codeKey; - } - - public String getNation_code() { - return nation_code; - } - - public void setNation_code(String nation_code) { - this.nation_code = nation_code; - } - - public void setClient_pay_type(String client_pay_type) { - this.client_pay_type = client_pay_type; - } - - public void setClient_pay_desc(String client_pay_desc) { - this.client_pay_desc = client_pay_desc; - } - - public String getClient_pay_type() { - return client_pay_type; - } - - public String getClient_pay_desc() { - return client_pay_desc; - } - - public void setAlipayindustry(String alipayindustry) { - this.alipayindustry = alipayindustry; - } - - public void setCompany_photo(String company_photo) { - this.company_photo = company_photo; - } - - public void setCompany_website(String company_website) { - this.company_website = company_website; - } - - public void setStore_photo(String store_photo) { - this.store_photo = store_photo; - } - - public void setWechatindustry(String wechatindustry) { - this.wechatindustry = wechatindustry; - } - - public String getAlipayindustry() { - return alipayindustry; - } - - public String getCompany_photo() { - return company_photo; - } - - public String getCompany_website() { - return company_website; - } - - public String getStore_photo() { - return store_photo; - } - - public String getWechatindustry() { - return wechatindustry; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java deleted file mode 100644 index 3d7084b9e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java +++ /dev/null @@ -1,96 +0,0 @@ -package au.com.royalpay.payment.manage.application.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import javax.validation.constraints.NotEmpty; - -/** - * Created by yuan on 2018/5/23. - */ -public class ClientPreApplyStep1Bean { - @NotEmpty(message = "username can't be null") - private String username; - @NotEmpty(message = "password can't be null") - private String password; - @NotEmpty(message = "contact_person can't be null") - private String contact_person; - @NotEmpty(message = "contact_phone can't be null") - private String contact_phone; - @NotEmpty(message = "contact_email can't be null") - private String contact_email; - @NotEmpty(message = "phoneCodeKey can't be null") - private String phoneCodeKey; - private String apply_source = "pc"; - private int channel; - - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getContact_person() { - return contact_person; - } - - public void setContact_person(String contact_person) { - this.contact_person = contact_person; - } - - public String getContact_phone() { - return contact_phone; - } - - public void setContact_phone(String contact_phone) { - this.contact_phone = contact_phone; - } - - public String getContact_email() { - return contact_email; - } - - public void setContact_email(String contact_email) { - this.contact_email = contact_email; - } - - public String getPhoneCodeKey() { - return phoneCodeKey; - } - - public void setPhoneCodeKey(String phoneCodeKey) { - this.phoneCodeKey = phoneCodeKey; - } - - public String getApply_source() { - return apply_source; - } - - public void setApply_source(String apply_source) { - this.apply_source = apply_source; - } - - public int getChannel() { - return channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/HandleLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/HandleLogQuery.java deleted file mode 100644 index b3b049f63..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/HandleLogQuery.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.application.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yuan on 2018/6/27. - */ -public class HandleLogQuery { - private int page = 1; - private int limit = 10; - private String client_pre_apply_id; - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getClient_pre_apply_id() { - return client_pre_apply_id; - } - - public void setClient_pre_apply_id(String client_pre_apply_id) { - this.client_pre_apply_id = client_pre_apply_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/SimpleClientBean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/SimpleClientBean.java deleted file mode 100644 index c8cce7a66..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/SimpleClientBean.java +++ /dev/null @@ -1,139 +0,0 @@ -package au.com.royalpay.payment.manage.application.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yishuqian on 02/03/2017. - */ -public class SimpleClientBean { - @JSONField(name = "company_name") - private String companyName; - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "short_name") - private String shortName; - @NotEmpty(message = "error.payment.valid.param_missing") - private String industry; - @JSONField(name = "company_photo") - private String companyPhoto; - @JSONField(name = "company_website") - private String companyWebsite; - @JSONField(name = "company_phone") - @NotEmpty(message = "error.payment.valid.param_missing") - private String companyPhone; - @JSONField(name = "logo_id") - private String logoId; - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - private String state; - - private int openStatus = 0; - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getLogoId() { - return logoId; - } - - public void setLogoId(String logoId) { - this.logoId = logoId; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public int getOpenStatus() { - return openStatus; - } - - public void setOpenStatus(int openStatus) { - this.openStatus = openStatus; - } - - public String getCompanyPhoto() { - return companyPhoto; - } - - public void setCompanyPhoto(String companyPhoto) { - this.companyPhoto = companyPhoto; - } - - public String getCompanyWebsite() { - return companyWebsite; - } - - public void setCompanyWebsite(String companyWebsite) { - this.companyWebsite = companyWebsite; - } - - public String getCompanyPhone() { - return companyPhone; - } - - public void setCompanyPhone(String companyPhone) { - this.companyPhone = companyPhone; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyManageService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyManageService.java deleted file mode 100644 index 62ad51225..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyManageService.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.application.core; - -import au.com.royalpay.payment.manage.application.beans.AddHandleLogDetail; -import au.com.royalpay.payment.manage.application.beans.ClientApplyQueryBean; -import au.com.royalpay.payment.manage.application.beans.HandleLogQuery; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yuan on 2018/6/4. - */ -public interface SimpleClientApplyManageService { - JSONObject listsApplies(JSONObject manager,ClientApplyQueryBean clientApplyQueryBean); - - JSONObject findOneApply(JSONObject manager,String client_pre_apply_id); - - JSONObject listAllHandleLogs(JSONObject manager,HandleLogQuery handleLogQuery); - - void addHandleLog(JSONObject manager,AddHandleLogDetail addHandleLogDetail); - - void closeHandle(JSONObject manager,String client_pre_apply_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java deleted file mode 100644 index efb6047d8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java +++ /dev/null @@ -1,59 +0,0 @@ -package au.com.royalpay.payment.manage.application.core; - -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.List; - -public interface SimpleClientApplyService { - void verifyRegisterSMSCode(String codeKey, String phoneNumber); - - JSONObject newAccount(NewAccountBean accountBean); - - String partnerSignIn(JSONObject account); - - String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request); - - void sendOpenSms(String phoneNumber, String nationCode); - - String checkOrGenerateRegisterProcessKey(String accountName, String codeKey); - - void deleteRegisterProcessKey(String codeKey); - - void sendVerifyEmail(String address, int client_id,String username); - - String checkOrGenerateVerifyMailKey(String address, String codeKey); - - void deleteVerifyMailKey(String codeKey); - - void verifyMail(String address, JSONObject loginAccount); - - void saveOrUpdateApplyInfo(JSONObject companyBean, String username); - - JSONObject getPayType(); - - List getSysRate(JSONObject sysConfig); - - List getIndustryMap(); - - JSONObject getSourceAggregateFile(String username ,String clean_days); - - JSONObject getClientAggregateFile(String username, MultipartFile file,String clean_days, JSONObject signInfo) throws IOException; - - JSONObject getPreApplyInfoForAggree(String username ,String clean_days); - - JSONObject getBankInfo(String bsb_no); - - void checkAccountName(String contact_phone,String nation_code); - - void subscribeNewsletter(String mail, String lang); - - void getAndSendLoginSmsCode(String phoneNumber, String nationCode, HttpServletRequest request); - - void verifyLoginSMSCode(String codeKey, String phoneNumber); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientService.java deleted file mode 100644 index e9e54c323..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientService.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.application.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.Map; - -/** - * Created by yishuqian on 03/03/2017. - */ -public interface SimpleClientService { - - JSONObject getClientFiles(JSONObject partner); - - JSONObject getBankAccount(JSONObject partner); - - JSONObject getClientInfo(JSONObject partner); - - - Map getGreenChannelClients(String managerId); - - void checkGreenChannelClients(); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyManageServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyManageServiceImpl.java deleted file mode 100644 index 7b8dc3d10..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyManageServiceImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -package au.com.royalpay.payment.manage.application.core.impls; - -import au.com.royalpay.payment.manage.application.beans.AddHandleLogDetail; -import au.com.royalpay.payment.manage.application.beans.ClientApplyQueryBean; -import au.com.royalpay.payment.manage.application.beans.HandleLogQuery; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyManageService; -import au.com.royalpay.payment.manage.mappers.preapply.PreApplyHandleLogMapper; -import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; - -/** - * Created by yuan on 2018/6/4. - */ -@Service -public class SimpleClientApplyManageServiceImpl implements SimpleClientApplyManageService{ - @Resource - private SysClientPreMapperMapper sysClientPreMapperMapper; - - @Resource - private PreApplyHandleLogMapper preApplyHandleLogMapper; - @Override - public JSONObject listsApplies(JSONObject manager, ClientApplyQueryBean clientApplyQueryBean) { - if(manager == null){ - throw new BadRequestException(); - } - JSONObject params = clientApplyQueryBean.insertObject(); - - PageList applies = sysClientPreMapperMapper.listApplies(params, - new PageBounds(clientApplyQueryBean.getPage(), clientApplyQueryBean.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(applies); - } - - @Override - public JSONObject findOneApply(JSONObject manager, String client_pre_apply_id) { - if(manager == null){ - throw new BadRequestException(); - } - return sysClientPreMapperMapper.findOneByClientPreApplyId(client_pre_apply_id); - } - - @Override - public JSONObject listAllHandleLogs(JSONObject manager, HandleLogQuery handleLogQuery) { - if(manager == null){ - throw new BadRequestException(); - } - JSONObject params = handleLogQuery.insertObject(); - PageList allLogs = preApplyHandleLogMapper.listHandleLogs(params,new PageBounds(handleLogQuery.getPage(),handleLogQuery.getLimit(),Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(allLogs); - } - - @Override - public void addHandleLog(JSONObject manager, AddHandleLogDetail addHandleLogDetail) { - if(manager == null){ - throw new BadRequestException(); - } - JSONObject apply = sysClientPreMapperMapper.findOneByClientPreApplyId(addHandleLogDetail.getClient_pre_apply_id()); - if (apply == null) { - throw new NotFoundException("Apply Record Not Found Please Check"); - } - JSONObject detail = addHandleLogDetail.insertObject(); - detail.put("auditor", manager.getString("display_name")); - detail.put("client_id", apply.getIntValue("client_id")); - detail.put("auditor_id", manager.getString("manager_id")); - detail.put("create_time", new Date()); - preApplyHandleLogMapper.save(detail); - apply.put("status",1); - sysClientPreMapperMapper.update(apply); - - } - - @Override - public void closeHandle(JSONObject manager, String client_pre_apply_id) { - JSONObject apply = sysClientPreMapperMapper.findOneByClientPreApplyId(client_pre_apply_id); - if (apply == null) { - throw new NotFoundException("Apply Record Not Found Please Check"); - } - if (apply.getIntValue("status") == 2) { - throw new BadRequestException("The Record Has Been Handled"); - } - JSONObject detail = new JSONObject(); - detail.put("client_pre_apply_id", client_pre_apply_id); - detail.put("client_id", apply.getIntValue("client_id")); - detail.put("auditor", manager.getString("display_name")); - detail.put("auditor_id", manager.getString("manager_id")); - detail.put("remark", "结停"); - detail.put("create_time", new Date()); - preApplyHandleLogMapper.save(detail); - apply.put("status", 2); - sysClientPreMapperMapper.update(apply); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java deleted file mode 100644 index 0e52611ec..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ /dev/null @@ -1,892 +0,0 @@ -package au.com.royalpay.payment.manage.application.core.impls; - -import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; -import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.core.mappers.PmtSubMerchantIdMapper; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager; -import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.support.sms.SmsSender; -import au.com.royalpay.payment.manage.support.sms.msg.OpenMessage; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import au.com.royalpay.payment.manage.system.core.MailGunService; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import au.com.royalpay.payment.tools.utils.PdfUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.parser.Feature; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.multipart.MultipartFile; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletRequest; -import java.awt.image.BufferedImage; -import java.io.*; -import java.net.URISyntaxException; -import java.net.URLDecoder; -import java.time.Duration; -import java.util.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -@Service -public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { - - @Resource - private MpPaymentApi mpPaymentApi; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private MailGunService mailGunService; - @Resource - private MailService mailService; - @Resource - private AttachmentClient attachmentClient; - @Resource - private PermissionPartnerManager permissionPartnerManager; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private SysClientLegalPersonMapper sysClientLegalPersonMapper; - @Resource - private ClientManager clientManager; - @Resource - private SignInAccountService signInAccountService; - @Resource - private SimpleClientApplyService simpleClientApplyService; - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private SysClientPreMapperMapper sysClientPreMapperMapper; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientRateMapper clientRateMapper; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private PmtSubMerchantIdMapper pmtSubMerchantIdMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private SysCustomerSubscribeMapper subscribeMapper; - - @Resource - private ClientBDMapper clientBDMapper; - private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2021/09/07/1630997571126_fqWcLQ5Rx0wFm8pVwpKuI1gjf6FmwX.pdf"; - @Resource - private SmsSender smsSender; - @Resource - private StringRedisTemplate stringRedisTemplate; - private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT"; - private final String REGISTER_CLIENT_PROCESS_PREFIX = "REGISTER_CLIENT_PROCESS"; - private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL"; - private final String LOGIN_CLIENT_PREFIX = "LGOIN_CLIENT"; - private final String LOGIN_CLIENT_PROCESS_PREFIX = "LOGIN_CLIENT_PROCESS"; - private static final String CLIENT_AGREE_FILE = "client_agree_file"; - private final List tags = new ArrayList<>(); - - @PostConstruct - public void init() { - tags.add("account"); - } - - @Override - public void verifyRegisterSMSCode(String codeKey, String phoneNumber) { - String rediskey = getRegisterClientRedisKey(phoneNumber); - String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); - if (codeValue == null || !codeValue.equals(codeKey)) { - throw new BadRequestException("Verification code has expired or is not correct"); - } - stringRedisTemplate.delete(rediskey); - } - - @Override - public JSONObject newAccount(NewAccountBean accountBean) { - return null; - } - - @Override - public String partnerSignIn(JSONObject account) { - return null; - } - - @Override - public String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request) { - String reidsCheckCodeKey = getRegisterClientRedisKey(phoneNumber); - String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); - if (StringUtils.isNotEmpty(value)) { - throw new BadRequestException("SMS has been sent,Please check your messages or try again in 3 minutes."); - } - String registerClientCode = RandomStringUtils.random(6, false, true); - int expireMin = 3; - logger.debug("send {} sms code : {} ",phoneNumber, registerClientCode); - smsSender.sendAuthCodeMessage(nationCode.trim(),phoneNumber,request.getLocales().nextElement(),new AuthCodeMessage("RoyalPay", registerClientCode,expireMin)); - stringRedisTemplate.boundValueOps(getRegisterClientRedisKey(phoneNumber)).set(registerClientCode, Duration.ofMinutes(expireMin)); - return registerClientCode; - } - - @Override - public void sendOpenSms(String phoneNumber, String nationCode) { - try { - smsSender.sendOpenMessage(nationCode.trim(), phoneNumber, Locale.CHINESE, new OpenMessage(phoneNumber)); - } catch (Exception e) { - e.printStackTrace(); - throw new ServerErrorException("Phone number is wrong Please try again"); - } - } - - @Override - public void sendVerifyEmail(String address, int client_id, String username) { - JSONObject client = clientManager.getClientInfo(client_id); - if (client == null) { - throw new BadRequestException("Merchant not found"); - } - if (client.getBooleanValue("mail_confirm")) { - throw new BadRequestException("mail address has been verified"); - } - String key = checkOrGenerateVerifyMailKey(address, null); - Context ctx = new Context(); - ctx.setVariable("url", PlatformEnvironment.getEnv().concatUrl("/register/account/mail/" + address + "/verify/" + key + "/jump?username=" + username)); - final String content = thymeleaf.process("mail/register_application", ctx); - // SendMail sendMail = new SendMail(); - // Set to = new HashSet<>(); - // to.add(address); - // sendMail.setMailTos(to); - // sendMail.setFrom("info@mail.royalpay.com.au"); - // sendMail.setTitle("Royalpay"); - // sendMail.setContent(content); - // sendMail.setTags(tags); - // mailGunService.sendMail(sendMail); - - Runnable task2 = () -> { - try { - String emailId = mailService.sendEmail("This is a verification email", address, "", content); - } catch (Exception ignore) { - } - }; - pool.execute(task2); - - } - - @Override - public String checkOrGenerateRegisterProcessKey(String accountName, String codeKey) { - Assert.notNull(accountName, "accountName can't be null"); - if (StringUtils.isNotEmpty(codeKey)) { - String redisAccountName = stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(codeKey)).get(); - if (!accountName.equals(redisAccountName)) { - throw new BadRequestException("Data error,Please re-register for safety."); - } else { - return codeKey; - } - } - String key = RandomStringUtils.random(10, true, false); - stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(key)).set(accountName, 1, TimeUnit.HOURS); - return key; - } - - @Override - public void deleteRegisterProcessKey(String codeKey) { - stringRedisTemplate.delete(getRegisterClientProcessRedisKey(codeKey)); - } - - @Override - public String checkOrGenerateVerifyMailKey(String address, String codeKey) { - Assert.notNull(address, "address can't be null"); - if (StringUtils.isNotEmpty(codeKey)) { - String redisAddress = stringRedisTemplate.boundValueOps(getVerifyMailRedisKey(codeKey)).get(); - if (!address.equals(redisAddress)) { - throw new BadRequestException("Mail expired"); - } else { - return codeKey; - } - } - String key = RandomStringUtils.random(10, true, false); - stringRedisTemplate.boundValueOps(getVerifyMailRedisKey(key)).set(address, 1, TimeUnit.HOURS); - return key; - - } - - @Override - public void deleteVerifyMailKey(String codeKey) { - stringRedisTemplate.delete(getVerifyMailRedisKey(codeKey)); - } - - @Override - public void checkAccountName(String contact_phone, String nation_code) { - nation_code = nation_code.trim(); - if (!nation_code.startsWith("+")) { - nation_code = "+" + nation_code; - } - List account = clientAccountMapper.findByPhone(contact_phone, nation_code); - if (account != null && !account.isEmpty()) { - throw new ForbiddenException("用户名已被注册"); - } - } - - @Override - public void subscribeNewsletter(String mail, String lang) { - JSONObject subscribeInfo = subscribeMapper.findByEmail(mail); - Date newDate = new Date(); - if (subscribeInfo != null && subscribeInfo.getBoolean("is_valid")) { - throw new BadRequestException("您已订阅成功,请勿重新提交"); - } - String imageUrl = lang == null || "zh".equals(lang) ? "royalpay_newsletter_thank_you.png" : "royalpay_newsletter_thank_you_en.png"; - Context ctx = new Context(); - ctx.setVariable("imageUrl", PlatformEnvironment.getEnv().concatUrl("/static/images/" + imageUrl)); - final String content = thymeleaf.process("mail/subscribe_mail.html", ctx); - try { - String emailId = mailService.sendEmail("You have successfully subscribed to Newsletter", mail, "", content); - if (subscribeInfo == null) { - subscribeInfo = new JSONObject(); - subscribeInfo.put("approve_email_id", emailId); - subscribeInfo.put("subscribe_email", mail); - subscribeInfo.put("create_time", newDate); - subscribeInfo.put("update_time", newDate); - subscribeMapper.save(subscribeInfo); - return; - } - if (!subscribeInfo.getBoolean("is_valid")) { - subscribeInfo.put("approve_email_id", emailId); - subscribeInfo.put("is_valid", 1); - subscribeInfo.put("update_time", newDate); - subscribeMapper.update(subscribeInfo); - } - - - } catch (URISyntaxException | IOException e) { - e.printStackTrace(); - } - } - - @Override - public JSONObject getSourceAggregateFile(String username ,String clean_days) { - JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - - String address = apply.getString("address").trim(); - if (address.contains(",")) { - apply.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - apply.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - apply.put("acn_type", "ABN: (" + apply.getString("abn") + ")"); - apply.put("company_name_acn", apply.getString("company_name") + " (ABN " + apply.getString("abn") + ")"); - apply.put("clean", "T+" + clean_days.trim()); - apply.put("clean_days", clean_days); - - apply.put("located_country", "Australia"); - if("1".equalsIgnoreCase(apply.getString("clean_days"))){ -// clean_1 clean_1_friday clean_1_saturday - // second, third or fourth - apply.put("clean_1", apply.getString("clean_days")); - apply.put("clean_1_friday", "first"); - apply.put("clean_1_saturday", "second"); - }else if("2".equalsIgnoreCase(apply.getString("clean_days"))){ - apply.put("clean_1", apply.getString("clean_days")); - apply.put("clean_1_friday", "second"); - apply.put("clean_1_saturday", "third"); - }else if("3".equalsIgnoreCase(apply.getString("clean_days"))){ - apply.put("clean_1", apply.getString("clean_days")); - apply.put("clean_1_friday", "third"); - apply.put("clean_1_saturday", "fourth"); - } - JSONObject sysConfig = sysConfigManager.getSysConfig(); - JSONObject test = JSON.parseObject(sysConfig.getString("sys_apply_rates")); - - JSONObject rate = test.getJSONObject("t"+clean_days.trim()); - - apply.put("wechat_rate",rate.getString("Wechat")); - apply.put("alipay_rate",rate.getString("Alipay")); - apply.put("alipay_online_rate",rate.getString("AlipayOnline")); - apply.put("cbbank_rate",rate.getString("CB_Bankpay")); - - JSONObject bankInfo = getBankInfo(apply.getString("bsb_no")); - apply.put("bank", bankInfo.getString("bank")); - apply.put("bsb_no", apply.getString("bsb_no")); - apply.put("account_no", apply.getString("bank_no")); - apply.put("account_name", apply.getString("bank_name")); - - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - apply.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - apply.put("end_date", end_date); - - apply.put("legal_person", apply.getString("representative_person")); - apply.put("legal_job_title", apply.getString("representative_job_title")); - apply.put("legal_phone", apply.getString("representative_phone")); - apply.put("legal_email", apply.getString("representative_email")); - apply.put("client_contract_manager", apply.getString("representative_person"));//client contract manager - return exportClientAggregateFile(apply); - } - - private JSONObject exportClientAggregateFile(JSONObject apply) { - InputStream stream = null; - JSONObject result = new JSONObject(); - try { - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE); - pdu.setPdfTemplate(apply); - File file = new File(apply.getString("username") + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileInfo = attachmentClient.uploadFile(stream, apply.getString("username") + "_" + System.currentTimeMillis() + "_agreement_source.pdf", false); - result.put("file_value", fileInfo.getString("url")); - } catch (Exception e) { - throw new BadRequestException("获取合同文件失败"); - } - return result; - } - - @Override - @Transactional - public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) { - JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - String salt = PasswordUtils.newSalt(); - applyInfo.put("salt", salt); - applyInfo.put("password_hash", PasswordUtils.hashPwd(applyInfo.getString("password"), salt)); - applyInfo.put("password_aes", PasswordUtils.encryptAESPwd(applyInfo.getString("password"))); - if (apply == null) { - sysClientPreMapperMapper.save(applyInfo); - } else { - applyInfo.put("client_pre_apply_id", apply.getIntValue("client_pre_apply_id")); - applyInfo.put("update_time", new Date()); - sysClientPreMapperMapper.update(applyInfo); - if (applyInfo.getBooleanValue("agree")) { - applyerToClient(username, null); - } - } - } - - @Override - public JSONObject getPayType() { - String[] online_desc = {"pc网站|PC Web","手机端网站|Mobile Web","APP ","微信内/支付宝内网站|Wechat/Alipay JSAPI","小程序|MiniProgram"}; - String[] online_desc_value = {"101","102","103","104","105"}; - - String[] offline_desc = {"二维码立牌|QR Code","Royalpay POS","收银系统|POS","无人售货机|Vending machine"}; - String[] offline_desc_value = {"201","202","203","204"}; - - String[] pos = {"ipos","pospal","Aus Post","Lotus","AoShangBao","Infinity","EasyCloud","AoMaiKe","其他|other"}; - String[] pos_value = {"20301","20302","20303","20304","20305","20306","20307","20308","20399"}; - - JSONObject payType = new JSONObject(); - List online = new ArrayList<>(); - List offline = new ArrayList<>(); - List sub = new ArrayList<>(); - - for(int i =0 ; i< pos.length;i++) { - JSONObject temp = new JSONObject(); - temp.put("label",pos[i]); - temp.put("value",pos_value[i]); - sub.add(temp); - } - - for(int i =0 ; i< online_desc.length;i++) { - JSONObject temp = new JSONObject(); - temp.put("label",online_desc[i]); - temp.put("value",online_desc_value[i]); - online.add(temp); - } - - for(int i =0 ; i< offline_desc.length;i++) { - JSONObject temp = new JSONObject(); - temp.put("label",offline_desc[i]); - temp.put("value",offline_desc_value[i]); - if("收银系统|POS".equals(offline_desc[i])) { - temp.put("sub",sub); - } - offline.add(temp); - } - payType.put("online",online); - payType.put("offline",offline); - - return payType; - - } - - @Override - public List getSysRate(JSONObject sysConfig){ - HashMap map = JSON.parseObject(sysConfig.getString("sys_apply_rates"),LinkedHashMap.class, Feature.OrderedField); - List rates= new ArrayList<>(); - JSONObject tName = new JSONObject(); - tName.put("t1","T+1"); - tName.put("t2","T+2"); - tName.put("t3","T+3"); - for( String strt:map.keySet()){ - JSONObject t = map.get(strt); - List data = new ArrayList<>(); - for(String str:t.keySet()){ - JSONObject rate = new JSONObject(); - rate.put("channel",str); - rate.put("rate",t.get(str)); - data.add(rate); - } - JSONObject temp = new JSONObject(); - temp.put("data",data); - temp.put("name",tName.getString(strt)); - rates.add(temp); - } - return rates; - } - - @Override - public List getIndustryMap(){ - List industryMap = new ArrayList<>(); - - String[] industryLabel ={"鞋包服饰","机票行业","软件服务","旅游票务","国际租车","医疗服务(出国)","医疗服务(不出国)","留学教育(网络教育)","留学教育(一年及以下)","其它货物贸易行业","文具/办公用品","综合商城","酒店行业","教育行业","国际物流","数码电器","母婴","化妆品","食品","留学教育(一年以上)","其它服务行业"}; - String[] industryValue ={"327","339","356","357","358","359","360","361","362","338","337","336","328","329","330","332","333","334","335","363","331"}; - - for(int i =0 ; i< industryLabel.length;i++) { - JSONObject temp = new JSONObject(); - temp.put("label",industryLabel[i]); - temp.put("value",industryValue[i]); - industryMap.add(temp); - } - return industryMap; - } - - @Override - public JSONObject getPreApplyInfoForAggree(String username ,String clean_days) { - - JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - - String address = apply.getString("address").trim(); - if (address.contains(",")) { - apply.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - apply.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - apply.put("acn_type", "ABN: (" + apply.getString("abn") + ")"); - apply.put("company_name_acn", apply.getString("company_name") + " (ABN " + apply.getString("abn") + ")"); - apply.put("clean", "T+" + clean_days.trim()); - apply.put("clean_days", clean_days); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - JSONObject test = JSON.parseObject(sysConfig.getString("sys_apply_rates")); - JSONObject rate = test.getJSONObject("t" + clean_days.trim()); - apply.put("wechat_rate",rate.getString("Wechat")); - apply.put("alipay_rate",rate.getString("Alipay")); - apply.put("alipay_online_rate",rate.getString("AlipayOnline")); - apply.put("cbbank_rate",rate.getString("CB_Bankpay")); - - JSONObject bankInfo = getBankInfo(apply.getString("bsb_no")); - apply.put("bank", bankInfo.getString("bank")); - apply.put("bsb_no", apply.getString("bsb_no")); - apply.put("account_no", apply.getString("bank_no")); - apply.put("account_name", apply.getString("bank_name")); - - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - apply.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - apply.put("end_date", end_date); - - apply.put("legal_person", apply.getString("representative_person")); - apply.put("legal_job_title", apply.getString("representative_job_title")); - apply.put("legal_phone", apply.getString("representative_phone")); - apply.put("legal_email", apply.getString("representative_email")); - - return apply; - } - - - @Override - public JSONObject getClientAggregateFile(String username, MultipartFile file ,String clean_days, JSONObject signInfo) throws IOException{ - JSONObject apply = getPreApplyInfoForAggree(username ,clean_days); - apply.put("full_name", URLDecoder.decode(file.getOriginalFilename(),"UTF-8")); - BufferedImage img = ImageIO.read(file.getInputStream()); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ImageIO.write(img, "png", out); - apply.put("img","data:image/png;base64," + Base64.encodeBase64String(out.toByteArray())); - - return exportImgAggregateFile(username, apply, signInfo); - } - - private JSONObject exportImgAggregateFile(String username, JSONObject apply, JSONObject signInfo) throws IOException { - InputStream stream = null; - JSONObject contractInfo = new JSONObject(); - try { - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE); - pdu.setPdfTemplate(apply); - File file = new File(username + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file, "STSong-Light", "UniGB-UCS2-H"); - stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileInfo = attachmentClient.uploadFile(stream, username + "_" + System.currentTimeMillis() + "_agreement.pdf", false); - - contractInfo.put("contract_url", fileInfo.getString("url")); - apply.put("contract_url", contractInfo.getString("contract_url")); - signInfo.put("contract_url", contractInfo.getString("contract_url")); - apply.put("agree", true); - apply.put("update_time", new Date()); - sysClientPreMapperMapper.update(apply); - } catch (Exception e) { - logger.error("合同制作出现问题:", e); - throw new BadRequestException("合同制作出现问题:" + e.getMessage()); - } finally { - stream.close(); - } - applyerToClient(apply.getString("username"), signInfo); - return contractInfo; - } - - //todo - private void applyerToClient(String username, JSONObject signInfo) { - JSONObject sysConfig = sysConfigManager.getSysConfig(); - String arr[] = sysConfig.getString("temp_sub_mch_id").split(","); - List availableMerchants = WechatPayEnvironment.getEnv().getWechatMerchantConfigs().stream() - .filter(mch -> StringUtils.equals(mch.getMpId(), "globalpay")) - .map(WeChatPayConfig.Merchant::getMerchantId) - .collect(Collectors.toList()); - JSONObject subMerchant = pmtSubMerchantIdMapper.randomOne(availableMerchants); - if (subMerchant == null) { - throw new BadRequestException("System is busy Please try again"); - } - Date now = new Date(); - JSONObject param = new JSONObject(); - param.put("begin_time", DateFormatUtils.format(now, "YYYYMMdd")); - param.put("end_time", DateFormatUtils.format(DateUtils.addDays(now, 1), "YYYYMMdd")); - param.put("agree", true); - List existCount = sysClientPreMapperMapper.query(param); - if (existCount.size() > 30) { - throw new BadRequestException("New merchant over limit,Please contact us"); - } - JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - - List account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61"); - if (account != null && !account.isEmpty()) { - throw new ForbiddenException("The user name has been registered"); - } - String clientMoniker = generateClientMoniker(); - JSONObject sysClient = new JSONObject(); - JSONObject followBd = managerMapper.findByLoginId("customerservice"); - - sysClient.put("bd_user", followBd.getString("manager_id")); - sysClient.put("bd_user_name", followBd.getString("display_name")); - sysClient.put("company_name", apply.getString("company_name")); - sysClient.put("abn", apply.getString("abn")); - sysClient.put("short_name", apply.getString("short_name")); - sysClient.put("address", apply.getString("address")); - sysClient.put("suburb", apply.getString("suburb")); - sysClient.put("state", apply.getString("state")); - sysClient.put("postcode", apply.getString("postcode")); - sysClient.put("royalpayindustry", apply.getString("industry")); - sysClient.put("alipayindustry", apply.getString("alipayindustry")); - sysClient.put("industry", apply.getString("wechatindustry")); - sysClient.put("enable_wechat", 1); - if (StringUtils.isBlank(apply.getString("wechatindustry"))) { - sysClient.put("industry", 331); - sysClient.put("enable_wechat", 0); - } - sysClient.put("contact_person", apply.getString("contact_person")); - sysClient.put("contact_job", apply.getString("contact_job")); - sysClient.put("logo_url", apply.getString("logo_url")); - sysClient.put("company_website", apply.getString("company_website")); - sysClient.put("company_photo", apply.getString("company_photo")); - sysClient.put("store_photo", apply.getString("store_photo")); - sysClient.put("contact_email", apply.getString("contact_email")); - sysClient.put("contact_phone", "+61" + apply.getString("contact_phone")); - sysClient.put("company_phone", apply.getString("company_phone")); - sysClient.put("client_moniker", clientMoniker); - sysClient.put("create_time", new Date()); - sysClient.put("source", 4); - sysClient.put("org_id", 1); - sysClient.put("approve_result", 2); - sysClient.put("approve_time", new Date()); - sysClient.put("creator", 0); - sysClient.put("business_name", apply.getString("short_name")); - /*sysClient.put("industry", 331);*/ - sysClient.put("merchant_id", subMerchant.getString("merchant_id")); - sysClient.put("sub_merchant_id", subMerchant.getString("sub_merchant_id")); - sysClient.put("common_sub_merchant_id", 1); - sysClient.put("skip_clearing", 1); - sysClient.put("clean_days", apply.getIntValue("clean_days")); - sysClient.put("country", "AUS"); - sysClient.put("credential_code", RandomStringUtils.random(32, true, true)); - sysClient.put("ali_sub_merchant_id", clientMoniker); - clientMapper.save(sysClient); - - JSONObject representativeInfo = new JSONObject(); - representativeInfo.put("client_id", sysClient.getIntValue("client_id")); - representativeInfo.put("representative_person", apply.getString("representative_person")); - representativeInfo.put("job_title", apply.getString("representative_job_title")); - representativeInfo.put("phone", apply.getString("representative_phone")); - representativeInfo.put("email", apply.getString("representative_email")); - representativeInfo.put("address", apply.getString("registered_address")); - representativeInfo.put("suburb", apply.getString("registered_suburb")); - representativeInfo.put("state", apply.getString("registered_state")); - representativeInfo.put("postcode", apply.getString("registered_postcode")); - sysClientLegalPersonMapper.save(representativeInfo); - - JSONObject clientBd = new JSONObject(); - clientBd.put("client_id", sysClient.getIntValue("client_id")); - clientBd.put("bd_id", followBd.getString("manager_id")); - clientBd.put("bd_name", followBd.getString("display_name")); - clientBd.put("create_time", new Date()); - clientBd.put("create_id", "0"); - clientBd.put("start_date", new Date()); - clientBd.put("proportion", 1); - clientBDMapper.saveBD(clientBd); - - int clientId = sysClient.getIntValue("client_id"); - - JSONObject sysAccount = new JSONObject(); - sysAccount.put("username", apply.getString("username")); - sysAccount.put("display_name", apply.getString("contact_person")); - sysAccount.put("salt", apply.getString("salt")); - sysAccount.put("role", 1); - sysAccount.put("password_hash", apply.getString("password_hash")); - sysAccount.put("password_aes", apply.getString("password_aes")); - sysAccount.put("creator", 0); - sysAccount.put("contact_phone", apply.getString("contact_phone")); - sysAccount.put("client_id", clientId); - sysAccount.put("create_time", new Date()); - sysAccount.put("is_password_expired", 0); - sysAccount.put("nation_code", "+61"); - clientAccountMapper.save(sysAccount); - - if (signInfo != null) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", sysClient.getString("client_id")); - fileJson.put("last_update_date", new Date()); - //fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", CLIENT_AGREE_FILE); - fileJson.put("file_value", signInfo.getString("contract_url")); - fileJson.put("status", 1); - fileJson.put("signature_time", new Date()); - fileJson.put("signature_ip", signInfo.getString("signature_ip")); - fileJson.put("user_agent", signInfo.getString("user_agent")); - fileJson.put("signature_account_id", sysAccount.getString("account_id")); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - } - - JSONObject sysBank = new JSONObject(); - sysBank.put("client_id", clientId); - sysBank.put("account_no", apply.getString("bank_no")); - sysBank.put("account_name", apply.getString("bank_name")); - sysBank.put("bsb_no", apply.getString("bsb_no")); - JSONObject bankInfo = getBankInfo(apply.getString("bsb_no")); - sysBank.put("bank", bankInfo.getString("bank")); - sysBank.put("city", bankInfo.getString("city")); - sysBank.put("address", bankInfo.getString("address")); - sysBank.put("system", bankInfo.getString("system")); - sysBank.put("postcode", bankInfo.getString("postcode")); - sysBank.put("state", bankInfo.getString("state")); - sysBank.put("branch", bankInfo.getString("branch")); - clientBankAccountMapper.save(sysBank); - - JSONObject clientConfig = new JSONObject(); - clientConfig.put("client_id", clientId); - clientConfig.put("skip_clearing", 1); - clientConfig.put("enable_wechat", 1); - clientConfig.put("client_moniker", clientMoniker); - clientConfig.put("clean_days", apply.getIntValue("clean_days")); - clientConfig.put("common_sub_merchant_id", 1); - if (StringUtils.isNotBlank(apply.getString("client_pay_type")) && StringUtils.isNotBlank(apply.getString("client_pay_desc"))) { - clientConfig.put("client_pay_type", apply.getString("client_pay_type")); - clientConfig.put("client_pay_desc", apply.getString("client_pay_desc")); - } - clientConfigMapper.save(clientConfig); - - apply.put("client_moniker", clientMoniker); - sysClientPreMapperMapper.update(apply); - - permissionPartnerManager.permissionClientModuleSave(clientId, clientMoniker); - - JSONObject sysRate = new JSONObject(); - sysRate.put("client_id", clientId); - sysRate.put("clean_days", apply.getIntValue("clean_days")); - sysRate.put("remark", "自主申请"); - sysRate.put("create_time", new Date()); - sysRate.put("update_time", new Date()); - sysRate.put("active_time", DateFormatUtils.format(DateUtils.addDays(new Date(),-1), "yyyy-MM-dd")); - sysRate.put("expiry_time", DateFormatUtils.format(DateUtils.addYears(new Date(), 1), "yyyy-MM-dd")); - - JSONObject rateConfig = JSON.parseObject(sysConfig.getString("sys_apply_rates")); - JSONObject chooseRate = new JSONObject(); - if (apply.getIntValue("clean_days") == 1) { - chooseRate = rateConfig.getJSONObject("t1"); - } - if (apply.getIntValue("clean_days") == 2) { - chooseRate = rateConfig.getJSONObject("t2"); - } - if (apply.getIntValue("clean_days") == 3) { - chooseRate = rateConfig.getJSONObject("t3"); - } - sysRate.putAll(chooseRate); - - configNewClientRate(sysRate, clientId, "Wechat", "Wechat"); - configNewClientRate(sysRate, clientId, "Alipay", "Alipay"); - configNewClientRate(sysRate, clientId, "AlipayOnline", "AlipayOnline"); - configNewClientRate(sysRate, clientId, "CB_BankPay", "CB_Bankpay"); - Runnable task2 = () -> { - try { - if (signInfo != null) { -// clientManager.registerClientApplyGMS(clientMoniker, sysAccount.getString("account_id")); - }else { - clientManager.getNewAggregateAgreeFile(clientMoniker, null, true); - } - } catch (Exception ignore) { - logger.error("{}自助申请成功,支付宝报备失败:{}",clientMoniker,ignore); - } - //发送开通短信和邮件 - try { - simpleClientApplyService.sendOpenSms(apply.getString("contact_phone"), "61"); -// clientManager.sendOpenEmail(sysClient, apply.getString("username"), apply.getString("password")); - } catch (Exception e) { - logger.error("{}:发送短信或邮件失败:{}",clientMoniker,e); - } - }; - pool.execute(task2); - } - - private String generateClientMoniker() { - String clientMoniker = RandomStringUtils.random(4, true, true).toUpperCase(); - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client != null) { - generateClientMoniker(); - } - return clientMoniker; - } - - private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey) { - if (config.containsKey(rateKey)) { - JSONObject newConfig = new JSONObject(); - newConfig.putAll(config); - newConfig.put("rate_value", config.getBigDecimal(rateKey)); - newConfig.put("rate_name", channel); - if (!clientRateMapper.listClientRatesForSaving(clientId, config.getDate("active_time"), config.getDate("expiry_time"), - config.getBigDecimal("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) { - return; - } - List existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel); - for (JSONObject rateLog : existRate) { - rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1)); - clientRateMapper.updateConfig(rateLog); - } - clientRateMapper.saveRate(newConfig); - } - } - - @Override - public JSONObject getBankInfo(String bsb_no) { - String url = "https://api.bank.codes/au-bsb/json/ab9379cfdab559509bbdcdd11923489f/" + bsb_no; - JSONObject banInfo = new JSONObject(); - try { - HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute(); - if (result.isSuccess()) { - banInfo = result.getResponseContentJSONObj(); - if (!banInfo.getBooleanValue("valid")){ - throw new NotFoundException("BSB Number Not Found"); - } - } - } catch (IOException e) { - throw new ServerErrorException(); - } - return banInfo; - } - - @Override - public void verifyMail(String address, JSONObject loginAccount) { - LoginInfo loginInfo = new LoginInfo(); - loginInfo.setLoginId(loginAccount.getString("userName")); - loginInfo.setPassword(loginAccount.getString("password")); - JSONObject account = signInAccountService.clientLoginCheck(loginInfo); - JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); - if (!address.equals(client.getString("contact_email"))) { - throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); - } - JSONObject record = new JSONObject(); - record.put("client_id", client.getIntValue("client_id")); - record.put("mail_confirm", true); - clientMapper.update(record); - } - - private String getRegisterClientRedisKey(String phoneNumber) { - return REGISTER_CLIENT_PREFIX + phoneNumber; - } - - private String getRegisterClientProcessRedisKey(String codeKey) { - return REGISTER_CLIENT_PROCESS_PREFIX + codeKey; - } - - - //region 手机登录 - @Override - public void getAndSendLoginSmsCode(String phoneNumber, String nationCode, HttpServletRequest request) { - JSONObject result = new JSONObject(); - String reidsCheckCodeKey = getLoginClientRedisKey(phoneNumber); - String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); - if (StringUtils.isNotEmpty(value)) { - throw new BadRequestException("SMS has been sent,Please check your messages or try again in 1 minutes."); - } - String registerClientCode = RandomStringUtils.random(6, false, true); - logger.debug("{} phone sms send code :{}",phoneNumber,registerClientCode); - int expireMin = 1; - smsSender.sendAuthCodeMessage(nationCode.trim(),phoneNumber,request.getLocales().nextElement(),new AuthCodeMessage("RoyalPay", registerClientCode,expireMin)); - stringRedisTemplate.boundValueOps(getLoginClientRedisKey(phoneNumber)).set(registerClientCode, Duration.ofMinutes(expireMin)); - } - - @Override - public void verifyLoginSMSCode(String codeKey, String phoneNumber) { - String rediskey = getLoginClientRedisKey(phoneNumber); - String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); - if (codeValue == null || !codeValue.equals(codeKey)) { - throw new BadRequestException("Verification code has expired or is not correct"); - } - stringRedisTemplate.delete(rediskey); - } - - private String getVerifyMailRedisKey(String codekey) { - return VERIFY_MAIL_PREFIX + codekey; - } - - private String getLoginClientRedisKey(String phoneNumber){ - return LOGIN_CLIENT_PREFIX + phoneNumber; - } - - private String getLoginClientProcessRedisKey(String codeKey) { - return LOGIN_CLIENT_PROCESS_PREFIX + codeKey; - } - //endregion -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientServiceImp.java deleted file mode 100644 index fc57b451c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientServiceImp.java +++ /dev/null @@ -1,198 +0,0 @@ -package au.com.royalpay.payment.manage.application.core.impls; - -import au.com.royalpay.payment.manage.application.core.SimpleClientService; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.util.*; - -/** - * Created by yishuqian on 03/03/2017. - */ -@Service -public class SimpleClientServiceImp implements SimpleClientService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientMapper clientMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ManagerMapper managerMapper; - - @Override - public JSONObject getClientFiles(JSONObject partner) { - List existFiles = clientFilesMapper.findClientFile(partner.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - for (JSONObject file : existFiles) { - fileJson.put(file.getString("file_name"), file.getString("file_value")); - } - return fileJson; - } - - @Override - public JSONObject getBankAccount(JSONObject partner) { - List list = clientBankAccountMapper.clientBankAccounts(partner.getIntValue("client_id")); - return list.isEmpty() ? new JSONObject() : list.get(0); - } - - @Override - public JSONObject getClientInfo(JSONObject partner) { - int client_id = partner.getIntValue("client_id"); - JSONObject client = clientMapper.findClient(client_id); - JSONObject bankInfo = getBankAccount(partner); - if (bankInfo != null && !bankInfo.isEmpty()) { - client.put("bankaccount", bankInfo); - } - JSONObject fileInfo = getClientFiles(partner); - if (fileInfo != null && !fileInfo.isEmpty()) { - client.put("file", fileInfo); - } - return client; - } - - @Override - public Map getGreenChannelClients(String managerId) { - JSONObject config = sysConfigManager.getSysConfig(); - JSONObject params = new JSONObject(); - params.put("approve_time", new Date()); - params.put("open_status", "3"); - params.put("managerId", managerId); - params.put("interval_begin_day", config.getIntValue("green_channel_timeout")); - List timeoutClients = clientMapper.listGreenChannel(params); - - params.put("interval_begin_day", config.getIntValue("green_channel_waring")); - params.put("interval_end_day", config.getIntValue("green_channel_timeout")); - List waringClients = clientMapper.listGreenChannel(params); - - Map result = new HashMap<>(); - - for (JSONObject client : waringClients) { - String key = client.getString("manager_id"); - if (result.containsKey(key)) { - JSONObject asd = result.get(key); - JSONArray qwe = asd.getJSONArray("waring"); - qwe.add(client); - asd.put("waring", qwe); - } else { - JSONObject resultElement = new JSONObject(); - JSONArray list = new JSONArray(); - list.add(client); - resultElement.put("waring", list); - resultElement.put("timeout", new ArrayList<>()); - result.put(key, resultElement); - } - } - - for (JSONObject client : timeoutClients) { - String key = client.getString("manager_id"); - if (result.containsKey(key)) { - JSONObject asd = result.get(key); - JSONArray qwe = asd.getJSONArray("timeout"); - qwe.add(client); - asd.put("timeout", qwe); - - } else { - JSONObject resultElement = new JSONObject(); - JSONArray list = new JSONArray(); - list.add(client); - resultElement.put("timeout", list); - resultElement.put("waring", new ArrayList<>()); - result.put(key, resultElement); - } - } - return result; - } - - @Override - public void checkGreenChannelClients() { - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - String templateId = api.getTemplateId("daily-green-channel"); - Map jo = getGreenChannelClients(null); - int totalWaring = 0; - int totalTimeout = 0; - for (Map.Entry entry : jo.entrySet()) { - JSONObject clients = entry.getValue(); - JSONArray waring = clients.getJSONArray("waring"); - JSONArray timeout = clients.getJSONArray("timeout"); - String open_id = null; - String manager_id = null; - if (!CollectionUtils.isEmpty(waring)) { - open_id = ((JSONObject) clients.getJSONArray("waring").get(0)).getString("wx_openid"); - manager_id = ((JSONObject) clients.getJSONArray("waring").get(0)).getString("manager_id"); - } - if (!CollectionUtils.isEmpty(timeout)) { - open_id = ((JSONObject) clients.getJSONArray("timeout").get(0)).getString("wx_openid"); - manager_id = ((JSONObject) clients.getJSONArray("timeout").get(0)).getString("manager_id"); - } - if (StringUtils.isEmpty(open_id)) { - continue; - } - - String waringClientMoniker = ""; - String timeoutClientMoniker = ""; - for (Object o : waring) { - waringClientMoniker += ((JSONObject) o).getString("client_moniker"); - waringClientMoniker += ";"; - totalWaring++; - } - for (Object o : timeout) { - timeoutClientMoniker += ((JSONObject) o).getString("client_moniker"); - timeoutClientMoniker += ";"; - totalTimeout++; - } - - try { - TemplateMessage msg = new TemplateMessage(open_id, templateId, - PlatformEnvironment.getEnv().concatUrl("/analysis/daily_reports/greenChannel/" + manager_id)); - msg.put("first", "绿色通道商户预警", "#ff0000"); - msg.put("keyword1", DateFormatUtils.format(new Date(), "yyyy-MM-dd"), "#ff0000"); - msg.put("keyword2", "即将到期的商户" + waring.size() + "个(" + waringClientMoniker + ")已经过期的商户" + timeout.size() + "个(" + timeoutClientMoniker + ")", - "#ff0000"); - msg.put("remark", " ", "#ff0000"); - api.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error("checkGreenChannelClientsError," + open_id + "," + e.getMessage()); - } - - } - - List operators = managerMapper.listOpenIdsOfCompliances(); - for (String operator_openid : operators) { - if (StringUtils.isEmpty(operator_openid)) { - continue; - } - try { - TemplateMessage msg = new TemplateMessage(operator_openid, templateId, - PlatformEnvironment.getEnv().concatUrl("/analysis/daily_reports/greenChannel")); - msg.put("first", "绿色通道商户预警", "#ff0000"); - msg.put("keyword1", DateFormatUtils.format(new Date(), "yyyy-MM-dd"), "#ff0000"); - msg.put("keyword2", "即将到期的商户" + totalWaring + "个,已经过期的商户" + totalTimeout + "个", "#ff0000"); - msg.put("remark", " ", "#ff0000"); - api.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error("checkGreenChannelClientsError," + operator_openid + "," + e.getMessage()); - } - - } - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/ContentController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/ContentController.java deleted file mode 100644 index abf996ad2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/ContentController.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.application.web; - -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; - -@Controller -public class ContentController { - - @Resource - private SimpleClientApplyService simpleClientApplyService; - - @GetMapping("/contract/source") - private String helloWorld(Model model,@RequestParam String username, @RequestParam String clean_days){ - JSONObject contractInfo= simpleClientApplyService.getPreApplyInfoForAggree(username ,clean_days); - model.addAttribute("company_phone", contractInfo.getString("company_phone")); - model.addAttribute("legal_phone", contractInfo.getString("legal_phone")); - model.addAttribute("acn_type", contractInfo.getString("acn_type")); - model.addAttribute("account_no", contractInfo.getString("account_no")); - model.addAttribute("contact_email", contractInfo.getString("contact_email")); - model.addAttribute("bank", contractInfo.getString("bank")); - model.addAttribute("account_name", contractInfo.getString("account_name")); - model.addAttribute("legal_email", contractInfo.getString("legal_email")); - model.addAttribute("state", contractInfo.getString("state")); - model.addAttribute("start_date", contractInfo.getString("start_date")); - model.addAttribute("contact_person", contractInfo.getString("contact_person")); - model.addAttribute("postcode", contractInfo.getString("postcode")); - model.addAttribute("clean", contractInfo.getString("clean")); - model.addAttribute("clean_days", contractInfo.getString("clean_days")); - model.addAttribute("legal_job_title", contractInfo.getString("legal_job_title")); - model.addAttribute("bsb_no", contractInfo.getString("bsb_no")); - model.addAttribute("company_name", contractInfo.getString("company_name")); - model.addAttribute("address", contractInfo.getString("address")); - model.addAttribute("suburb", contractInfo.getString("suburb")); - model.addAttribute("wechat_rate", contractInfo.getString("wechat_rate")); - model.addAttribute("cbbank_rate", contractInfo.getString("cbbank_rate")); - model.addAttribute("alipay_online_rate", contractInfo.getString("alipay_online_rate")); - model.addAttribute("alipay_rate", contractInfo.getString("alipay_rate")); - return "contract_for_compliance"; - } - - @GetMapping(value = "/aggregateFile/client_info") - @ResponseBody - public JSONObject getClientInfoByAggree(@RequestParam String username, @RequestParam String clean_days) { - return simpleClientApplyService.getPreApplyInfoForAggree(username ,clean_days); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java deleted file mode 100644 index 465f95631..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ /dev/null @@ -1,139 +0,0 @@ -package au.com.royalpay.payment.manage.application.web; - -import au.com.royalpay.payment.manage.application.beans.ClientPreApplyBean; -import au.com.royalpay.payment.manage.application.beans.ClientPreApplyStep1Bean; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.io.IOException; -import java.util.List; - -@RestController -@RequestMapping("/register") -public class SimpleClientApplyController { - @Resource - private SimpleClientApplyService simpleClientApplyService; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private AttachmentClient attachmentClient; - - @GetMapping("/account/check") - public void checkAccountName(@RequestParam String nation_code, @RequestParam String phone) { - simpleClientApplyService.checkAccountName(phone, nation_code); - } - - @GetMapping("/account/mail/{address}/verify/{codeKey}/jump") - public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address, @RequestParam String username) { - simpleClientApplyService.checkOrGenerateVerifyMailKey(address, codeKey); - ModelAndView view = new ModelAndView("mail/verify_mail"); - view.addObject("codeKey", codeKey); - view.addObject("address", address); - view.addObject("username", username); - return view; - } - - @PostMapping("/account/mail/{address}/verify/{codeKey}") - @ResponseBody - public void verifyMail(@PathVariable String codeKey, @PathVariable String address, @RequestBody JSONObject account) { - simpleClientApplyService.checkOrGenerateVerifyMailKey(address, codeKey); - simpleClientApplyService.verifyMail(address, account); - simpleClientApplyService.deleteVerifyMailKey(codeKey); - } - - @PostMapping("/info/update/{username}/step1") - @ResponseBody - public JSONObject registerCompanyInfoStep1(@PathVariable String username, @RequestBody @Valid ClientPreApplyStep1Bean account) { - JSONObject result = new JSONObject(); - simpleClientApplyService.verifyRegisterSMSCode(account.getPhoneCodeKey(), account.getContact_phone()); - String codeKey = simpleClientApplyService.checkOrGenerateRegisterProcessKey(username, null); - simpleClientApplyService.saveOrUpdateApplyInfo(account.insertObject(), username); - result.put("codeKey",codeKey); - return result; - } - - @PostMapping("/info/phone/{phone_number}/verify") - @ResponseBody - public void getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code, HttpServletRequest request) { - simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code, request); - } - - @PostMapping("/info/update/{username}") - public void registerCompanyInfo(@PathVariable String username, @RequestBody @Valid ClientPreApplyBean applyBean) { - simpleClientApplyService.checkOrGenerateRegisterProcessKey(username,applyBean.getCodeKey()); - if(StringUtils.isNotEmpty(applyBean.getBsb_no().trim())){ - simpleClientApplyService.getBankInfo(applyBean.getBsb_no()); - } - simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username); - } - - @PostMapping(value = "/clientCompliance/commit_aggregate_file") - @ResponseBody - public JSONObject getClientArregateFile(@RequestHeader("User-Agent") String userAgent,@RequestParam MultipartFile file, @RequestParam(value = "username") String username, @RequestParam(value = "clean_days") String clean_days) throws IOException { - JSONObject signInfo = new JSONObject(); - signInfo.put("signature_ip", RequestEnvironment.getClientIp()); - signInfo.put("user_agent", userAgent); - return simpleClientApplyService.getClientAggregateFile(username, file, clean_days, signInfo); - } - - @GetMapping("/client/source_aggregate_file") - public JSONObject getSourceAggregateFile(@RequestParam String username, @RequestParam String clean_days) { - return simpleClientApplyService.getSourceAggregateFile(username, clean_days); - } - - @PostMapping("/upload/files") - public JSONObject uploadImage(@RequestParam MultipartFile file) throws Exception { - return attachmentClient.uploadFile(file, false); - } - - @GetMapping(value = "/aggregateFile/client_info") - @ResponseBody - public JSONObject getClientInfoByAggree(@RequestParam String username, @RequestParam String clean_days) { - return simpleClientApplyService.getPreApplyInfoForAggree(username, clean_days); - } - - @GetMapping("/info/bank/{bsb_no}") - public JSONObject getBankInfo(@PathVariable String bsb_no, @RequestParam String username, @RequestParam String codeKey) { - simpleClientApplyService.checkOrGenerateRegisterProcessKey(username, codeKey); - return simpleClientApplyService.getBankInfo(bsb_no); - } - - @GetMapping("/config/sys_rates") - public JSONObject getSysRate() { - JSONObject sysConfig = sysConfigManager.getSysConfig(); - return JSON.parseObject(sysConfig.getString("sys_apply_rates")); - } - - @GetMapping("/config/sys_rates_register") - public List getSysRateRegister() { - return simpleClientApplyService.getSysRate(sysConfigManager.getSysConfig()); - } - - @GetMapping("/config/pay_type") - public JSONObject getPayType() { - return simpleClientApplyService.getPayType(); - } - - @GetMapping("/config/getWechatIndustry") - public List getWechatIndustry() { - return simpleClientApplyService.getIndustryMap(); - } - - @GetMapping("/send/mail/subscribe") - public void sendSubscribeMail(@RequestParam(value = "mail", required = true) String mail, @RequestParam("lang") String lang) { - simpleClientApplyService.subscribeNewsletter(mail, lang); - } - -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientManageController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientManageController.java deleted file mode 100644 index b1d698e57..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientManageController.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.application.web; - -import au.com.royalpay.payment.manage.application.beans.AddHandleLogDetail; -import au.com.royalpay.payment.manage.application.beans.ClientApplyQueryBean; -import au.com.royalpay.payment.manage.application.beans.HandleLogQuery; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyManageService; -import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yuan on 2018/6/4. - */ -@RestController -@RequestMapping("/register/manage") -public class SimpleClientManageController { - @Resource - private SimpleClientApplyManageService simpleClientApplyManageService; - - @ManagerMapping(method = RequestMethod.GET,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject listApply(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,ClientApplyQueryBean clientApplyQueryBean){ - return simpleClientApplyManageService.listsApplies(manager,clientApplyQueryBean); - } - - @ManagerMapping(value = "/getOne/{client_pre_apply_id}",method = RequestMethod.GET,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject findOneApply(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_pre_apply_id){ - return simpleClientApplyManageService.findOneApply(manager,client_pre_apply_id); - } - - @ManagerMapping(value = "/log",method = RequestMethod.GET,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject listAllHandleLog(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HandleLogQuery handleLogQuery){ - return simpleClientApplyManageService.listAllHandleLogs(manager,handleLogQuery); - } - - @ManagerMapping(method = RequestMethod.PUT,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void addHandleLog(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AddHandleLogDetail addHandleLogDetail){ - simpleClientApplyManageService.addHandleLog(manager,addHandleLogDetail); - } - - @ManagerMapping(value = "/{client_pre_apply_id}",method = RequestMethod.PUT,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void closeHandle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_pre_apply_id){ - simpleClientApplyManageService.closeHandle(manager,client_pre_apply_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/AppAdvice.java b/src/main/java/au/com/royalpay/payment/manage/apps/AppAdvice.java deleted file mode 100644 index e33d17410..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/AppAdvice.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.apps; - -import au.com.royalpay.payment.manage.apps.core.AppPermissionSupport; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.util.UrlPathHelper; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -/** - * Created by yixian on 2017-03-15. - */ -@ControllerAdvice(basePackages = "com.royalpay.payment.apps.web.api", annotations = AppController.class) -public class AppAdvice { - @Resource - private AppPermissionSupport appPermissionSupport; - private UrlPathHelper urlPathHelper = new UrlPathHelper(); - - @ModelAttribute(CommonConsts.APP_INFO) - public JSONObject app(@RequestParam String appid, @RequestParam String sign, @RequestParam long timestamp, HttpServletRequest request) { - String ip = RequestEnvironment.getClientIp(); - return appPermissionSupport.validateSign(appid, timestamp, ip, urlPathHelper.getRequestUri(request), sign); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/AppController.java b/src/main/java/au/com/royalpay/payment/manage/apps/AppController.java deleted file mode 100644 index fb2944bcf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/AppController.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.apps; - -import org.springframework.web.bind.annotation.RestController; - -import java.lang.annotation.*; - -/** - * Created by yixian on 2017-03-15. - */ -@Documented -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@RestController -public @interface AppController { -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/bean/CustomerImpressionQuery.java b/src/main/java/au/com/royalpay/payment/manage/apps/bean/CustomerImpressionQuery.java deleted file mode 100644 index c4ae0da28..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/bean/CustomerImpressionQuery.java +++ /dev/null @@ -1,121 +0,0 @@ -package au.com.royalpay.payment.manage.apps.bean; - -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; - -/** - * Created by wangning on 2017/12/28. - */ -public class CustomerImpressionQuery { - private int payment_times_begin; - private int payment_times_end; - private BigDecimal amount_begin; - private BigDecimal amount_end; - private String order; - private String nick_name; - private int client_id; - private int page = 1; - private int limit = 10; - - public JSONObject toParam(){ - JSONObject param = new JSONObject(); - param.put("payment_times_begin",this.payment_times_begin); - param.put("payment_times_end",this.payment_times_end); - param.put("amount_begin",this.amount_begin); - param.put("amount_end",this.amount_end); - param.put("order",this.order); - param.put("client_id",this.client_id); - param.put("nick_name",nick_name); - return param; - } - - public int getPayment_times_begin() { - return payment_times_begin; - } - - public void setPayment_times_begin(int payment_times_begin) { - this.payment_times_begin = payment_times_begin; - } - - public int getPayment_times_end() { - return payment_times_end; - } - - public void setPayment_times_end(int payment_times_end) { - this.payment_times_end = payment_times_end; - } - - public BigDecimal getamount_begin() { - return amount_begin; - } - - public void setamount_begin(BigDecimal amount_begin) { - this.amount_begin = amount_begin; - } - - public BigDecimal getamount_end() { - return amount_end; - } - - public void setamount_end(BigDecimal amount_end) { - this.amount_end = amount_end; - } - - public String getOrder() { - return order; - } - - public void setOrder(String order) { - this.order = order; - } - - public BigDecimal getAmount_begin() { - return amount_begin; - } - - public void setAmount_begin(BigDecimal amount_begin) { - this.amount_begin = amount_begin; - } - - public BigDecimal getAmount_end() { - return amount_end; - } - - public void setAmount_end(BigDecimal amount_end) { - this.amount_end = amount_end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getClient_id() { - return client_id; - } - - public void setClient_id(int client_id) { - this.client_id = client_id; - } - - public String getNick_name() { - return nick_name; - } - - public void setNick_name(String nick_name) { - this.nick_name = nick_name; - } -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/AppPermissionSupport.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/AppPermissionSupport.java deleted file mode 100644 index b8f3fdf47..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/AppPermissionSupport.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.apps.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2017-03-15. - */ -public interface AppPermissionSupport { - JSONObject validateSign(String appid, long timestamp, String ip, String requestUri, String sign); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/CustomerImpressionService.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/CustomerImpressionService.java deleted file mode 100644 index 36e3c92f5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/CustomerImpressionService.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.apps.core; - -import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 2017/12/28. - */ -public interface CustomerImpressionService { - - JSONObject listPageble(CustomerImpressionQuery customerImpressionQuery); - - JSONObject findOne(int client_id,String customer_id); - - void generateTag(int client_id); - - void generateInfo(); - - void modifyNameRemark(int client_id, String customer_id,String name_remark); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/SSOSupport.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/SSOSupport.java deleted file mode 100644 index 381fa7e12..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/SSOSupport.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.apps.core; - -import com.alibaba.fastjson.JSONObject; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - -/** - * Created by yixian on 2017-03-15. - */ -public interface SSOSupport { - String cacheReferer(String referer, String appid, String type); - - String cacheManager(String appid, JSONObject manager); - - RefererInfo getCachedReferer(String ssoKey, String type); - - String cacheClient(String appid, JSONObject clientUser); - - JSONObject getCachedManager(String appid, String code); - - JSONObject getCachedClientAccount(String appid, String code); - - class RefererInfo{ - private String referer; - private String appid; - - public RefererInfo(String referer, String appid) { - try { - this.referer = URLDecoder.decode(referer,"utf-8"); - } catch (UnsupportedEncodingException ignored) { - } - this.appid = appid; - } - - public String getReferer() { - return referer; - } - - public String getAppid() { - return appid; - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/AppPermissionSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/AppPermissionSupportImpl.java deleted file mode 100644 index d1523e2f3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/AppPermissionSupportImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package au.com.royalpay.payment.manage.apps.core.impls; - -import au.com.royalpay.payment.manage.apps.core.AppPermissionSupport; -import au.com.royalpay.payment.manage.mappers.system.SysAppsMapper; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-03-15. - */ -@Service -public class AppPermissionSupportImpl implements AppPermissionSupport { - @Resource - private SysAppsMapper sysAppsMapper; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public JSONObject validateSign(String appid, long timestamp, String ip, String requestUri, String sign) { - JSONObject app = sysAppsMapper.findApp(appid); - if (app == null) { - throw new ForbiddenException("InvalidApp"); - } - if (app.getBooleanValue("enable_ip_whitelist")) { - String whitelist = app.getString("ip_whitelist"); - whitelist = whitelist == null ? "" : whitelist; - if (!whitelist.contains(ip)) { - app.put("invalid_ip", true); - } - } - long now = System.currentTimeMillis(); - if (Math.abs(now - timestamp) > 30_000) { - throw new ForbiddenException("Timeout"); - } - String auth = app.getString("auth_code"); - String str = String.join("&", appid, auth, timestamp + "", requestUri); - logger.debug("sso-str before hash:{}", str); - String hash = DigestUtils.sha256Hex(str).toLowerCase(); - if (!StringUtils.equals(hash, sign)) { - throw new ForbiddenException("InvalidSign"); - } - return app; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java deleted file mode 100644 index b871acef7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java +++ /dev/null @@ -1,200 +0,0 @@ -package au.com.royalpay.payment.manage.apps.core.impls; - -import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; -import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService; -import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.geo.GeoIPSupport; -import au.com.royalpay.payment.tools.geo.entity.GeoLocation; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.data.redis.core.BoundListOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Created by wangning on 2017/12/28. - */ -@Service -public class CustomerImpressionServiceImpl implements CustomerImpressionService { - @Resource - private ClientCustomersMapper clientCustomersMapper; - @Resource - private OrderMapper orderMapper; - @Resource - private GeoIPSupport geoIPSupport; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - @Resource - private CustomerMapper customerMapper; - @Resource - private Locker locker; - @Resource - private StringRedisTemplate stringRedisTemplate; - - private static String CUSTOMER_IMPRESSION_PREFIX = "Customer_impression_insert"; - Logger logger = LoggerFactory.getLogger(CustomerImpressionServiceImpl.class); - - @Override - public JSONObject listPageble(CustomerImpressionQuery customerImpressionQuery) { - PageList logs = clientCustomersMapper.listCustomerInfo(customerImpressionQuery.toParam(), - new PageBounds(customerImpressionQuery.getPage(), customerImpressionQuery.getLimit(), Order.formString(customerImpressionQuery.getOrder()))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public JSONObject findOne(int client_id, String customer_id) { - JSONObject customer = clientCustomersMapper.getClientCustomerWithNull(client_id, customer_id); - if (customer == null) { - throw new BadRequestException("customer info not exist"); - } - JSONObject params = new JSONObject(); - params.put("customer_id", customer_id); - params.put("include_success_status", 4); - List paymentInfos = new ArrayList<>(); - PageList ordersLast = orderMapper.listOrderByCustomer(params, new PageBounds(1, 1, Order.formString("create_time.desc"))); - if (!CollectionUtils.isEmpty(ordersLast)) { - JSONObject order = ordersLast.get(0); - JSONObject paymentInfo = new JSONObject(); - paymentInfo.put("pay_time", DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss")); - String city = geoIPSupport.getLocation(order.getString("customer_ip")).map(GeoLocation::getCity).orElse(null); - if (!StringUtils.isEmpty(city)) { - paymentInfo.put("pay_location", city); - } - paymentInfos.add(paymentInfo); - - } - PageList ordersFirst = orderMapper.listOrderByCustomer(params, new PageBounds(1, 1, Order.formString("create_time.asc"))); - if (!CollectionUtils.isEmpty(ordersFirst)) { - JSONObject order = ordersFirst.get(0); - JSONObject paymentInfo = new JSONObject(); - paymentInfo.put("pay_time", DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss")); - String city = geoIPSupport.getLocation(order.getString("customer_ip")).map(GeoLocation::getCity).orElse(null); - if (!StringUtils.isEmpty(city)) { - paymentInfo.put("pay_location", city); - } - paymentInfos.add(paymentInfo); - } - customer.put("payment_info", paymentInfos); - return customer; - } - - @Override - @Transactional - public void generateTag(int client_id) { - JSONObject params = new JSONObject(); - DateTime dt = new DateTime(); - dt = dt.minusMonths(1); - params.put("confirm_time", dt.toDate()); - params.put("client_id", client_id); - List orders = orderMapper.listAnalysisClientCustomer(params); - for (JSONObject order : orders) { - int payment_times = order.getInteger("payment_times"); - JSONObject updateRecord = new JSONObject(); - updateRecord.put("client_id", order.getIntValue("client_id")); - updateRecord.put("customer_id", order.getString("customer_id")); - if (payment_times < 2) { - updateRecord.put("tag", "不活跃用户"); - } - if (payment_times >= 2 && payment_times < 10) { - updateRecord.put("tag", "潜力用户"); - } - if (payment_times >= 10) { - updateRecord.put("tag", "忠实用户"); - } - clientCustomersMapper.update(updateRecord); - } - - } - - @Override - public void generateInfo() { - Date now = new Date(); - BoundListOperations ops = stringRedisTemplate.boundListOps("customer_impression"); - String redisValue = ops.leftPop(); - - while (!StringUtils.isEmpty(redisValue)) { - try { - JSONObject order = JSON.parseObject(redisValue); - redisValue = ops.leftPop(); - if (StringUtils.isEmpty(order.getString("channel"))) { - continue; - } - String customer_id = order.getString("customer_id"); - JSONObject userInfo = customerMapper.findCustomerByOpenId(customer_id); - if (userInfo == null) { - userInfo = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id); - } - if (userInfo == null) { - userInfo = customerMapper.findCustomerGlobalpayByOpenId(customer_id); - } - locker.lock(CUSTOMER_IMPRESSION_PREFIX + customer_id, 30_000, 30_000); - try { - JSONObject clientCustomerInfo = clientCustomersMapper.getClientCustomerWithNull(order.getIntValue("client_id"), customer_id); - if (clientCustomerInfo == null) { - JSONObject client_customer = new JSONObject(); - client_customer.put("client_id", order.getIntValue("client_id")); - client_customer.put("customer_id", order.getString("customer_id")); - client_customer.put("channel", order.getString("channel")); - client_customer.put("tag", "不活跃用户"); - if (userInfo != null) { - client_customer.put("headimg", userInfo.getString("headimg")); - client_customer.put("nick_name", userInfo.getString("nickname")); - } - client_customer.put("payment_times", 1); - client_customer.put("update_time", now); - client_customer.put("total_amount", order.getBigDecimal("total_amount")); - client_customer.put("last_payment_time", order.getDate("confirm_time")); - clientCustomersMapper.insert(client_customer); - } else { - clientCustomerInfo.put("payment_times", 1); - clientCustomerInfo.put("client_id", order.getIntValue("client_id")); - clientCustomerInfo.put("customer_id", order.getString("customer_id")); - clientCustomerInfo.put("total_amount", order.getBigDecimal("total_amount")); - if (userInfo != null) { - clientCustomerInfo.put("headimg", userInfo.getString("headimg")); - clientCustomerInfo.put("nick_name", userInfo.getString("nickname")); - } - clientCustomerInfo.put("last_payment_time", order.getDate("confirm_time")); - clientCustomersMapper.updateAfterPaymentFinish(clientCustomerInfo); - } - } finally { - locker.unlock(CUSTOMER_IMPRESSION_PREFIX + customer_id); - } - } catch (Exception e) { - logger.debug("Reduce Customer Impression Error Redis Value =" + redisValue, e); - } - } - } - - @Override - public void modifyNameRemark(int client_id, String customer_id, String name_remark) { - JSONObject clientCustomerInfo = clientCustomersMapper.getClientCustomer(client_id, customer_id); - if (clientCustomerInfo == null) { - throw new NotFoundException("customer not found"); - } - clientCustomerInfo.put("name_remak", name_remark); - clientCustomersMapper.update(clientCustomerInfo); - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/SSOSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/SSOSupportImpl.java deleted file mode 100644 index 6a198b0ff..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/SSOSupportImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package au.com.royalpay.payment.manage.apps.core.impls; - -import au.com.royalpay.payment.manage.apps.core.SSOSupport; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.concurrent.TimeUnit; - -/** - * Created by yixian on 2017-03-15. - */ -@Service -public class SSOSupportImpl implements SSOSupport { - @Resource - private StringRedisTemplate stringRedisTemplate; - @Value("${app.redis.prefix}") - private String prefix; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public String cacheReferer(String referer, String appid, String type) { - JSONObject refererInfo = new JSONObject(); - refererInfo.put("referer", referer); - refererInfo.put("appid", appid); - String key = System.currentTimeMillis() + RandomStringUtils.random(5, true, true); - String cacheKey = refererCacheKey(type, key); - stringRedisTemplate.boundValueOps(cacheKey).set(refererInfo.toJSONString(), 5, TimeUnit.MINUTES); - return key; - } - - @Override - public String cacheManager(String appid, JSONObject manager) { - String code = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(10, true, true); - String cacheKey = accountCacheKey("manager", appid, code); - stringRedisTemplate.boundValueOps(cacheKey).set(manager.toJSONString(), 30, TimeUnit.SECONDS); - return code; - } - - @Override - public RefererInfo getCachedReferer(String ssoKey, String type) { - String cacheKey = refererCacheKey(type, ssoKey); - String jsonstr = stringRedisTemplate.boundValueOps(cacheKey).get(); - stringRedisTemplate.delete(cacheKey); - if (jsonstr != null) { - JSONObject referer = JSON.parseObject(jsonstr); - return new RefererInfo(referer.getString("referer"), referer.getString("appid")); - } - return null; - } - - @Override - public String cacheClient(String appid, JSONObject clientUser) { - String code = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(10, true, true); - String cacheKey = accountCacheKey("client", appid, code); - logger.debug("========cacheClient,key:{}========", cacheKey); - stringRedisTemplate.boundValueOps(cacheKey).set(clientUser.toJSONString(), 30, TimeUnit.SECONDS); - return code; - } - - @Override - public JSONObject getCachedManager(String appid, String code) { - return getCachedAccount(appid, code, "manager"); - } - - private JSONObject getCachedAccount(String appid, String code, String type) { - String cacheKey = accountCacheKey(type, appid, code); - logger.debug("========getCachedAccount,key:{}========", cacheKey); - String jsonstr = stringRedisTemplate.boundValueOps(cacheKey).get(); - stringRedisTemplate.delete(cacheKey); - if (jsonstr != null) { - return JSON.parseObject(jsonstr); - } - return null; - } - - @Override - public JSONObject getCachedClientAccount(String appid, String code) { - logger.debug("========getCachedClientAccount,appid:{},code:{}========", appid, code); - return getCachedAccount(appid, code, "client"); - } - - private String refererCacheKey(String type, String key) { - return prefix + ":sso:referers:" + type + ":" + key; - } - - private String accountCacheKey(String type, String appid, String key) { - return prefix + ":sso:accounts:" + type + ":" + appid + ":" + key; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/ctrip/CtripAfterPaymentFinishListener.java b/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/ctrip/CtripAfterPaymentFinishListener.java deleted file mode 100644 index 0314c0f83..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/ctrip/CtripAfterPaymentFinishListener.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.apps.events.listeners.ctrip; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.manage.customers.core.CouponValidateService; -import au.com.royalpay.payment.manage.mappers.log.CouponAccuessLogMapper; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by wangning on 17/01/2018. - */ -@Service -public class CtripAfterPaymentFinishListener implements ApplicationListener { - Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private CouponValidateService couponValidateService; - @Resource - private CouponAccuessLogMapper couponAccuessLogMapper; - - @Override - public void onApplicationEvent(AfterPaymentFinishEvent event) { - JSONObject order = event.getFinishedEvent().getOrder(); - String orderId = order.getString("order_id"); - List accuessCouponLogs = couponAccuessLogMapper.findCouponByOrderId(orderId); - if (accuessCouponLogs != null && !accuessCouponLogs.isEmpty()) { - JSONObject accuessCouponLog = accuessCouponLogs.get(0); - String couponId = accuessCouponLog.getString("coupon_id"); - couponValidateService.ctripCouponLogNotice(couponId, orderId, order.getString("customer_id"), order.getString("status")); - logger.info("订单 [" + orderId + "]推送支付成功Ctrip卡券=======>[" + couponId + "]"); - } - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/ctrip/CtripRefundFinishedEventListener.java b/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/ctrip/CtripRefundFinishedEventListener.java deleted file mode 100644 index 07a8a604f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/ctrip/CtripRefundFinishedEventListener.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.apps.events.listeners.ctrip; - -import au.com.royalpay.payment.core.events.RefundFinishedEvent; -import au.com.royalpay.payment.manage.customers.core.CouponValidateService; -import au.com.royalpay.payment.manage.mappers.log.CouponAccuessLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @author kira - * @date 2018/8/8 - */ -@Service -public class CtripRefundFinishedEventListener implements ApplicationListener { - Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private OrderMapper orderMapper; - @Resource - private CouponValidateService couponValidateService; - @Resource - private CouponAccuessLogMapper couponAccuessLogMapper; - @Override - public void onApplicationEvent(RefundFinishedEvent event) { - JSONObject refund = event.getRefundOrder(); - JSONObject order = orderMapper.find(refund.getString("order_id")); - String orderId = order.getString("order_id"); - List accuessCouponLogs = couponAccuessLogMapper.findCouponByOrderId(orderId); - if (accuessCouponLogs != null && !accuessCouponLogs.isEmpty()) { - JSONObject accuessCouponLog = accuessCouponLogs.get(0); - String couponId = accuessCouponLog.getString("coupon_id"); - couponValidateService.ctripCouponLogNotice(couponId, orderId, order.getString("customer_id"), order.getString("status")); - logger.info("订单 [" + orderId + "]推送退款成功Ctrip卡券=======>[" + couponId + "]"); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/events/package-info.java b/src/main/java/au/com/royalpay/payment/manage/apps/events/package-info.java deleted file mode 100644 index 99acb1d8e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/events/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Created by wangning on 17/01/2018. - */ -package au.com.royalpay.payment.manage.apps.events; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/package-info.java b/src/main/java/au/com/royalpay/payment/manage/apps/package-info.java deleted file mode 100644 index 0d9efa1e8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * app管理 - * Created by yixian on 2017-03-14. - */ -package au.com.royalpay.payment.manage.apps; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java b/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java deleted file mode 100644 index d5de2eb8e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.apps.web; - -import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; -import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.device.advise.AppClientController; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@AppClientController -@RequestMapping(value = "/customers/impression") -public class CustomerImpressionController { - @Resource - private CustomerImpressionService customerImpressionService; - - @GetMapping("/list") - @ResponseBody - public JSONObject list(CustomerImpressionQuery customerImpressionQuery, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) { - customerImpressionQuery.setClient_id(app.getInteger("client_id")); - return customerImpressionService.listPageble(customerImpressionQuery); - } - - @GetMapping("/{customer_id}") - @ResponseBody - public JSONObject find(@PathVariable String customer_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) { - return customerImpressionService.findOne(app.getIntValue("client_id"), customer_id); - } - - @PutMapping("/{customer_id}") - @ResponseBody - public void modifyNameRemark(@PathVariable String customer_id, @RequestBody JSONObject customerInfo, - @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) { - customerImpressionService.modifyNameRemark(app.getIntValue("client_id"), customer_id, customerInfo.getString("name_remark")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerRMIController.java b/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerRMIController.java deleted file mode 100644 index 67060d079..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerRMIController.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.apps.web; - -import au.com.royalpay.payment.manage.apps.AppController; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@AppController -@RequestMapping(value = "/customers/rmi") -public class CustomerRMIController { - @Resource - private ClientManager clientManager; - @Resource - private ClientConfigService clientConfigService; - - @GetMapping("/{client_moniker}") - @ResponseBody - public JSONObject checkPointsAfterPay(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.APP_INFO) JSONObject app) { - JSONObject result = clientManager.getClientInfoByMoniker(client_moniker); - result.putAll(clientConfigService.find(result.getIntValue("client_id"))); - return result; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/web/SSOCallbackController.java b/src/main/java/au/com/royalpay/payment/manage/apps/web/SSOCallbackController.java deleted file mode 100644 index 86bad1d8e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/web/SSOCallbackController.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.apps.web; - -import au.com.royalpay.payment.manage.apps.core.SSOSupport; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * Created by yixian on 2017-03-15. - */ -@RestController -@RequestMapping("/sso_callbacks") -public class SSOCallbackController { - @Resource - private SSOSupport ssoSupport; - - @GetMapping("/manager/{ssoKey}") - public void managerSsoCallback(@PathVariable String ssoKey, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - HttpServletResponse response) throws IOException { - SSOSupport.RefererInfo referer = ssoSupport.getCachedReferer(ssoKey, "manager"); - if (referer == null) { - response.sendRedirect("/manage.html"); - return; - } - String code = ssoSupport.cacheManager(referer.getAppid(), manager); - String url = UriComponentsBuilder.fromHttpUrl(referer.getReferer()).queryParam("code", code).toUriString(); - response.sendRedirect(url); - } - - @GetMapping("/client/{ssoKey}") - public void clientSsoCallback(@PathVariable String ssoKey, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject clientAccount, - HttpServletResponse response) throws IOException { - SSOSupport.RefererInfo referer = ssoSupport.getCachedReferer(ssoKey, "client"); - if (referer == null) { - response.sendRedirect("/index.html"); - return; - } - String code = ssoSupport.cacheClient(referer.getAppid(), clientAccount); - String url = UriComponentsBuilder.fromHttpUrl(referer.getReferer()).queryParam("code", code).toUriString(); - response.sendRedirect(url); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/web/SSOSignInController.java b/src/main/java/au/com/royalpay/payment/manage/apps/web/SSOSignInController.java deleted file mode 100644 index fed45acec..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apps/web/SSOSignInController.java +++ /dev/null @@ -1,79 +0,0 @@ -package au.com.royalpay.payment.manage.apps.web; - -import au.com.royalpay.payment.manage.apps.AppController; -import au.com.royalpay.payment.manage.apps.core.SSOSupport; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * Created by yixian on 2017-03-13. - */ -@AppController -@RequestMapping("/api/sso") -public class SSOSignInController { - @Resource - private SSOSupport ssoSupport; - - @GetMapping("/manager_sign_in") - public void managerSignIn(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @ModelAttribute(CommonConsts.APP_INFO) JSONObject app, - @RequestParam("callback") String referer, - HttpServletResponse response) throws IOException { - if (manager == null) { - String ssoKey = ssoSupport.cacheReferer(referer, app.getString("appid"),"manager"); - String uri = UriComponentsBuilder.fromUriString("/m_login.html").queryParam("f", "/sso_callbacks/manager/" + ssoKey).toUriString(); - response.sendRedirect("/m_login.html?f=" + uri); - } else { - String code = ssoSupport.cacheManager(app.getString("appid"), manager); - String url = UriComponentsBuilder.fromHttpUrl(referer).queryParam("code", code).toUriString(); - response.sendRedirect(url); - } - } - - @GetMapping("/manager_sign_in/{code}/manager") - public JSONObject getManagerInfo(@ModelAttribute(CommonConsts.APP_INFO) JSONObject app, @PathVariable String code) { - if (app.getBooleanValue("invalid_ip")){ - throw new ForbiddenException("InvalidIP"); - } - JSONObject manager = ssoSupport.getCachedManager(app.getString("appid"), code); - if (manager == null) { - throw new ForbiddenException("Code not exists or expired"); - } - return manager; - } - - @GetMapping("/client_sign_in") - public void clientSignIn(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject clientUser, @ModelAttribute(CommonConsts.APP_INFO) JSONObject app, - @RequestParam("callback") String referer, - HttpServletResponse response) throws IOException { - if (clientUser == null) { - String ssoKey = ssoSupport.cacheReferer(referer, app.getString("appid"),"client"); - String uri = UriComponentsBuilder.fromUriString("/login.html").queryParam("f", "/sso_callbacks/client/" + ssoKey).toUriString(); - response.sendRedirect(uri); - } else { - String code = ssoSupport.cacheClient(app.getString("appid"), clientUser); - String url = UriComponentsBuilder.fromHttpUrl(referer).queryParam("code", code).toUriString(); - response.sendRedirect(url); - } - } - - @GetMapping("/client_sign_in/{code}/account") - public JSONObject getClientInfo(@ModelAttribute(CommonConsts.APP_INFO) JSONObject app, @PathVariable String code) { - if (app.getBooleanValue("invalid_ip")){ - throw new ForbiddenException("InvalidIP"); - } - JSONObject account = ssoSupport.getCachedClientAccount(app.getString("appid"), code); - if (account == null) { - throw new ForbiddenException("Code not exists or expired"); - } - return account; - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/entity/ApsNotice.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/entity/ApsNotice.java deleted file mode 100644 index 61928b0fb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/entity/ApsNotice.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.entity; - - -import com.alibaba.fastjson.JSONObject; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public class ApsNotice { - private static final long serialVersionUID = 1L; - private String id; - - private Date createTime; - - private String creator; - - private Date modifyTime; - - private String modifier; - - /** - * 消息标题 - */ - private String title; - - /** - * 消息内容 - */ - private String content; - - /** - * 消息状态 - * 0;可用 - * 1;禁用 - */ - private Integer status = 0; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/entity/ApsNoticeClient.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/entity/ApsNoticeClient.java deleted file mode 100644 index 2f1f76390..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/entity/ApsNoticeClient.java +++ /dev/null @@ -1,72 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.entity; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public class ApsNoticeClient { - private static final long serialVersionUID = 1L; - private String id; - - private Date createTime; - - private String creator; - - private Date modifyTime; - - private String modifier; - - /** - * 消息ID - */ - private String noticeId; - - /** - * 商户Code - */ - private String partnerCode; - - /** - * 用户id - */ - private String userId; - - /** - * 用户第一次阅读时间 - */ - private Date readTime; - - /** - * 用户操作状态 - * 0;未读 - * 1;已读 - * 2;同意 - * 3;拒绝 - */ - private Integer status; - - /** - * 用户操作时间 - */ - private Date statusTime; - - /** - * 运营处理时间 - * 0;未处理 - * 1;已处理 - */ - private Integer handle; - - /** - * 是否失效 - */ - private Integer isValid; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/repository/ApsNoticeClientRepository.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/repository/ApsNoticeClientRepository.java deleted file mode 100644 index 6e10f4f1e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/repository/ApsNoticeClientRepository.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.repository; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.Date; -import java.util.List; - -public interface ApsNoticeClientRepository { - void saveApsNoticeClient(ApsNoticeClient apsNoticeClient); - - void updateApsNoticeClient(ApsNoticeClient apsNoticeClient); - - PageList getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds); - - void updateApsNoticeClientByPartnerCode(Date modifyTime, String modifier, String partnerCode); - - ApsNoticeClient getApsNoticeClientById(String id); - - List apsNoticeClients(String id, String clientStatus); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/repository/ApsNoticeRepository.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/repository/ApsNoticeRepository.java deleted file mode 100644 index 39bca95bd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/repository/ApsNoticeRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.repository; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -public interface ApsNoticeRepository { - PageList getApsNotices(PageBounds pageBounds); - - ApsNotice saveApsNotice(ApsNotice apsNotice); - - void updateApsNotice(JSONObject apsNotice); - - ApsNotice getApsNoticesById(String id); - - List getApsNotice(String id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/ApsNoticeClientsService.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/ApsNoticeClientsService.java deleted file mode 100644 index 09ac8ef61..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/ApsNoticeClientsService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.service; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public interface ApsNoticeClientsService { - PageList getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds); - - void exportApsNoticeClients(String id, String clientStatus, HttpServletRequest request, HttpServletResponse response); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/ApsNoticeService.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/ApsNoticeService.java deleted file mode 100644 index 29dd36714..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/ApsNoticeService.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.service; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import au.com.royalpay.payment.manage.apsKYC.web.command.AddNoticeCommand; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -public interface ApsNoticeService { - PageList getApsNotices(PageBounds pageBounds); - - void saveApsNotice(JSONObject manager, AddNoticeCommand addNoticeCommand); - - void updateApsNoticeClient(JSONObject manager, ApsNoticeClient apsNoticeClient); - - AddNoticeCommand getApsNotice(String id); - - void updateApsNotice(JSONObject manager, JSONObject apsNotice); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java deleted file mode 100644 index 6c922510c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java +++ /dev/null @@ -1,249 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.service.Impl; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice; -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository; -import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeClientsService; -import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFRow; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.xssf.usermodel.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService { - - @Autowired - private ApsNoticeClientRepository apsNoticeClientRepository; - - @Autowired - private ManagerMapper managerMapper; - - @Autowired - private ClientMapper clientMapper; - - @Autowired - private ClientAccountMapper clientAccountMapper; - - @Autowired - private ApsNoticeMapper apsNoticeMapper; - - @Override - public PageList getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds) { - PageList apsNoticeClients = apsNoticeClientRepository.getApsNoticeClients(id, clientStatus, pageBounds); - for (JSONObject apsNoticeClient : apsNoticeClients) { - if (apsNoticeClient.containsKey("modifier") && StringUtils.isNotBlank(apsNoticeClient.getString("modifier"))) { - JSONObject modifier = managerMapper.findDetail(apsNoticeClient.getString("modifier")); - if (modifier != null) { - apsNoticeClient.put("modifier_name", modifier.getString("username")); - } - } - if (apsNoticeClient.containsKey("user_id") && StringUtils.isNotBlank(apsNoticeClient.getString("user_id"))) { - if (apsNoticeClient.getString("user_id").equals("0")) { - apsNoticeClient.put("user_name", "未知"); - } else { - JSONObject user = clientAccountMapper.findDetail(apsNoticeClient.getString("user_id")); - if (user != null) { - apsNoticeClient.put("user_name", user.getString("username")); - } - } - } - JSONObject clinet = clientMapper.findClientByMoniker(apsNoticeClient.getString("partner_code")); - if (clinet != null && clinet.containsKey("bd_user_name") && StringUtils.isNotBlank(clinet.getString("bd_user_name"))) { - apsNoticeClient.put("bd_name", clinet.getString("bd_user_name")); - } - } - return apsNoticeClients; - } - - @Override - public void exportApsNoticeClients(String id, String clientStatus, HttpServletRequest request, HttpServletResponse response) { - List apsNoticeClients = apsNoticeClientRepository.apsNoticeClients(id, clientStatus); - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - OutputStream os = null; - XSSFWorkbook xWorkbook = null; - - try { - ApsNotice apsNotice = apsNoticeMapper.getApsNoticesById(id); - - - String fileName = apsNotice.getTitle() + "(" + df.format(new Date()) + ").xlsx"; - fileName = new String(fileName.getBytes("gbk"), "iso8859-1"); - os = response.getOutputStream(); - response.reset(); - response.setHeader("Content-disposition", "attachment; filename = " + fileName); - response.setContentType("application/octet-streem"); - - //创建表格工作空间 - xWorkbook = new XSSFWorkbook(); - //创建一个新表格 - XSSFSheet xSheet = xWorkbook.createSheet("商户列表"); - //set Sheet页头部 - setSheetHeader(xWorkbook, xSheet); - //set Sheet页内容 - setSheetContent(xWorkbook, xSheet, apsNoticeClients); - xWorkbook.write(os); - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (null != os) { - try { - os.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - if (null != xWorkbook) { - try { - xWorkbook.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - private void setSheetContent(XSSFWorkbook xWorkbook, XSSFSheet xSheet, List apsNoticeClients) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //创建内容样式(头部以下的样式) - CellStyle cs = xWorkbook.createCellStyle(); - cs.setWrapText(true); - - //设置水平垂直居中 - cs.setAlignment(CellStyle.ALIGN_CENTER); - cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - - if (null != apsNoticeClients && apsNoticeClients.size() > 0) { - for (int i = 0; i < apsNoticeClients.size(); i++) { - XSSFRow xRow = xSheet.createRow(i + 1); - //设置第一列 - XSSFCell xCell0 = xRow.createCell(0); - xCell0.setCellStyle(cs); - xCell0.setCellValue(apsNoticeClients.get(i).getPartnerCode()); - //设置第二列 - XSSFCell xCell1 = xRow.createCell(1); - xCell1.setCellStyle(cs); - JSONObject clinet = clientMapper.findClientByMoniker(apsNoticeClients.get(i).getPartnerCode()); - if (clinet != null && clinet.containsKey("bd_user_name") && StringUtils.isNotBlank(clinet.getString("bd_user_name"))) { - xCell1.setCellValue(clinet.getString("bd_user_name")); - } else { - xCell1.setCellValue("未配置BD"); - } - //设置第三列 - XSSFCell xCell2 = xRow.createCell(2); - xCell2.setCellStyle(cs); - xCell2.setCellValue(apsNoticeClients.get(i).getStatus()); - String userName = "未知"; - if (StringUtils.isNotBlank(apsNoticeClients.get(i).getUserId())) { - if (!apsNoticeClients.get(i).getUserId().equals("0")) { - JSONObject user = clientAccountMapper.findDetail(apsNoticeClients.get(i).getUserId()); - if (user != null) { - userName = user.getString("username"); - } - } - } - switch (apsNoticeClients.get(i).getStatus()) { - case 0: { - xCell2.setCellValue("未读"); - break; - } - case 1: { - xCell2.setCellValue("已读(" + userName + ":" + df.format(apsNoticeClients.get(i).getReadTime()) + ")"); - break; - } - case 2: { - xCell2.setCellValue("同意(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")"); - break; - } - case 3: { - xCell2.setCellValue("拒绝(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")"); - break; - } - } - //设置第四列 - XSSFCell xCell3 = xRow.createCell(3); - xCell3.setCellStyle(cs); - switch (apsNoticeClients.get(i).getHandle()) { - case 0: { - xCell3.setCellValue("未处理"); - break; - } - case 1: { - if (StringUtils.isNotBlank(apsNoticeClients.get(i).getModifier())) { - JSONObject modifier = managerMapper.findDetail(apsNoticeClients.get(i).getModifier()); - if (modifier != null) { - xCell3.setCellValue("已处理(" + modifier.getString("username") + ":" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")"); - } else { - xCell3.setCellValue("已处理(未知用户:" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")"); - } - } - break; - } - } - } - } - } - - private void setSheetHeader(XSSFWorkbook xWorkbook, XSSFSheet xSheet) { - //设置表格的宽度 xSheet.setColumnWidth(0, 20 * 256); 中的数字 20 自行设置为自己适用的 - xSheet.setColumnWidth(0, 10 * 256); - xSheet.setColumnWidth(1, 25 * 256); - xSheet.setColumnWidth(2, 40 * 256); - xSheet.setColumnWidth(3, 40 * 256); - //创建表格的样式 - CellStyle cs = xWorkbook.createCellStyle(); - //设置水平、垂直居中 - cs.setAlignment(CellStyle.ALIGN_CENTER); - cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - //设置字体 - Font headerFont = xWorkbook.createFont(); - headerFont.setFontHeightInPoints((short) 12); - /*headerFont.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);*/ - headerFont.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD); - headerFont.setFontName("宋体"); - cs.setFont(headerFont); - cs.setWrapText(true);//是否自动换行 - - //创建一行 - XSSFRow xRow0 = xSheet.createRow(0); - //设置每一列 - XSSFCell xCell0 = xRow0.createCell(0); - xCell0.setCellStyle(cs); - xCell0.setCellValue("商户名称"); - - XSSFCell xCell1 = xRow0.createCell(1); - xCell1.setCellStyle(cs); - xCell1.setCellValue("所属BD"); - - XSSFCell xCell2 = xRow0.createCell(2); - xCell2.setCellStyle(cs); - xCell2.setCellValue("商户操作状态"); - - XSSFCell xCell3 = xRow0.createCell(3); - xCell3.setCellStyle(cs); - xCell3.setCellValue("运营操作状态"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeServiceImpl.java deleted file mode 100644 index 2b5a3f3b8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeServiceImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.domain.service.Impl; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice; -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository; -import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeRepository; -import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeService; -import au.com.royalpay.payment.manage.apsKYC.web.command.AddNoticeCommand; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class ApsNoticeServiceImpl implements ApsNoticeService { - - @Autowired - private ApsNoticeRepository apsNoticeRepository; - - @Autowired - private ApsNoticeClientRepository apsNoticeClientRepository; - - @Override - public PageList getApsNotices(PageBounds pageBounds) { - return apsNoticeRepository.getApsNotices(pageBounds); - } - - @Override - public void saveApsNotice(JSONObject manager, AddNoticeCommand addNoticeCommand) { - // 保存消息数据 - ApsNotice saveApsNotice = addNoticeCommand.saveApsNotice(addNoticeCommand, manager); - ApsNotice apsNotice = apsNoticeRepository.saveApsNotice(saveApsNotice); - for (String partnerCode : addNoticeCommand.getPartnerCodes()) { - if (StringUtils.isNotBlank(partnerCode)) { - apsNoticeClientRepository.updateApsNoticeClientByPartnerCode(new Date(), manager.getString("manager_id"), partnerCode); - ApsNoticeClient apsNoticeClient = addNoticeCommand.saveApsNoticeClient(partnerCode, manager, apsNotice.getId()); - apsNoticeClientRepository.saveApsNoticeClient(apsNoticeClient); - } - } - } - - @Override - public void updateApsNoticeClient(JSONObject manager, ApsNoticeClient apsNoticeClient) { - ApsNoticeClient apsNoticeClientById = apsNoticeClientRepository.getApsNoticeClientById(apsNoticeClient.getId()); - apsNoticeClientById.setModifier(manager.getString("manager_id")); - apsNoticeClientById.setModifyTime(new Date()); - if (apsNoticeClient.getHandle() != null) { - apsNoticeClientById.setHandle(apsNoticeClient.getHandle()); - } - if (apsNoticeClient.getIsValid() != null) { - apsNoticeClientById.setIsValid(apsNoticeClient.getIsValid()); - } - apsNoticeClientRepository.updateApsNoticeClient(apsNoticeClientById); - } - - @Override - public AddNoticeCommand getApsNotice(String id) { - List apsNotice = apsNoticeRepository.getApsNotice(id); - AddNoticeCommand addNoticeCommand = new AddNoticeCommand(); - ArrayList codes = new ArrayList<>(); - for (JSONObject a : apsNotice) { - addNoticeCommand.setTitle(a.getString("title")); - addNoticeCommand.setContent(a.getString("content")); - addNoticeCommand.setCreateTime(a.getDate("create_time")); - codes.add(a.getString("partner_code")); - } - addNoticeCommand.setPartnerCodes(codes.toArray(new String[codes.size()])); - return addNoticeCommand; - } - - @Override - public void updateApsNotice(JSONObject manager, JSONObject apsNotice) { - apsNotice.put("modifier", manager.getString("manager_id")); - apsNotice.put("modify_time", new Date()); - apsNoticeRepository.updateApsNotice(apsNotice); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/infrastructure/repository/ApsNoticeClientRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/infrastructure/repository/ApsNoticeClientRepositoryImpl.java deleted file mode 100644 index 6205defaf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/infrastructure/repository/ApsNoticeClientRepositoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.infrastructure.repository; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository; -import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeClientMapper; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import java.util.Date; -import java.util.List; - -@Repository -public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository { - - @Autowired - private ApsNoticeClientMapper mapper; - - @Override - public void saveApsNoticeClient(ApsNoticeClient apsNoticeClient) { - mapper.saveApsNoticeClient(apsNoticeClient); - } - - @Override - public void updateApsNoticeClient(ApsNoticeClient apsNoticeClient) { - mapper.updateApsNoticeClient(apsNoticeClient); - } - - @Override - public PageList getApsNoticeClients(String id, String clientStatus, PageBounds pageBounds) { - return mapper.getApsNoticeClients(id, clientStatus, pageBounds); - } - - @Override - public void updateApsNoticeClientByPartnerCode(Date modifyTime, String modifier, String partnerCode) { - mapper.updateApsNoticeClientByPartnerCode(modifyTime, modifier, partnerCode); - } - - @Override - public ApsNoticeClient getApsNoticeClientById(String id) { - return mapper.getApsNoticeClientById(id); - } - - @Override - public List apsNoticeClients(String id, String clientStatus) { - return mapper.apsNoticeClients(id, clientStatus); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/infrastructure/repository/ApsNoticeRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/infrastructure/repository/ApsNoticeRepositoryImpl.java deleted file mode 100644 index ceaab3928..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/infrastructure/repository/ApsNoticeRepositoryImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.infrastructure.repository; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice; -import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeRepository; -import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeMapper; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ApsNoticeRepositoryImpl implements ApsNoticeRepository { - - @Autowired - private ApsNoticeMapper mapper; - - @Override - public PageList getApsNotices(PageBounds pageBounds) { - return mapper.getApsNotices(pageBounds); - } - - @Override - public ApsNotice saveApsNotice(ApsNotice apsNotice) { - mapper.saveApsNotice(apsNotice); - return mapper.getApsNoticesById(apsNotice.getId()); - } - - @Override - public void updateApsNotice(JSONObject apsNotice) { - mapper.updateApsNotice(apsNotice); - } - - @Override - public ApsNotice getApsNoticesById(String id) { - return mapper.getApsNoticesById(id); - } - - @Override - public List getApsNotice(String id) { - return mapper.getApsNotice(id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/RestApsKYCController.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/RestApsKYCController.java deleted file mode 100644 index e471002e4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/RestApsKYCController.java +++ /dev/null @@ -1,117 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.web; - - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeClientsService; -import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeService; -import au.com.royalpay.payment.manage.apsKYC.web.command.AddNoticeCommand; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@RestController -@RequestMapping(value = "/aps/kyc") -public class RestApsKYCController { - - @Resource - private ApsNoticeService apsNoticeService; - - @Resource - private ApsNoticeClientsService apsNoticeClientsService; - - /** - * 获取消息通知列表 - * - * @param page 当前页 - * @param pageSize 每页数 - * @return - */ - @ManagerMapping(value = "/notices", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER}) - public JSONObject getApsNotices(@RequestParam(value = "page", defaultValue = "1") int page, - @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) { - PageBounds pageBounds = new PageBounds(page, pageSize); - PageList apply = apsNoticeService.getApsNotices(pageBounds); - return PageListUtils.buildPageListResult(apply); - } - - /** - * 获取消息通知详情 - * - * @param id 通知id - * @return AddNoticeCommand - */ - @ManagerMapping(value = "/notice", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER}) - public AddNoticeCommand getApsNotice(@RequestParam String id) { - return apsNoticeService.getApsNotice(id); - } - - /** - * 修改消息 - * - * @param manager - * @param apsNotice - */ - @ManagerMapping(value = "/notice", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SALES_MANAGER}) - public void updateApsNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject apsNotice) { - apsNoticeService.updateApsNotice(manager, apsNotice); - } - - /** - * 获取消息通知商户列表 - * - * @param page 当前页 - * @param pageSize 每页数 - * @param id 消息id - * @return JSONObject - */ - @ManagerMapping(value = "/notice/clients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER}) - public JSONObject getApsNoticeClients(@RequestParam(value = "page", defaultValue = "1") int page, - @RequestParam(value = "pageSize", defaultValue = "20") int pageSize, - @RequestParam String id, @RequestParam(required = false) String clientStatus) { - PageBounds pageBounds = new PageBounds(page, pageSize); - PageList apply = apsNoticeClientsService.getApsNoticeClients(id, clientStatus, pageBounds); - return PageListUtils.buildPageListResult(apply); - } - - /** - * 新增消息通知 - * - * @param manager 运营用户 - * @param addNoticeCommand 新增数据 - */ - @ManagerMapping(value = "/notice", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SALES_MANAGER}) - public void addApsNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AddNoticeCommand addNoticeCommand) { - apsNoticeService.saveApsNotice(manager, addNoticeCommand); - } - - /** - * 修改商户数据 - * - * @param manager 运营数据 - * @param apsNoticeClient 消息关联商户数据 - */ - @ManagerMapping(value = "/notice/client", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SALES_MANAGER}) - public void updateApsNoticeClient(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ApsNoticeClient apsNoticeClient) { - apsNoticeService.updateApsNoticeClient(manager, apsNoticeClient); - } - - /** - * 导出商户名单 - * - * @param id - * @param clientStatus - */ - @ManagerMapping(value = "/notice/clients/excel", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER}) - public void exportApsNoticeClients(@RequestParam String id, @RequestParam(required = false) String clientStatus, HttpServletRequest request, HttpServletResponse response) throws Exception { - apsNoticeClientsService.exportApsNoticeClients(id, clientStatus, request, response); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/command/AddNoticeCommand.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/command/AddNoticeCommand.java deleted file mode 100644 index 0816ddf16..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/command/AddNoticeCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.web.command; - - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice; -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import com.alibaba.fastjson.JSONObject; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.joda.time.DateTime; - -import java.util.Date; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class AddNoticeCommand { - - private String[] partnerCodes; - - private String title; - - private String content; - - private Date createTime; - - public ApsNotice saveApsNotice(AddNoticeCommand addNoticeDescriptor, JSONObject manager) { - return new ApsNotice() - .setCreateTime(new Date()) - .setCreator(manager.getString("manager_id")) - .setTitle(addNoticeDescriptor.getTitle()) - .setContent(addNoticeDescriptor.getContent()); - } - - public ApsNoticeClient saveApsNoticeClient(String partnerCode, JSONObject manager, String noticeId) { - return new ApsNoticeClient() - .setCreateTime(new Date()) - .setCreator(manager.getString("manager_id")) - .setNoticeId(noticeId) - .setPartnerCode(partnerCode) - .setIsValid(0) - .setHandle(0) - .setStatus(0); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/command/SelectApsNoticeCommand.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/command/SelectApsNoticeCommand.java deleted file mode 100644 index 9e87a6f7e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/web/command/SelectApsNoticeCommand.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.apsKYC.web.command; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SelectApsNoticeCommand { - private int limit = 10; - private int page = 1; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java deleted file mode 100644 index bf5cac476..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.core; - -import java.text.ParseException; -import java.util.Calendar; -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yixian on 2017-02-07. - */ -public interface BDPrizeService { - void generateRecord(String month); - - @Transactional - void recordGenerateProcess(Calendar now); - - JSONObject listRecords(String year); - - JSONObject findReport(String month) throws Exception; - - JSONObject getBDReport(String month, String managerId); - - List getRateConfig(); - - void updateRates(List rates, JSONObject manager); - - List listBDLevels(); - - void updateBDLevel(String bdId, JSONObject info, JSONObject manager); - - List listBDLeaderAndManager(String month); - - List listNeedConfigCommission(); - - void insertOrUpdateCommissionConfig(String month, List config, JSONObject manager) throws ParseException; - - void deleteCommConfig(String config_id); - - void updateBdKpiConfig(List configs, JSONObject manager)throws ParseException; - - void exportCommissionMonth(String month, HttpServletResponse response) throws Exception; - - void exportCommissionDetail(String month, String managerId, HttpServletResponse response); - - List findCommissionList(JSONObject manager); - - List getBDTeamKpiCompletionDegree(String month); - - List getBDProportionByTeamType(String month, String teamType); - - JSONObject getBDKpiByManagerId(String month, String manager_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java deleted file mode 100644 index 97546526e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java +++ /dev/null @@ -1,793 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.core.impls; - -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; -import au.com.royalpay.payment.manage.bdprize.support.BDPrizeCalculator; -import au.com.royalpay.payment.manage.bdprize.support.impls.BDPrizeCalculatorDefaultImpl; -import au.com.royalpay.payment.manage.bdprize.support.impls.DefaultClientWithBDAwayDeterminor; -import au.com.royalpay.payment.manage.mappers.financial.*; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -/** - * Created by yixian on 2017-02-07. - */ -@Service -public class BDPrizeServiceImpl implements BDPrizeService { - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private TransactionMapper transactionMapper; - @Resource - private FinancialBDPrizeRecordMapper financialBDPrizeRecordMapper; - @Resource - private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; - @Resource - private FinancialBDPrizeDetailMapper financialBDPrizeDetailMapper; - @Resource - private FinancialBDConfigMapper financialBDConfigMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private FinancialBDRateConfigMapper financialBDRateConfigMapper; - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - @Resource - private Locker locker; - - - @Resource - private FinancialBDCommissionConfigMapper financialBDCommissionConfigMapper; - @Resource - private FinancialLeaderPrizeLogMapper financialLeaderPrizeLogMapper; - - @Value("${app.backup-app:false}") - private boolean backupSystem; - - private static BigDecimal percent = new BigDecimal(100); - - private static String[] channels = new String[]{"Wechat", "Alipay","AlipayOnline", "Rpay","rpaypmt_card", "rpaypmt_dd"}; - private static Logger logger = LoggerFactory.getLogger(BDPrizeServiceImpl.class); - - @Override - public void generateRecord(String month) { - if (backupSystem) { - throw new ServerErrorException("Updating System,wait for a moment"); - } - if (!locker.lock("bd_prize_task", 300_000)) { - throw new ServerErrorException("Processing task, wait for a moment"); - } - try { - SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM"); - Date date = null; - try { - date = sdf.parse(month); - } catch (ParseException e) { - e.printStackTrace(); - } - Calendar now = Calendar.getInstance(); - now.setTime(date); - recordGenerateProcess(now); - - } finally { - locker.unlock("bd_prize_task"); - } - - } - - @Transactional - @Override - public void recordGenerateProcess(Calendar now) { - String month = DateFormatUtils.format(now, "yyyy-MM"); - clearReportOfMonth(month); - - JSONObject record = new JSONObject(); - record.put("create_time", new Date()); - record.put("month", month); - financialBDPrizeRecordMapper.save(record); - - for (String channel : channels) { - List trades = transactionMapper.listTransactionsForBDPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, channel); - List clientsWithBDAway = clientBDMapper.clientsWithBDAway(); - List rateConfig = getRateConfig(); - BDPrizeCalculator calculator = new BDPrizeCalculatorDefaultImpl(trades, now.getTime()).clientBDMapper(clientBDMapper).transactionMapper(transactionMapper) - .clientsWithBDAwayDeterminor(new DefaultClientWithBDAwayDeterminor(clientsWithBDAway)).rateConfig(rateConfig); - calculator.calculate(); - List report = calculator.getReport(now.get(Calendar.YEAR),now.get(Calendar.MONTH) + 1); - logger.info("======calculator.report=========="+channel+"===="+report.toString()); - for (JSONObject log : report) { - log.put("record_id", record.getString("record_id")); - log.put("channel", channel); - log.remove("prize_log_id"); - logger.info("=========financialBDPrizeLogMapper.save======="+log.toString()); - financialBDPrizeLogMapper.save(log); - List details = (List) log.get("details"); - for (JSONObject detail : details) { - detail.put("prize_log_id", log.getString("prize_log_id")); - detail.put("channel", channel); - financialBDPrizeDetailMapper.save(detail); - } - } - } - //BD Leader Prize - //bd_type:1 销售总监 2 大客户经理 3悉尼分公司经理 4 COO 5 NGDepartment - //todo 10月开始悉尼分公司经理不享受悉尼销售组提成 - List bdLeaders = managerMapper.listByRole(1, ManagerRole.BD_LEADER.getMask()); - for (JSONObject leader : bdLeaders) { - BigDecimal groupAmount = transactionMapper.totalAmountForBDLeaderPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1,leader.getString("manager_id")); - JSONObject bdConfig = financialBDConfigMapper.getBdConfig(leader.getString("manager_id")); - int bd_type = bdConfig ==null?2:("Sydney").equals(bdConfig.getString("city"))?2:1;//sydney leader 即悉尼大客户经理 - JSONObject rateJson = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, groupAmount.toString(), bd_type); - BigDecimal groupPrize = new BigDecimal(0); - if (rateJson != null) { - groupPrize = groupAmount.multiply(new BigDecimal(rateJson.getString("commission_rate")).divide(percent)).setScale(2, RoundingMode.DOWN); - } - BigDecimal send_prize = groupPrize; - JSONObject prizeLog = new JSONObject(); - prizeLog.put("record_id", record.getString("record_id")); - prizeLog.put("manager_id", leader.getString("manager_id")); - prizeLog.put("bd_name", leader.getString("display_name")); - prizeLog.put("bd_level", 0); - prizeLog.put("total_amount", groupAmount); - prizeLog.put("total_prize", groupPrize); - prizeLog.put("total_donation", BigDecimal.ZERO); - prizeLog.put("send_prize", send_prize); - prizeLog.put("hold_prize", 0); - prizeLog.put("prize_type", 1); - prizeLog.put("channel", "ALL"); - financialBDPrizeLogMapper.save(prizeLog); - } - } - - private void clearReportOfMonth(String month) { - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - if (report != null) { - String recordId = report.getString("record_id"); - financialBDPrizeDetailMapper.clearDetailsOfReport(recordId); - financialBDPrizeLogMapper.clearLogsOfReport(recordId); - financialBDPrizeRecordMapper.delete(recordId); - } - } - - @Override - public JSONObject listRecords(String year) { - if (!year.matches("\\d{4}")) { - throw new BadRequestException("Invalid Year"); - } - List records = financialBDPrizeRecordMapper.listRecordsInYear(year); - JSONObject res = new JSONObject(); - res.put("data", records); - return res; - } - - @Override - public JSONObject findReport(String month) throws Exception { - try { - Date mon = DateUtils.parseDate(month, new String[]{"yyyy-MM"}); - month = DateFormatUtils.format(mon, "yyyy-MM"); - } catch (ParseException e) { - throw new BadRequestException("Invalid Month"); - } - JSONObject report = financialBDPrizeRecordMapper.getReport(month); - if (report == null) { - throw new BadRequestException("Report not created"); - } - - for (String channel : channels) { - JSONObject channelReport = financialBDPrizeRecordMapper.getChannelReport(report.getString("record_id"), channel); - report.put(channel + "Report", channelReport); - } - - List prizeLogs = financialBDPrizeLogMapper.listPrizeLogsForReport(0, report.getString("record_id"), - new PageBounds(Order.formString("total_amount.desc"))); - List bdLeaderPrizeLogs = financialBDPrizeLogMapper.listPrizeLogsForReport(1, report.getString("record_id"), - new PageBounds(Order.formString("total_amount.desc"))); - - BigDecimal cplTotalprize = new BigDecimal(0.00); - for (JSONObject log : bdLeaderPrizeLogs) { - prizeLogs.add(log); - cplTotalprize = cplTotalprize.add(log.getBigDecimal("total_amount")); - } - report.put("logs", prizeLogs); - - - DateTime monthDate = new DateTime(month); - //bd manager commission -// JSONObject cityPrizeLog = new JSONObject(); -// cityPrizeLog.put("total_amount", cplTotalprize); -// JSONObject cplRate = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, cplTotalprize.toString(), 2); -// if (cplRate == null) { -// cityPrizeLog.put("total_prize", 0.00); -// } else { -// BigDecimal _commission_rate = new BigDecimal(cplRate.getString("commission_rate")); -// BigDecimal _total_amount = new BigDecimal(cityPrizeLog.getString("total_amount")); -// BigDecimal total_prize = _total_amount.multiply(_commission_rate.divide(percent)).setScale(2, RoundingMode.DOWN); -// cityPrizeLog.put("total_prize", total_prize); -// } -// report.put("cityPrizeLogs", cityPrizeLog); - List leaderPrizeLog = financialLeaderPrizeLogMapper.listLeaderPrizeLog(report.getString("record_id")); - if (!leaderPrizeLog.isEmpty()) { - for (JSONObject prizeLog : leaderPrizeLog) { - if (prizeLog.getIntValue("bd_type") == 3) { - report.put("sydneyPrizeLog", prizeLog); - } - if (prizeLog.getIntValue("bd_type") == 4) { - report.put("directPrizeLogs", prizeLog); - } - if (prizeLog.getIntValue("bd_type") == 5) { - report.put("ngDepartmentPrizeLog", prizeLog); - } - } - return report; - } - //bd_type=3 悉尼分公司经理 悉尼销售组和大客户组流水提成 - if (!locker.lock(report.getString("record_id"), 300_000)) { - throw new ServerErrorException("Processing task, wait for a moment"); - } - try { - List prizeLogList = new ArrayList<>(); - JSONObject sydneyPrizeLog = new JSONObject(); - BigDecimal sydneyAmount = transactionMapper.totalAmountForSydneyGMPrize(monthDate.getYear(), monthDate.getMonthOfYear()); - sydneyPrizeLog.put("total_amount",sydneyAmount); - sydneyPrizeLog.put("bd_type", 3); - JSONObject sydneyGMRate = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, sydneyAmount.toString(), 3); - if (sydneyGMRate == null) { - sydneyPrizeLog.put("total_prize", 0.00); - } else { - BigDecimal sydney_commission_rate = new BigDecimal(sydneyGMRate.getString("commission_rate")); - BigDecimal total_prize = sydneyAmount.multiply(sydney_commission_rate.divide(percent)).setScale(2, RoundingMode.DOWN); - sydneyPrizeLog.put("total_prize", total_prize); - } - report.put("sydneyPrizeLog", sydneyPrizeLog); - prizeLogList.add(sydneyPrizeLog); - - - //COO & NJ commission - JSONObject params = new JSONObject(); - params.put("begin", TimeZoneUtils.beginDate(TimeZoneUtils.getFirstDay(monthDate.toString()))); - params.put("end", TimeZoneUtils.getPerFirstDayOfMonth(TimeZoneUtils.getLastDay(monthDate.toString()))); - BigDecimal totalprize = transactionAnalysisMapper.analysisTotalAmount(params); - - JSONObject directPrizeLogs = new JSONObject(); - directPrizeLogs.put("total_amount", totalprize); - directPrizeLogs.put("bd_type", 4); - JSONObject rate = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, totalprize.toString(), 4); - if (rate == null) { - directPrizeLogs.put("total_prize", 0.00); - } else { - BigDecimal _commission_rate = new BigDecimal(rate.getString("commission_rate")); - BigDecimal _total_amount = new BigDecimal(directPrizeLogs.getString("total_amount")); - BigDecimal total_prize = _total_amount.multiply(_commission_rate.divide(percent)).setScale(2, RoundingMode.DOWN); - directPrizeLogs.put("total_prize", total_prize); - } - report.put("directPrizeLogs", directPrizeLogs); - prizeLogList.add(directPrizeLogs); - - JSONObject ngDepartmentPrizeLog = new JSONObject(); - ngDepartmentPrizeLog.put("total_amount", totalprize); - ngDepartmentPrizeLog.put("bd_type", 5); - JSONObject ngRate = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, totalprize.toString(), 5); - if (ngRate == null) { - ngDepartmentPrizeLog.put("total_prize", 0.00); - } else { - BigDecimal ng_commission_rate = new BigDecimal(ngRate.getString("commission_rate")); - BigDecimal ng_total_prize = totalprize.multiply(ng_commission_rate.divide(percent)).setScale(2, RoundingMode.DOWN); - ngDepartmentPrizeLog.put("total_prize", ng_total_prize); - } - report.put("ngDepartmentPrizeLog", ngDepartmentPrizeLog); - prizeLogList.add(ngDepartmentPrizeLog); - - for (JSONObject prizeLog : prizeLogList) { - prizeLog.put("record_id", report.getString("record_id")); - prizeLog.put("create_time", new Date()); - financialLeaderPrizeLogMapper.save(prizeLog); - } - return report; - } finally { - locker.unlock(report.getString("record_id")); - } - - } - - @Override - public JSONObject getBDReport(String month, String managerId) { - try { - Date mon = DateUtils.parseDate(month, new String[]{"yyyy-MM"}); - month = DateFormatUtils.format(mon, "yyyy-MM"); - } catch (ParseException e) { - throw new BadRequestException("Invalid Month"); - } - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - if (report == null) { - throw new BadRequestException("Report not created"); - } - List bdLogs = financialBDPrizeLogMapper.findByReportAndBD(report.getString("record_id"), managerId); - if (bdLogs == null) { - JSONObject res = new JSONObject(); - res.put("month", report.getString("month")); - res.put("no_record", true); - return res; - } - JSONObject log = new JSONObject(); - log.put("month", report.getString("month")); - List details = new ArrayList<>(); - for (JSONObject bdlog : bdLogs) { - log.put(bdlog.getString("channel") + "Detail", bdlog); - List channelDetails = financialBDPrizeDetailMapper.listDetails(bdlog.getString("prize_log_id"), - new PageBounds(Order.formString("client_moniker.asc,order_date_from.asc"))); - for (JSONObject detail : channelDetails) { - detail.put("order_date_from", DateFormatUtils.format(detail.getDate("order_date_from"), "dd/MMM/yyyy", RequestEnvironment.getLocale())); - detail.put("order_date_to", DateFormatUtils.format(detail.getDate("order_date_to"), "dd/MMM/yyyy", RequestEnvironment.getLocale())); - details.add(detail); - } - } - log.put("details", details); - - JSONObject totalDetail = financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), managerId); - log.putAll(totalDetail); - JSONObject bdInfo = managerMapper.findById(managerId); - if (bdInfo == null) { - log.put("leftCompany", true); - }else { - if (ManagerRole.BD_LEADER.hasRole(bdInfo.getIntValue("role"))) { - JSONObject groupPrizeLog = financialBDPrizeLogMapper.findByReportAndGroup(report.getString("record_id"), managerId); - log.put("group_prize", groupPrizeLog); - } - } - - - return log; - } - - @Override - public List getRateConfig() { - return financialBDRateConfigMapper.listAllConfig(); - } - - @Override - @Transactional - public void updateRates(List rates, JSONObject manager) { - for (JSONObject rate : rates) { - double bdRate = rate.getDoubleValue("prize_rate"); - if (bdRate > 1 || bdRate < 0) { - throw new BadRequestException("Invalid BD Rate:" + bdRate); - } - JSONObject update = new JSONObject(); - update.put("config_id", rate.getIntValue("config_id")); - update.put("prize_rate", bdRate); - int rowCount = financialBDRateConfigMapper.update(update); - if (rowCount < 1) { - throw new BadRequestException("Invalid Config"); - } - } - } - - @Override - public List listBDLevels() { - return financialBDConfigMapper.listBDConfig(); - } - - @Override - public void updateBDLevel(String bdId, JSONObject info, JSONObject manager) { - JSONObject config = financialBDConfigMapper.getBdConfig(bdId); - if (config == null) { - JSONObject bdUser = managerMapper.findById(bdId); - if (bdUser == null || !ManagerRole.BD_USER.hasRole(bdUser.getIntValue("role"))) { - throw new BadRequestException("BD User Not exists"); - } - config = new JSONObject(); - config.put("manager_id", bdId); - config.put("bd_name", bdUser.getString("display_name")); - config.put("bd_level", info.getIntValue("bd_level")); - config.put("bd_type", info.getIntValue("bd_type")); - config.put("city", info.getString("city")); - config.put("get_prize", info.getBooleanValue("get_prize")); - config.put("bd_group", info.getString("bd_group")); - config.put("last_update_by", manager.getString("display_name")); - config.put("last_update_date", new Date()); - financialBDConfigMapper.saveBDConfig(config); - } else { - config.put("bd_level", info.getIntValue("bd_level")); - config.put("city", info.getString("city")); - config.put("get_prize", info.getBooleanValue("get_prize")); - config.put("bd_group", info.getString("bd_group")); - config.put("bd_type", info.getIntValue("bd_type")); - config.put("last_update_by", manager.getString("display_name")); - config.put("last_update_date", new Date()); - financialBDConfigMapper.updateBDConfig(config); - } - } - - @Override - public List listBDLeaderAndManager(String month) { - List currentLeader = financialBDCommissionConfigMapper.listBDLeMaInfoHistory(month); - if (currentLeader.size() <= 0 || "".equals(currentLeader)) { - return listNeedConfigCommission(); - } - return currentLeader; - } - - @Override - public List listNeedConfigCommission() { - List commissionInfo = new ArrayList<>(); - return commissionInfo; - } - - @Override - public void insertOrUpdateCommissionConfig(String month, List configs, JSONObject manager) throws ParseException { - for (JSONObject config : configs) { - //更新 - if (config.get("commission_start_amount") == null || "".equals("commission_start_amount")) { - throw new BadRequestException("commission start amount is not be null"); - } - if (config.get("bd_commission_rate") == null || "".equals("bd_commission_rate")) { - throw new BadRequestException("commission rate is not be null"); - } - if (config.getDouble("commission_start_amount") == config.getDouble("commission_end_amount")) { - throw new BadRequestException("commission rate is not be same"); - } - - if (config.getString("bc_config_id") != null && !"".equals(config.getString("bc_config_id"))) { - config.put("last_update_date", new Date()); - config.put("last_update_by", manager.getString("display_name")); - financialBDCommissionConfigMapper.updateCommissionConfig(config); - } else { - String[] firLasDay = getMonthFisrtLastDay(month); - config.put("start_date", firLasDay[0]); - config.put("end_date", firLasDay[1]); - config.put("creation_date", new Date()); - config.put("creation_by", manager.getString("display_name")); - config.put("last_update_date", new Date()); - config.put("last_update_by", manager.getString("display_name")); - financialBDCommissionConfigMapper.insertCommissionConfig(config); - } - } - } - - @Override - public void deleteCommConfig(String config_id) { - financialBDCommissionConfigMapper.deleteConfig(config_id); - } - - public String[] getMonthFisrtLastDay(String monthStr) throws ParseException { - Calendar calendar = new GregorianCalendar(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat mf = new SimpleDateFormat("yyyy-MM"); - Date date = mf.parse(monthStr); - calendar.setTime(date); - String[] firLasDay = new String[2]; - calendar.add(calendar.DATE, 0); - firLasDay[0] = sdf.format(calendar.getTime()); - calendar.roll(calendar.DATE, -1); - firLasDay[1] = sdf.format(calendar.getTime()); - return firLasDay; - } - - @Override - public void updateBdKpiConfig(List configs, JSONObject manager) throws ParseException { - for (JSONObject config : configs){ - config.put("last_update_date", new Date()); - config.put("last_update_by", manager.getString("display_name")); - financialBDConfigMapper.updateBDConfig(config); - } - } - - @Override - public void exportCommissionMonth(String month, HttpServletResponse resp) throws Exception { - OutputStream ous = null; - JSONObject report = findReport(month); - if (report != null) { - List logs = (List) report.get("logs"); - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + "BD_Commission_Info_" + month + ".xls"); - ous = resp.getOutputStream(); - HSSFWorkbook wb = new HSSFWorkbook(); - Cell cell = null; - HSSFFont font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle titleStyle = wb.createCellStyle(); - titleStyle.setFont(font); - HSSFCellStyle style = wb.createCellStyle(); - //设置背景颜色 - style.setFillForegroundColor(HSSFColor.RED.index); - //solid 填充 foreground 前景色 - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - Sheet sheet = wb.createSheet("BD_Commission_Info_" + month); - sheet.setDefaultColumnWidth(20); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - //bd and manager - String[] BDTitle = {"BD Name","KPI", "BD Level", "Transaction Amount", "Total Commission","Send Commission", "Hold prize", "Prize Type"}; - for (int i = 0; i < BDTitle.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(BDTitle[i]); - } - for (JSONObject log : logs) { - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(log.getString("bd_name")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("kpi_amount")==null?BigDecimal.ZERO.toPlainString():log.getBigDecimal("kpi_amount").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(financialBdLevel(log.getIntValue("bd_level"))); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("total_amount").toPlainString()); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("total_prize").toPlainString()); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("send_prize").toPlainString()); - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("hold_prize").toPlainString()); - if (log.getIntValue("prize_type") == 0) { - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue("BD"); - } - if (log.getIntValue("prize_type") == 1) { - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue("Group"); - } - if (!log.getBoolean("is_valid")) { - for (int i = 0; i <= 7; i++) { - row.getCell(i).setCellStyle(style); - } - } - } - //analysis - String[] analysisTitle = {"month", "Total Commission", "Total Send", "Total Hold", "Total Fund"}; - row = sheet.createRow(++rowNum); - for (int i = 0; i < analysisTitle.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(analysisTitle[i]); - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(month); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(report.getBigDecimal("total_prize").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(report.getBigDecimal("total_send_prize").toPlainString()); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(report.getBigDecimal("total_hold_prize").toPlainString()); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(report.getBigDecimal("total_donation").toPlainString()); - //channel - String[] channelTitle = {"channel", "BD Total Commission", "BD Total Send", "BD Total Hold", "BD Total Fund"}; - row = sheet.createRow(++rowNum); - for (int i = 0; i < channelTitle.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(channelTitle[i]); - } - for (String channel: channels) { - JSONObject channelReport = report.getJSONObject(channel + "Report"); - if (channelReport != null) { - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(channel); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(channelReport.getBigDecimal("total_prize").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(channelReport.getBigDecimal("total_send_prize").toPlainString()); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(channelReport.getBigDecimal("total_hold_prize").toPlainString()); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(channelReport.getBigDecimal("total_donation").toPlainString()); - } - } - //Sydney GM & COO & NJ commission - String[] GMTitle = {"name", "Transaction Amount", "Total Commission"}; - row = sheet.createRow(++rowNum); - for (int i = 0; i < GMTitle.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(GMTitle[i]); - } - JSONObject sydneyPrizeLog = report.getJSONObject("sydneyPrizeLog"); - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Sydney GM"); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(sydneyPrizeLog.getBigDecimal("total_amount").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(sydneyPrizeLog.getBigDecimal("total_prize").toPlainString()); - - JSONObject ngDepartmentPrizeLog = report.getJSONObject("ngDepartmentPrizeLog"); - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("NJ Department"); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(ngDepartmentPrizeLog.getBigDecimal("total_amount").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(ngDepartmentPrizeLog.getBigDecimal("total_prize").toPlainString()); - - JSONObject directPrizeLogs = report.getJSONObject("directPrizeLogs"); - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("COO"); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(directPrizeLogs.getBigDecimal("total_amount").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(directPrizeLogs.getBigDecimal("total_prize").toPlainString()); - - wb.write(ous); - ous.flush(); - } - } - - @Override - public void exportCommissionDetail(String month, String managerId, HttpServletResponse resp) { - try { - Date mon = DateUtils.parseDate(month, new String[]{"yyyy-MM"}); - month = DateFormatUtils.format(mon, "yyyy-MM"); - } catch (ParseException e) { - throw new BadRequestException("Invalid Month"); - } - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - if (report == null) { - throw new BadRequestException("Report not created"); - } - List bdLogs = financialBDPrizeDetailMapper.findCommissionDetailById(report.getString("record_id"), managerId); - OutputStream ous = null; - try { - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + "BD_COMMISSION_" + month + ".xlsx"); - ous = resp.getOutputStream(); - Workbook wb = new XSSFWorkbook(); - Sheet sheet = wb.createSheet(); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"Client Moniker", "Order Date Range", "Client Rate", "Client Source", "Init Months", "Transaction", "Coefficient", "BD Rate", - "Commission", "RoyalPay Surcharge", "Channel"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - - for (JSONObject bdlog : bdLogs) { - row = sheet.createRow(++rowNum); - bdlog.put("order_date_from", DateFormatUtils.format(bdlog.getDate("order_date_from"), "dd/MMM/yyyy", RequestEnvironment.getLocale())); - bdlog.put("order_date_to", DateFormatUtils.format(bdlog.getDate("order_date_to"), "dd/MMM/yyyy", RequestEnvironment.getLocale())); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("client_moniker")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("order_date_from") + "~" + bdlog.getString("order_date_to")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("rate_value") + "%"); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(financialClientSource(bdlog.getIntValue("source"))); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("client_create_months")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("total_transaction")); - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("coefficient")); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("bd_rate") + "%"); - row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("prize_value")); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("royal_surcharge")); - row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(bdlog.getString("channel")); - } - wb.write(ous); - ous.flush(); - IOUtils.closeQuietly(ous); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public List findCommissionList(JSONObject manager) { - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - return financialBDPrizeRecordMapper.getReportByManagerId(manager.getString("manager_id")); - } - return null; - } - - @Override - public List getBDTeamKpiCompletionDegree(String month) { - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - List prizeAmountAndBdTypeList = new ArrayList<>(); - if (report == null) { - try { - Date start_date = DateUtils.parseDate(month+"-01","yyyy-MM-dd"); - Date end_date = DateUtils.addMonths(start_date,1); - prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountRealTime(start_date,end_date); - } catch (ParseException e) { - e.printStackTrace(); - } - }else{ - prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountAndBdType(getReportByMonth(month)); - } - - for (JSONObject prize : prizeAmountAndBdTypeList) { - BigDecimal kpi = financialBDCommissionConfigMapper.findCurrentCommissionMaxAmount(month, prize.getIntValue("bd_type")); - prize.put("kpi", kpi); - prize.put("completionDegree", prize.getBigDecimal("total_amount").divide(kpi,2)); - } - List prizeSort = prizeAmountAndBdTypeList.stream() - .sorted((prize1, prize2) -> prize2.getBigDecimal("completionDegree").compareTo(prize1.getBigDecimal("completionDegree"))) - .collect(Collectors.toList()); - return prizeSort; - } - - @Override - public List getBDProportionByTeamType(String month, String teamType) { - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - if (report == null) { - try { - Date start_date = DateUtils.parseDate(month+"-01","yyyy-MM-dd"); - Date end_date = DateUtils.addMonths(start_date,1); - return financialBDConfigMapper.findManagerByTeamTypeRealTime(teamType,start_date,end_date); - } catch (ParseException e) { - e.printStackTrace(); - throw new BadRequestException("Month is wrong"); - } - }else { - return financialBDConfigMapper.findManagerByTeamType(teamType, getReportByMonth(month)); - } - } - - @Override - public JSONObject getBDKpiByManagerId(String month, String manager_id) { - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - if (report == null) { - try { - Date start_date = DateUtils.parseDate(month+"-01","yyyy-MM-dd"); - Date end_date = DateUtils.addMonths(start_date,1); - return financialBDPrizeLogMapper.findByReportAndBDTotalRealTime(manager_id,start_date,end_date); - } catch (ParseException e) { - e.printStackTrace(); - throw new BadRequestException("Month is wrong"); - } - }else { - return financialBDPrizeLogMapper.findByReportAndBDTotal(getReportByMonth(month), manager_id); - } - } - - public String getReportByMonth(String month) { - try { - Date mon = DateUtils.parseDate(month, new String[]{"yyyy-MM"}); - month = DateFormatUtils.format(mon, "yyyy-MM"); - } catch (ParseException e) { - throw new BadRequestException("Invalid Month"); - } - - JSONObject report = financialBDPrizeRecordMapper.findByMonth(month); - if (report == null) { - throw new BadRequestException("Report not created"); - } - return report.getString("record_id"); - } - - private String financialBdLevel (int level) { - switch (level) { - case 0: - return "Leader"; - case 1: - return "Junior"; - case 2: - return "Intermediate"; - case 3: - return "Senior"; - default: - return "Unknown"; - } - } - - private String financialClientSource(int source) { - switch (source) { - case 1: - return "BD"; - case 2: - return "Apply"; - case 3: - return "Distribute"; - default: - return "Unknown"; - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/package-info.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/package-info.java deleted file mode 100644 index 293d483bb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * BD绩效提成 - * Created by yixian on 2017-02-07. - */ -package au.com.royalpay.payment.manage.bdprize; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/BDPrizeCalculator.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/support/BDPrizeCalculator.java deleted file mode 100644 index 049a5bedb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/BDPrizeCalculator.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.support; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-02-08. - */ -public interface BDPrizeCalculator { - - void calculate(); - - List getReport(int year,int month); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/ClientsWithBDAwayDeterminor.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/support/ClientsWithBDAwayDeterminor.java deleted file mode 100644 index 2576661fe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/ClientsWithBDAwayDeterminor.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.support; - -import java.util.Date; - -/** - * Created by yixian on 2017-02-08. - */ -public interface ClientsWithBDAwayDeterminor { - - boolean clientWithBDAway(int clientId, Date date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java deleted file mode 100644 index 89cebb2fb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java +++ /dev/null @@ -1,257 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.support.impls; - -import au.com.royalpay.payment.manage.bdprize.support.BDPrizeCalculator; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; - -/** - * Created by yixian on 2017-02-08. - */ -public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator { - private static Logger logger = LoggerFactory.getLogger(BDPrizeCalculator.class); - private final List tradeLogs; - private final Date month; - private ClientBDMapper clientBDMapper; - private DefaultClientWithBDAwayDeterminor clientsWithBDAwayDeterminor; - private Map> results = new HashMap<>(); - private Map bdMap = new HashMap<>(); - private Map>> rateConfigMap = new HashMap<>(); - private Map bdTotalMap = new HashMap<>(); - private TransactionMapper transactionMapper; - - public BDPrizeCalculatorDefaultImpl(List tradeLogs, Date month) { - this.tradeLogs = tradeLogs; - this.month = month; - } - - public BDPrizeCalculatorDefaultImpl clientBDMapper(ClientBDMapper clientBDMapper) { - this.clientBDMapper = clientBDMapper; - return this; - } - - public BDPrizeCalculatorDefaultImpl transactionMapper(TransactionMapper transactionMapper) { - this.transactionMapper = transactionMapper; - return this; - } - - public BDPrizeCalculatorDefaultImpl clientsWithBDAwayDeterminor(DefaultClientWithBDAwayDeterminor clientWithBDAwayDeterminor) { - this.clientsWithBDAwayDeterminor = clientWithBDAwayDeterminor; - return this; - } - - public BDPrizeCalculatorDefaultImpl rateConfig(List rateConfig) { - for (JSONObject rateCfgItem : rateConfig) { - int level = rateCfgItem.getIntValue("bd_level"); - int kpiRange = rateCfgItem.getIntValue("kpi_range"); - Map> levelRates = rateConfigMap.get(level); - if (levelRates == null) { - levelRates = new HashMap<>(); - rateConfigMap.put(level, levelRates); - } - List rate = levelRates.get(kpiRange); - if (rate == null) { - rate = new ArrayList<>(); - levelRates.put(kpiRange, rate); - } - rate.add(rateCfgItem); - } - return this; - } - - @Override - public void calculate() { - if (clientBDMapper == null) { - throw new ServerErrorException(); - } - for (JSONObject trade : tradeLogs) { - saveTradeDetail(trade); - } - } - - @Override - public List getReport(int year,int month1) { - List report = new ArrayList<>(); - for (Map.Entry> resultItem : results.entrySet()) { - JSONObject log = new JSONObject(); - log.put("manager_id", resultItem.getKey()); - JSONObject bd = bdMap.get(resultItem.getKey()); - int bdLevel = bd.getIntValue("bd_level"); - log.put("bd_level", bdLevel); - log.put("kpi_amount", bd.getBigDecimal("kpi_amount")); - log.put("bd_name", bd.getString("bd_name")); - log.put("total_amount", 0); - log.put("total_prize", 0); - log.put("total_donation", 0); - BigDecimal totalAmount = transactionMapper.totalAmountForBDPrize(year,month1,bd.getString("bd_id")); - List details = new ArrayList<>(); - for (Map.Entry detail : resultItem.getValue().entrySet()) { - JSONObject detailItem = detail.getValue(); - int clientId = detailItem.getIntValue("client_id"); -// int months = detailItem.getIntValue("client_create_months"); - BigDecimal totalTransaction = detailItem.getBigDecimal("total_transaction"); - BigDecimal coefficient = detailItem.getBigDecimal("coefficient"); - int prizeLevel = getKpiPrizeLevel(totalAmount,log.getBigDecimal("kpi_amount")); - logger.debug("-------->bd kpi level:"+bd.getString("bd_name")+"---level:"+prizeLevel+",kpi:"+log.getBigDecimal("kpi_amount")+",trans:"+totalAmount+",client_id:"+clientId); - BigDecimal bdRate = getNewRate(bdLevel, prizeLevel, detailItem.getIntValue("client_source"), detailItem.getBigDecimal("rate_value")); - BigDecimal prizeValue = totalTransaction.multiply(coefficient).multiply(bdRate).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN); - BigDecimal donation = BigDecimal.ZERO; - if (clientsWithBDAwayDeterminor.clientWithBDAway(clientId, month)) { - prizeValue = prizeValue.multiply(BigDecimal.valueOf(0.5)).setScale(2, RoundingMode.DOWN); - donation = new BigDecimal(prizeValue.toPlainString()).setScale(2, RoundingMode.DOWN); - detailItem.put("client_status", 2); - } - detailItem.put("prize_value", prizeValue); - detailItem.put("donation", donation); - detailItem.put("bd_rate", bdRate); - details.add(detailItem); - log.put("total_amount", log.getBigDecimal("total_amount").add(totalTransaction.multiply(coefficient)).setScale(2, RoundingMode.DOWN)); - log.put("total_prize", log.getBigDecimal("total_prize").add(prizeValue)); - log.put("total_donation", log.getBigDecimal("total_donation").add(donation)); - } - log.put("details", details); - BigDecimal totalPrize = log.getBigDecimal("total_prize"); - BigDecimal sendPrize = totalPrize.multiply(BigDecimal.valueOf(0.8)).setScale(2, RoundingMode.DOWN); - log.put("send_prize", sendPrize); - log.put("hold_prize", totalPrize.subtract(sendPrize)); - report.add(log); - } - return report; - } - - private void saveTradeDetail(JSONObject trade) { - int clientId = trade.getIntValue("client_id"); - Date tradeDate = trade.getDate("trade_date"); - List bdUsers = clientBDMapper.listClientBDAvailable(clientId, tradeDate); - for (JSONObject bd : bdUsers) { - String bdId = bd.getString("bd_id"); - int bdLevel = bd.getIntValue("bd_level"); - boolean getPrize = bd.getBooleanValue("get_prize"); - if (!getPrize) { - continue; - } - if (bdLevel == 0) { - throw new ServerErrorException("BD Level not configured:" + bdId); - } - bdMap.put(bdId, bd); - Map result = results.get(bdId); - if (result == null) { - result = new LinkedHashMap<>(); - results.put(bdId, result); - } - BigDecimal rateValue = trade.getBigDecimal("rate_value"); - rateValue = rateValue == null ? new BigDecimal("1.6") : rateValue; - BigDecimal coefficient = bd.getBigDecimal("proportion"); - - int months = getClientStartMonths(trade.getDate("client_create_time"), tradeDate); - String key = clientId + "_" + months + "_" + rateValue.doubleValue() + "_" + coefficient.doubleValue(); - JSONObject detail = result.get(key); - int clientSource = trade.getIntValue("client_source"); - if (detail == null) { - detail = initDetail(clientId, bdId, months, clientSource, rateValue, coefficient, tradeDate); - result.put(key, detail); - } - detail.put("order_date_to", tradeDate); - BigDecimal totalTransaction = detail.getBigDecimal("total_transaction").add(trade.getBigDecimal("total")); - detail.put("total_transaction", totalTransaction); - BigDecimal total = bdTotalMap.get(bdId); - if (total == null) { - total = BigDecimal.ZERO; - } - total = total.add(totalTransaction.multiply(coefficient)); - bdTotalMap.put(bdId, total); - } - } - - private int getClientStartMonths(Date clientStartDate, Date tradeDate) { - Calendar calStart = Calendar.getInstance(); - calStart.setTime(clientStartDate); - Calendar calDest = Calendar.getInstance(); - calDest.setTime(tradeDate); - int yearDiff = calDest.get(Calendar.YEAR) - calStart.get(Calendar.YEAR); - int monthDiff = yearDiff * 12 + calDest.get(Calendar.MONTH) - calStart.get(Calendar.MONTH); - monthDiff = calDest.get(Calendar.DATE) < calStart.get(Calendar.DATE) ? monthDiff : monthDiff + 1; - return monthDiff; - } - - private JSONObject initDetail(int clientId, String bdId, int months, int clientSource, BigDecimal rateValue, BigDecimal coefficient, Date tradeDate) { - JSONObject detail; - detail = new JSONObject(); - detail.put("client_id", clientId); - detail.put("manager_id", bdId); - detail.put("order_date_from", tradeDate); - detail.put("order_date_to", tradeDate); - detail.put("rate_value", rateValue); - detail.put("client_source", clientSource); - detail.put("client_create_months", months); - detail.put("client_status", clientsWithBDAwayDeterminor.clientWithBDAway(clientId, tradeDate)); - detail.put("total_transaction", 0); - detail.put("coefficient", coefficient); - return detail; - } - - private BigDecimal getRate(int bdLevel, int months, int clientSource, BigDecimal clientRate) { - if (clientSource == 1) { - Map> rates = rateConfigMap.get(bdLevel); - //todo 截止到2017-06-30 (继续延期) -// List rate = rates.get(Math.min((months - 1) / 3 + 1, 3)); - List rate = rates.get(1); - for (JSONObject rateCfg : rate) { - if (rateCfg.getBigDecimal("rate_from").compareTo(clientRate) <= 0 && rateCfg.getBigDecimal("rate_to").compareTo(clientRate) >= 0) { - return rateCfg.getBigDecimal("prize_rate"); - } - } - } else { - BigDecimal[] rates = {BigDecimal.valueOf(0.05), BigDecimal.valueOf(0.01), BigDecimal.valueOf(0.01)}; - //todo 截止到2017-06-30 (继续延期) -// return rates[Math.min((months - 1) / 3, 2)]; - return rates[0]; - } - throw new ServerErrorException("Prize Rate Config has no equalize:bdLevel=" + bdLevel + ",months=" + months + ",clientRate=" + clientRate.doubleValue()); - } - - - private BigDecimal getNewRate(int bdLevel, int kpiRange, int clientSource, BigDecimal clientRate) { - BigDecimal prizeRate = BigDecimal.ZERO; - Map> levelRates = rateConfigMap.get(bdLevel); - List rate = levelRates.get(kpiRange); - for (JSONObject rateCfg : rate) { - if (rateCfg.getBigDecimal("rate_from").compareTo(clientRate) <= 0 && rateCfg.getBigDecimal("rate_to").compareTo(clientRate) >= 0) { - prizeRate= rateCfg.getBigDecimal("prize_rate"); - continue; - } - } - if (clientSource == 1) { - return prizeRate; - } else { - return prizeRate.divide(BigDecimal.valueOf(2), 3, RoundingMode.HALF_DOWN); - } - } - - private int getKpiPrizeLevel(BigDecimal transactionAmount,BigDecimal kpiAmount){ - if (kpiAmount.compareTo(BigDecimal.ZERO)==0){//未设置kpi金额的按照最小完成度来计算 - return 1; - } - BigDecimal rate = transactionAmount.divide(kpiAmount, 2, RoundingMode.HALF_DOWN); - if (rate.compareTo(BigDecimal.valueOf(0.5))<0){ - return 1; - } - if (rate.compareTo(BigDecimal.valueOf(0.8))<0){ - return 2; - } - if (rate.compareTo(BigDecimal.valueOf(1))<0){ - return 3; - } - if (rate.compareTo(BigDecimal.valueOf(1.2))<0){ - return 4; - } - return 5; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/DefaultClientWithBDAwayDeterminor.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/DefaultClientWithBDAwayDeterminor.java deleted file mode 100644 index a319e4c94..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/DefaultClientWithBDAwayDeterminor.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.support.impls; - -import java.util.Date; -import java.util.List; - -import au.com.royalpay.payment.manage.bdprize.support.ClientsWithBDAwayDeterminor; - - -/** - * Created by yixian on 2017-02-08. - */ -public class DefaultClientWithBDAwayDeterminor implements ClientsWithBDAwayDeterminor { - - private final List clientsWithBDAway; - - public DefaultClientWithBDAwayDeterminor(List clientsWithBDAway) { - this.clientsWithBDAway = clientsWithBDAway; - } - - @Override - public boolean clientWithBDAway(int clientId, Date date) { - //todo 截止到2017-06-30 (延期) -// return clientsWithBDAway.contains(clientId); - return false; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java deleted file mode 100644 index b15cedd84..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java +++ /dev/null @@ -1,146 +0,0 @@ -package au.com.royalpay.payment.manage.bdprize.web; - -import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -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 java.io.IOException; -import java.text.ParseException; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yixian on 2017-02-07. - */ -@RestController -@RequestMapping("/sys/bd_prize") -public class BDPrizeController { - @Resource - private BDPrizeService bdPrizeService; - - @ManagerMapping(value = "/generate_record/{month}", method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public void generateRecord(@PathVariable String month) { - bdPrizeService.generateRecord(month); - } - - @ManagerMapping(value = "/records", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.BD_USER}) - public JSONObject listRecords(@RequestParam String year) { - return bdPrizeService.listRecords(year); - } - - @ManagerMapping(value = "/records/{month}", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF}) - public JSONObject getRecordInfo(@PathVariable String month) throws Exception { - return bdPrizeService.findReport(month); - } - - @ManagerMapping(value = "/records/{month}/bd_users/{managerId}", method = RequestMethod.GET, role = ManagerRole.FINANCIAL_STAFF) - public JSONObject getBDUserReportDetail(@PathVariable String month, @PathVariable String managerId) { - return bdPrizeService.getBDReport(month, managerId); - } - - @ManagerMapping(value = "/records/{month}/bd_user_detail", method = RequestMethod.GET, role = ManagerRole.BD_USER) - public JSONObject getBDUserReportDetailForBD(@PathVariable String month, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return bdPrizeService.getBDReport(month, manager.getString("manager_id")); - } - - @ManagerMapping(value = "/config/rates", method = RequestMethod.GET, role = {ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public List listRateConfigs() { - return bdPrizeService.getRateConfig(); - } - - @ManagerMapping(value = "/config/rates", method = RequestMethod.PUT, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public void updateRateConfigs(@RequestBody List rates, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - bdPrizeService.updateRates(rates, manager); - } - - @ManagerMapping(value = "/config/bd_levels", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public List listBDLevels() { - return bdPrizeService.listBDLevels(); - } - - @ManagerMapping(value = "/config/bd_levels/{bdId}", method = RequestMethod.PUT, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public void updateBDLevel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String bdId, @RequestBody JSONObject info) { - bdPrizeService.updateBDLevel(bdId, info,manager); - } - - @ManagerMapping(value = "/commission/le_ma/{month}",method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public List listBDLeaderAndManager(@PathVariable String month){ - return bdPrizeService.listBDLeaderAndManager(month); - } - - @ManagerMapping(value = "/commission/le_ma/update/{month}",method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public void updateCommissionConfig(@PathVariable String month , @RequestBody List info , @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws ParseException { - bdPrizeService.insertOrUpdateCommissionConfig(month,info,manager); - } - @ManagerMapping(value = "/commission/delete/{config_id}",method = RequestMethod.DELETE) - public void deleteCommission(@PathVariable String config_id){ - bdPrizeService.deleteCommConfig(config_id); - } - - @ManagerMapping(value = "/commission/le_ma/new",method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public List newCommissionConfig(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws ParseException { - return bdPrizeService.listNeedConfigCommission(); - } - - @ManagerMapping(value = "/commission/kpi/update/{month}",method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) - public void updatKpiConfig(@PathVariable String month , @RequestBody List info , @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws ParseException { - bdPrizeService.updateBdKpiConfig(info,manager); - } - - @ManagerMapping(value = "/commission/export/{month}",method = RequestMethod.GET, role = {ManagerRole.SALES_MANAGER, ManagerRole.FINANCIAL_STAFF,ManagerRole.DIRECTOR, ManagerRole.ADMIN}) - public void exportCommissionMonth(@PathVariable String month, HttpServletResponse response) throws Exception { - bdPrizeService.exportCommissionMonth(month, response); - } - - @ManagerMapping(value = "/commission/export/{month}/bd_users/{managerId}", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF}) - public void exportCommissionDetail(@PathVariable String month, @PathVariable String managerId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) { - bdPrizeService.exportCommissionDetail(month, managerId, response); - } - - @ManagerMapping(value = "/commission/personal/bd_user", method = RequestMethod.GET, role = {ManagerRole.BD_USER}) - public List getCommissionList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return bdPrizeService.findCommissionList(manager); - } - - @ManagerMapping(value = "/commission/export/{month}/bd_users", method = RequestMethod.GET, role = {ManagerRole.BD_USER}) - public void exportCommissionBdUserDetail(@PathVariable String month, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) { - bdPrizeService.exportCommissionDetail(month, manager.getString("manager_id"), response); - } - - /** - * 获取BD团队KPI完成度 - */ - @ManagerMapping(value = "/commission/{month}/completion_degree", method = RequestMethod.GET, role = {ManagerRole.DIRECTOR, ManagerRole.ADMIN}) - public List getBDTeamKpiCompletionDegree(@PathVariable String month) { - return bdPrizeService.getBDTeamKpiCompletionDegree(month); - } - - /** - * 团队每个BD的占比 - */ - @ManagerMapping(value = "/commission/{month}/bd_proportion/{teamType}", method = RequestMethod.GET, role = {ManagerRole.DIRECTOR, ManagerRole.ADMIN}) - public List getBDProportionByTeamType(@PathVariable String month, @PathVariable String teamType) { - return bdPrizeService.getBDProportionByTeamType(month, teamType); - } - - /** - * 查询BD KPI - */ - @ManagerMapping(value = "/commission/{month}/bd_user_kpi/{manager_id}", method = RequestMethod.GET, role = {ManagerRole.DIRECTOR, ManagerRole.ADMIN}) - public JSONObject getBDKpiByManagerId(@PathVariable String month, @PathVariable String manager_id) { - return bdPrizeService.getBDKpiByManagerId(month, manager_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/bean/NewBillBean.java b/src/main/java/au/com/royalpay/payment/manage/bill/bean/NewBillBean.java deleted file mode 100644 index cdec27ee2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/bean/NewBillBean.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.bill.bean; - -import java.math.BigDecimal; - -/** - * Created by wangning on 11/02/2018. - */ -public class NewBillBean { - - private BigDecimal amount; - - private String currency; - - private String remark; - - private String expire; - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getExpire() { - return expire; - } - - public void setExpire(String expire) { - this.expire = expire; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/bean/QueryBillBean.java b/src/main/java/au/com/royalpay/payment/manage/bill/bean/QueryBillBean.java deleted file mode 100644 index 9ce6277a8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/bean/QueryBillBean.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.bill.bean; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 26/02/2018. - */ -public class QueryBillBean { - private String status; - private int page = 1; - private int limit = 20; - - public JSONObject toParams(){ - JSONObject params = new JSONObject(); - params.put("status",status); - return params; - } - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/bean/QueryBillOrderBean.java b/src/main/java/au/com/royalpay/payment/manage/bill/bean/QueryBillOrderBean.java deleted file mode 100644 index f91195abb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/bean/QueryBillOrderBean.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.bill.bean; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 26/02/2018. - */ -public class QueryBillOrderBean { - private String status; - private int page = 1; - private int limit = 20; - - public JSONObject toParams(){ - JSONObject param = new JSONObject(); - param.put("status",status); - return param; - } - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/core/BillOrderService.java b/src/main/java/au/com/royalpay/payment/manage/bill/core/BillOrderService.java deleted file mode 100644 index 9492f5516..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/core/BillOrderService.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.bill.core; - -import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by wangning on 11/02/2018. - */ -public interface BillOrderService { - - List getByBillId(String bill_id, int client_id); - - JSONObject query(String bill_id,int client_id, QueryBillOrderBean queryBillOrderBean); - - JSONObject analysis(String bill_id,int client_id, QueryBillOrderBean queryBillOrderBean); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/core/BillService.java b/src/main/java/au/com/royalpay/payment/manage/bill/core/BillService.java deleted file mode 100644 index 7cd60a836..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/core/BillService.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.bill.core; - -import au.com.royalpay.payment.manage.bill.bean.NewBillBean; -import au.com.royalpay.payment.manage.bill.bean.QueryBillBean; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 11/02/2018. - */ -public interface BillService { - - JSONObject getBillDetail(String billId,int client_id); - - void updateBillStatus(String billId,String status,int client_id); - - void removeBill(String billId); - - JSONObject save(int client_id,NewBillBean newBillBean); - - JSONObject queryBills(int client_id, QueryBillBean queryBillBean); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java deleted file mode 100644 index 5b1e79fc8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package au.com.royalpay.payment.manage.bill.core.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean; -import au.com.royalpay.payment.manage.bill.core.BillOrderService; -import au.com.royalpay.payment.manage.mappers.bill.BillMapper; -import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -/** - * Created by wangning on 11/02/2018. - */ -@Service -public class BillOrderServiceImpl implements BillOrderService { - @Resource - private BillOrderMapper billOrderMapper; - @Resource - private BillMapper billMapper; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - - @Override - public List getByBillId(String bill_id, int client_id) { - JSONObject bill = billMapper.findOne(bill_id); - if (bill.getIntValue("client_id") != client_id) { - throw new BadRequestException("You have no right to check this bill"); - } - List wechatBillOrders = billOrderMapper.findByBillIdWithWechatInfo(bill_id); - for (JSONObject order : wechatBillOrders) { - if ("Alipay".equals(order.getString("channel"))) { - JSONObject alipayInfo = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); - if (alipayInfo != null) { - order.put("nickname", alipayInfo.getString("nickname")); - order.put("headimg", alipayInfo.getString("headimg")); - } - } - } - return wechatBillOrders; - } - - @Override - public JSONObject query(String bill_id, int client_id, QueryBillOrderBean queryBillOrderBean) { - JSONObject bill = billMapper.findOne(bill_id); - if (bill.getIntValue("client_id") != client_id) { - throw new BadRequestException("You have no right to check this bill"); - } - PageList list = billOrderMapper.query(bill_id, queryBillOrderBean.toParams(), - new PageBounds(queryBillOrderBean.getPage(), queryBillOrderBean.getLimit())); - for (JSONObject order : list) { - order.put("currency",bill.getString("currency")); - } - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject analysis(String bill_id, int client_id, QueryBillOrderBean queryBillOrderBean) { - JSONObject bill = billMapper.findOne(bill_id); - if (bill.getIntValue("client_id") != client_id) { - throw new BadRequestException("You have no right to check this bill"); - } - return billOrderMapper.analysis(bill_id, queryBillOrderBean.toParams()); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java deleted file mode 100644 index 6349a184b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -package au.com.royalpay.payment.manage.bill.core.impl; - -import au.com.royalpay.payment.manage.bill.bean.NewBillBean; -import au.com.royalpay.payment.manage.bill.bean.QueryBillBean; -import au.com.royalpay.payment.manage.bill.core.BillService; -import au.com.royalpay.payment.manage.mappers.bill.BillMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.RoundingMode; -import java.util.Date; - -/** - * Created by wangning on 11/02/2018. - */ -@Service -public class BillServiceImpl implements BillService { - @Resource - private BillMapper billMapper; - @Resource - private ClientManager clientManager; - - @Override - public JSONObject save(int client_id, NewBillBean newBillBean) { - JSONObject client = clientManager.getClientInfo(client_id); -// if(client==null){ -// throw new NotFoundException("client info not found"); -// } - Date now = new Date(); - JSONObject record = new JSONObject(); - record.put("client_id", client_id); - record.put("price", newBillBean.getAmount().divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN)); - record.put("currency", newBillBean.getCurrency()); - record.put("remark", newBillBean.getRemark()); - record.put("create_time", now); - record.put("cancle_time", addExpire(now, newBillBean.getExpire())); - record.put("status", 1); - billMapper.save(record); - JSONObject result = new JSONObject(); - //添加开关 - String codeUrl = selectBillVersion(client,record.getString("bill_id")); - result.put("partner_name",client.getString("short_name")); - result.put("partner_code",client.getString("client_moniker")); - result.put("full_name",client.getString("company_name")); - result.put("code_url",codeUrl); - result.put("bill",record); - return result; - } - - private String selectBillVersion(JSONObject clientInfo ,String billCodeId){ - String billCodeVersion = clientInfo.containsKey("billcode_version")?clientInfo.getString("billcode_version"):""; - switch (billCodeVersion){ - case "v1": - return PlatformEnvironment.getEnv().concatUrl("/api/v1.0/share_code/bills/payment/orders/" + billCodeId); - case "v2": - return PlatformEnvironment.getEnv().concatUrl("/api/v1.0/share_code/bills/payment/orders/"+billCodeId+"/link/payment"); - default: - return PlatformEnvironment.getEnv().concatUrl("/api/v1.0/share_code/bills/payment/orders/" + billCodeId); - } - } - - @Override - public JSONObject queryBills(int client_id, QueryBillBean queryBillBean) { - JSONObject params = queryBillBean.toParams(); - params.put("client_id", client_id); - PageList list = billMapper.listWithOrderAnalysis(params, new PageBounds(queryBillBean.getPage(), queryBillBean.getLimit())); - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject getBillDetail(String billId, int client_id) { - JSONObject bill = billMapper.findOne(billId); - if (bill.getIntValue("client_id") != client_id) { - throw new BadRequestException("You have no right to check this bill"); - } - return bill; - } - - @Override - public void updateBillStatus(String billId, String status, int client_id) { - JSONObject bill = billMapper.findOne(billId); - if (bill.getIntValue("client_id") != client_id) { - throw new BadRequestException("You have no right to check this bill"); - } - JSONObject record = new JSONObject(); - record.put("bill_id", billId); - record.put("status", status); - billMapper.update(record); - } - - @Override - public void removeBill(String billId) { - billMapper.delete(billId); - } - - private Date addExpire(Date now, String expire) { - if (Integer.valueOf(expire.substring(0, expire.length() - 1)) == 0) { - return null; - } - String unit = expire.substring(expire.length() - 1, expire.length()); - switch (unit) { - case "s": - return DateUtils.addSeconds(now, Integer.valueOf(expire.substring(0, expire.length() - 1))); - case "h": - return DateUtils.addHours(now, Integer.valueOf(expire.substring(0, expire.length() - 1))); - case "d": - return DateUtils.addDays(now, Integer.valueOf(expire.substring(0, expire.length() - 1))); - } - throw new ServerErrorException("日期单位不正确"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/billqrcode/bean/NewBillQrCodeBean.java b/src/main/java/au/com/royalpay/payment/manage/billqrcode/bean/NewBillQrCodeBean.java deleted file mode 100644 index 937620a67..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/billqrcode/bean/NewBillQrCodeBean.java +++ /dev/null @@ -1,77 +0,0 @@ -package au.com.royalpay.payment.manage.billqrcode.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import java.math.BigDecimal; - -public class NewBillQrCodeBean { - - private BigDecimal order_amount; - - private String currency = "AUD"; - - private String remark; - - private String cancle_time; - - private String client_order_id; - - public JSONObject toJson(){ - JSONObject record = new JSONObject(); - if(order_amount != null){ - record.put("order_amount",order_amount); - } - if(StringUtils.isNotEmpty(remark)){ - record.put("remark",remark); - } - if(StringUtils.isNotEmpty(client_order_id)){ - record.put("client_order_id",client_order_id); - } - if (StringUtils.isNotEmpty(cancle_time)) { - record.put("cancle_time",cancle_time); - } - record.put("currency",currency); - return record; - } - - public BigDecimal getOrder_amount() { - return order_amount; - } - - public void setOrder_amount(BigDecimal order_amount) { - this.order_amount = order_amount; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getCancle_time() { - return cancle_time; - } - - public void setCancle_time(String cancle_time) { - this.cancle_time = cancle_time; - } - - public String getClient_order_id() { - return client_order_id; - } - - public void setClient_order_id(String client_order_id) { - this.client_order_id = client_order_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/billqrcode/bean/QueryBillBean.java b/src/main/java/au/com/royalpay/payment/manage/billqrcode/bean/QueryBillBean.java deleted file mode 100644 index bf5e7fb6b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/billqrcode/bean/QueryBillBean.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.billqrcode.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yuan on 2018/5/9. - */ -public class QueryBillBean { - private int limit = 10; - private int page = 1; - private String status; - private String client_order_id; - - public JSONObject toJson(){ - JSONObject jason = new JSONObject(); - if(StringUtils.isNotEmpty(status)){ - jason.put("status",status); - } - if(StringUtils.isNotEmpty(client_order_id)){ - jason.put("client_order_id",client_order_id); - } - return jason; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getClient_order_id() { - return client_order_id; - } - - public void setClient_order_id(String client_order_id) { - this.client_order_id = client_order_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/PartnerBillService.java b/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/PartnerBillService.java deleted file mode 100644 index def496f3c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/PartnerBillService.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.billqrcode.core; - -import au.com.royalpay.payment.manage.billqrcode.bean.NewBillQrCodeBean; -import au.com.royalpay.payment.manage.billqrcode.bean.QueryBillBean; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yuan on 2018/5/3. - */ -public interface PartnerBillService { - String saveBill(JSONObject partner, NewBillQrCodeBean newBillQrCodeBean); - - List listBills(JSONObject partner, QueryBillBean queryBillBean); - - void dailyCheckDirectedBillCode(); - - void disableBills(JSONObject partner,String bill_code_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java deleted file mode 100644 index 4bcb961fb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -package au.com.royalpay.payment.manage.billqrcode.core.impl; - -import au.com.royalpay.payment.manage.billqrcode.bean.NewBillQrCodeBean; -import au.com.royalpay.payment.manage.billqrcode.bean.QueryBillBean; -import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService; -import au.com.royalpay.payment.manage.mappers.billqrcode.DirectedBillCodeMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - * Created by yuan on 2018/5/3. - */ -@Service -public class PartnerBillServiceImpl implements PartnerBillService { - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientMapper clientMapper; - - @Resource - private ClientManager clientManager; - - @Resource - private DirectedBillCodeMapper directedBillCodeMapper; - - - @Override - @Transactional - public String saveBill(JSONObject partner, NewBillQrCodeBean newBillQrCodeBean) { - JSONObject client = clientMapper.findClientByMoniker(partner.getString("client_moniker")); - if (client == null) { - throw new NotFoundException("client info not found"); - } - if(StringUtils.isNotEmpty(newBillQrCodeBean.getClient_order_id())){ - JSONObject bill = directedBillCodeMapper.findOne(newBillQrCodeBean.getClient_order_id()); - if(bill != null){ - if(bill.getIntValue("status") == 2){ - throw new BadRequestException("该订单已关闭,请确认"); - } - if(bill.getIntValue("status") == 3){ - throw new BadRequestException("该订单已完成,请确认"); - } - if(bill.getIntValue("status") == 1){ - if(bill.getBigDecimal("order_amount") == newBillQrCodeBean.getOrder_amount()){ - return QRCodeUtils.qrcodeImageCode(bill.getString("code_url"), 250, false); - } - throw new BadRequestException("已有相同订单号正在被支付,详情请查看订单列表"); - } - } - } - JSONObject record = newBillQrCodeBean.toJson(); - if(record.getString("client_order_id") == null){ - record.put("client_order_id","Bill_" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + "_" + RandomStringUtils.random(5, true, true).toUpperCase()); - } - record.put("client_id",partner.getIntValue("client_id")); - record.put("create_time", new Date()); - record.put("status",1); - directedBillCodeMapper.save(record); - String code_url = getQRCodeImg(record); - record.put("code_url",code_url); - directedBillCodeMapper.update(record); - if("v1".equals(client.getString("billcode_version"))){ - record.put("code_urls",code_url); - record.put("code_url",QRCodeUtils.qrcodeImageCode(code_url, 250, false)); - }else{ - String url = PlatformEnvironment.getEnv().concatUrl("api/v1.0/share_code/business/bills/"+record.getString("bill_code_id")+"/link/payment"); - record.put("code_urls",url); - record.put("code_url",QRCodeUtils.qrcodeImageCode(url, 250, false)); - } - return record.getString("code_url"); - } - - private String getQRCodeImg(JSONObject bill){ - return PlatformEnvironment.getEnv().concatUrl("api/v1.0/share_code/business/bills/"+bill.getString("bill_code_id")); - } - - @Override - public List listBills(JSONObject partner, QueryBillBean queryBillBean) { - int client_id = partner.getInteger("client_id"); - JSONObject client = clientManager.getClientInfo(client_id); - if (client == null) { - throw new NotFoundException("client info not found"); - } - JSONObject params = queryBillBean.toJson(); - params.put("client_id",client_id); - List bills = directedBillCodeMapper.findByClientId(params,new PageBounds(queryBillBean.getPage(),queryBillBean.getLimit(), Order.formString("create_time.desc"))); -// bills.stream().filter(t->StringUtils.isNotEmpty(t.getString("code_url"))).forEach(t->t.put("code_url",QRCodeUtils.qrcodeImageCode(t.getString("code_url"), 250, false))); - for (JSONObject bill : bills) { - switch (client.getString("billcode_version")){ - case "v1": - bill.put("code_urls",bill.getString("code_url")); - break; - case "v2": - bill.put("code_urls", PlatformEnvironment.getEnv().concatUrl("api/v1.0/share_code/business/bills/"+bill.getString("bill_code_id")+"/link/payment")); - break; - } - bill.put("code_url",QRCodeUtils.qrcodeImageCode(bill.getString("code_urls"), 250, false)); - } - return bills; - } - - @Override - public void disableBills(JSONObject partner, String bill_code_id) { - int client_id = partner.getInteger("client_id"); - JSONObject client = clientManager.getClientInfo(client_id); - if (client == null) { - throw new NotFoundException("client info not found"); - } - JSONObject bill = directedBillCodeMapper.findOneByBillCodeId(bill_code_id); - if(bill.getIntValue("status")==1){ - if(bill.getString("order_id") != null){ - bill.put("status",2); - directedBillCodeMapper.update(bill); - } - } - } - - @Override - public void dailyCheckDirectedBillCode() { - List listAllBill = directedBillCodeMapper.listAllBills(); - for (JSONObject bill: listAllBill) { - if(DateUtils.addDays(bill.getDate("cancle_time"),1).before(new Date())){ - bill.put("status",2); - directedBillCodeMapper.update(bill); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/billqrcode/web/PartnerBillController.java b/src/main/java/au/com/royalpay/payment/manage/billqrcode/web/PartnerBillController.java deleted file mode 100644 index c18f2f2a6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/billqrcode/web/PartnerBillController.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.billqrcode.web; - -import au.com.royalpay.payment.manage.billqrcode.bean.NewBillQrCodeBean; -import au.com.royalpay.payment.manage.billqrcode.bean.QueryBillBean; -import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yuan on 2018/5/3. - */ -@RestController -@RequestMapping("/partner/qrcode") -public class PartnerBillController { - - @Resource - private PartnerBillService partnerBillService; - - @PartnerMapping(value = "/bills", method = RequestMethod.POST) - public JSONObject addBill(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody NewBillQrCodeBean newBillQrCodeBean) { - JSONObject billCode = new JSONObject(); - billCode.put("code_url", partnerBillService.saveBill(partner, newBillQrCodeBean)); - return billCode; - } - - @PartnerMapping(value = "", method = RequestMethod.GET) - public List listBills(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, QueryBillBean queryBillBean) { - return partnerBillService.listBills(partner,queryBillBean); - } - @PartnerMapping(value = "/{bill_code_id}", method = RequestMethod.DELETE) - public void disableBills(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,@PathVariable String bill_code_id) { - partnerBillService.disableBills(partner,bill_code_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashback/bean/CashbackQuery.java b/src/main/java/au/com/royalpay/payment/manage/cashback/bean/CashbackQuery.java deleted file mode 100644 index 59bf6ddaf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashback/bean/CashbackQuery.java +++ /dev/null @@ -1,87 +0,0 @@ -package au.com.royalpay.payment.manage.cashback.bean; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.time.DateUtils; -import javax.validation.constraints.NotEmpty; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Created by yishuqian on 08/06/2017. - */ -public class CashbackQuery { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - @NotEmpty(message = "error.payment.valid.param_missing") - private String begin; - private String end; - private String org_id; - private int page = 1; - private int limit = 10; - private String cashback_type; - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (begin != null) { - try { - params.put("begin", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("end", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - if (cashback_type!=null){ - params.put("cashback_type",cashback_type); - } - return params; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public void setEnd(String end) { - this.end = end; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getCashback_type() { - return cashback_type; - } - - public void setCashback_type(String cashback_type) { - this.cashback_type = cashback_type; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashback/core/CashbackService.java b/src/main/java/au/com/royalpay/payment/manage/cashback/core/CashbackService.java deleted file mode 100644 index faa58ad37..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashback/core/CashbackService.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.cashback.core; - -import au.com.royalpay.payment.manage.cashback.bean.CashbackQuery; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by wangning on 2017/12/19. - */ -public interface CashbackService { - - List getCashbackDaily(CashbackQuery query); - - JSONObject getPartnerCashback(CashbackQuery query); - - JSONObject getCashbackAmount(JSONObject params); - - JSONObject getDrawDeposits(JSONObject params, int page, int limit); - - JSONObject getCashbackRecores(JSONObject params, int page, int limit); - - JSONObject getCashbackAnalysis(); - - List getSettleDelayRecord(JSONObject params); - - PageList getSettleDelayRank(JSONObject params, PageBounds page); - - JSONObject analysisCashback(JSONObject params); - - void drawDeposits(BigDecimal drawAmount, int clientId, JSONObject operator); - - void saveSurchargeDiscountCashback(int clientId, String clientMoniker, String transactionOrderId, BigDecimal cashbackAmount, Date date, String remark); -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/cashback/core/impl/CashbackServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/cashback/core/impl/CashbackServiceImp.java deleted file mode 100644 index 4cd24c53e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashback/core/impl/CashbackServiceImp.java +++ /dev/null @@ -1,138 +0,0 @@ -package au.com.royalpay.payment.manage.cashback.core.impl; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import au.com.royalpay.payment.core.PmtCashbackService; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import au.com.royalpay.payment.manage.cashback.bean.CashbackQuery; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.mappers.cashback.CashbackDrawDepositsMapper; -import au.com.royalpay.payment.manage.mappers.cashback.CashbackRecordsMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -/** - * Created by yishuqian on 26/05/2017. - */ -@Service -public class CashbackServiceImp implements CashbackService { - @Resource - private CashbackRecordsMapper cashbackRecordsMapper; - @Resource - private PmtCashbackService pmtCashbackService; - @Resource - private CashbackDrawDepositsMapper cashbackDrawDepositsMapper; - - /** - * 营销账户余额 - * - * @param params - * @return - */ - @Override - public JSONObject getCashbackAmount(JSONObject params) { - BigDecimal cashbackAmount = cashbackRecordsMapper.getCashTotal(params); - BigDecimal cashbackDrawAmount = cashbackDrawDepositsMapper.getDrawTotal(params); - BigDecimal balance = cashbackAmount.subtract(cashbackDrawAmount); - JSONObject res = new JSONObject(); - res.put("totalAmount", cashbackAmount); - res.put("drawAmount", cashbackDrawAmount); - res.put("balanceAmount", balance); - return res; - } - - /** - * 返现记录 - * - * @param params - * @param page - * @param limit - * @return - */ - @Override - public JSONObject getCashbackRecores(JSONObject params, int page, int limit) { - PageList list = cashbackRecordsMapper.getCashbackRecores(params, new PageBounds(page, limit, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject getDrawDeposits(JSONObject params, int page, int limit) { - PageList list = cashbackDrawDepositsMapper.getDrawLogs(params, new PageBounds(page, limit, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public List getCashbackDaily(CashbackQuery query) { - JSONObject params = query.toParams(); - return cashbackRecordsMapper.getCashbackDaily(params); - } - - @Override - public JSONObject getPartnerCashback(CashbackQuery query) { - JSONObject params = query.toParams(); - PageList list = cashbackRecordsMapper.getPartnerTotalCashback(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("cashback_amount.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject getCashbackAnalysis() { - BigDecimal totalCashback = cashbackRecordsMapper.getCashTotal(null); - BigDecimal totalDraw = cashbackDrawDepositsMapper.getDrawTotal(null); - BigDecimal unDraw = totalCashback.subtract(totalDraw); - JSONObject res = new JSONObject(); - res.put("total_cashback", totalCashback); - res.put("total_draw_deposits", totalDraw); - res.put("waiting_draw_deposits", unDraw); - return res; - } - - @Override - public List getSettleDelayRecord(JSONObject params) { - return cashbackRecordsMapper.getSettleDelayDaily(params.getDate("begin"), params.getDate("end")); - } - - @Override - public PageList getSettleDelayRank(JSONObject params, PageBounds page) { - return cashbackRecordsMapper.getSettleDelayRank(params, page); - } - - @Override - public JSONObject analysisCashback(JSONObject params) { - return cashbackRecordsMapper.analysisCashback(params); - } - - @Override - public void drawDeposits(BigDecimal drawAmount, int clientId, JSONObject operator) { - pmtCashbackService.drawDeposits(drawAmount, clientId, operator); - } - - @Override - public void saveSurchargeDiscountCashback(int clientId, String clientMoniker, String transactionOrderId, BigDecimal cashbackAmount, Date date, String remark) { - if (!cashbackRecordsMapper.findBySurchargeDiscountLog(clientId, date).isEmpty()) { - return; - } - String cashback_id = 'R' + clientMoniker + "-" + DateFormatUtils.format(date, "yyyyMMddHHmmssSSS") + "-" + RandomStringUtils.random(3, true, false).toUpperCase(); - //营销账户 - JSONObject cashback = new JSONObject(); - cashback.put("cashback_id", cashback_id); - cashback.put("client_id", clientId); - cashback.put("cashback_amount", cashbackAmount); - cashback.put("order_id", transactionOrderId); - cashback.put("cashback_type", 2); - cashback.put("remark", remark); - cashback.put("create_time", date); - cashbackRecordsMapper.save(cashback); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashback/web/CashbackController.java b/src/main/java/au/com/royalpay/payment/manage/cashback/web/CashbackController.java deleted file mode 100644 index 8bfa346e4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashback/web/CashbackController.java +++ /dev/null @@ -1,95 +0,0 @@ -package au.com.royalpay.payment.manage.cashback.web; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; - -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -/** - * Created by yishuqian on 01/06/2017. - */ -@RestController -@RequestMapping("/cashback") -public class CashbackController { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private CashbackService cashbackService; - @Resource - private ClientManager clientManager; - - - @PartnerMapping(value = "/common",method = RequestMethod.GET) - public JSONObject getCashbackCommData(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean analysisBean){ - JSONObject params = analysisBean.toParams(null); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - return cashbackService.getCashbackAmount(params); - } - - @PartnerMapping(value = "/records",method = RequestMethod.GET) - public JSONObject getCashbackRecords(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean analysisBean){ - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = analysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - return cashbackService.getCashbackRecores(params,analysisBean.getPage(),analysisBean.getLimit()); - } - - @PartnerMapping(value = "/drawlogs",method = RequestMethod.GET) - public JSONObject getCashbackDrawLogs(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean analysisBean){ - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = analysisBean.toParams(timezone); - try { - clientManager.validateClients(partner.getIntValue("client_id"), params); - } catch (Exception e) { - logger.error("including not permission client_id"); - params.remove("client_ids"); - } - params.put("client_id", partner.getIntValue("client_id")); - return cashbackService.getDrawDeposits(params,analysisBean.getPage(),analysisBean.getLimit()); - } - - @PartnerMapping(value = "/withdraw_deposits",method = RequestMethod.PUT,roles = PartnerRole.ADMIN) - public void drawDeposits(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody JSONObject cashObj){ - if (!cashObj.containsKey("draw_amount")||cashObj.getBigDecimal("draw_amount").compareTo(BigDecimal.ZERO)<=0){ - throw new InvalidShortIdException(); - } - JSONObject obj = new JSONObject(); - BigDecimal draw_amount = cashObj.getBigDecimal("draw_amount"); - obj.put("client_id",partner.getIntValue("client_id")); - obj.put("account_id",partner.getString("account_id")); - obj.put("display_name",partner.getString("display_name")); - if (cashObj.containsKey("client_id")){ - JSONArray clientIds = clientManager.getAllClientIds(partner.getIntValue("client_id")); - if (!clientIds.contains(cashObj.getString("client_id"))){ - throw new ForbiddenException("partner has no permission"); - } - obj.put("client_id",cashObj.getIntValue("client_id")); - } - cashbackService.drawDeposits(draw_amount,obj.getIntValue("client_id"),obj); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashback/web/ManageCashbackController.java b/src/main/java/au/com/royalpay/payment/manage/cashback/web/ManageCashbackController.java deleted file mode 100644 index bc1b0cb90..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashback/web/ManageCashbackController.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.cashback.web; - -import au.com.royalpay.payment.manage.cashback.bean.CashbackQuery; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -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; - -/** - * Created by yishuqian on 07/06/2017. - */ -@RestController -@ManagerMapping(value = "/sys/cashback",role = ManagerRole.ADMIN) -public class ManageCashbackController { - @Resource - private CashbackService cashbackService; - - @RequestMapping(value = "/daily",method = RequestMethod.GET) - @ReadOnlyConnection - public List getCashbackDaily(CashbackQuery query){ - return cashbackService.getCashbackDaily(query); - } - - @RequestMapping(value = "/partners",method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject getCashbackPartners(CashbackQuery query){ - return cashbackService.getPartnerCashback(query); - } - - @RequestMapping(value = "/analysis",method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject getCashbackAnalysis(){ - return cashbackService.getCashbackAnalysis(); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/beans/CashierBean.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/beans/CashierBean.java deleted file mode 100644 index 9251836b5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/beans/CashierBean.java +++ /dev/null @@ -1,63 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yishuqian on 20/12/2016. - */ -public class CashierBean { - @NotEmpty(message = "error.payment.valid.param_missing") - private String name; - @NotEmpty(message = "error.payment.valid.param_missing") - private String code; - private String phone; - private String photo; - private String remark; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public JSONObject toJson(){ - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/beans/CashierQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/beans/CashierQueryBean.java deleted file mode 100644 index b7f663330..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/beans/CashierQueryBean.java +++ /dev/null @@ -1,92 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.TimeZone; - -/** - * redpack query - * Created by davep on 2016-08-03. - */ -public class CashierQueryBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private String begin; - private String end; - private int page = 1; - private int limit = 20; - private String name; - private String code; - public JSONObject params(String timezone) { - JSONObject params = new JSONObject(); - if (timezone != null) { - format.setTimeZone(TimeZone.getTimeZone(timezone)); - } - if (begin != null) { - try { - params.put("from", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("to", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - if (name != null){ - params.put("name",name); - } - if (code != null){ - params.put("code",code); - } - return params; - } - - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public void setEnd(String end) { - this.end = end; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/CashierOrderService.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/CashierOrderService.java deleted file mode 100644 index 17ac6a7bb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/CashierOrderService.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.core; - -import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean; -import com.alibaba.fastjson.JSONObject; -import org.springframework.ui.Model; - -import java.io.IOException; -import java.net.URISyntaxException; - -/** - * Created by yishuqian on 23/12/2016. - */ -public interface CashierOrderService { - JSONObject listCashierOrders(JSONObject partner, CashierQueryBean query); - JSONObject listCashierOrders(String cashier_id, JSONObject partner, CashierQueryBean query); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/CashierService.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/CashierService.java deleted file mode 100644 index 433fc86c2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/CashierService.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.core; - -import au.com.royalpay.payment.manage.cashiers.beans.CashierBean; -import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean; -import com.alibaba.fastjson.JSONObject; -import org.springframework.ui.Model; - -/** - * Created by yishuqian on 20/12/2016. - */ -public interface CashierService { - JSONObject listCashier(JSONObject partner, CashierQueryBean query); - - JSONObject addCashier(JSONObject partner, CashierBean cashierBean); - - void updateCashier(JSONObject partner, String cashier_id, CashierBean info); - - void changeCashierValidStatus(JSONObject partner, String cashier_id,boolean isValid); - - JSONObject getCashierByCashierId(String cashier_id); - - JSONObject getCashierByCashierId(String cashier_id, JSONObject partner); - - JSONObject newBindRequest(String cashier_id); - - void bindWechatUser(String cashier_id, String bindId, JSONObject wechat); - - void prepareModalMap(JSONObject client, JSONObject cashier, String channel, Model modelMap); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java deleted file mode 100644 index 3b279a7ce..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java +++ /dev/null @@ -1,51 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.core.impls; - -import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean; -import au.com.royalpay.payment.manage.cashiers.core.CashierOrderService; -import au.com.royalpay.payment.manage.mappers.cashiers.CashierMapper; -import au.com.royalpay.payment.manage.mappers.cashiers.CashierOrderMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 23/12/2016. - */ -@Service -public class CashierOrderServiceImp implements CashierOrderService { - @Resource - private CashierMapper cashierMapper; - @Resource - private CashierOrderMapper cashierOrderMapper; - - @Override - public JSONObject listCashierOrders(JSONObject partner, CashierQueryBean query) { - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.params(timezone); - params.put("client_id", partner.getIntValue("client_id")); - PageList list = cashierOrderMapper.listOrders(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject listCashierOrders(String cashier_id, JSONObject partner, CashierQueryBean query) { - JSONObject cashier = cashierMapper.findIsValidById(cashier_id); - if (cashier == null) { - throw new BadRequestException("Cashier Not Found Or Disabled"); - } - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.params(timezone); - params.put("client_id", partner.getIntValue("client_id")); - params.put("cashier_id", cashier_id); - PageList list = cashierOrderMapper.listOrders(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java deleted file mode 100644 index 72e2a654e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java +++ /dev/null @@ -1,149 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.core.impls; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.PaymentChannelApi; -import au.com.royalpay.payment.manage.cashiers.beans.CashierBean; -import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean; -import au.com.royalpay.payment.manage.cashiers.core.CashierService; -import au.com.royalpay.payment.manage.mappers.cashiers.CashierMapper; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.RandomStringUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.math.RoundingMode; -import java.util.Date; -import java.util.concurrent.TimeUnit; - -/** - * Created by yishuqian on 20/12/2016. - */ -@Service -public class CashierServiceImp implements CashierService { - @Resource - private CashierMapper cashierMapper; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private PaymentApi paymentApi; - @Value("${app.redis.prefix}") - private String prefix; - - @Override - public JSONObject listCashier(JSONObject partner, CashierQueryBean query) { - JSONObject params = query.params(null); - params.put("client_id", partner.getIntValue("client_id")); - PageList pageList = cashierMapper.listCashiers(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(pageList); - } - - @Override - public JSONObject addCashier(JSONObject partner, CashierBean cashierBean) { - JSONObject cashier = cashierBean.toJson(); - JSONObject cashierInfo = cashierMapper.findCashierByCode(partner.getIntValue("client_id"), cashierBean.getCode()); - if (cashierInfo != null) { - throw new BadRequestException("error.cashier.valid.dumplicate_cashier_code"); - } - cashier.put("client_id", partner.getIntValue("client_id")); - cashier.put("create_time", new Date()); - cashierMapper.save(cashier); - return cashier; - } - - @Override - public void updateCashier(JSONObject partner, String cashier_id, CashierBean info) { - JSONObject cashier = cashierMapper.findOne(cashier_id); - Assert.notNull(cashier, "cashier not found"); - if (partner.getIntValue("client_id") != cashier.getIntValue("client_id")) { - throw new ForbiddenException("You have no permission!"); - } - JSONObject cashierUpdate = info.toJson(); - cashierUpdate.put("cashier_id", cashier_id); - cashierMapper.update(cashierUpdate); - } - - @Override - public void changeCashierValidStatus(JSONObject partner, String cashier_id,boolean isValid) { - JSONObject cashier = cashierMapper.findOne(cashier_id); - Assert.notNull(cashier, "cashier not found"); - if (partner.getIntValue("client_id") != cashier.getIntValue("client_id")) { - throw new ForbiddenException("You have no permission!"); - } - cashier.put("is_valid", isValid); - if (!isValid) { - cashier.put("wechat_openid", null); - cashier.put("nick_name", null); - cashier.put("headimgurl", null); - cashier.put("phone", null); - cashier.put("photo", null); - } - cashierMapper.update(cashier); - } - - @Override - public JSONObject getCashierByCashierId(String cashier_id) { - return cashierMapper.findOne(cashier_id); - } - - @Override - public JSONObject getCashierByCashierId(String cashier_id, JSONObject partner) { - JSONObject cashier = cashierMapper.findOne(cashier_id); - Assert.notNull(cashier, "cashier not found"); - if (partner.getIntValue("client_id") != cashier.getIntValue("client_id")) { - throw new ForbiddenException("You have no permission!"); - } - String url = PlatformEnvironment.getEnv().concatUrl("/partner/cashiers/payment/" + partner.getString("client_moniker") + "/" + cashier_id + "/qr_pay"); - cashier.put("url", url); - cashier.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false)); - return cashier; - } - - @Override - public JSONObject newBindRequest(String cashier_id) { - String bindId = RandomStringUtils.random(16, true, true); - stringRedisTemplate.boundValueOps(prefix + ":cashier_bind_wechat:" + bindId).set(cashier_id + "", 5, TimeUnit.MINUTES); - JSONObject bind = new JSONObject(); - bind.put("bind_id", bindId); - String url = PlatformEnvironment.getEnv().concatUrl("/partner/cashiers/wechat_bind/" + cashier_id + "/" + bindId); - bind.put("url", url); - return bind; - } - - @Override - public void bindWechatUser(String cashier_id, String bindId, JSONObject wechat) { - String manageridStr = stringRedisTemplate.boundValueOps(prefix + ":cashier_bind_wechat:" + bindId).get(); - if (manageridStr == null) { - throw new BadRequestException("URL expired"); - } - if (!manageridStr.equals(cashier_id)) { - throw new BadRequestException("Invalid Cashier"); - } - JSONObject cashier = cashierMapper.findOne(cashier_id); - Assert.notNull(cashier, "cashier not found"); - cashier.put("wechat_openid", wechat.getString("wepay_openid")); - cashier.put("nick_name", wechat.getString("nickname")); - cashier.put("headimgurl", wechat.getString("headimgurl")); - cashierMapper.update(cashier); - } - - @Override - public void prepareModalMap(JSONObject client, JSONObject cashier, String channel, Model modelMap) { - PaymentChannelApi api = paymentApi.channelApi(channel); - String exchangeRate = api.queryExchangeRateDecimal(client.getIntValue("client_id")).setScale(5, RoundingMode.DOWN).toPlainString(); - modelMap.addAttribute("exchange_rate", exchangeRate); - modelMap.addAttribute("channel", channel); - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/package-info.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/package-info.java deleted file mode 100644 index 823939324..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Cashiers - * - */ -package au.com.royalpay.payment.manage.cashiers; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/web/CashierManageController.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/web/CashierManageController.java deleted file mode 100644 index ec457eb38..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/web/CashierManageController.java +++ /dev/null @@ -1,99 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.web; - -import au.com.royalpay.payment.manage.cashiers.beans.CashierBean; -import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean; -import au.com.royalpay.payment.manage.cashiers.core.CashierOrderService; -import au.com.royalpay.payment.manage.cashiers.core.CashierService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 20/12/2016. - */ -@Controller -@RequestMapping("/partner/cashiers") -public class CashierManageController { - @Resource - private CashierService cashierService; - @Resource - private CashierOrderService cashierOrderService; - - @RequestMapping(method = RequestMethod.GET) - @RequirePartner(roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public JSONObject listCashiers(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, CashierQueryBean query){ - return cashierService.listCashier(partner,query); - } - - @RequestMapping(method = RequestMethod.POST) - @RequirePartner(roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public JSONObject addCashier(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody CashierBean cashierBean){ - return cashierService.addCashier(partner,cashierBean); - } - - @PartnerMapping(value = "/{cashier_id}", method = RequestMethod.PUT,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public void updateVipCustomer(@PathVariable String cashier_id, @RequestBody CashierBean info, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - cashierService.updateCashier(partner, cashier_id, info); - } - - @PartnerMapping(value = "/{cashier_id}", method = RequestMethod.GET,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getCashier(@PathVariable String cashier_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - return cashierService.getCashierByCashierId(cashier_id,partner); - } - - @RequestMapping(value = "/wechat_bind/{cashier_id}",method = RequestMethod.POST) - @RequirePartner(roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public JSONObject cashierBindWechat(@PathVariable String cashier_id) { - return cashierService.newBindRequest(cashier_id); - } - - @WechatMapping(value = "/wechat_bind/{cashier_id}/{bindId}", method = RequestMethod.GET,oauthType = WxOauthType.USERINFO) - public String bindManagerWechat(@PathVariable String cashier_id, @PathVariable String bindId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) { - cashierService.bindWechatUser(cashier_id,bindId,wechat); - return "manager_bind_success"; - } - - - @PartnerMapping(value = "/orders", method = RequestMethod.GET) - @ResponseBody - public JSONObject getPartnerCashierOrders(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, CashierQueryBean query) { - return cashierOrderService.listCashierOrders(partner, query); - } - - @PartnerMapping(value = "/orders/{cashier_id}", method = RequestMethod.GET) - @ResponseBody - public JSONObject getPartnerCashierOrdersById(@PathVariable String cashier_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, - CashierQueryBean query) { - return cashierOrderService.listCashierOrders(cashier_id, partner, query); - } - - @PartnerMapping(value = "/{cashier_id}/disable", method = RequestMethod.PUT,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public void deleteVipCustomer(@PathVariable String cashier_id, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - cashierService.changeCashierValidStatus(partner, cashier_id, false); - } - - @PartnerMapping(value = "/{cashier_id}/enable", method = RequestMethod.PUT,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public void enableVipCustomer(@PathVariable String cashier_id, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - cashierService.changeCashierValidStatus(partner, cashier_id, true); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/web/CashierPaymerntContorller.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/web/CashierPaymerntContorller.java deleted file mode 100644 index b5c1a842f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/web/CashierPaymerntContorller.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.cashiers.web; - -import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean; -import au.com.royalpay.payment.manage.cashiers.core.CashierOrderService; -import au.com.royalpay.payment.manage.cashiers.core.CashierService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 20/12/2016. - */ -@Controller -@RequestMapping("/partner/cashiers/payment") -public class CashierPaymerntContorller { - @Resource - private CashierService cashierService; - @Resource - private CashierOrderService cashierOrderService; - -// @PartnerMapping(value = "/orders", method = RequestMethod.GET) -// @ResponseBody -// public JSONObject getPartnerCashierOrders(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, CashierQueryBean query) { -// return cashierOrderService.listCashierOrders(partner, query); -// } -// -// @PartnerMapping(value = "/orders/{cashier_id}", method = RequestMethod.GET) -// @ResponseBody -// public JSONObject getPartnerCashierOrders(@PathVariable String cashier_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, -// CashierQueryBean query) { -// return cashierOrderService.listCashierOrders(cashier_id, partner, query); -// } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/AgentCommissionAnalysis.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/AgentCommissionAnalysis.java deleted file mode 100644 index 67bd2d78b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/AgentCommissionAnalysis.java +++ /dev/null @@ -1,142 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.beans; - -import au.com.royalpay.payment.tools.CommonConsts; - -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by yixian on 2017-03-08. - */ -public class AgentCommissionAnalysis { - private int orgId; - private int year; - private int month; - private BigDecimal rate; - private String channel; - private Map> clientAnalysis = new HashMap<>(); - private BigDecimal totalGrossAmount = BigDecimal.ZERO; - private BigDecimal totalAgentCharge = BigDecimal.ZERO; - private BigDecimal totalAgentNetCharge = BigDecimal.ZERO; - private BigDecimal totalOrgCharge = BigDecimal.ZERO; - private BigDecimal totalOrgNetCharge = BigDecimal.ZERO; - private JSONObject org; - private JSONObject parentOrg; - - public AgentCommissionAnalysis(int orgId, int year, int month, BigDecimal rate,String channel,JSONObject org,JSONObject parentOrg) { - this.orgId = orgId; - this.year = year; - this.month = month; - this.rate = rate; - this.channel = channel; - this.org = org; - this.parentOrg = parentOrg; - } - - public AgentCommissionAnalysis attachAnalysis(JSONObject dayAnalysis,String channel) { - int clientId = dayAnalysis.getIntValue("client_id"); - List clientTrades = clientAnalysis.get(clientId); - if (clientTrades == null) { - clientTrades = new ArrayList<>(); - clientAnalysis.put(clientId, clientTrades); - } - Date tradeDate = dayAnalysis.getDate("trade_date"); - BigDecimal grossAmount = dayAnalysis.getBigDecimal("total"); - BigDecimal dayRate = dayAnalysis.getBigDecimal(channel+"_rate_value"); - BigDecimal agentCharge = grossAmount.multiply(dayRate.divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP)); - BigDecimal orgCharge = BigDecimal.ZERO; - BigDecimal orgNetCharge = BigDecimal.ZERO; - switch (channel){ - case "alipay": - orgCharge = grossAmount.multiply(org.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP)); - orgNetCharge = orgCharge.subtract(grossAmount.multiply(parentOrg.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP))); - break; - case "wechat": - orgCharge = grossAmount.multiply(org.getBigDecimal("wechat_rate_value").divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP)); - orgNetCharge = orgCharge.subtract(grossAmount.multiply(parentOrg.getBigDecimal("wechat_rate_value").divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP))); - break; - case "alipayonline": - orgCharge = grossAmount.multiply(org.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP)); - orgNetCharge = orgCharge.subtract(grossAmount.multiply(parentOrg.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP))); - break; - default: - break; - } - - - totalGrossAmount = totalGrossAmount.add(grossAmount); - totalAgentCharge = totalAgentCharge.add(agentCharge); - totalAgentNetCharge = totalAgentNetCharge.add(orgNetCharge); - totalOrgCharge = totalOrgCharge.add(orgCharge); - totalOrgNetCharge = totalOrgNetCharge.add(orgNetCharge); - if (!clientTrades.isEmpty()) { - JSONObject item = clientTrades.get(clientTrades.size() - 1); - BigDecimal rate = item.getBigDecimal("client_rate"); - if (rate.compareTo(dayRate) == 0) { - BigDecimal gross = item.getBigDecimal("gross_amount").add(grossAmount); - item.put("gross_amount", gross); - BigDecimal totalCharge = item.getBigDecimal("total_charge").add(agentCharge); - item.put("total_charge", totalCharge); - BigDecimal totalOrgCharge = item.getBigDecimal("org_charge").add(orgCharge); - item.put("org_charge", totalOrgCharge); - BigDecimal totalRoyalpayClearingCharge = item.getBigDecimal("org_net_charge").add(orgNetCharge); - item.put("org_net_charge", totalRoyalpayClearingCharge); - Date from = item.getDate("date_from"); - Date to = item.getDate("date_to"); - from = from.before(tradeDate) ? from : tradeDate; - to = to.after(tradeDate) ? to : tradeDate; - item.put("date_from", from); - item.put("date_to", to); - return this; - } - } - JSONObject item = new JSONObject(); - item.put("year", year); - item.put("month", month); - item.put("date_from", tradeDate); - item.put("date_to", tradeDate); - item.put("client_rate", dayRate); - item.put("gross_amount", grossAmount); - item.put("total_charge", agentCharge); - item.put("org_charge", orgCharge); - item.put("channel",channel); - item.put("org_net_charge",orgNetCharge); - clientTrades.add(item); - return this; - } - - public JSONObject totalCommission() { - JSONObject result = new JSONObject(); - result.put("org_id", orgId); - result.put("year", year); - result.put("month", month); - result.put("create_time", new Date()); - result.put("org_rate", rate); - result.put("gross_amount", totalGrossAmount); - result.put("total_charge", totalAgentCharge); - result.put("org_charge", totalOrgCharge); - result.put("org_net_charge",totalOrgNetCharge); - result.put("channel",channel); - return result; - } - - public List getCommissionDetails(String recordId) { - List list = new ArrayList<>(); - for (Map.Entry> entry : clientAnalysis.entrySet()) { - int clientId = entry.getKey(); - for (JSONObject item : entry.getValue()) { - item.put("client_id", clientId); - item.put("record_id", recordId); - list.add(item); - } - } - return list; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerBean.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerBean.java deleted file mode 100644 index 109e1e05b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerBean.java +++ /dev/null @@ -1,70 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.beans; - -import com.alibaba.fastjson.JSONObject; -import javax.validation.constraints.Email; -import org.hibernate.validator.constraints.Length; -import javax.validation.constraints.NotBlank; - -/** - * Created by yixian on 2017-01-23. - */ -public class CityPartnerBean { - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 50) - private String name; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 50) - private String city; - @Email(message = "error.payment.valid.invalid_email") - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 80) - private String email; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 30) - private String phone; - private String captcha; - - public JSONObject toJSON(){ - return (JSONObject) JSONObject.toJSON(this); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getCaptcha() { - return captcha; - } - - public void setCaptcha(String captcha) { - this.captcha = captcha; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerCommissionAnalysis.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerCommissionAnalysis.java deleted file mode 100644 index 4660e1331..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerCommissionAnalysis.java +++ /dev/null @@ -1,234 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.beans; - -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; - -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; - -/** - * Created by yixian on 2017-03-08. - */ -public class CityPartnerCommissionAnalysis { - private int orgId; - private int year; - private int month; - private BigDecimal alipayChargeRate; - private BigDecimal wechatChargeRate; - private BigDecimal jdChargeRate; - private BigDecimal alipayonlineChargeRate; - private BigDecimal rate; - private BigDecimal orgRate; - private String channel; - private int commissionType; - private Map> clientAnalysis = new HashMap<>(); - private BigDecimal totalGrossAmount = BigDecimal.ZERO; - private BigDecimal totalChargeSum = BigDecimal.ZERO; - private BigDecimal totalRoyalPayCharge = BigDecimal.ZERO; - private BigDecimal totalOrgChargeSum = BigDecimal.ZERO; - private BigDecimal totalnetCharge = BigDecimal.ZERO; - - public CityPartnerCommissionAnalysis(int orgId, int year, int month, BigDecimal rate, String channel, BigDecimal alipayChargeRate, - BigDecimal wechatChargeRate, BigDecimal jdChargeRate, BigDecimal alipayonlineChargeRate, BigDecimal orgRate,int commissionType) { - this.orgId = orgId; - this.year = year; - this.month = month; - this.rate = rate; - this.channel = channel; - this.commissionType = commissionType; - this.alipayChargeRate = alipayChargeRate; - this.wechatChargeRate = wechatChargeRate; - this.jdChargeRate = jdChargeRate; - this.alipayonlineChargeRate = alipayonlineChargeRate; - this.orgRate = orgRate; - } - - public CityPartnerCommissionAnalysis calculator(JSONObject dayAnalysis, String channel, int type) { - switch (type) { - case 1: - return attachAnalysis(dayAnalysis, channel); - case 3: - return attachNetCommissionAnalysis(dayAnalysis, channel); - default: - throw new ServerErrorException("unkonw calculate type"); - } - - } - - public CityPartnerCommissionAnalysis attachAnalysis(JSONObject dayAnalysis, String channel) { - int clientId = dayAnalysis.getIntValue("client_id"); - List clientTrades = clientAnalysis.get(clientId); - if (clientTrades == null) { - clientTrades = new ArrayList<>(); - clientAnalysis.put(clientId, clientTrades); - } - Date tradeDate = dayAnalysis.getDate("trade_date"); - BigDecimal total = dayAnalysis.getBigDecimal("total"); - BigDecimal dayRate = dayAnalysis.getBigDecimal(channel + "_rate_value"); - BigDecimal dayCharge = total.multiply(dayRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal royalpayCharge = total.multiply(rate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal thirdPartyPaymentCharge = getThirdPartyCharge(channel, total); - BigDecimal netCharge = royalpayCharge.subtract(thirdPartyPaymentCharge); - - BigDecimal orgCharge = dayCharge.subtract(royalpayCharge); - - totalGrossAmount = totalGrossAmount.add(total); - totalChargeSum = totalChargeSum.add(dayCharge); - totalRoyalPayCharge = totalRoyalPayCharge.add(royalpayCharge); - totalOrgChargeSum = totalOrgChargeSum.add(orgCharge); - totalnetCharge = totalnetCharge.add(netCharge); - if (!clientTrades.isEmpty()) { - JSONObject item = clientTrades.get(clientTrades.size() - 1); - BigDecimal rate = item.getBigDecimal("client_rate"); - if (rate.compareTo(dayRate) == 0) { - BigDecimal gross = item.getBigDecimal("gross_amount").add(total); - item.put("gross_amount", gross); - BigDecimal totalCharge = item.getBigDecimal("total_charge").add(dayCharge); - item.put("total_charge", totalCharge); - BigDecimal totalRoyalCharge = item.getBigDecimal("royalpay_charge").add(royalpayCharge); - item.put("royalpay_charge", totalRoyalCharge); - BigDecimal totalOrgCharge = item.getBigDecimal("org_charge").add(orgCharge); - item.put("org_charge", totalOrgCharge); - BigDecimal totalRoyalpayClearingCharge = item.getBigDecimal("net_charge").add(netCharge); - item.put("net_charge", totalRoyalpayClearingCharge); - Date from = item.getDate("date_from"); - Date to = item.getDate("date_to"); - from = from.before(tradeDate) ? from : tradeDate; - to = to.after(tradeDate) ? to : tradeDate; - item.put("date_from", from); - item.put("date_to", to); - return this; - } - } - JSONObject item = new JSONObject(); - item.put("year", year); - item.put("month", month); - item.put("date_from", tradeDate); - item.put("date_to", tradeDate); - item.put("client_rate", dayRate); - item.put("gross_amount", total); - item.put("total_charge", dayCharge); - item.put("royalpay_charge", royalpayCharge); - item.put("org_charge", orgCharge); - item.put("channel", channel); - item.put("net_charge", netCharge); - item.put("commission_type",commissionType); - clientTrades.add(item); - return this; - } - - public JSONObject totalCommission() { - JSONObject result = new JSONObject(); - result.put("org_id", orgId); - result.put("year", year); - result.put("month", month); - result.put("create_time", new Date()); - result.put("org_rate", rate); - result.put("gross_amount", totalGrossAmount); - result.put("total_charge", totalChargeSum); - result.put("royalpay_charge", totalRoyalPayCharge); - result.put("org_charge", totalOrgChargeSum); - result.put("net_charge", totalnetCharge); - result.put("channel", channel); - result.put("commission_type",commissionType); - return result; - } - - public List getCommissionDetails(String recordId) { - List list = new ArrayList<>(); - for (Map.Entry> entry : clientAnalysis.entrySet()) { - int clientId = entry.getKey(); - for (JSONObject item : entry.getValue()) { - item.put("client_id", clientId); - item.put("record_id", recordId); - list.add(item); - } - } - return list; - } - - public CityPartnerCommissionAnalysis attachNetCommissionAnalysis(JSONObject dayAnalysis, String channel) { - int clientId = dayAnalysis.getIntValue("client_id"); - List clientTrades = clientAnalysis.get(clientId); - if (clientTrades == null) { - clientTrades = new ArrayList<>(); - clientAnalysis.put(clientId, clientTrades); - } - Date tradeDate = dayAnalysis.getDate("trade_date"); - BigDecimal total = dayAnalysis.getBigDecimal("total"); - BigDecimal dayRate = dayAnalysis.getBigDecimal(channel + "_rate_value"); - BigDecimal dayCharge = total.multiply(dayRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal royalpayCharge = total.multiply(rate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal thirdPartyPaymentCharge = getThirdPartyCharge(channel, total); - BigDecimal netCharge = royalpayCharge.subtract(thirdPartyPaymentCharge); - BigDecimal orgCharge = netCharge.multiply(orgRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - totalGrossAmount = totalGrossAmount.add(total); - totalChargeSum = totalChargeSum.add(dayCharge); - totalRoyalPayCharge = totalRoyalPayCharge.add(royalpayCharge); - totalOrgChargeSum = totalOrgChargeSum.add(orgCharge); - totalnetCharge = totalnetCharge.add(netCharge); - if (!clientTrades.isEmpty()) { - JSONObject item = clientTrades.get(clientTrades.size() - 1); - BigDecimal rate = item.getBigDecimal("client_rate"); - if (rate.compareTo(dayRate) == 0) { - BigDecimal gross = item.getBigDecimal("gross_amount").add(total); - item.put("gross_amount", gross); - BigDecimal totalCharge = item.getBigDecimal("total_charge").add(dayCharge); - item.put("total_charge", totalCharge); - BigDecimal totalRoyalCharge = item.getBigDecimal("royalpay_charge").add(royalpayCharge); - item.put("royalpay_charge", totalRoyalCharge); - BigDecimal totalOrgCharge = item.getBigDecimal("org_charge").add(orgCharge); - item.put("org_charge", totalOrgCharge); - BigDecimal totalRoyalpayClearingCharge = item.getBigDecimal("net_charge").add(netCharge); - item.put("net_charge", totalRoyalpayClearingCharge); - Date from = item.getDate("date_from"); - Date to = item.getDate("date_to"); - from = from.before(tradeDate) ? from : tradeDate; - to = to.after(tradeDate) ? to : tradeDate; - item.put("date_from", from); - item.put("date_to", to); - return this; - } - } - JSONObject item = new JSONObject(); - item.put("year", year); - item.put("month", month); - item.put("date_from", tradeDate); - item.put("date_to", tradeDate); - item.put("client_rate", dayRate); - item.put("gross_amount", total); - item.put("total_charge", dayCharge); - item.put("royalpay_charge", royalpayCharge); - item.put("org_charge", orgCharge); - item.put("channel", channel); - item.put("net_charge", netCharge); - clientTrades.add(item); - return this; - } - - private BigDecimal getThirdPartyCharge(String channel, BigDecimal total) { - BigDecimal thirdPartyPaymentCharge = BigDecimal.ZERO; - switch (channel) { - case "alipay": - thirdPartyPaymentCharge = total.multiply(alipayChargeRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - break; - case "wechat": - thirdPartyPaymentCharge = total.multiply(wechatChargeRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - break; - case "alipayonline": - thirdPartyPaymentCharge = total.multiply(alipayonlineChargeRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - break; - default: - break; - } - return thirdPartyPaymentCharge; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerSeniorCommissionAnalysis.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerSeniorCommissionAnalysis.java deleted file mode 100644 index 113a74bd7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/CityPartnerSeniorCommissionAnalysis.java +++ /dev/null @@ -1,238 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.beans; - -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; - -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by yixian on 2017-03-08. - */ -public class CityPartnerSeniorCommissionAnalysis { - private int orgId; - private int year; - private int month; - private BigDecimal alipayChargeRate; - private BigDecimal wechatChargeRate; - private BigDecimal jdChargeRate; - private BigDecimal alipayonlineChargeRate; - private BigDecimal rate; - private BigDecimal orgRate; - private String channel; - private int commissionType; - private Map> clientAnalysis = new HashMap<>(); - private BigDecimal totalGrossAmount = BigDecimal.ZERO; - private BigDecimal totalChargeSum = BigDecimal.ZERO; - private BigDecimal totalRoyalPayCharge = BigDecimal.ZERO; - private BigDecimal totalOrgChargeSum = BigDecimal.ZERO; - private BigDecimal totalnetCharge = BigDecimal.ZERO; - - public CityPartnerSeniorCommissionAnalysis(int orgId, int year, int month, BigDecimal rate, String channel, BigDecimal alipayChargeRate, - BigDecimal wechatChargeRate, BigDecimal jdChargeRate, BigDecimal alipayonlineChargeRate, BigDecimal orgRate, int commissionType) { - this.orgId = orgId; - this.year = year; - this.month = month; - this.rate = rate; - this.channel = channel; - this.commissionType = commissionType; - this.alipayChargeRate = alipayChargeRate; - this.wechatChargeRate = wechatChargeRate; - this.jdChargeRate = jdChargeRate; - this.alipayonlineChargeRate = alipayonlineChargeRate; - this.orgRate = orgRate; - } - - public CityPartnerSeniorCommissionAnalysis calculator(JSONObject dayAnalysis, String channel, int type) { - switch (type) { - case 1: - return attachAnalysis(dayAnalysis, channel); - case 3: - return attachNetCommissionAnalysis(dayAnalysis, channel); - default: - throw new ServerErrorException("unkonw calculate type"); - } - - } - - public CityPartnerSeniorCommissionAnalysis attachAnalysis(JSONObject dayAnalysis, String channel) { - int clientId = dayAnalysis.getIntValue("client_id"); - List clientTrades = clientAnalysis.get(clientId); - if (clientTrades == null) { - clientTrades = new ArrayList<>(); - clientAnalysis.put(clientId, clientTrades); - } - Date tradeDate = dayAnalysis.getDate("trade_date"); - BigDecimal total = dayAnalysis.getBigDecimal("total"); - BigDecimal dayRate = dayAnalysis.getBigDecimal(channel + "_rate_value"); - BigDecimal dayCharge = total.multiply(dayRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal royalpayCharge = total.multiply(rate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal thirdPartyPaymentCharge = getThirdPartyCharge(channel, total); - BigDecimal netCharge = royalpayCharge.subtract(thirdPartyPaymentCharge); - - BigDecimal orgCharge = dayCharge.subtract(royalpayCharge); - - totalGrossAmount = totalGrossAmount.add(total); - totalChargeSum = totalChargeSum.add(dayCharge); - totalRoyalPayCharge = totalRoyalPayCharge.add(royalpayCharge); - totalOrgChargeSum = totalOrgChargeSum.add(orgCharge); - totalnetCharge = totalnetCharge.add(netCharge); - if (!clientTrades.isEmpty()) { - JSONObject item = clientTrades.get(clientTrades.size() - 1); - BigDecimal rate = item.getBigDecimal("client_rate"); - if (rate.compareTo(dayRate) == 0) { - BigDecimal gross = item.getBigDecimal("gross_amount").add(total); - item.put("gross_amount", gross); - BigDecimal totalCharge = item.getBigDecimal("total_charge").add(dayCharge); - item.put("total_charge", totalCharge); - BigDecimal totalRoyalCharge = item.getBigDecimal("royalpay_charge").add(royalpayCharge); - item.put("royalpay_charge", totalRoyalCharge); - BigDecimal totalOrgCharge = item.getBigDecimal("org_charge").add(orgCharge); - item.put("org_charge", totalOrgCharge); - BigDecimal totalRoyalpayClearingCharge = item.getBigDecimal("net_charge").add(netCharge); - item.put("net_charge", totalRoyalpayClearingCharge); - Date from = item.getDate("date_from"); - Date to = item.getDate("date_to"); - from = from.before(tradeDate) ? from : tradeDate; - to = to.after(tradeDate) ? to : tradeDate; - item.put("date_from", from); - item.put("date_to", to); - return this; - } - } - JSONObject item = new JSONObject(); - item.put("year", year); - item.put("month", month); - item.put("date_from", tradeDate); - item.put("date_to", tradeDate); - item.put("client_rate", dayRate); - item.put("gross_amount", total); - item.put("total_charge", dayCharge); - item.put("royalpay_charge", royalpayCharge); - item.put("org_charge", orgCharge); - item.put("channel", channel); - item.put("net_charge", netCharge); - item.put("commission_type",commissionType); - clientTrades.add(item); - return this; - } - - public JSONObject totalCommission() { - JSONObject result = new JSONObject(); - result.put("org_id", orgId); - result.put("year", year); - result.put("month", month); - result.put("create_time", new Date()); - result.put("org_rate", rate); - result.put("gross_amount", totalGrossAmount); - result.put("total_charge", totalChargeSum); - result.put("royalpay_charge", totalRoyalPayCharge); - result.put("org_charge", totalOrgChargeSum); - result.put("net_charge", totalnetCharge); - result.put("channel", channel); - result.put("commission_type",commissionType); - return result; - } - - public List getCommissionDetails(String recordId) { - List list = new ArrayList<>(); - for (Map.Entry> entry : clientAnalysis.entrySet()) { - int clientId = entry.getKey(); - for (JSONObject item : entry.getValue()) { - item.put("client_id", clientId); - item.put("record_id", recordId); - list.add(item); - } - } - return list; - } - - public CityPartnerSeniorCommissionAnalysis attachNetCommissionAnalysis(JSONObject dayAnalysis, String channel) { - int clientId = dayAnalysis.getIntValue("client_id"); - List clientTrades = clientAnalysis.get(clientId); - if (clientTrades == null) { - clientTrades = new ArrayList<>(); - clientAnalysis.put(clientId, clientTrades); - } - Date tradeDate = dayAnalysis.getDate("trade_date"); - BigDecimal total = dayAnalysis.getBigDecimal("total"); - BigDecimal dayRate = dayAnalysis.getBigDecimal(channel + "_rate_value"); - BigDecimal dayCharge = total.multiply(dayRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal royalpayCharge = total.multiply(rate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - - BigDecimal thirdPartyPaymentCharge = getThirdPartyCharge(channel, total); - BigDecimal netCharge = royalpayCharge.subtract(thirdPartyPaymentCharge); - BigDecimal orgCharge = netCharge.multiply(orgRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - totalGrossAmount = totalGrossAmount.add(total); - totalChargeSum = totalChargeSum.add(dayCharge); - totalRoyalPayCharge = totalRoyalPayCharge.add(royalpayCharge); - totalOrgChargeSum = totalOrgChargeSum.add(orgCharge); - totalnetCharge = totalnetCharge.add(netCharge); - if (!clientTrades.isEmpty()) { - JSONObject item = clientTrades.get(clientTrades.size() - 1); - BigDecimal rate = item.getBigDecimal("client_rate"); - if (rate.compareTo(dayRate) == 0) { - BigDecimal gross = item.getBigDecimal("gross_amount").add(total); - item.put("gross_amount", gross); - BigDecimal totalCharge = item.getBigDecimal("total_charge").add(dayCharge); - item.put("total_charge", totalCharge); - BigDecimal totalRoyalCharge = item.getBigDecimal("royalpay_charge").add(royalpayCharge); - item.put("royalpay_charge", totalRoyalCharge); - BigDecimal totalOrgCharge = item.getBigDecimal("org_charge").add(orgCharge); - item.put("org_charge", totalOrgCharge); - BigDecimal totalRoyalpayClearingCharge = item.getBigDecimal("net_charge").add(netCharge); - item.put("net_charge", totalRoyalpayClearingCharge); - Date from = item.getDate("date_from"); - Date to = item.getDate("date_to"); - from = from.before(tradeDate) ? from : tradeDate; - to = to.after(tradeDate) ? to : tradeDate; - item.put("date_from", from); - item.put("date_to", to); - return this; - } - } - JSONObject item = new JSONObject(); - item.put("year", year); - item.put("month", month); - item.put("date_from", tradeDate); - item.put("date_to", tradeDate); - item.put("client_rate", dayRate); - item.put("gross_amount", total); - item.put("total_charge", dayCharge); - item.put("royalpay_charge", royalpayCharge); - item.put("org_charge", orgCharge); - item.put("channel", channel); - item.put("net_charge", netCharge); - clientTrades.add(item); - return this; - } - - private BigDecimal getThirdPartyCharge(String channel, BigDecimal total) { - BigDecimal thirdPartyPaymentCharge = BigDecimal.ZERO; - switch (channel) { - case "alipay": - thirdPartyPaymentCharge = total.multiply(alipayChargeRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - break; - case "wechat": - thirdPartyPaymentCharge = total.multiply(wechatChargeRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - break; - case "alipayonline": - thirdPartyPaymentCharge = total.multiply(alipayonlineChargeRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - break; - default: - break; - } - return thirdPartyPaymentCharge; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/ReferrerCommissionAnalysis.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/ReferrerCommissionAnalysis.java deleted file mode 100644 index 611b090a8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/beans/ReferrerCommissionAnalysis.java +++ /dev/null @@ -1,92 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.beans; - -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; - -/** - * Created by kira on 2017-09-14. - */ -public class ReferrerCommissionAnalysis { - private int orgId; - private int year; - private int month; - private BigDecimal referrerRate; - private Map> clientAnalysis = new HashMap<>(); - private BigDecimal totalGrossAmount = BigDecimal.ZERO; - private BigDecimal totalOrgChargeSum = BigDecimal.ZERO; - - public ReferrerCommissionAnalysis(int orgId, int year, int month, BigDecimal rate) { - this.orgId = orgId; - this.year = year; - this.month = month; - this.referrerRate = rate; - } - - public ReferrerCommissionAnalysis attachAnalysis(JSONObject dayAnalysis) { - int clientId = dayAnalysis.getIntValue("client_id"); - List clientTrades = clientAnalysis.get(clientId); - if (clientTrades == null) { - clientTrades = new ArrayList<>(); - clientAnalysis.put(clientId, clientTrades); - } - - BigDecimal total = dayAnalysis.getBigDecimal("total"); - BigDecimal orgCharge = total.multiply(referrerRate).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP); - Date tradeDate = dayAnalysis.getDate("trade_date"); - - totalGrossAmount = totalGrossAmount.add(total); - totalOrgChargeSum = totalOrgChargeSum.add(orgCharge); - if (!clientTrades.isEmpty()) { - JSONObject item = clientTrades.get(clientTrades.size() - 1); - BigDecimal gross = item.getBigDecimal("gross_amount").add(total); - item.put("gross_amount", gross); - BigDecimal totalOrgCharge = item.getBigDecimal("org_charge").add(orgCharge); - item.put("org_charge", totalOrgCharge); - Date from = item.getDate("date_from"); - Date to = item.getDate("date_to"); - from = from.before(tradeDate) ? from : tradeDate; - to = to.after(tradeDate) ? to : tradeDate; - item.put("date_from", from); - item.put("date_to", to); - return this; - } - JSONObject item = new JSONObject(); - item.put("year", year); - item.put("month", month); - item.put("gross_amount", total); - item.put("org_charge", orgCharge); - item.put("date_from", tradeDate); - item.put("date_to", tradeDate); - clientTrades.add(item); - return this; - } - - public JSONObject totalCommission() { - JSONObject result = new JSONObject(); - result.put("org_id", orgId); - result.put("year", year); - result.put("month", month); - result.put("create_time", new Date()); - result.put("rate", referrerRate); - result.put("gross_amount", totalGrossAmount); - result.put("org_charge", totalOrgChargeSum); - return result; - } - - public List getCommissionDetails(String recordId) { - List list = new ArrayList<>(); - for (Map.Entry> entry : clientAnalysis.entrySet()) { - int clientId = entry.getKey(); - for (JSONObject item : entry.getValue()) { - item.put("client_id", clientId); - item.put("record_id", recordId); - list.add(item); - } - } - return list; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerPrizeService.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerPrizeService.java deleted file mode 100644 index 105c627c1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerPrizeService.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.core; - -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yixian on 2017-03-08. - */ -public interface CityPartnerPrizeService { - - List listAvailableMonths(String year); - - JSONObject getCityPartnerPrizeInfo(String monthStr); - - List getCityPartnerPrizeInfoList(String monthStr); - - JSONObject getCityPartnerPrizeDetail(String monthStr, String orgId); - - void generate(String month); - - void generateReferrer(String month); - - List listReferrerAvailableMonths(String year); - - JSONObject getReferrerPrizeInfo(String monthStr); - - JSONObject getReferrerPrizeDetail(String monthStr, String orgId); - - List getReferrerPrizeInfoList(String monthStr); - - List listAgentAvailableMonths(String year); - - JSONObject getAgentPrizeInfo(String monthStr); - - JSONObject getAgentPrizeDetail(String monthStr, String orgId); - - List getAgentPrizeInfoList(String monthStr); - - void generateSenior(String monthStr); - - List querySenior(JSONObject param); - - JSONObject getSenior(String monthStr, String orgId); - - void exportMonthFiles(String monthStr, HttpServletResponse httpResponse) throws Exception; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerRegisterService.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerRegisterService.java deleted file mode 100644 index e9c73ccf2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerRegisterService.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.core; - - -import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerBean; - -/** - * Created by yixian on 2017-01-23. - */ -public interface CityPartnerRegisterService { - void saveRegistry(CityPartnerBean cityPartner); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerService.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerService.java deleted file mode 100644 index 617340d4f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/CityPartnerService.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-02-05. - */ -public interface CityPartnerService { - JSONObject listRequests(int page, int limit); - List listAllRequests(); - - void handleRequest(String requestId, JSONObject manager); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java deleted file mode 100644 index b561602d0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java +++ /dev/null @@ -1,1797 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.core.impls; - -import au.com.royalpay.payment.channels.alipay.config.AlipayConfig; -import au.com.royalpay.payment.channels.alipay.runtime.alipayplus.AlipayPlusRuleManager; -import au.com.royalpay.payment.manage.citypartner.beans.AgentCommissionAnalysis; -import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerCommissionAnalysis; -import au.com.royalpay.payment.manage.citypartner.beans.ReferrerCommissionAnalysis; -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerPrizeService; -import au.com.royalpay.payment.manage.mappers.financial.*; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.defines.PayChannel; -import au.com.royalpay.payment.tools.defines.TradeType; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.joda.time.DateTime; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -/** - * Created by yixian on 2017-03-08. - */ -@Service -public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { - @Resource - private TransactionMapper transactionMapper; - @Resource - private OrgMapper orgMapper; - @Resource - private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; - @Resource - private FinancialPartnerCommissionDetailMapper financialPartnerCommissionDetailMapper; - @Resource - private FinancialReferrerCommissionDetailMapper financialReferrerCommissionDetailMapper; - @Resource - private FinancialAgentCommissionDetailMapper financialAgentCommissionDetailMapper; - @Resource - private FinancialAgentCommissionMapper financialAgentCommissionMapper; - @Resource - private FinancialReferrerCommissionMapper financialReferrerCommissionMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private FinancialSeniorPartnerCommissionMapper financialSeniorPartnerCommissionMapper; - @Resource - private FinancialSeniorPartnerCommissionDetailMapper financialSeniorPartnerCommissionDetailMapper; - @Resource - private MerchantInfoProvider merchantInfoProvider; - - - @Override - public List listAvailableMonths(String year) { - int yearNum = checkValidYear(year); - List months = financialPartnerCommissionMapper.listAvailableMonths(yearNum); - List monthObjs = new ArrayList<>(); - for (Integer mon : months) { - JSONObject item = new JSONObject(); - item.put("month", mon); - item.put("monthstr", year + "-" + StringUtils.substring("00" + mon, -2)); - JSONObject chargeInfo = getCityPartnerPrizeInfo(item.getString("monthstr")); - item.put("royalpay_charge", chargeInfo.getString("royalpay_charge")); - item.put("org_charge", chargeInfo.getString("org_charge")); - JSONObject referrerChargeInfo = getReferrerPrizeInfo(item.getString("monthstr")); - item.put("referrer_charge", referrerChargeInfo.getString("org_charge")); - item.put("total_charge", chargeInfo.getBigDecimal("org_charge").add(referrerChargeInfo.getBigDecimal("org_charge"))); - monthObjs.add(item); - } - return monthObjs; - } - - private int checkValidYear(String year) { - try { - return Integer.parseInt(year); - } catch (NumberFormatException e) { - throw new BadRequestException("Invalid Year"); - } - } - - @Override - public JSONObject getCityPartnerPrizeInfo(String monthStr) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject sum = new JSONObject(); - sum.put("gross_amount", 0); - sum.put("total_charge", 0); - sum.put("royalpay_charge", 0); - sum.put("org_charge", 0); - List partnerPrizes = financialPartnerCommissionMapper.list(year, month); - for (JSONObject prize : partnerPrizes) { - plusKey(sum, prize, "gross_amount"); - plusKey(sum, prize, "total_charge"); - //暂只处理合伙人提成总额 - if (prize.get("parent_org_id") == null) { - prize.put("org_charge", prize.getBigDecimal("org_charge").add(prize.getBigDecimal("share_charge"))); - } - plusKey(sum, prize, "royalpay_charge"); - plusKey(sum, prize, "org_charge"); - prize.put("monthstr", monthStr); - } - sum.put("city_partners", partnerPrizes); - sum.put("monthstr", monthStr); - return sum; - } - - @Override - public List getCityPartnerPrizeInfoList(String monthStr) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - return financialPartnerCommissionMapper.list(year, month); - } - - private void plusKey(JSONObject sum, JSONObject prize, String key) { - sum.put(key, sum.getBigDecimal(key).add(prize.getBigDecimal(key))); - } - - private Date parseMonth(String monthStr) { - try { - return DateUtils.parseDate(monthStr, new String[]{"yyyy-MM"}); - } catch (ParseException e) { - throw new BadRequestException("Invalid month format"); - } - } - - @Override - public JSONObject getCityPartnerPrizeDetail(String monthStr, String orgId) { - - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject result = new JSONObject(); - - List total = financialPartnerCommissionMapper.find(year, month, orgId); - if (CollectionUtils.isEmpty(total)) { - return null; - } - - String tableColumn[] = {"gross_amount", "total_charge", "royalpay_charge", "org_charge", "net_charge"}; - - List recordIds = new ArrayList<>(); - Map chargeResultMap = new HashMap<>(); - for (JSONObject jsonObject : total) { - result.put("name", jsonObject.getString("name")); - recordIds.add(jsonObject.getString("record_id")); - for (String s : tableColumn) { - String key = jsonObject.getString("channel") + "_" + s; - if (chargeResultMap.containsKey(key)) { - chargeResultMap.put(key, chargeResultMap.get(key).add(jsonObject.getBigDecimal(s))); - } else { - chargeResultMap.put(key, jsonObject.getBigDecimal(s)); - } - } - } - - List details = financialPartnerCommissionDetailMapper.listDetailsByRecordIds(recordIds); - Map> detailMap = new HashMap<>(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - for (JSONObject detail : details) { - detail.put("date_from", format.format(detail.get("date_from"))); - detail.put("date_to", format.format(detail.get("date_to"))); - String key = detail.getString("client_id"); - if (detailMap.containsKey(key)) { - detailMap.get(key).add(detail); - } else { - List tmpList = new ArrayList<>(); - tmpList.add(detail); - detailMap.put(key, tmpList); - } - } - - List partnerClientInfos = new ArrayList<>(); - BigDecimal resultGrossAmount = BigDecimal.ZERO; - BigDecimal resultTotalCharge = BigDecimal.ZERO; - BigDecimal resultRoyalpayCharge = BigDecimal.ZERO; - BigDecimal resultOrgCharge = BigDecimal.ZERO; - BigDecimal resultNetCharge = BigDecimal.ZERO; - for (Map.Entry> entry : detailMap.entrySet()) { - JSONObject sumResult = new JSONObject(); - BigDecimal grossAmount = BigDecimal.ZERO; - BigDecimal totalCharge = BigDecimal.ZERO; - BigDecimal royalpayCharge = BigDecimal.ZERO; - BigDecimal netCharge = BigDecimal.ZERO; - BigDecimal orgCharge = BigDecimal.ZERO; - String clientMoniker = ""; - int type = 1; - for (JSONObject jsonObject : entry.getValue()) { - grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount")); - totalCharge = totalCharge.add(jsonObject.getBigDecimal("total_charge")); - royalpayCharge = royalpayCharge.add(jsonObject.getBigDecimal("royalpay_charge")); - orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge")); - if (jsonObject.getBigDecimal("net_charge") != null) { - netCharge = netCharge.add(jsonObject.getBigDecimal("net_charge")); - } - clientMoniker = jsonObject.getString("client_moniker"); - type = jsonObject.getIntValue("type"); - } - resultGrossAmount = resultGrossAmount.add(grossAmount); - resultTotalCharge = resultTotalCharge.add(totalCharge); - resultRoyalpayCharge = resultRoyalpayCharge.add(royalpayCharge); - resultOrgCharge = resultOrgCharge.add(orgCharge); - resultNetCharge = resultNetCharge.add(netCharge); - sumResult.put("gross_amount", grossAmount); - sumResult.put("total_charge", totalCharge); - sumResult.put("royalpay_charge", royalpayCharge); - sumResult.put("org_charge", orgCharge); - sumResult.put("net_charge", netCharge); - sumResult.put("client_moniker", clientMoniker); - sumResult.put("channel_detail", entry.getValue()); - sumResult.put("type", type); - partnerClientInfos.add(sumResult); - } - result.put("partner_client_infos", partnerClientInfos); - - for (Map.Entry entry : chargeResultMap.entrySet()) { - result.put(entry.getKey(), entry.getValue()); - } - result.put("monthstr", monthStr); - result.put("total_transaction", resultGrossAmount); - result.put("total_charge", resultTotalCharge); - result.put("royalPay_charge", resultRoyalpayCharge); - result.put("net_charge", resultNetCharge); - result.put("own_charge", resultOrgCharge); - JSONObject senior = financialSeniorPartnerCommissionMapper.find(year, month, orgId); - if (senior != null) { - result.put("senior_partner_charge", senior.getBigDecimal("gross_amount")); - result.put("city_partner_charge", resultOrgCharge.add(senior.getBigDecimal("gross_amount"))); - } else { - result.put("city_partner_charge", resultOrgCharge); - } - return result; - } - - - @Transactional - public void generateold(String monthStr) { - Date mon = checkMonth(monthStr); - DateTime begin = new DateTime(mon); - DateTime end = begin.plusMonths(1); - int year = begin.getYear(); - int month = begin.getMonthOfYear(); - - JSONObject sysConfig = sysConfigManager.getSysConfig(); - BigDecimal alipayChargeRate = new BigDecimal("0.6"); - BigDecimal wechatChargeRate = new BigDecimal("0.6"); - BigDecimal jdChargeRate = new BigDecimal("0.9"); - BigDecimal alipayonlineChargeRate = new BigDecimal("0.6"); - if (sysConfig.getBigDecimal("Alipay_charge_rate") != null) { - alipayChargeRate = sysConfig.getBigDecimal("Alipay_charge_rate"); - } - if (sysConfig.getBigDecimal("Wechat_charge_rate") != null) { - wechatChargeRate = sysConfig.getBigDecimal("Wechat_charge_rate"); - } - if (sysConfig.getBigDecimal("jd_charge_rate") != null) { - jdChargeRate = sysConfig.getBigDecimal("jd_charge_rate"); - } - if (sysConfig.getBigDecimal("alipayonline_charge_rate") != null) { - alipayonlineChargeRate = sysConfig.getBigDecimal("alipayonline_charge_rate"); - } - HashMap channelMap = new HashMap<>(); - channelMap.put("Alipay", "Alipay"); - channelMap.put("Wechat", "Wechat"); - channelMap.put("AlipayOnline", "AlipayOnline"); - Set orgIds = new HashSet<>(); - List transactionAnalysis = transactionMapper.listTransactionsForCityPartnerCommission(begin.toDate(), end.toDate()); - Map results = new HashMap<>(); - for (JSONObject analysisDay : transactionAnalysis) { - int orgId = analysisDay.getIntValue("org_id"); - JSONObject org = orgMapper.findOne(orgId); - if (org.getIntValue("parent_org_id") > 0) { - orgIds.add(orgId); - } - if (org == null) { - // shall never happen - throw new ServerErrorException("Organization Id not exists:" + orgId); - } - financialPartnerCommissionDetailMapper.clearData(year, month, org.getIntValue("commission_type")); - financialPartnerCommissionMapper.clearData(year, month, org.getIntValue("commission_type")); - - String key = analysisDay.getString("channel"); - String channel = analysisDay.getString("channel"); - if (!channelMap.containsKey(key)) { - continue; - } - channel = channel.toLowerCase(); - CityPartnerCommissionAnalysis orgAnalysis = results.get(orgId + channel); - if (orgAnalysis == null) { - orgAnalysis = new CityPartnerCommissionAnalysis(orgId, year, month, org.getBigDecimal(channel + "_rate_value"), key, alipayChargeRate, - wechatChargeRate, jdChargeRate, alipayonlineChargeRate, org.getBigDecimal("rate_value"), org.getIntValue("commission_type")); - results.put(orgId + channel, orgAnalysis); - } - orgAnalysis.calculator(analysisDay, channel, org.getIntValue("commission_type")); - - } - for (CityPartnerCommissionAnalysis commission : results.values()) { - JSONObject commissionAnalysis = commission.totalCommission(); - financialPartnerCommissionMapper.save(commissionAnalysis); - String recordId = commissionAnalysis.getString("record_id"); - List details = commission.getCommissionDetails(recordId); - for (JSONObject detail : details) { - financialPartnerCommissionDetailMapper.save(detail); - } - } - Runnable task = () -> { - orgIds.forEach((p) -> { - generateAgentold(monthStr, p); - }); - generateReferrer(monthStr); - generateSenior(monthStr); - }; - new Thread(task).start(); - } - - @Override - @Transactional - public void generate(String monthStr) { - Date mon = checkMonth(monthStr); - DateTime begin = new DateTime(mon); - DateTime timeinterval1=begin.plusDays(10); - DateTime timeinterval2=begin.plusDays(20); - DateTime end = begin.plusMonths(1); - int year = begin.getYear(); - int month = begin.getMonthOfYear(); - -// List list = financialPartnerCommissionMapper.list(year, month); -// if (list != null && !list.isEmpty()) { -// throw new ServerErrorException("请不要重复生成合伙人记录"); -// } - - financialPartnerCommissionDetailMapper.clearData(year, month, 1); - financialPartnerCommissionMapper.clearData(year, month, 1); - - JSONObject sysConfig = sysConfigManager.getSysConfig(); - BigDecimal alipayChargeRate = new BigDecimal("0.6"); - BigDecimal wechatChargeRate = new BigDecimal("0.6"); - BigDecimal jdChargeRate = new BigDecimal("0.9"); - BigDecimal alipayonlineChargeRate = new BigDecimal("0.6"); - BigDecimal retailInterchangeChargeRate = new BigDecimal("0.5"); - BigDecimal retailServiceChargeRate = new BigDecimal("0.5"); - BigDecimal onlineInterchangeChargeRate = new BigDecimal("0.5"); - BigDecimal onlineServiceChargeRate = new BigDecimal("0.5"); - - if (sysConfig.getBigDecimal("Alipay_charge_rate") != null) { - alipayChargeRate = sysConfig.getBigDecimal("Alipay_charge_rate"); - } - if (sysConfig.getBigDecimal("Wechat_charge_rate") != null) { - wechatChargeRate = sysConfig.getBigDecimal("Wechat_charge_rate"); - } - if (sysConfig.getBigDecimal("jd_charge_rate") != null) { - jdChargeRate = sysConfig.getBigDecimal("jd_charge_rate"); - } - if (sysConfig.getBigDecimal("alipayonline_charge_rate") != null) { - alipayonlineChargeRate = sysConfig.getBigDecimal("alipayonline_charge_rate"); - } - if (sysConfig.getBigDecimal("retail_interchange_charge_rate") != null) { - retailInterchangeChargeRate = sysConfig.getBigDecimal("retail_interchange_charge_rate"); - } - if (sysConfig.getBigDecimal("retail_service_charge_rate") != null) { - retailServiceChargeRate = sysConfig.getBigDecimal("retail_service_charge_rate"); - } - if (sysConfig.getBigDecimal("online_interchange_charge_rate") != null) { - onlineInterchangeChargeRate = sysConfig.getBigDecimal("online_interchange_charge_rate"); - } - if (sysConfig.getBigDecimal("online_service_charge_rate") != null) { - onlineServiceChargeRate = sysConfig.getBigDecimal("online_service_charge_rate"); - } - - JSONObject channelCharge = new JSONObject(); - channelCharge.put("alipayChargeRate", alipayChargeRate); - channelCharge.put("wechatChargeRate", wechatChargeRate); - channelCharge.put("jdChargeRate", jdChargeRate); - channelCharge.put("alipayonlineChargeRate", alipayonlineChargeRate); - channelCharge.put("retailInterchangeChargeRate", retailInterchangeChargeRate); - channelCharge.put("retailServiceChargeRate", retailServiceChargeRate); - channelCharge.put("onlineInterchangeChargeRate", onlineInterchangeChargeRate); - channelCharge.put("onlineServiceChargeRate", onlineServiceChargeRate); - - List transactionDetail=new ArrayList<>(); - long time1=System.currentTimeMillis(); - List transactionDetail1 = transactionMapper.listTransactionForCityPartnerCommissionByDate(begin.toDate(), timeinterval1.toDate()); - List transactionDetail2 = transactionMapper.listTransactionForCityPartnerCommissionByDate(timeinterval1.toDate(), timeinterval2.toDate()); - List transactionDetail3 = transactionMapper.listTransactionForCityPartnerCommissionByDate(timeinterval2.toDate(), end.toDate()); - long time2=System.currentTimeMillis(); - System.out.println("=====>time:"+(time2-time1)); - transactionDetail.addAll(transactionDetail1); - transactionDetail.addAll(transactionDetail2); - transactionDetail.addAll(transactionDetail3); - transactionDetail.forEach(item -> { - if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) { - item.put("channel", item.getString("pay_type")); - } - }); - Map> groupByOrgMap = transactionDetail.stream().collect(Collectors.groupingBy(e -> e.getInteger("org_id"))); - for (Map.Entry> oneOrg : groupByOrgMap.entrySet()) { - int orgId = oneOrg.getKey(); - JSONObject org = orgMapper.findOne(orgId); - if (org == null) { - // shall never happen - throw new ServerErrorException("Organization Id not exists:" + orgId); - } - if (org.getInteger("commission_type") != 1) { - generateold(monthStr); - return; - } - List items = oneOrg.getValue(); - Map> groupByChannelMap = items.stream().collect(Collectors.groupingBy(e -> e.getString("channel"))); - List channelAmount = orgChannelAmount(org, groupByChannelMap, channelCharge); - for (JSONObject channel : channelAmount) { - channel.put("share_charge", 0); - channel.put("month", month); - channel.put("year", year); - channel.put("org_id", orgId); - financialPartnerCommissionMapper.save(channel); - } - } - Map> groupByClientMap = transactionDetail.stream().collect(Collectors.groupingBy(e -> e.getInteger("client_id"))); - for (Map.Entry> oneClient : groupByClientMap.entrySet()) { - JSONObject org = orgMapper.findOne(oneClient.getValue().get(0).getInteger("org_id")); - Map> groupByChannel = oneClient.getValue().stream().collect(Collectors.groupingBy(e -> e.getString("channel"))); - List clientChannelAmount = clientChannelAmount(oneClient.getKey(), org, groupByChannel, channelCharge, year, month, 1); - for (JSONObject channel : clientChannelAmount) { - financialPartnerCommissionDetailMapper.save(channel); - } - } - Runnable task = () -> { - generateAgent(monthStr, channelCharge); - generateReferrer(monthStr); - generateSenior(monthStr); - }; - new Thread(task).start(); - - - } - - public List orgChannelAmount(JSONObject orgInfo, Map> channelMap, JSONObject channelCharge) { - List amountByChannel = new ArrayList<>(); - for (Map.Entry> oneChannel : channelMap.entrySet()) { - BigDecimal total = BigDecimal.ZERO; - BigDecimal total_surage = BigDecimal.ZERO; - BigDecimal net_surage = BigDecimal.ZERO; - BigDecimal royalpay_surage = BigDecimal.ZERO; - BigDecimal transaction_fee = BigDecimal.ZERO; - JSONObject json = new JSONObject(); - String channel = oneChannel.getKey(); - if (orgInfo.get(channel.toLowerCase() + "_rate_value") == null) { - if (StringUtils.equals(channel.toLowerCase() + "_rate_value", "rpaypmt_card_rate_value")) { - if (orgInfo.get("rpaypmt_domestic_card_rate_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下domestic_card成本手续费未设置"); - } - if (orgInfo.get("rpaypmt_overseas_card_rate_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下overseas_card成本手续费未设置"); - } - } else if (StringUtils.equalsAny(channel, "alipay_ac_sg", "alipay_ac_mo", "alipay_ac_hk", "alipay_ac_lu", "alipay_ac_gb", "alipay_ac_us", "paytm", "kakaopay", "truemoney", "ezlink", "gcash", "tng", "dana", "easy_paisa", "bkash", "lazada_wallet_my")) { - channel = "alipayother"; - if (orgInfo.get("alipayother_rate_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下" + oneChannel.getKey() + "成本手续费未设置"); - } - } else if (StringUtils.equals(channel, "alipay_cn")) { - channel = "alipayonlinecn"; - if (orgInfo.get("alipayonlinecn_rate_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下" + oneChannel.getKey() + "成本手续费未设置"); - } - } else if (StringUtils.equals(channel.toLowerCase(), "apsinstore")) { - if (orgInfo.get("retail_interchange_fee_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下A+(Retail)的 Interchange Fee 成本手续费未设置"); - } - if (orgInfo.get("retail_service_fee_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下A+(Retail)的 Service Fee 成本手续费未设置"); - } - } else if (StringUtils.equals(channel.toLowerCase(), "apscashier")) { - if (orgInfo.get("online_interchange_fee_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下A+(Online)的 Interchange Fee 成本手续费未设置"); - } - if (orgInfo.get("online_service_fee_value") == null) { - throw new ServerErrorException(orgInfo.getString("name") + "组织下A+(Online)的 Service Fee 成本手续费未设置"); - } - } else { - throw new ServerErrorException(orgInfo.getString("name") + "组织下" + oneChannel.getKey() + "成本手续费未设置"); - - } - } - PayChannel payChannel = PayChannel.fromChannelCode(channel); - - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE || payChannel == PayChannel.ALIPAY_APS_CASHIER) { - Map> groupByPayType = oneChannel.getValue().stream().collect(Collectors.groupingBy(e -> "alipay_cn".equalsIgnoreCase(e.getString("pay_type")))); - for (Map.Entry> payType : groupByPayType.entrySet()) { - BigDecimal totalAps = BigDecimal.ZERO; - BigDecimal total_surageAps = BigDecimal.ZERO; - BigDecimal net_surageAps = BigDecimal.ZERO; - BigDecimal royalpay_surageAps = BigDecimal.ZERO; - BigDecimal transaction_feeAps = BigDecimal.ZERO; - JSONObject jsonAps = new JSONObject(); - if (payType.getKey()) { - for (JSONObject params : payType.getValue()) { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate = null; - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - int i = currencyScale(params.getString("clearing_currency")); - totalAps = totalAps.add(tmpClearingAmount); - total_surageAps = total_surageAps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surageAps = royalpay_surageAps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - // net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surageAps = net_surageAps.add(params.getBigDecimal("channel_surcharge")); - transaction_feeAps = transaction_feeAps.add(params.getBigDecimal("transaction_fee")); - } - BigDecimal org_charge = total_surageAps.subtract(royalpay_surageAps); - jsonAps.put("channel", oneChannel.getKey() + ",alipayCN"); - jsonAps.put("gross_amount", totalAps); - jsonAps.put("total_charge", total_surageAps); - jsonAps.put("transaction_fee", transaction_feeAps); - jsonAps.put("net_charge", net_surageAps); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - jsonAps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value")))); - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - jsonAps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value")))); - } else { - jsonAps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - jsonAps.put("royalpay_charge", royalpay_surageAps); - jsonAps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge); - jsonAps.put("commission_type", "1"); - jsonAps.put("create_time", new Date()); - amountByChannel.add(jsonAps); - } - if (Boolean.FALSE.equals(payType.getKey())) { - for (JSONObject params : payType.getValue()) { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate = null; - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - int i = currencyScale(params.getString("clearing_currency")); - totalAps = totalAps.add(tmpClearingAmount); - total_surageAps = total_surageAps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surageAps = royalpay_surageAps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - // net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surageAps = net_surageAps.add(params.getBigDecimal("channel_surcharge")); - transaction_feeAps = transaction_feeAps.add(params.getBigDecimal("transaction_fee")); - } - BigDecimal org_charge = total_surageAps.subtract(royalpay_surageAps); - jsonAps.put("channel", oneChannel.getKey() + ",alipayOS"); - jsonAps.put("gross_amount", totalAps); - jsonAps.put("total_charge", total_surageAps); - jsonAps.put("transaction_fee", transaction_feeAps); - jsonAps.put("net_charge", net_surageAps); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - jsonAps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value")))); - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - jsonAps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value")))); - } else { - jsonAps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - jsonAps.put("royalpay_charge", royalpay_surageAps); - jsonAps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge); - jsonAps.put("commission_type", "1"); - jsonAps.put("create_time", new Date()); - amountByChannel.add(jsonAps); - } - } - } else { - for (JSONObject params : oneChannel.getValue()) { - if (payChannel == PayChannel.RPAY_CHANNEL_CARD) { - //rpaypmt_domestic_card - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card" + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - int i = currencyScale(params.getString("clearing_currency")); - royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - - //rpaypmt_overseas_card - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_overseas_card" + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - total = total.add(tmpClearingAmount); - total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); - transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee")); - } else { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate = null; - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - int i = currencyScale(params.getString("clearing_currency")); - total = total.add(tmpClearingAmount); - total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - // net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); - transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee")); - - } - } - BigDecimal org_charge = total_surage.subtract(royalpay_surage); - json.put("channel", oneChannel.getKey()); - json.put("gross_amount", total); - json.put("total_charge", total_surage); - json.put("transaction_fee", transaction_fee); - json.put("net_charge", net_surage); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - json.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value")))); - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - json.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value")))); - } else { - json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - json.put("royalpay_charge", royalpay_surage); - json.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge); - json.put("commission_type", "1"); - json.put("create_time", new Date()); - amountByChannel.add(json); - } - } - return amountByChannel; - } - - public List parentOrgChannelAmount(JSONObject orgInfo, JSONObject parentOrgInfo, Map> channelMap, JSONObject channelCharge) { - List amountByChannel = new ArrayList<>(); - - for (Map.Entry> oneChannel : channelMap.entrySet()) { - BigDecimal total = BigDecimal.ZERO; - BigDecimal total_surage = BigDecimal.ZERO; - BigDecimal net_surage = BigDecimal.ZERO; - BigDecimal royalpay_surage = BigDecimal.ZERO; - BigDecimal share_surage = BigDecimal.ZERO; - BigDecimal transaction_fee = BigDecimal.ZERO; - JSONObject json = new JSONObject(); - String channel = oneChannel.getKey(); - for (JSONObject params : oneChannel.getValue()) { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate; - if (StringUtils.equals("alipayaps", channel.toLowerCase())) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - AlipayConfig.BizType bizType = AlipayPlusRuleManager.getRules().determineAmsBizType(TradeType.fromGatewayNumber(params.getInteger("gateway"))); - if (bizType == AlipayConfig.BizType.RETAIL) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("interchange_fee_value").add(orgInfo.getBigDecimal("service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - int i = currencyScale(params.getString("clearing_currency")); - BigDecimal parent_surage = tmpClearingAmount.multiply(parentOrgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP); - BigDecimal roy_surage = tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP); - total = total.add(tmpClearingAmount); - total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage = royalpay_surage.add(roy_surage); - //net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); - share_surage = share_surage.add(roy_surage.subtract(parent_surage)).setScale(i, RoundingMode.HALF_UP); - transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee")); - - } - BigDecimal org_charge = total_surage.subtract(royalpay_surage); - json.put("channel", oneChannel.getKey()); - json.put("gross_amount", total); - json.put("total_charge", total_surage); - json.put("net_charge", net_surage); - if (StringUtils.equals("alipayaps", channel.toLowerCase())) { - json.put("org_rate", (orgInfo.getBigDecimal("interchange_fee_value").add(orgInfo.getBigDecimal("service_fee_value")))); - } else { - json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - json.put("partner_charge", royalpay_surage); - json.put("share_charge", share_surage); - json.put("org_charge", org_charge); - json.put("transaction_fee", transaction_fee); - json.put("commission_type", "1"); - json.put("create_time", new Date()); - amountByChannel.add(json); - } - - return amountByChannel; - } - - //type 1:一级代理 2:二级代理 - public List clientChannelAmount(int clientId, JSONObject orgInfo, Map> channelMap, JSONObject channelCharge, int year, int month, int type) { - List amountByChannel = new ArrayList<>(); - for (Map.Entry> oneChannel : channelMap.entrySet()) { - BigDecimal total = BigDecimal.ZERO; - BigDecimal total_surage = BigDecimal.ZERO; - BigDecimal net_surage = BigDecimal.ZERO; - BigDecimal royalpay_surage = BigDecimal.ZERO; - BigDecimal transaction_fee = BigDecimal.ZERO; - Date datefrom = new Date(); - Date dateto = new Date(); - JSONObject json = new JSONObject(); - String channel = oneChannel.getKey(); - if (StringUtils.equals(oneChannel.getKey(), "alipay_cn")) { - channel = "alipayonlinecn"; - } - if (StringUtils.equalsAny(oneChannel.getKey(), "alipay_ac_sg", "alipay_ac_mo", "alipay_ac_hk", "alipay_ac_lu", "alipay_ac_gb", "alipay_ac_us", "paytm", "kakaopay", "truemoney", "ezlink", "gcash", "tng", "dana", "easy_paisa", "bkash", "lazada_wallet_my")) { - channel = "alipayother"; - } - String rateChannel = oneChannel.getKey(); - JSONObject clientRate = null; - try { - clientRate = merchantInfoProvider.clientCurrentRate(clientId, oneChannel.getValue().get(0).getDate("transaction_time"), - rateChannel); - } catch (Exception e) { - } - PayChannel payChannel = PayChannel.fromChannelCode(channel); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE || payChannel == PayChannel.ALIPAY_APS_CASHIER) { - Map> groupByPayType = oneChannel.getValue().stream().collect(Collectors.groupingBy(e -> e.getString("pay_type").equals("alipay_cn"))); - for (Map.Entry> payType : groupByPayType.entrySet()) { - if (payType.getKey()) { - String recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey() + ",alipayCN"); - BigDecimal total_aps = BigDecimal.ZERO; - BigDecimal total_surage_aps = BigDecimal.ZERO; - BigDecimal net_surage_aps = BigDecimal.ZERO; - BigDecimal royalpay_surage_aps = BigDecimal.ZERO; - BigDecimal transaction_fee_aps = BigDecimal.ZERO; - Date datefrom_aps = new Date(); - Date dateto_aps = new Date(); - JSONObject json_aps = new JSONObject(); - for (JSONObject params : payType.getValue()) { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate = BigDecimal.ZERO; - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - int i = currencyScale(params.getString("clearing_currency")); - if (total_aps.compareTo(BigDecimal.ZERO) == 0) { - datefrom_aps = params.getDate("transaction_time"); - dateto_aps = params.getDate("transaction_time"); - } else { - if (params.getDate("transaction_time").before(datefrom)) { - datefrom_aps = params.getDate("transaction_time"); - } - if (params.getDate("transaction_time").after(dateto)) { - dateto_aps = params.getDate("transaction_time"); - } - } - - total_aps = total_aps.add(tmpClearingAmount); - total_surage_aps = total_surage_aps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage_aps = royalpay_surage_aps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - //net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surage_aps = net_surage_aps.add(params.getBigDecimal("channel_surcharge")); - transaction_fee_aps = transaction_fee_aps.add(params.getBigDecimal("transaction_fee")); - } - BigDecimal org_charge = total_surage_aps.subtract(royalpay_surage_aps); - if (channel.toLowerCase().equals("alipay_direct")) { - channel = channel.replace("_", ""); - } - json_aps.put("channel", oneChannel.getKey() + ",alipayCN"); - json_aps.put("record_id", recordId); - json_aps.put("client_id", clientId); - if (clientRate != null) { - json_aps.put("client_rate", clientRate.getBigDecimal("rate_value")); - } else { - json_aps.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED)); - } - json_aps.put("gross_amount", total); - json_aps.put("total_charge", total_surage); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - json_aps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value")))); - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - json_aps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value")))); - } else { - json_aps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - json_aps.put("royalpay_charge", royalpay_surage_aps); - if (type == 1) { - json_aps.put("net_charge", net_surage_aps); - } - if (type == 2) { - json_aps.put("org_net_charge", net_surage_aps); - } - json_aps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge); - json_aps.put("transaction_fee", transaction_fee_aps); - json_aps.put("commission_type", "1"); - json_aps.put("create_time", new Date()); - json_aps.put("date_from", DateFormatUtils.format(datefrom_aps, "yyyy-MM-dd")); - json_aps.put("date_to", DateFormatUtils.format(dateto_aps, "yyyy-MM-dd")); - json_aps.put("year", year); - json_aps.put("month", month); - amountByChannel.add(json_aps); - } - if (!payType.getKey()) { - String recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey() + ",alipayOS"); - BigDecimal total_aps = BigDecimal.ZERO; - BigDecimal total_surage_aps = BigDecimal.ZERO; - BigDecimal net_surage_aps = BigDecimal.ZERO; - BigDecimal royalpay_surage_aps = BigDecimal.ZERO; - BigDecimal transaction_fee_aps = BigDecimal.ZERO; - Date datefrom_aps = new Date(); - Date dateto_aps = new Date(); - JSONObject json_aps = new JSONObject(); - for (JSONObject params : payType.getValue()) { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - BigDecimal channelRate = BigDecimal.ZERO; - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - int i = currencyScale(params.getString("clearing_currency")); - if (total_aps.compareTo(BigDecimal.ZERO) == 0) { - datefrom_aps = params.getDate("transaction_time"); - dateto_aps = params.getDate("transaction_time"); - } else { - if (params.getDate("transaction_time").before(datefrom)) { - datefrom_aps = params.getDate("transaction_time"); - } - if (params.getDate("transaction_time").after(dateto)) { - dateto_aps = params.getDate("transaction_time"); - } - } - - total_aps = total_aps.add(tmpClearingAmount); - total_surage_aps = total_surage_aps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage_aps = royalpay_surage_aps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - //net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surage_aps = net_surage_aps.add(params.getBigDecimal("channel_surcharge")); - transaction_fee_aps = transaction_fee_aps.add(params.getBigDecimal("transaction_fee")); - } - BigDecimal org_charge = total_surage_aps.subtract(royalpay_surage_aps); - if (channel.toLowerCase().equals("alipay_direct")) { - channel = channel.replace("_", ""); - } - json_aps.put("channel", oneChannel.getKey() + ",alipayOS"); - json_aps.put("record_id", recordId); - json_aps.put("client_id", clientId); - if (clientRate != null) { - json_aps.put("client_rate", clientRate.getBigDecimal("rate_value")); - } else { - json_aps.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED)); - } - json_aps.put("gross_amount", total); - json_aps.put("total_charge", total_surage); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - json_aps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value")))); - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - json_aps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value")))); - } else { - json_aps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - json_aps.put("royalpay_charge", royalpay_surage_aps); - if (type == 1) { - json_aps.put("net_charge", net_surage_aps); - } - if (type == 2) { - json_aps.put("org_net_charge", net_surage_aps); - } - json_aps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge); - json_aps.put("transaction_fee", transaction_fee_aps); - json_aps.put("commission_type", "1"); - json_aps.put("create_time", new Date()); - json_aps.put("date_from", DateFormatUtils.format(datefrom_aps, "yyyy-MM-dd")); - json_aps.put("date_to", DateFormatUtils.format(dateto_aps, "yyyy-MM-dd")); - json_aps.put("year", year); - json_aps.put("month", month); - amountByChannel.add(json_aps); - } - } - } else { - String recordId = ""; - if (type == 1) { - recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey()); - } - if (type == 2) { - recordId = financialAgentCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey()); - } - for (JSONObject params : oneChannel.getValue()) { - BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); - if (StringUtils.equals(channel.toLowerCase() + "_rate_value", "rpaypmt_card_rate_value")) { - //rpaypmt_domestic_card - BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - int i = currencyScale(params.getString("clearing_currency")); - if (total.compareTo(BigDecimal.ZERO) == 0) { - datefrom = params.getDate("transaction_time"); - dateto = params.getDate("transaction_time"); - } else { - if (params.getDate("transaction_time").before(datefrom)) { - datefrom = params.getDate("transaction_time"); - } - if (params.getDate("transaction_time").after(dateto)) { - dateto = params.getDate("transaction_time"); - } - } - royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - //rpaypmt_overseas_card - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_overseas_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")); - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - if (total.compareTo(BigDecimal.ZERO) == 0) { - datefrom = params.getDate("transaction_time"); - dateto = params.getDate("transaction_time"); - } else { - if (params.getDate("transaction_time").before(datefrom)) { - datefrom = params.getDate("transaction_time"); - } - if (params.getDate("transaction_time").after(dateto)) { - dateto = params.getDate("transaction_time"); - } - } - - total = total.add(tmpClearingAmount); - total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); - transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee")); - } else { - BigDecimal channelRate; - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipay_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - } else { - channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); - } - BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge") - .subtract(params.getBigDecimal("surcharge_cashback")) - .subtract(params.getBigDecimal("transaction_fee")); - //增加货币判断 - //增加transaction_fee为null异常 - if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) { - params.put("transaction_fee", BigDecimal.ZERO); - } - int i = currencyScale(params.getString("clearing_currency")); - if (total.compareTo(BigDecimal.ZERO) == 0) { - datefrom = params.getDate("transaction_time"); - dateto = params.getDate("transaction_time"); - } else { - if (params.getDate("transaction_time").before(datefrom)) { - datefrom = params.getDate("transaction_time"); - } - if (params.getDate("transaction_time").after(dateto)) { - dateto = params.getDate("transaction_time"); - } - } - - total = total.add(tmpClearingAmount); - total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP); - royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); - //net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); - net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); - transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee")); - } - - } - BigDecimal org_charge = total_surage.subtract(royalpay_surage); - if (channel.toLowerCase().equals("alipay_direct")) { - channel = channel.replace("_", ""); - } - json.put("channel", oneChannel.getKey()); - - json.put("record_id", recordId); - json.put("client_id", clientId); - if (clientRate != null) { - json.put("client_rate", clientRate.getBigDecimal("rate_value")); - } else { - json.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED)); - } - json.put("gross_amount", total); - json.put("total_charge", total_surage); - if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) { - json.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value")))); - } else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) { - json.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value")))); - } else { - json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); - } - json.put("royalpay_charge", royalpay_surage); - if (type == 1) { - json.put("net_charge", net_surage); - } - if (type == 2) { - json.put("org_net_charge", net_surage); - } - json.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge); - json.put("transaction_fee", transaction_fee); - json.put("commission_type", "1"); - json.put("create_time", new Date()); - json.put("date_from", DateFormatUtils.format(datefrom, "yyyy-MM-dd")); - json.put("date_to", DateFormatUtils.format(dateto, "yyyy-MM-dd")); - json.put("year", year); - json.put("month", month); - amountByChannel.add(json); - } - } - - return amountByChannel; - } - - private int currencyScale(String currency) { - int i = 0; - switch (currency) { - case "JPY": - i = 0; - break; - default: - i = 2; - break; - } - return i; - } - - private BigDecimal getThirdPartyCharge(String channel, BigDecimal total, JSONObject chargeRate) { - BigDecimal thirdPartyPaymentCharge = BigDecimal.ZERO; - switch (channel) { - case "Alipay": - thirdPartyPaymentCharge = total.multiply(chargeRate.getBigDecimal("alipayChargeRate").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(2, RoundingMode.HALF_UP); - break; - case "Wechat": - thirdPartyPaymentCharge = total.multiply(chargeRate.getBigDecimal("wechatChargeRate").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(2, RoundingMode.HALF_UP); - break; - case "AlipayOnline": - thirdPartyPaymentCharge = total.multiply(chargeRate.getBigDecimal("alipayonlineChargeRate").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(2, RoundingMode.HALF_UP); - break; - default: - break; - } - return thirdPartyPaymentCharge; - } - - - @Override - @Transactional - public void generateReferrer(String monthStr) { - Date mon = checkMonth(monthStr); - DateTime begin = new DateTime(mon); - DateTime timeinterval1=begin.plusDays(10); - DateTime timeinterval2=begin.plusDays(20); - DateTime end = begin.plusMonths(1); - int year = begin.getYear(); - int month = begin.getMonthOfYear(); - - financialReferrerCommissionDetailMapper.clearData(year, month); - financialReferrerCommissionMapper.clearData(year, month); - List transactionAnalysis=new ArrayList<>(); - List transactionAnalysis1 = transactionMapper.listTransactionsForReferrerCommission(begin.toDate(), timeinterval1.toDate()); - List transactionAnalysis2 = transactionMapper.listTransactionsForReferrerCommission(timeinterval1.toDate(), timeinterval2.toDate()); - List transactionAnalysis3 = transactionMapper.listTransactionsForReferrerCommission(timeinterval2.toDate(), end.toDate()); - transactionAnalysis.addAll(transactionAnalysis1); - transactionAnalysis.addAll(transactionAnalysis2); - transactionAnalysis.addAll(transactionAnalysis3); - Map results = new HashMap<>(); - for (JSONObject analysisDay : transactionAnalysis) { - Integer orgId = analysisDay.getInteger("org_id"); - ReferrerCommissionAnalysis referrerCommissionAnalysis = results.get(orgId); - if (referrerCommissionAnalysis == null) { - referrerCommissionAnalysis = new ReferrerCommissionAnalysis(orgId, year, month, analysisDay.getBigDecimal("rate_value")); - results.put(orgId, referrerCommissionAnalysis); - } - referrerCommissionAnalysis.attachAnalysis(analysisDay); - } - for (ReferrerCommissionAnalysis commission : results.values()) { - JSONObject commissionAnalysis = commission.totalCommission(); - financialReferrerCommissionMapper.save(commissionAnalysis); - String recordId = commissionAnalysis.getString("record_id"); - List details = commission.getCommissionDetails(recordId); - for (JSONObject detail : details) { - financialReferrerCommissionDetailMapper.save(detail); - } - } - } - - @Transactional - public void generateAgentold(String monthStr, int orgId) { - JSONObject org = orgMapper.findOne(orgId); - if (org == null) { - // shall never happen - throw new ServerErrorException("Organization Id not exists:" + orgId); - } - JSONObject parnetOrg = orgMapper.findOne(org.getIntValue("parent_org_id")); - if (parnetOrg == null) { - // shall never happen - throw new ServerErrorException("Organization Parent Id not exists:" + org.getIntValue("parent_org_id")); - } - - Date mon = checkMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - - financialAgentCommissionDetailMapper.clearData(year, month); - financialAgentCommissionMapper.clearData(year, month); - HashMap channelMap = new HashMap<>(); - channelMap.put("Alipay", "Alipay"); - channelMap.put("Wechat", "Wechat"); - channelMap.put("AlipayOnline", "AlipayOnline"); - List transactionAnalysis = transactionMapper.listTransactionsForAgentCommission(year, month, org.getIntValue("parent_org_id")); - Map results = new HashMap<>(); - for (JSONObject analysisDay : transactionAnalysis) { - String key = analysisDay.getString("channel"); - String channel = analysisDay.getString("channel"); - if (!channelMap.containsKey(key)) { - continue; - } - channel = channel.toLowerCase(); - AgentCommissionAnalysis agentCommissionAnalysis = results.get(orgId + channel); - if (agentCommissionAnalysis == null) { - agentCommissionAnalysis = new AgentCommissionAnalysis(orgId, year, month, org.getBigDecimal(channel + "_rate_value"), key, org, parnetOrg); - results.put(orgId + channel, agentCommissionAnalysis); - } - agentCommissionAnalysis.attachAnalysis(analysisDay, channel); - - } - for (AgentCommissionAnalysis commission : results.values()) { - JSONObject commissionAnalysis = commission.totalCommission(); - financialAgentCommissionMapper.save(commissionAnalysis); - String recordId = commissionAnalysis.getString("record_id"); - List details = commission.getCommissionDetails(recordId); - for (JSONObject detail : details) { - financialAgentCommissionDetailMapper.save(detail); - } - } - } - - @Transactional - public void generateAgent(String monthStr, JSONObject channelCharge) { - - Date mon = checkMonth(monthStr); - DateTime begin = new DateTime(mon); - DateTime timeinterval1=begin.plusDays(10); - DateTime timeinterval2=begin.plusDays(20); - DateTime end = begin.plusMonths(1); - int year = begin.getYear(); - int month = begin.getMonthOfYear(); - - financialAgentCommissionMapper.clearData(year, month); - financialAgentCommissionDetailMapper.clearData(year, month); - List transactionDetail=new ArrayList<>(); - List transactionDetail1 = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(begin.toDate(), timeinterval1.toDate()); - List transactionDetail2 = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(timeinterval1.toDate(), timeinterval2.toDate()); - List transactionDetail3 = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(timeinterval2.toDate(), end.toDate()); - transactionDetail.addAll(transactionDetail1); - transactionDetail.addAll(transactionDetail2); - transactionDetail.addAll(transactionDetail3); - transactionDetail.forEach(item -> { - if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) { - item.put("channel", item.getString("pay_type")); - } - }); - Map> groupByOrgMap = transactionDetail.stream().collect(Collectors.groupingBy(e -> e.getInteger("org_id"))); - for (Map.Entry> oneOrg : groupByOrgMap.entrySet()) { - - int orgId = oneOrg.getKey(); - JSONObject org = orgMapper.findOne(orgId); - if (org == null) { - // shall never happen - throw new ServerErrorException("Organization Id not exists:" + orgId); - } - JSONObject parentOrg = orgMapper.findOne(org.getInteger("parent_org_id")); - if (parentOrg == null) { - // shall never happen - throw new ServerErrorException("Parent Organization Id not exists:" + orgId); - } - if (org.getInteger("commission_type") != 1) { - generateold(monthStr); - return; - } - List items = oneOrg.getValue(); - Map> groupByChannelMap = items.stream().collect(Collectors.groupingBy(e -> e.getString("channel"))); - List channelAmount = parentOrgChannelAmount(org, parentOrg, groupByChannelMap, channelCharge); - for (JSONObject channel : channelAmount) { - if (channel.getBigDecimal("share_charge").compareTo(BigDecimal.ZERO) != 0) { - JSONObject parentCommission = financialPartnerCommissionMapper.findByChanel(year, month, parentOrg.getInteger("org_id"), channel.getString("channel")); - if (parentCommission == null) { - JSONObject temp = new JSONObject(); - temp.put("org_id", parentOrg.getInteger("org_id")); - temp.put("year", year); - temp.put("month", month); - temp.put("create_time", new Date()); - temp.put("org_rate", 0); - temp.put("gross_amount", 0); - temp.put("total_charge", 0); - temp.put("royalpay_charge", 0); - temp.put("org_charge", 0); - temp.put("transaction_fee", 0); - temp.put("share_charge", 0); - temp.put("channel", channel.getString("channel")); - temp.put("net_charge", 0); - temp.put("commission_type", 1); - temp.put("settle_surcharge", 0); - financialPartnerCommissionMapper.save(temp); - parentCommission = temp; - } - parentCommission.put("share_charge", parentCommission.getBigDecimal("share_charge").add(channel.getBigDecimal("share_charge"))); - financialPartnerCommissionMapper.update(parentCommission); - JSONObject mineCommission = financialPartnerCommissionMapper.findByChanel(year, month, orgId, channel.getString("channel")); - mineCommission.put("share_charge", mineCommission.getBigDecimal("share_charge").subtract(channel.getBigDecimal("share_charge"))); - financialPartnerCommissionMapper.update(mineCommission); - } - } - } - } - - @Override - public List listReferrerAvailableMonths(String year) { - int yearNum = checkValidYear(year); - List months = financialReferrerCommissionMapper.listAvailableMonths(yearNum); - List monthObjs = new ArrayList<>(); - for (Integer mon : months) { - JSONObject item = new JSONObject(); - item.put("month", mon); - item.put("monthstr", year + "-" + StringUtils.substring("00" + mon, -2)); - JSONObject chargeInfo = getReferrerPrizeInfo(item.getString("monthstr")); - item.put("org_charge", chargeInfo.getString("org_charge")); - item.put("gross_amount", chargeInfo.getString("gross_amount")); - monthObjs.add(item); - } - return monthObjs; - } - - @Override - public JSONObject getReferrerPrizeInfo(String monthStr) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject sum = new JSONObject(); - sum.put("gross_amount", 0); - sum.put("org_charge", 0); - List referrerPrizes = financialReferrerCommissionMapper.list(year, month); - for (JSONObject prize : referrerPrizes) { - plusKey(sum, prize, "gross_amount"); - plusKey(sum, prize, "org_charge"); - prize.put("monthstr", monthStr); - } - sum.put("referrer", referrerPrizes); - sum.put("monthstr", monthStr); - return sum; - } - - @Override - public JSONObject getReferrerPrizeDetail(String monthStr, String orgId) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject result = new JSONObject(); - - List total = financialReferrerCommissionMapper.find(year, month, orgId); - if (CollectionUtils.isEmpty(total)) { - return null; - } - List recordIds = new ArrayList<>(); - for (JSONObject jsonObject : total) { - result.put("name", jsonObject.getString("name")); - recordIds.add(jsonObject.getString("record_id")); - } - - List details = financialReferrerCommissionDetailMapper.listDetailsByRecordIds(recordIds); - Map> detailMap = new HashMap<>(); - for (JSONObject detail : details) { - String key = detail.getString("client_id"); - if (detailMap.containsKey(key)) { - detailMap.get(key).add(detail); - } else { - List tmpList = new ArrayList<>(); - tmpList.add(detail); - detailMap.put(key, tmpList); - } - } - - List partnerClientInfos = new ArrayList<>(); - BigDecimal resultGrossAmount = BigDecimal.ZERO; - BigDecimal resultOrgCharge = BigDecimal.ZERO; - for (Map.Entry> entry : detailMap.entrySet()) { - JSONObject sumResult = new JSONObject(); - BigDecimal grossAmount = BigDecimal.ZERO; - BigDecimal orgCharge = BigDecimal.ZERO; - String clientMoniker = ""; - for (JSONObject jsonObject : entry.getValue()) { - grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount")); - orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge")); - clientMoniker = jsonObject.getString("client_moniker"); - } - resultGrossAmount = resultGrossAmount.add(grossAmount); - resultOrgCharge = resultOrgCharge.add(orgCharge); - sumResult.put("gross_amount", grossAmount); - sumResult.put("org_charge", orgCharge); - sumResult.put("client_moniker", clientMoniker); - partnerClientInfos.add(sumResult); - } - result.put("partner_client_infos", partnerClientInfos); - result.put("monthstr", monthStr); - result.put("gross_amount", resultGrossAmount); - result.put("org_charge", resultOrgCharge); - return result; - } - - @Override - public List getReferrerPrizeInfoList(String monthStr) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - return financialReferrerCommissionMapper.list(year, month); - } - - private Date checkMonth(String month) { - try { - return DateUtils.parseDate(month, new String[]{"yyyy-MM"}); - } catch (ParseException e) { - throw new BadRequestException("Invalid Month Format"); - } - } - - @Override - public List listAgentAvailableMonths(String year) { - int yearNum = checkValidYear(year); - List months = financialAgentCommissionMapper.listAvailableMonths(yearNum); - List monthObjs = new ArrayList<>(); - for (Integer mon : months) { - JSONObject item = new JSONObject(); - item.put("month", mon); - item.put("monthstr", year + "-" + StringUtils.substring("00" + mon, -2)); - JSONObject chargeInfo = getAgentPrizeInfo(item.getString("monthstr")); - item.put("org_charge", chargeInfo.getString("org_charge")); - item.put("gross_amount", chargeInfo.getString("gross_amount")); - item.put("total_charge", chargeInfo.getString("total_charge")); - monthObjs.add(item); - } - return monthObjs; - } - - @Override - public JSONObject getAgentPrizeInfo(String monthStr) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject sum = new JSONObject(); - sum.put("gross_amount", 0); - sum.put("org_charge", 0); - sum.put("total_charge", 0); - List referrerPrizes = financialAgentCommissionMapper.list(year, month); - for (JSONObject prize : referrerPrizes) { - plusKey(sum, prize, "gross_amount"); - plusKey(sum, prize, "org_charge"); - plusKey(sum, prize, "total_charge"); - prize.put("monthstr", monthStr); - } - sum.put("referrer", referrerPrizes); - sum.put("monthstr", monthStr); - return sum; - } - - @Override - public JSONObject getAgentPrizeDetail(String monthStr, String orgId) { - - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject result = new JSONObject(); - - List total = financialAgentCommissionMapper.find(year, month, orgId); - if (CollectionUtils.isEmpty(total)) { - return null; - } - BigDecimal royalpay_charge = BigDecimal.ZERO; - List partnerPrizeList = financialPartnerCommissionDetailMapper.listDetailByMonth(year, month); - Map countPartnerPrizeMap = new HashMap<>(); - for (JSONObject p : partnerPrizeList) { - royalpay_charge = royalpay_charge.add(p.getBigDecimal("royalpay_charge")); - String key = p.getString("client_id") + p.getString("channel").toLowerCase(); - JSONObject partnerTmp = countPartnerPrizeMap.get(key); - if (partnerTmp == null) { - JSONObject partner = new JSONObject(); - partner.put("royalpay_charge", p.getBigDecimal("royalpay_charge")); - countPartnerPrizeMap.put(key, partner); - } else { - partnerTmp.put("royalpay_charge", partnerTmp.getBigDecimal("royalpay_charge").add(p.getBigDecimal("royalpay_charge"))); - } - } - - String tableColumn[] = {"gross_amount", "total_charge", "org_charge", "org_net_charge"}; - - List recordIds = new ArrayList<>(); - Map chargeResultMap = new HashMap<>(); - for (JSONObject jsonObject : total) { - result.put("name", jsonObject.getString("name")); - recordIds.add(jsonObject.getString("record_id")); - for (String s : tableColumn) { - String key = jsonObject.getString("channel") + "_" + s; - if (chargeResultMap.containsKey(key)) { - chargeResultMap.put(key, chargeResultMap.get(key).add(jsonObject.getBigDecimal(s))); - } else { - chargeResultMap.put(key, jsonObject.getBigDecimal(s)); - } - } - } - - List details = financialAgentCommissionDetailMapper.listDetailsByRecordIds(recordIds); - Map> detailMap = new HashMap<>(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - for (JSONObject detail : details) { - detail.put("date_from", format.format(detail.get("date_from"))); - detail.put("date_to", format.format(detail.get("date_to"))); - String key = detail.getString("client_id"); - detail.put("royalpay_charge", BigDecimal.ZERO); - if (countPartnerPrizeMap.get(key + detail.getString("channel").toLowerCase()) != null) { - detail.put("royalpay_charge", countPartnerPrizeMap.get(key + detail.getString("channel")).getBigDecimal("royalpay_charge")); - } else { - detail.put("royalpay_charge", BigDecimal.ZERO); - } - if (detailMap.containsKey(key)) { - detailMap.get(key).add(detail); - } else { - List tmpList = new ArrayList<>(); - tmpList.add(detail); - detailMap.put(key, tmpList); - } - } - - List partnerClientInfos = new ArrayList<>(); - BigDecimal resultGrossAmount = BigDecimal.ZERO; - BigDecimal resultTotalCharge = BigDecimal.ZERO; - BigDecimal resultRoyalpayCharge = BigDecimal.ZERO; - BigDecimal resultOrgCharge = BigDecimal.ZERO; - BigDecimal resultNetCharge = BigDecimal.ZERO; - for (Map.Entry> entry : detailMap.entrySet()) { - JSONObject sumResult = new JSONObject(); - BigDecimal grossAmount = BigDecimal.ZERO; - BigDecimal totalCharge = BigDecimal.ZERO; - BigDecimal royalpayCharge = BigDecimal.ZERO; - BigDecimal netCharge = BigDecimal.ZERO; - BigDecimal orgCharge = BigDecimal.ZERO; - String clientMoniker = ""; - for (JSONObject jsonObject : entry.getValue()) { - grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount")); - totalCharge = totalCharge.add(jsonObject.getBigDecimal("total_charge")); - royalpayCharge = royalpayCharge.add(jsonObject.getBigDecimal("royalpay_charge")); - orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge")); - if (jsonObject.getBigDecimal("net_charge") != null) { - netCharge = netCharge.add(jsonObject.getBigDecimal("org_net_charge")); - } - clientMoniker = jsonObject.getString("client_moniker"); - } - resultGrossAmount = resultGrossAmount.add(grossAmount); - resultTotalCharge = resultTotalCharge.add(totalCharge); - resultRoyalpayCharge = resultRoyalpayCharge.add(royalpayCharge); - resultOrgCharge = resultOrgCharge.add(orgCharge); - resultNetCharge = resultNetCharge.add(netCharge); - sumResult.put("gross_amount", grossAmount); - sumResult.put("total_charge", totalCharge); - sumResult.put("royalpay_charge", royalpayCharge); - sumResult.put("org_charge", orgCharge); - sumResult.put("org_net_charge", netCharge); - sumResult.put("client_moniker", clientMoniker); - sumResult.put("channel_detail", entry.getValue()); - partnerClientInfos.add(sumResult); - } - result.put("partner_client_infos", partnerClientInfos); - - for (Map.Entry entry : chargeResultMap.entrySet()) { - result.put(entry.getKey(), entry.getValue()); - } - result.put("monthstr", monthStr); - result.put("total_transaction", resultGrossAmount); - result.put("total_charge", resultTotalCharge); - result.put("royalPay_charge", resultRoyalpayCharge); - result.put("org_net_charge", resultNetCharge); - result.put("city_partner_charge", resultOrgCharge); - return result; - } - - @Override - public List getAgentPrizeInfoList(String monthStr) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - return financialAgentCommissionMapper.list(year, month); - } - - @Override - @Transactional - public void generateSenior(String monthStr) { - List seniorOrgs = orgMapper.listSeniorOrgId(0); - if (CollectionUtils.isEmpty(seniorOrgs)) { - return; - } - Date mon = checkMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - JSONObject sysConfig = sysConfigManager.getSysConfig(); - BigDecimal rate = sysConfig.getBigDecimal("senior_charge_rate").divide(CommonConsts.HUNDRED); - if (rate == null) { - rate = new BigDecimal("0.0006"); - } - Date now = new Date(); - financialSeniorPartnerCommissionMapper.clearData(year, month); - - BigDecimal finalRate = rate; - seniorOrgs.parallelStream().forEach(p -> { - List seniorSubOrgs = orgMapper.listSeniorOrgId(Integer.parseInt(p)); - if (CollectionUtils.isEmpty(seniorSubOrgs)) { - return; - } - JSONObject seniorOrgAnalysis = financialPartnerCommissionMapper.analysisSeniorForGenerate(year, month, seniorSubOrgs); - if (seniorOrgAnalysis == null) { - return; - } - JSONObject record = new JSONObject(); - record.put("org_id", p); - record.put("year", year); - record.put("month", month); - record.put("create_time", now); - record.put("org_rate", finalRate.multiply(CommonConsts.HUNDRED)); - record.put("gross_amount", seniorOrgAnalysis.getBigDecimal("gross_amount")); - record.put("net_charge", seniorOrgAnalysis.getBigDecimal("gross_amount").multiply(finalRate)); - financialSeniorPartnerCommissionMapper.save(record); - }); - - } - - @Override - public List querySenior(JSONObject param) { - Date mon = checkMonth(param.getString("monthStr")); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - List orgs = orgMapper.listSeniorOrgId(param.getIntValue("org_id")); - if (CollectionUtils.isEmpty(orgs)) { - return Collections.EMPTY_LIST; - } - List result = financialPartnerCommissionMapper.analysisSenior(year, month, orgs); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - BigDecimal rate = sysConfig.getBigDecimal("senior_charge_rate").divide(CommonConsts.HUNDRED); - if (rate == null) { - rate = new BigDecimal("0.0006"); - } - BigDecimal finalRate = rate; - result.parallelStream().forEach(p -> { - p.put("net_charge", p.getBigDecimal("gross_amount").multiply(finalRate).setScale(2, RoundingMode.HALF_DOWN)); - p.put("org_rate", finalRate.multiply(CommonConsts.HUNDRED)); - }); - return result; - } - - @Override - public JSONObject getSenior(String monthStr, String orgId) { - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - return financialSeniorPartnerCommissionMapper.find(year, month, orgId); - } - - @Override - public void exportMonthFiles(String monthStr, HttpServletResponse resp) throws Exception { - OutputStream ous = null; - Date monthDate = parseMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(monthDate); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; - List report = financialPartnerCommissionMapper.listWithOrgInfo(year, month); - if (report != null) { - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + "CityPartner_Commission_Info_" + monthStr + ".xls"); - ous = resp.getOutputStream(); - HSSFWorkbook wb = new HSSFWorkbook(); - Cell cell = null; - HSSFFont font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle titleStyle = wb.createCellStyle(); - titleStyle.setFont(font); - HSSFCellStyle style = wb.createCellStyle(); - style.setFillForegroundColor(HSSFColor.RED.index); - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - Sheet sheet = wb.createSheet("CityPartner_Commission_Info_" + month); - sheet.setDefaultColumnWidth(20); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] CommissionTitle = {"City Partner Name", "Transaction Amount", "Total Charge", "RoyalPay Charge", "Net Charge", "City Partner Charge", "Share Charge", "Type"}; - for (int i = 0; i < CommissionTitle.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(CommissionTitle[i]); - } - for (JSONObject log : report) { - row = sheet.createRow(++rowNum); - StringBuffer name = new StringBuffer(log.getString("name")); - if (log.get("parent_org_id") == null) { - name.append("(一级代理)"); - } else { - name.append("(二级代理)"); - } - String type = ""; - switch (log.getIntValue("commission_type")) { - case 1: - type = "渠道计算法"; - break; - case 2: - type = "总交易额比例"; - break; - case 3: - type = "收益比例"; - break; - default: - break; - } - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(name.toString()); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("gross_amount") == null ? BigDecimal.ZERO.toPlainString() : log.getBigDecimal("gross_amount").toPlainString()); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("total_charge") == null ? BigDecimal.ZERO.toPlainString() : log.getBigDecimal("total_charge").toPlainString()); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("royalpay_charge") == null ? BigDecimal.ZERO.toPlainString() : log.getBigDecimal("royalpay_charge").toPlainString()); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("net_charge") == null ? BigDecimal.ZERO.toPlainString() : log.getBigDecimal("net_charge").toPlainString()); - if (log.getBigDecimal("org_charge").compareTo(BigDecimal.ZERO) == 1) { - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("org_charge").toPlainString()); - } else { - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(BigDecimal.ZERO.toPlainString()); - } - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(log.getBigDecimal("share_charge") == null ? BigDecimal.ZERO.toPlainString() : log.getBigDecimal("share_charge").toPlainString()); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(type); - } - wb.write(ous); - ous.flush(); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerRegisterServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerRegisterServiceImpl.java deleted file mode 100644 index bb2e2a5c4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerRegisterServiceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.core.impls; - -import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerBean; -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerRegisterService; -import au.com.royalpay.payment.manage.mappers.system.CityPartnerRegisterMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-01-23. - */ -@Service -public class CityPartnerRegisterServiceImpl implements CityPartnerRegisterService { - @Resource - private CityPartnerRegisterMapper cityPartnerRegisterMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private ManagerMapper managerMapper; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public void saveRegistry(CityPartnerBean cityPartner) { - JSONObject partner = cityPartner.toJSON(); - partner.put("register_time", new Date()); - partner.put("ip", RequestEnvironment.getClientIp()); - cityPartnerRegisterMapper.savePartner(partner); - sendTemplateMessage(cityPartner); - } - - private void sendTemplateMessage(CityPartnerBean partner) { - try { - List admins = managerMapper.listDetailsByRole(null, ManagerRole.ADMIN.getMask()); - for (JSONObject admin : admins) { - String openId = admin.getString("wx_openid"); - if (openId != null) { - MpWechatApi api = mpWechatApiProvider.getWechatApiForTemplateMessage(openId); - - try { - TemplateMessage msg = initMsg(partner, openId, api.getTemplateId("new-apply")); - api.sendTemplateMessage(msg); - } catch (Exception e1) { - try { - TemplateMessage msg = initMsg(partner, openId, api.getTemplateId("new-apply")); - api.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error("发送模板消息失败:", e); - } - } - } - } - } catch (Exception e) { - logger.error("发送模板消息失败:", e); - } - } - - private TemplateMessage initMsg(CityPartnerBean partner, String openId, String templateId) { - TemplateMessage msg = new TemplateMessage(openId, templateId, PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat")); - msg.put("first", "有新的城市合伙人申请,请及时处理", "#ff0000"); - msg.put("keyword1", "城市合伙人申请", "#0000ff"); - msg.put("keyword2", partner.getCity(), "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", "联系人:" + partner.getName() + " 电话:" + partner.getPhone(), "#000000"); - msg.put("remark", "点击处理", "#ff0000"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerServiceImpl.java deleted file mode 100644 index bfe9fc284..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.core.impls; - -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerService; -import au.com.royalpay.payment.manage.mappers.system.CityPartnerRegisterMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-02-05. - */ -@Service -public class CityPartnerServiceImpl implements CityPartnerService { - @Resource - private CityPartnerRegisterMapper cityPartnerRegisterMapper; - @Override - public JSONObject listRequests(int page, int limit) { - PageList requests = cityPartnerRegisterMapper.listRequests(new PageBounds(page,limit, Order.formString("handled.asc,register_time.desc"))); - return PageListUtils.buildPageListResult(requests); - } - - @Override - public List listAllRequests() { - return cityPartnerRegisterMapper.listRequests(new PageBounds(Order.formString("handled.asc,register_time.desc"))); - - } - - @Override - public void handleRequest(String requestId, JSONObject manager) { - JSONObject request = cityPartnerRegisterMapper.find(requestId); - if (request!=null){ - request.put("handled",1); - request.put("handler",manager.getString("manager_id")); - request.put("handler_name",manager.getString("display_name")); - request.put("handletime",new Date()); - cityPartnerRegisterMapper.update(request); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/package-info.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/package-info.java deleted file mode 100644 index 3f33aac88..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 城市合伙人 - * Created by yixian on 2017-01-23. - */ -package au.com.royalpay.payment.manage.citypartner; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerController.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerController.java deleted file mode 100644 index 44f8fca9d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.web; - -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2017-02-05. - */ -@RestController -@ManagerMapping(value = "/sys/citypartners", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) -public class CityPartnerController { - @Resource - private CityPartnerService cityPartnerService; - - @RequestMapping(method = RequestMethod.GET) - public List listCityPartnerRequests() { - return cityPartnerService.listAllRequests(); - } - - @PutMapping("/{requestId}/handle") - public void handleRequest(@PathVariable String requestId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - cityPartnerService.handleRequest(requestId, manager); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerPrizeController.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerPrizeController.java deleted file mode 100644 index 7e81cb94e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerPrizeController.java +++ /dev/null @@ -1,389 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.web; - -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerPrizeService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.tradelog.beans.enums.AlipayPlusChannelEnum; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Created by yixian on 2017-03-08. - */ -@RestController -@ManagerMapping(value = "/sys/citypartner_prizes", role = ManagerRole.FINANCIAL_STAFF, method = RequestMethod.GET) -public class CityPartnerPrizeController { - - @Resource - private CityPartnerPrizeService cityPartnerPrizeService; - - /** - * 代理商提成生成 - * - * @param param - */ - @PostMapping("/generate") - public void generate(@RequestBody JSONObject param) { - String month = param.getString("month"); - cityPartnerPrizeService.generate(month); - } - - @GetMapping("/months") - public List listAvailableMonths(@RequestParam String year) { - return cityPartnerPrizeService.listAvailableMonths(year); - } - - @GetMapping("/export/{monthStr}") - public void exportExcel(@PathVariable String monthStr, HttpServletResponse httpResponse) throws Exception { - cityPartnerPrizeService.exportMonthFiles(monthStr, httpResponse); - } - - @GetMapping(value = "/months/{monthStr}") - public JSONObject getCityPartnersPrizeInfo(@PathVariable String monthStr) { - List partnerPrizeInfos = cityPartnerPrizeService.getCityPartnerPrizeInfoList(monthStr); - Map> partenerPrizeMap = new HashMap<>(); - for (JSONObject partnerPrizeInfo : partnerPrizeInfos) { - String key = partnerPrizeInfo.getString("org_id"); - if (partenerPrizeMap.containsKey(key)) { - partenerPrizeMap.get(key).add(partnerPrizeInfo); - } else { - List tmpList = new ArrayList<>(); - tmpList.add(partnerPrizeInfo); - partenerPrizeMap.put(key, tmpList); - } - } - JSONObject result = new JSONObject(); - List partnerInfos = new ArrayList<>(partenerPrizeMap.size()); - BigDecimal resultTotalCharge = BigDecimal.ZERO; - BigDecimal resultRoyalpayCharge = BigDecimal.ZERO; - BigDecimal resultOrgCharge = BigDecimal.ZERO; - BigDecimal resultNetCharge = BigDecimal.ZERO; - for (Map.Entry> entry : partenerPrizeMap.entrySet()) { - JSONObject sumResult = new JSONObject(); - BigDecimal grossAmount = BigDecimal.ZERO; - BigDecimal totalCharge = BigDecimal.ZERO; - BigDecimal royalpayCharge = BigDecimal.ZERO; - BigDecimal orgCharge = BigDecimal.ZERO; - BigDecimal netCharge = BigDecimal.ZERO; - BigDecimal shareCharge = BigDecimal.ZERO; - String cityPartnerName = ""; - int org_id = 0; - int type = 1; - ArrayList objectAlipayPlus = new ArrayList<>(); - ArrayList unGmos = new ArrayList<>(); - ArrayList aps = new ArrayList<>(); - for (JSONObject jsonObject : entry.getValue()) { - grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount")); - totalCharge = totalCharge.add(jsonObject.getBigDecimal("total_charge")); - royalpayCharge = royalpayCharge.add(jsonObject.getBigDecimal("royalpay_charge")); - shareCharge = shareCharge.add(jsonObject.getBigDecimal("share_charge")); - orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge")); - if (jsonObject.getBigDecimal("net_charge") != null) { - netCharge = netCharge.add(jsonObject.getBigDecimal("net_charge")); - } - org_id = jsonObject.getIntValue("org_id"); - cityPartnerName = jsonObject.getString("name"); - type = jsonObject.getIntValue("commission_type"); - if (StringUtils.equalsAny(jsonObject.getString("channel"), "alipay_cn", "alipay_ac_sg", "alipay_ac_mo", "alipay_ac_hk", "alipay_ac_lu", "alipay_ac_gb", "alipay_ac_us", "paytm", "kakaopay", "truemoney", "ezlink", "gcash", "tng", "dana", "easy_paisa", "bkash", "lazada_wallet_my")) { - jsonObject.put("channel", AlipayPlusChannelEnum.statusOf(jsonObject.getString("channel")).description()); - objectAlipayPlus.add(jsonObject); - } else if (StringUtils.equalsAny(jsonObject.getString("channel"), "ApsInStore,alipayCN", "ApsInStore,alipayOS", "ApsCashier,alipayCN", "ApsCashier,alipayOS")) { - aps.add(jsonObject); - } else { - unGmos.add(jsonObject); - } - } - if (entry.getValue().get(0).get("parent_org_id") != null) { - sumResult.put("org_type", "agent"); - } - sumResult.put("gross_amount", grossAmount); - sumResult.put("total_charge", totalCharge); - sumResult.put("royalpay_charge", royalpayCharge); - sumResult.put("org_charge", orgCharge); - sumResult.put("share_charge", shareCharge); - sumResult.put("org_name", cityPartnerName); - sumResult.put("org_id", org_id); - sumResult.put("net_charge", netCharge); - sumResult.put("type", type); - if (objectAlipayPlus.size() != 0) { - JSONObject totalAlipayPlus = new JSONObject(); - for (JSONObject alipayPlus : objectAlipayPlus) { - totalAlipayPlus.put("org_rate", 0); - totalAlipayPlus.put("org_id", alipayPlus.getString("org_id")); - totalAlipayPlus.put("year", alipayPlus.getString("year")); - totalAlipayPlus.put("month", alipayPlus.getString("month")); - totalAlipayPlus.put("channel", "alipayPlus"); - totalAlipayPlus.put("gross_amount", alipayPlus.getBigDecimal("gross_amount").add(totalAlipayPlus.getBigDecimal("gross_amount") != null ? totalAlipayPlus.getBigDecimal("gross_amount") : BigDecimal.valueOf(0))); - totalAlipayPlus.put("net_charge", alipayPlus.getBigDecimal("net_charge").add(totalAlipayPlus.getBigDecimal("net_charge") != null ? totalAlipayPlus.getBigDecimal("net_charge") : BigDecimal.valueOf(0))); - totalAlipayPlus.put("total_charge", alipayPlus.getBigDecimal("total_charge").add(totalAlipayPlus.getBigDecimal("total_charge") != null ? totalAlipayPlus.getBigDecimal("total_charge") : BigDecimal.valueOf(0))); - totalAlipayPlus.put("royalpay_charge", alipayPlus.getBigDecimal("royalpay_charge").add(totalAlipayPlus.getBigDecimal("royalpay_charge") != null ? totalAlipayPlus.getBigDecimal("royalpay_charge") : BigDecimal.valueOf(0))); - totalAlipayPlus.put("share_charge", alipayPlus.getBigDecimal("share_charge").add(totalAlipayPlus.getBigDecimal("share_charge") != null ? totalAlipayPlus.getBigDecimal("share_charge") : BigDecimal.valueOf(0))); - totalAlipayPlus.put("org_charge", alipayPlus.getBigDecimal("org_charge").add(totalAlipayPlus.getBigDecimal("org_charge") != null ? totalAlipayPlus.getBigDecimal("org_charge") : BigDecimal.valueOf(0))); - } - totalAlipayPlus.put("AlipayPlus", objectAlipayPlus); - unGmos.add(totalAlipayPlus); - } - if(aps.size() != 0){ - List apsInfo = getApsInfo(aps, monthStr); - for (JSONObject jsonObject : apsInfo) { - unGmos.add(jsonObject); - } - } - sumResult.put("channel_detail", unGmos); - resultTotalCharge = resultTotalCharge.add(totalCharge); - resultRoyalpayCharge = resultRoyalpayCharge.add(royalpayCharge); - if ("agent".equals(sumResult.getString("org_type"))) { - resultRoyalpayCharge = resultRoyalpayCharge.add(shareCharge); - } - resultOrgCharge = resultOrgCharge.add(orgCharge); - if (!"agent".equals(sumResult.getString("org_type"))) { - resultOrgCharge = resultOrgCharge.add(shareCharge); - } - resultNetCharge = resultNetCharge.add(netCharge); - partnerInfos.add(sumResult); - } - result.put("monthstr", monthStr); - result.put("total_charge", resultTotalCharge); - result.put("royalpay_charge", resultRoyalpayCharge); - result.put("net_charge", resultNetCharge); - result.put("org_charge", resultOrgCharge); - result.put("partner_info_list", partnerInfos); - return result; - } - - private List getApsInfo(List partnerPrizes, String monthStr) { - for (JSONObject prize : partnerPrizes) { - String[] channels = prize.getString("channel").split(","); - if (channels.length == 2) { - prize.put("channel", channels[0]); - prize.put("pay_type", channels[1]); - } - } - List apsInfo = new ArrayList<>(); - Map> groupByChannel = partnerPrizes.stream().collect(Collectors.groupingBy(e -> e.getString("channel"))); - for (Map.Entry> channel : groupByChannel.entrySet()) { - if (channel.getKey().equals("ApsInStore") || channel.getKey().equals("ApsCashier")) { - JSONObject sumAps = new JSONObject(); - sumAps.put("gross_amount", 0); - sumAps.put("total_charge", 0); - sumAps.put("royalpay_charge", 0); - sumAps.put("org_charge", 0); - sumAps.put("net_charge", 0); - sumAps.put("share_charge", 0); - for (JSONObject aps : channel.getValue()) { - plusKey(sumAps, aps, "gross_amount"); - plusKey(sumAps, aps, "total_charge"); - if (aps.get("parent_org_id") == null) { - aps.put("org_charge", aps.getBigDecimal("org_charge").add(aps.getBigDecimal("share_charge"))); - } - plusKey(sumAps, aps, "royalpay_charge"); - plusKey(sumAps, aps, "org_charge"); - plusKey(sumAps, aps, "net_charge"); - plusKey(sumAps, aps, "share_charge"); - aps.put("monthstr", monthStr); - } - sumAps.put("org_rate", channel.getValue().get(0).getString("org_rate")); - sumAps.put("channel", channel.getKey()); - sumAps.put("monthstr", monthStr); - sumAps.put("sunAps", channel.getValue()); - apsInfo.add(sumAps); - } - } - return apsInfo; - } - - private void plusKey(JSONObject sum, JSONObject prize, String key) { - sum.put(key, sum.getBigDecimal(key).add(prize.getBigDecimal(key))); - } - - @ManagerMapping("/months/{monthStr}/orgs/{orgId}") - public JSONObject getCityPartnerPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) { - return cityPartnerPrizeService.getCityPartnerPrizeDetail(monthStr, orgId); - } - - @PostMapping("/referrer/generate") - public void generateReferrer(@RequestBody JSONObject param) { - String month = param.getString("month"); - cityPartnerPrizeService.generateReferrer(month); - } - - @ManagerMapping("/referrer/months/{monthStr}/orgs/{orgId}") - public JSONObject getreferrerPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) { - return cityPartnerPrizeService.getReferrerPrizeDetail(monthStr, orgId); - } - - @GetMapping("/referrer/months") - public List listReferrerAvailableMonths(@RequestParam String year) { - return cityPartnerPrizeService.listReferrerAvailableMonths(year); - } - - @GetMapping(value = "/referrer/months/{monthStr}") - public JSONObject getReferrerPrizeInfo(@PathVariable String monthStr) { - List partnerPrizeInfos = cityPartnerPrizeService.getReferrerPrizeInfoList(monthStr); - Map> partenerPrizeMap = new HashMap<>(); - for (JSONObject partnerPrizeInfo : partnerPrizeInfos) { - String key = partnerPrizeInfo.getString("org_id"); - if (partenerPrizeMap.containsKey(key)) { - partenerPrizeMap.get(key).add(partnerPrizeInfo); - } else { - List tmpList = new ArrayList<>(); - tmpList.add(partnerPrizeInfo); - partenerPrizeMap.put(key, tmpList); - } - } - JSONObject result = new JSONObject(); - List partnerInfos = new ArrayList<>(partenerPrizeMap.size()); - BigDecimal resultGrossAmount = BigDecimal.ZERO; - BigDecimal resultOrgCharge = BigDecimal.ZERO; - for (Map.Entry> entry : partenerPrizeMap.entrySet()) { - JSONObject sumResult = new JSONObject(); - BigDecimal grossAmount = BigDecimal.ZERO; - BigDecimal orgCharge = BigDecimal.ZERO; - String cityPartnerName = ""; - int org_id = 0; - for (JSONObject jsonObject : entry.getValue()) { - grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount")); - orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge")); - org_id = jsonObject.getIntValue("org_id"); - cityPartnerName = jsonObject.getString("name"); - } - sumResult.put("gross_amount", grossAmount); - sumResult.put("org_charge", orgCharge); - sumResult.put("org_name", cityPartnerName); - sumResult.put("org_id", org_id); - sumResult.put("channel_detail", entry.getValue()); - resultGrossAmount = resultGrossAmount.add(grossAmount); - resultOrgCharge = resultOrgCharge.add(orgCharge); - partnerInfos.add(sumResult); - } - result.put("monthstr", monthStr); - result.put("gross_amount", resultGrossAmount); - result.put("org_charge", resultOrgCharge); - result.put("partner_info_list", partnerInfos); - return result; - } - - @ManagerMapping("/agent/months/{monthStr}/orgs/{orgId}") - public JSONObject getAgentPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) { - return cityPartnerPrizeService.getAgentPrizeDetail(monthStr, orgId); - } - - @GetMapping("/agent/months") - public List listAgentAvailableMonths(@RequestParam String year) { - return cityPartnerPrizeService.listAgentAvailableMonths(year); - } - - @GetMapping(value = "/agent/months/{monthStr}") - public JSONObject getAgentPrizeInfo(@PathVariable String monthStr) { - List partnerPrizeList = cityPartnerPrizeService.getCityPartnerPrizeInfoList(monthStr); - Map countPartnerPrizeMap = new HashMap<>(); - for (JSONObject p : partnerPrizeList) { - String key = p.getString("org_id"); - JSONObject partnerTmp = countPartnerPrizeMap.get(key); - if (partnerTmp == null) { - JSONObject partner = new JSONObject(); - partner.put("royalpay_charge", p.getBigDecimal("royalpay_charge")); - countPartnerPrizeMap.put(key, partner); - } else { - partnerTmp.put("royalpay_charge", partnerTmp.getBigDecimal("royalpay_charge").add(p.getBigDecimal("royalpay_charge"))); - } - } - - List partnerPrizeInfos = cityPartnerPrizeService.getAgentPrizeInfoList(monthStr); - Map> partenerPrizeMap = new HashMap<>(); - for (JSONObject partnerPrizeInfo : partnerPrizeInfos) { - String key = partnerPrizeInfo.getString("org_id"); - if (countPartnerPrizeMap.containsKey(key)) { - partnerPrizeInfo.put("royalpay_charge", countPartnerPrizeMap.get(key).getBigDecimal("royalpay_charge")); - } else { - partnerPrizeInfo.put("royalpay_charge", BigDecimal.ZERO); - } - if (partenerPrizeMap.containsKey(key)) { - partenerPrizeMap.get(key).add(partnerPrizeInfo); - } else { - List tmpList = new ArrayList<>(); - tmpList.add(partnerPrizeInfo); - partenerPrizeMap.put(key, tmpList); - } - } - - - JSONObject result = new JSONObject(); - List partnerInfos = new ArrayList<>(partenerPrizeMap.size()); - BigDecimal resultGrossAmount = BigDecimal.ZERO; - BigDecimal resultOrgCharge = BigDecimal.ZERO; - BigDecimal resultAgentCharge = BigDecimal.ZERO; - BigDecimal resultOrgNetCharge = BigDecimal.ZERO; - BigDecimal resultRoyalpayCharge = BigDecimal.ZERO; - - for (Map.Entry> entry : partenerPrizeMap.entrySet()) { - JSONObject sumResult = new JSONObject(); - BigDecimal grossAmount = BigDecimal.ZERO; - BigDecimal orgCharge = BigDecimal.ZERO; - BigDecimal agentCharge = BigDecimal.ZERO; - BigDecimal orgNetCharge = BigDecimal.ZERO; - BigDecimal royalpayCharge = BigDecimal.ZERO; - String cityPartnerName = ""; - int org_id = 0; - for (JSONObject jsonObject : entry.getValue()) { - grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount")); - orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge")); - agentCharge = agentCharge.add(jsonObject.getBigDecimal("total_charge")); - orgNetCharge = orgNetCharge.add(jsonObject.getBigDecimal("org_net_charge")); - royalpayCharge = royalpayCharge.add(jsonObject.getBigDecimal("royalpay_charge")); - org_id = jsonObject.getIntValue("org_id"); - cityPartnerName = jsonObject.getString("name"); - } - sumResult.put("gross_amount", grossAmount); - sumResult.put("org_charge", orgCharge); - sumResult.put("org_net_charge", orgNetCharge); - sumResult.put("org_name", cityPartnerName); - sumResult.put("org_id", org_id); - sumResult.put("channel_detail", entry.getValue()); - sumResult.put("royalpay_charge", royalpayCharge); - resultGrossAmount = resultGrossAmount.add(grossAmount); - resultOrgCharge = resultOrgCharge.add(orgCharge); - resultAgentCharge = resultAgentCharge.add(agentCharge); - resultOrgNetCharge = resultOrgNetCharge.add(orgNetCharge); - partnerInfos.add(sumResult); - } - - result.put("royalpay_charge", resultRoyalpayCharge); - result.put("monthstr", monthStr); - result.put("gross_amount", resultGrossAmount); - result.put("agent_total_charge", resultAgentCharge); - result.put("org_charge", resultOrgCharge); - result.put("org_net_charge", resultOrgNetCharge); - result.put("partner_info_list", partnerInfos); - return result; - } - - @PostMapping("/senior/generate") - public void generateSenior(@RequestBody JSONObject param) { - String month = param.getString("month"); - cityPartnerPrizeService.generate(month); - } - - @GetMapping("/senior/{orgId}") - public void findOne(@RequestParam String monthStr, @PathVariable String orgId) { - cityPartnerPrizeService.getSenior(monthStr, orgId); - } - - @GetMapping("/senior/{orgId}/details") - public List findDetail(@RequestParam String monthStr, @PathVariable String orgId) { - JSONObject params = new JSONObject(); - params.put("monthStr", monthStr); - params.put("org_id", orgId); - return cityPartnerPrizeService.querySenior(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java deleted file mode 100644 index d96cd5474..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.citypartner.web; -import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerBean; -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerRegisterService; -import au.com.royalpay.payment.manage.merchants.core.ClientApply; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -/** - * Created by yixian on 2017-01-23. - */ -@RestController -@RequestMapping("/partnership/citypartners") -public class CityPartnerRegisterController { - @Resource - private CityPartnerRegisterService cityPartnerRegisterService; - @Resource - private ClientApply clientApply; - - @RequestMapping(method = RequestMethod.POST) - public void register(@CookieValue(CommonConsts.CODE_KEY) String codeKey, HttpServletResponse response, - @RequestBody @Valid CityPartnerBean partner, Errors errors) throws Exception{ - String codeValue = clientApply.getVerifyCode(codeKey); - if (codeValue == null) { - throw new Exception("Verification code has expired"); - } - if (!codeValue.equals(partner.getCaptcha())){ - throw new Exception("Verification code is not correct"); - }else { - clientApply.deleteVerifyCodeKey(codeKey); - HttpUtils.dropCookie(response, CommonConsts.CODE_KEY); - } - HttpUtils.handleValidErrors(errors); - cityPartnerRegisterService.saveRegistry(partner); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java deleted file mode 100644 index d9ab1e4d8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java +++ /dev/null @@ -1,71 +0,0 @@ -package au.com.royalpay.payment.manage.complianceAudit.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - - -/** - * Created by yixian on 2016-07-01. - */ -public class ClientComplianceQuery { - - private int limit = 10; - private int page = 1; - private String status; - private String client_moniker; - private String type = "1"; - - public JSONObject toJson(){ - JSONObject jason = new JSONObject(); - if(StringUtils.isNotEmpty(status)){ - jason.put("status",status); - } - if(StringUtils.isNotEmpty(type)){ - jason.put("type",type); - } - if(StringUtils.isNotEmpty(client_moniker)){ - jason.put("client_moniker",client_moniker); - } - return jason; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/ClientComplianceApply.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/ClientComplianceApply.java deleted file mode 100644 index 348acec9e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/ClientComplianceApply.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.complianceAudit.core; - - -import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery; -import com.alibaba.fastjson.JSONObject; - - -/** - * Created by yishuqian on 18/10/2016. - */ -public interface ClientComplianceApply { - - JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery apply); - - JSONObject complianceAuthFile(JSONObject client); - - void passComplianceFile(JSONObject manager,int clientId,JSONObject passInfo); - - void passKycFile(JSONObject manager,int clientId,JSONObject passInfo); - - void refuseComplianceFile(JSONObject manager,int clientId,JSONObject refuseInfo); - - void refuseKycFile(JSONObject manager,int clientId,JSONObject refuseInfo); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java deleted file mode 100644 index 1c17826dd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -package au.com.royalpay.payment.manage.complianceAudit.core.impl; - - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery; -import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply; -import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum; -import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Created by yishuqian on 18/10/2016. - */ -@Service -public class ClientComplianceApplyImpl implements ClientComplianceApply -{ - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - @Resource - private SignInAccountService signInAccountService; - - @Override - public JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery applyQuery) { - JSONObject params = applyQuery.toJson(); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - PageList partners = clientComplianceCompanyMapper.listClientCompliances(params, new PageBounds(applyQuery.getPage(), applyQuery.getLimit(), Order.formString("submit_time.desc"))); - return PageListUtils.buildPageListResult(partners); - } - - @Override - public JSONObject complianceAuthFile(JSONObject client) - { - String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file"}; - if (client == null) { - throw new InvalidShortIdException(); - } - List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - if (clientFiles != null && !clientFiles.isEmpty()) { - for (String fileKey : fileKeys) { - List clientFileUrl = clientFiles.stream() - .filter(json -> (fileKey.equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("status", json.getString("status")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - fileJson.put(fileKey, clientFileUrl); - } - } - } - return fileJson; - - }; - - @Override - public void passComplianceFile(JSONObject manager, int clientId, JSONObject passInfo) { - JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId); - if (complianceDetail == null) { - throw new BadRequestException("无此记录"); - } - if (complianceDetail.getIntValue("status") == 1) { - throw new BadRequestException("审核已通过,请避免重复操作"); - - } - complianceDetail.put("operator_id", manager.getString("manager_id")); - complianceDetail.put("status",1); - complianceDetail.put("description",' '); - clientComplianceCompanyMapper.update(complianceDetail); - clientFilesMapper.updateFilesAuthStatus(clientId, - FilesAuthEnum.PASS_OPR.getAfterStatus(), - FilesAuthEnum.PASS_OPR.getBeforeStatus(), - FilesAuthEnum.PASS_OPR.getAuthType("compliance")); - - JSONObject client = clientManager.getClientInfo(clientId); - boolean clientChanged = false; - if (StringUtils.isNotBlank(complianceDetail.getString("company_photo"))) { - client.put("company_photo", complianceDetail.getString("company_photo")); - clientChanged = true; - } - if (StringUtils.isNotBlank(complianceDetail.getString("store_photo"))) { - client.put("store_photo", complianceDetail.getString("store_photo")); - clientChanged = true; - } - if (StringUtils.isNotBlank(complianceDetail.getString("company_website"))) { - client.put("company_website", complianceDetail.getString("company_website")); - clientChanged = true; - } - if (clientChanged) { - clientMapper.update(client); - } - } - - @Override - public void passKycFile(JSONObject manager, int clientId, JSONObject passInfo) { - JSONObject complianceDetail = clientComplianceCompanyMapper.findKycFileByClientId(clientId); - if (complianceDetail == null) { - throw new BadRequestException("无此记录"); - } - if (complianceDetail.getIntValue("status") == 1) { - throw new BadRequestException("审核已通过,请避免重复操作"); - } - complianceDetail.put("operator_id", manager.getString("manager_id")); - complianceDetail.put("status",1); - complianceDetail.put("description",' '); - clientComplianceCompanyMapper.update(complianceDetail); - clientFilesMapper.updateFilesAuthStatus(clientId, - FilesAuthEnum.PASS_OPR.getAfterStatus(), - FilesAuthEnum.PASS_OPR.getBeforeStatus(), - FilesAuthEnum.PASS_OPR.getAuthType("kyc")); - String[] unrepeatFiles = {"client_company_file","client_id_file"}; - for(String fileName : unrepeatFiles){ - clientFilesMapper.updateRepeatFilesAfterCommit(clientId,fileName); - } - } - - @Override - public void refuseComplianceFile(JSONObject manager, int clientId, JSONObject refuseInfo) { - JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId); - if (complianceDetail == null) { - throw new BadRequestException("无此记录"); - } - if (complianceDetail.getIntValue("status") == 2) { - throw new BadRequestException("已打回,请避免重复操作"); - } - complianceDetail.put("description",refuseInfo.getString("description")); - complianceDetail.put("operator_id", manager.getString("manager_id")); - complianceDetail.put("status",2); - clientComplianceCompanyMapper.update(complianceDetail); - clientFilesMapper.updateFilesAuthStatus(clientId, - FilesAuthEnum.REFUSE_OPR.getAfterStatus(), - FilesAuthEnum.REFUSE_OPR.getBeforeStatus(), - FilesAuthEnum.REFUSE_OPR.getAuthType("compliance")); - } - - @Override - public void refuseKycFile(JSONObject manager, int clientId, JSONObject refuseInfo) { - JSONObject complianceDetail = clientComplianceCompanyMapper.findKycFileByClientId(clientId); - if (complianceDetail == null) { - throw new BadRequestException("无此记录"); - } - if (complianceDetail.getIntValue("status") == 2) { - throw new BadRequestException("已打回,请避免重复操作"); - } - complianceDetail.put("description",refuseInfo.getString("description")); - complianceDetail.put("operator_id", manager.getString("manager_id")); - complianceDetail.put("status",2); - clientComplianceCompanyMapper.update(complianceDetail); - - clientFilesMapper.updateFilesAuthStatus(clientId, - FilesAuthEnum.REFUSE_OPR.getAfterStatus(), - FilesAuthEnum.REFUSE_OPR.getBeforeStatus(), - FilesAuthEnum.REFUSE_OPR.getAuthType("kyc")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/web/ComplianceAuditController.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/web/ComplianceAuditController.java deleted file mode 100644 index 0f15e787a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/web/ComplianceAuditController.java +++ /dev/null @@ -1,74 +0,0 @@ -package au.com.royalpay.payment.manage.complianceAudit.web; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery; -import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 18/10/2016. - */ -@RestController -@RequestMapping("/compliance/audit") -public class ComplianceAuditController -{ - @Resource - private ClientComplianceApply clientComplianceApply; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - - @RequestMapping(value = "/listClientCompliances",method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject clientComplianceList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ClientComplianceQuery apply) { - return clientComplianceApply.listClientComplianceApply(manager,apply); - } - - @ManagerMapping(value = "/{clientId}/pass/complianceFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void passComplianceAudit(@PathVariable int clientId, @RequestBody JSONObject passInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientComplianceApply.passComplianceFile(manager,clientId,passInfo); - } - - @ManagerMapping(value = "/{clientId}/pass/kycFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void passKycAudit(@PathVariable int clientId, @RequestBody JSONObject passInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientComplianceApply.passKycFile(manager,clientId,passInfo); - } - - @ManagerMapping(value = "/{clientId}/refuse/complianceFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void refuseComplianceAudit(@PathVariable int clientId, @RequestBody JSONObject refuseInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientComplianceApply.refuseComplianceFile(manager,clientId,refuseInfo); - } - - @ManagerMapping(value = "/{clientId}/refuse/kycFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void refuseKycAudit(@PathVariable int clientId, @RequestBody JSONObject refuseInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientComplianceApply.refuseKycFile(manager,clientId,refuseInfo); - } - - @RequestMapping(value = "/compliance/clientViewFiles/{clientMoniker}",method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject searchCompliances(@PathVariable String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - return clientManager.getComplianceFilesForClient(client); - } - - @RequestMapping(value = "/kyc/clientViewFiles/{clientMoniker}", method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject searchKycFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - return clientManager.getKycFilesForBD(client, manager, "operator"); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java b/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java deleted file mode 100644 index 0f3e12fa3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java +++ /dev/null @@ -1,84 +0,0 @@ -package au.com.royalpay.payment.manage.custom.beans; - - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; -/** - * @author kira - * @date 2018/7/27 - */ -public class AddCustomVO { - private String order_id; - private String custom; - private String mch_custom_id; - private String mch_custom_name; - private String mch_ext_custom_id; - private String mch_ext_custom_name; - private boolean has_sub; - private List subOrders; - - public String getOrder_id() { - return order_id; - } - - public void setOrder_id(String order_id) { - this.order_id = order_id; - } - - public String getCustom() { - return custom; - } - - public void setCustom(String custom) { - this.custom = custom; - } - - public String getMch_custom_id() { - return mch_custom_id; - } - - public void setMch_custom_id(String mch_custom_id) { - this.mch_custom_id = mch_custom_id; - } - - public String getMch_custom_name() { - return mch_custom_name; - } - - public void setMch_custom_name(String mch_custom_name) { - this.mch_custom_name = mch_custom_name; - } - - public String getMch_ext_custom_id() { - return mch_ext_custom_id; - } - - public void setMch_ext_custom_id(String mch_ext_custom_id) { - this.mch_ext_custom_id = mch_ext_custom_id; - } - - public String getMch_ext_custom_name() { - return mch_ext_custom_name; - } - - public void setMch_ext_custom_name(String mch_ext_custom_name) { - this.mch_ext_custom_name = mch_ext_custom_name; - } - - public boolean isHas_sub() { - return has_sub; - } - - public void setHas_sub(boolean has_sub) { - this.has_sub = has_sub; - } - - public List getSubOrders() { - return subOrders; - } - - public void setSubOrders(List subOrders) { - this.subOrders = subOrders; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java b/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java deleted file mode 100644 index 0f285f0ec..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java +++ /dev/null @@ -1,98 +0,0 @@ -package au.com.royalpay.payment.manage.custom.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * @author kira - * @date 2018/7/27 - */ -public class QueryCustomVo { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private String datefrom; - private String dateto; - private String channel; - private String report_status; - private int page = 1; - private int limit = 10; - - public JSONObject toParam() { - JSONObject result = new JSONObject(); - if (datefrom != null) { - try { - result.put("from", format.parse(datefrom)); - } catch (ParseException e) { - throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format"); - } - } - if (dateto != null) { - try { - result.put("to", DateUtils.addDays(format.parse(dateto), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format"); - } - } - if (StringUtils.isNotEmpty(channel)) { - result.put("channel", channel); - } - if(StringUtils.isNotEmpty(report_status)){ - result.put("report_status", report_status); - } - return result; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getDatefrom() { - return datefrom; - } - - public void setDatefrom(String datefrom) { - this.datefrom = datefrom; - } - - public String getDateto() { - return dateto; - } - - public void setDateto(String dateto) { - this.dateto = dateto; - } - - public String getChannel() { - return channel; - } - - public void setChannel(String channel) { - this.channel = channel; - } - - public String getReport_status() { - return report_status; - } - - public void setReport_status(String report_status) { - this.report_status = report_status; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java b/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java deleted file mode 100644 index 00de7944b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.custom.core; - -import au.com.royalpay.payment.manage.custom.beans.AddCustomVO; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * @author kira - * @date 2018/7/27 - */ -public interface CustomService { - - JSONObject findOneWithDetail(String report_id); - - void add(AddCustomVO addCustomVO); - - boolean check(int client_id, String channel); - - JSONObject query(JSONObject param, int page, int limit); - - List channelCustomConfigs(String channel); - - void resend(String report_id); - - JSONObject getCustomResult(String report_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java deleted file mode 100644 index 2b00aba51..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -package au.com.royalpay.payment.manage.custom.core.impl; - -import au.com.royalpay.payment.core.CustomSupport; -import au.com.royalpay.payment.core.beans.CustomReport; -import au.com.royalpay.payment.core.beans.OrderStatus; -import au.com.royalpay.payment.manage.custom.beans.AddCustomVO; -import au.com.royalpay.payment.manage.custom.core.CustomService; -import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper; -import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import javax.annotation.Resource; - -/** - * @author kira - * @date 2018/7/27 - */ -@Service -public class CustomServiceImpl implements CustomService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private CustomSupport customSupport; - @Resource - private CustomReportsMapper customReportsMapper; - @Resource - private CustomReportDetailsMapper customReportDetailsMapper; - - @Override - public JSONObject findOneWithDetail(String report_id) { - JSONObject result = customReportsMapper.findOne(report_id); - result.put("sub_orders", customReportDetailsMapper.findByReportId(report_id)); - try { - result.put("query_result", customSupport.queryCustomResult(report_id)); - } catch (Exception e) { - logger.error("Query Custom Declare status failure:", e); - } - return result; - } - - @Override - public void add(AddCustomVO addCustomVO) { - JSONObject report = customReportsMapper.findOne(addCustomVO.getOrder_id()); - if (report != null) { - throw new BadRequestException("report record exist"); - } - CustomReport customReport = new CustomReport(UUID.randomUUID().toString(), addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(), - addCustomVO.getCustom()); - customReport.addExtMchCustom(addCustomVO.getMch_ext_custom_id(), addCustomVO.getMch_ext_custom_name()); - if (!CollectionUtils.isEmpty(addCustomVO.getSubOrders())) { - addCustomVO.getSubOrders().forEach(p -> { - customReport.addSubOrder(p.getBigDecimal("order_fee"), p.getBigDecimal("order_fee").subtract(p.getBigDecimal("transport_fee")), p.getString("sub_order_no")); - }); - } - JSONObject result = customSupport.saveCustom(customReport); - customSupport.sendCustom(result.getString("report_id")); - } - - @Override - public boolean check(int client_id, String channel) { - List supportChannel = customSupport.customSupportedChannels(client_id); - boolean result = false; - for (String p : supportChannel) { - if (p.equals(channel)) { - result = true; - break; - } - } - return result; - } - - @Override - public JSONObject query(JSONObject param, int page, int limit) { - param.put("orderStatus", OrderStatus.SUCCESS.getStatus()); -// List channels = customSupport.customSupportedChannels(param.getIntValue("client_id")); - List channels = new ArrayList<>(); - channels.add("Wechat"); - channels.add("Alipay"); - channels.add("AlipayOnline"); - param.put("channels", channels); - if (!StringUtils.isEmpty(param.getString("channel"))) { - channels.clear(); - channels.add(param.getString("channel")); - param.put("channels", channels); - } - return PageListUtils.buildPageListResult(customReportsMapper.queryWithTrans(param, new PageBounds(page, limit))); - } - - @Override - public List channelCustomConfigs(String channel) { - return customSupport.channelCustomConfigs(channel); - } - - @Override - public void resend(String report_id) { -// JSONObject report = customReportsMapper.findOne(report_id); -// if (report.getIntValue("report_status") != 2) { -// throw new BadRequestException("order can't report"); -// } - customSupport.resendCustom(report_id); - - } - - @Override - public JSONObject getCustomResult(String report_id) { - return customSupport.queryCustomResult(report_id); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/package-info.java b/src/main/java/au/com/royalpay/payment/manage/custom/package-info.java deleted file mode 100644 index dfb3f0e26..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @author kira - * @date 2018/7/27 - */ -package au.com.royalpay.payment.manage.custom; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/task/CustomQueryTask.java b/src/main/java/au/com/royalpay/payment/manage/custom/task/CustomQueryTask.java deleted file mode 100644 index 8b04825a6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/task/CustomQueryTask.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.custom.task; - -import au.com.royalpay.payment.core.CustomSupport; -import au.com.royalpay.payment.core.mappers.PmtCustomReportMapper; -import com.alibaba.fastjson.JSONObject; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @Author: james7whm - * @Date: 2019/4/2 18:11 - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class CustomQueryTask { - @Resource - private CustomSupport customSupport; - - @Resource - private PmtCustomReportMapper pmtCustomReportMapper; - - @Scheduled(cron = "0 0/10 * * * *") - public void customReportQuery() { - List reports = pmtCustomReportMapper.findCustomReportNotScucess(); - reports.forEach(report -> { - try { - customSupport.queryCustomResult(report.getString("report_id")); - } catch (Exception e) { - //donothing - } - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java b/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java deleted file mode 100644 index 7127b90a8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.custom.web; - -import au.com.royalpay.payment.manage.custom.beans.AddCustomVO; -import au.com.royalpay.payment.manage.custom.beans.QueryCustomVo; -import au.com.royalpay.payment.manage.custom.core.CustomService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -@RestController -@PartnerMapping(value = "/custom") -public class CustomController { - - @Resource - private CustomService customService; - - @GetMapping("/{report_id}") - public JSONObject findOne(@PathVariable String report_id) { - return customService.findOneWithDetail(report_id); - } - - @GetMapping("/query") - public JSONObject queryWithTran(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, QueryCustomVo queryCustomVo) { - JSONObject param = queryCustomVo.toParam(); - param.put("client_id", partner.getIntValue("client_id")); - return customService.query(param, queryCustomVo.getPage(), queryCustomVo.getLimit()); - } - - @PostMapping("") - @ResponseBody - public void add(@RequestBody AddCustomVO addCustomVO) { - customService.add(addCustomVO); - } - - @GetMapping("/channelCustom") - public List channelCustomConfigs(@RequestParam String channel) { - return customService.channelCustomConfigs(channel); - } - - @PostMapping("/{report_id}/resend") - public void resend(@PathVariable String report_id) { - customService.resend(report_id); - } - - @GetMapping("/{report_id}/customResult") - public void getCustomResult(@PathVariable String report_id) { - customService.getCustomResult(report_id); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/beans/CustomerComment.java b/src/main/java/au/com/royalpay/payment/manage/customers/beans/CustomerComment.java deleted file mode 100644 index 7e8b157bc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/beans/CustomerComment.java +++ /dev/null @@ -1,81 +0,0 @@ -package au.com.royalpay.payment.manage.customers.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -import java.util.Date; - -public class CustomerComment { - - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "first_name") - private String firstName; - - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "last_name") - private String lastName; - - @NotEmpty(message = "error.payment.valid.param_missing") - private String email; - - private String comment; - - @JSONField(name = "create_time") - private Date createTime; - - private int status; - - public JSONObject insertObject() { - return (JSONObject) JSON.toJSON(this); - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getComment() { - return comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/beans/EncourageEventParameters.java b/src/main/java/au/com/royalpay/payment/manage/customers/beans/EncourageEventParameters.java deleted file mode 100644 index d17cad2ec..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/beans/EncourageEventParameters.java +++ /dev/null @@ -1,97 +0,0 @@ -package au.com.royalpay.payment.manage.customers.beans; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * 鼓励金配置信息 - * Created by yixian on 2017-04-30. - */ -public class EncourageEventParameters { - @JSONField(name = "from_date") - @NotEmpty - private String fromDate; - @JSONField(name = "to_date") - @NotEmpty - private String toDate; - @JSONField(name = "crit_rate") - private int critRate = 0;//翻倍暴击率 - @NotNull - @JSONField(name = "max_crit") - private BigDecimal maxCrit; //最大倍率 - @JSONField(name = "min_amount") - private BigDecimal minAmount = BigDecimal.ZERO;//鼓励金最小金额 - @JSONField(name = "max_amount") - @NotNull - private BigDecimal maxAmount;//鼓励金最大金额 - @JSONField(name = "max_count") - private int maxCount = 3;//鼓励金每日最大领取次数 - @JSONField(name = "min_pay") - @NotNull - private BigDecimal minPay;//最低支付金额 - @JSONField(name = "debug_mode") - private boolean debugMode = false;//测试轮(只允许开发者领取和抵扣) - - public JSONObject toJSON() { - JSONObject json = new JSONObject(); - DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - try { - json.put("from_date",format.parse(fromDate)); - json.put("to_date",format.parse(toDate)); - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - json.put("crit_rate",critRate); - json.put("max_crit",maxCrit); - json.put("min_amount",minAmount); - json.put("max_amount",maxAmount); - json.put("max_count",maxCount); - json.put("min_pay",minPay); - json.put("debug_mode",debugMode); - return json; - } - - public void setFromDate(String fromDate) { - this.fromDate = fromDate; - } - - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public void setCritRate(int critRate) { - this.critRate = critRate; - } - - public void setMinAmount(BigDecimal minAmount) { - this.minAmount = minAmount; - } - - public void setMaxAmount(BigDecimal maxAmount) { - this.maxAmount = maxAmount; - } - - public void setMaxCount(int maxCount) { - this.maxCount = maxCount; - } - - public void setMinPay(BigDecimal minPay) { - this.minPay = minPay; - } - - public void setDebugMode(boolean debugMode) { - this.debugMode = debugMode; - } - - public void setMaxCrit(BigDecimal maxCrit) { - this.maxCrit = maxCrit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/beans/GatewayParams.java b/src/main/java/au/com/royalpay/payment/manage/customers/beans/GatewayParams.java deleted file mode 100644 index f3479e792..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/beans/GatewayParams.java +++ /dev/null @@ -1,59 +0,0 @@ -package au.com.royalpay.payment.manage.customers.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import org.apache.commons.lang3.StringUtils; -import javax.validation.constraints.NotEmpty; - -import javax.validation.constraints.Pattern; - -/** - * Created by yixian on 2016-07-09. - */ -public class GatewayParams { - @NotEmpty(message = "error.payment.valid.param_missing") - private String nonce_str; - @NotEmpty(message = "error.payment.valid.param_missing") - private String sign; - @NotEmpty(message = "error.payment.valid.param_missing") - @Pattern(regexp = "^\\d{10,15}$", message = "error.payment.valid.invalid_time") - private String time; - - public void valid() { - if (StringUtils.isEmpty(nonce_str)) { - throw new ParamInvalidException("nonce_str", "error.payment.valid.param_missing"); - } - if (StringUtils.isEmpty(sign)) { - throw new ParamInvalidException("sign", "error.payment.valid.param_missing"); - } - if (StringUtils.isEmpty("time")) { - throw new ParamInvalidException("time", "error.payment.valid.param_missing"); - } - if (!time.matches("^\\d{10,15}$")) { - throw new ParamInvalidException("time", "error.payment.valid.invalid_time"); - } - } - - public String getNonce_str() { - return nonce_str; - } - - public void setNonce_str(String nonce_str) { - this.nonce_str = nonce_str; - } - - public String getSign() { - return sign; - } - - public void setSign(String sign) { - this.sign = sign; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/beans/ReceiveLogQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/customers/beans/ReceiveLogQueryBean.java deleted file mode 100644 index 4051113d3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/beans/ReceiveLogQueryBean.java +++ /dev/null @@ -1,69 +0,0 @@ -package au.com.royalpay.payment.manage.customers.beans; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * Created by yixian on 2017-05-01. - */ -public class ReceiveLogQueryBean { - - private String orderId; - - private String clientMoniker; - private String date; - private int page=1; - private int limit=10; - - public JSONObject toParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(orderId)) { - param.put("order_id", orderId); - } - if (StringUtils.isNotBlank(clientMoniker)) { - param.put("client_moniker", clientMoniker); - } - if (date != null) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); - param.put("date", dt); - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - } - return param; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public void setDate(String date) { - this.date = date; - } - - public int getPage() { - return page; - } - - public int getLimit() { - return limit; - } - - public void setPage(int page) { - this.page = page; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java deleted file mode 100644 index 5756026df..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yuan on 2017/10/10. - */ -public interface CouponValidateService { - - JSONObject getCoupon(JSONObject partner, int page, int limit); - - JSONObject getCouponById(JSONObject partner, String coupon_log_id); - - //使用后核销券 - boolean useCoupon(String couponLogId); - - JSONObject getPaymentManager(); - - JSONObject ctripCheck(int client_id); - - JSONObject ctripCouponInfo(String coupon_log_id,int client_id,boolean is_expiry); - - JSONObject ctripCouponLogNotice(String coupon_log_id,String order_id,String open_id,String status); - - JSONObject getHalloweenOrderInfo(String customerId, String transactionDate); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerCommentService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerCommentService.java deleted file mode 100644 index 0de3f5971..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerCommentService.java +++ /dev/null @@ -1,8 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core; - -import au.com.royalpay.payment.manage.customers.beans.CustomerComment; - -public interface CustomerCommentService { - - void save(CustomerComment customerComment); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPaymentInfoService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPaymentInfoService.java deleted file mode 100644 index ed472ea8c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPaymentInfoService.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core; - -import com.alibaba.fastjson.JSONObject; - -public interface CustomerPaymentInfoService { - - void save(JSONObject paymentInfo); - - void update(JSONObject paymentInfo); - - JSONObject selectPaymentInfoByOpenId(String open_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java deleted file mode 100644 index f47965685..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core; - -import au.com.royalpay.payment.manage.customers.beans.GatewayParams; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; - -/** - * Created by yishuqian on 24/04/2017. - */ -public interface CustomerPointsService { - void PreSendOrderPoints(String orderId, Double amount, String openId, int use_point); - - @Transactional - void afterPaymentPointsHandle(String orderId, Double amount, String openId); - - int getCurrentPoints(String openId); - - void checkSign(GatewayParams params, boolean checkTimeout); - - int getOldPoints(String customer_id, String channel); - - int checkPointsAfterPay(String order_id); - - BigDecimal checkLotteryAfterPay(String order_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerRewardLogService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerRewardLogService.java deleted file mode 100644 index 87faf2ff2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerRewardLogService.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core; - -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletRequest; - -public interface CustomerRewardLogService { - JSONObject takeReward(String openid,String channel); - - JSONObject getRewardDetail(String reward_id); - - void saveReward(int type2,int type3,String type1,String date); - - void checkRedpacksStatus(String rewardId,String sendListId); - - void reSendRedPacks(); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/EncourageService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/EncourageService.java deleted file mode 100644 index a0aa8f94f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/EncourageService.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core; - -import au.com.royalpay.payment.manage.customers.beans.EncourageEventParameters; -import au.com.royalpay.payment.manage.customers.beans.ReceiveLogQueryBean; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-04-25. - */ -public interface EncourageService { - - JSONObject currentEncourageConfig(); - - JSONObject takeEncourageMoney(String orderId, String visitorOpenId); - - JSONObject doubleEncourageMoney(String orderId); - - JSONObject getBalanceStatus(String openid); - - List listEvents(); - - JSONObject eventReport(String eventId); - - void updateParameters(String eventId, EncourageEventParameters parameters); - - JSONObject newEvent(EncourageEventParameters parameters); - - JSONObject listReceiveLogs(String eventId, ReceiveLogQueryBean query); - - JSONObject listUseLogs(String eventId, int page, int limit); - - void prepareUserInfo(JSONObject user, String user_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java deleted file mode 100644 index 5163f7f79..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java +++ /dev/null @@ -1,289 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.manage.customers.core.CouponValidateService; -import au.com.royalpay.payment.manage.mappers.customers.CustomerMembershipMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.http.NameValuePair; -import org.apache.http.message.BasicNameValuePair; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - - -/** - * Created by yuan on 2017/10/10. - */ -@Service -public class CouponValidateServiceImpl implements CouponValidateService { - - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${app.customer.host}") - private String CUSTOMER_HOST; - - @Value("${customer.app.appid}") - private String CUSTOMER_APP_ID; - - @Value("${customer.app.auth-code}") - private String CUSTOMER_AUTH_CODE; - - @Resource - private CustomerMembershipMapper customerMembershipMapper; - @Resource - private ClientManager clientManager; - - @Resource - private OrderMapper orderMapper; - - @Resource - private CustomerMapper customerMapper; - - @Override - public JSONObject getCoupon(JSONObject partner,int page,int limit) { - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/payment/vercoupons") - .queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp) - .queryParam("sign", sign) - .queryParam("client_moniker", partner.getString("client_moniker")) - .queryParam("client_id", partner.getString("client_id")) - .queryParam("page", page) - .queryParam("limit", limit) - .toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); - JSONObject json = new JSONObject(); - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - json = result.getResponseContentJSONObj(); - if (json != null) { - return json; - } - } - - } catch (Exception ignored) { - ignored.printStackTrace(); - } - return json; - } - - @Override - public JSONObject getCouponById(JSONObject partner,String couponLogId) { - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/payment/" + couponLogId + "/getcoupon") - .queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp) - .queryParam("sign", sign) - .queryParam("client_moniker", partner.getString("client_moniker")) - .toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); - JSONObject coupon = null; - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - coupon = result.getResponseContentJSONObj(); - } - } catch (Exception e) { - e.printStackTrace(); - throw new BadRequestException("未查到此优惠券,请稍后重试!"); - } - checkCoupon(coupon,partner); - return coupon; - } - - private void checkCoupon(JSONObject coupon,JSONObject partner){ - if(null == coupon || coupon.size() < 0){ - throw new BadRequestException("未查到此优惠券,请确认券码是否正确"); - } - if(!coupon.getString("client_moniker").equals(partner.getString("client_moniker"))){ - throw new BadRequestException("此优惠券不属于您"); - } - if(DateUtils.addDays(coupon.getDate("expiry"), 1).before(new Date())){ - throw new BadRequestException("此优惠券已过有效期"); - } - if(coupon.getIntValue("status") == 0){ - throw new BadRequestException("此优惠券已失效"); - } - if(coupon.getIntValue("status") == 3){ - throw new BadRequestException("此优惠券已使用过"); - } - } - - - //使用后核销券 - @Override - public boolean useCoupon(String couponLogId) { - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/payment/" + couponLogId + "/use") - .queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp) - .queryParam("sign", sign).toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.PUT); - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - return true; - } - return false; - } catch (Exception ignored) { - logger.error("积分商城优惠券 [" + couponLogId + "]核销失败"); - ignored.printStackTrace(); - } - return false; - } - - @Override - public JSONObject getPaymentManager() { - JSONObject object = new JSONObject(); - object.put("managers",customerMembershipMapper.listPaymentManagerByCus()); - return object; - } - - @Override - public JSONObject ctripCheck(int client_id) { - JSONObject client = clientManager.getClientInfo(client_id); - if(client==null){ - throw new NotFoundException("Merchant Not Found"); - } - String uri = signUrl(UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/"+client.getString("client_moniker")+"/enableCtrip")); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); - try { - HttpRequestResult reqResult = gen.execute(); - if (reqResult.isSuccess()) { - return reqResult.getResponseContentJSONObj(); - } - } catch (Exception ignored) { - } - return null; - } - - @Override - public JSONObject ctripCouponInfo(String coupon_id, int client_id, boolean is_expiry) { - JSONObject client = clientManager.getClientInfo(client_id); - if(client==null){ - throw new NotFoundException("Merchant Not Found"); - } - String uri = signUrl(UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "/coupon/"+coupon_id+"/couponLogInfo")); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); - gen.addQueryString("client_moniker",client.getString("client_moniker")); - if (!is_expiry) { - gen.addQueryString("is_expiry", "0"); - } - try { - HttpRequestResult reqResult = gen.execute(); - if (reqResult.isSuccess()) { - return reqResult.getResponseContentJSONObj(); - } - } catch (Exception ignored) { - } - return null; - } - - @Override - public JSONObject ctripCouponLogNotice(String coupon_id, String order_id, String open_id,String status) { - String uri = signUrl(UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/"+coupon_id+"/addCtripCouponLog")); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.POST); - List params = new ArrayList<>(); - params.add(new BasicNameValuePair("order_id", order_id)); - params.add(new BasicNameValuePair("openid", open_id)); - params.add(new BasicNameValuePair("status", status)); - gen.setFormStringEntity(params); - try { - HttpRequestResult reqResult = gen.execute(); - if (reqResult.isSuccess()) { - return reqResult.getResponseContentJSONObj(); - } - } catch (Exception ignored) { - } - return null; - } - - @Override - public JSONObject getHalloweenOrderInfo(String customerId, String transactionDate) { - List orderList = new ArrayList<>(); - JSONObject relation = customerMapper.findCustomerBykangaId(customerId); - if (relation.containsKey("wechat_openid")) { - JSONObject param = new JSONObject(); - param.put("customer_id", relation.getString("wechat_openid")); - param.put("transaction_date", transactionDate); - param.put("status", 5); - List orderListWechat = orderMapper.listHalloweenActOrder(param); - if(orderListWechat!=null){ - orderList.addAll(orderListWechat); - } - } - if (relation.containsKey("globalpay_openid")) { - JSONObject param = new JSONObject(); - param.put("customer_id", relation.getString("globalpay_openid")); - param.put("transaction_date", transactionDate); - param.put("status", 5); - List orderListGlobal = orderMapper.listHalloweenActOrder(param); - if(orderListGlobal!=null){ - orderList.addAll(orderListGlobal); - } - } - // 获取万圣节活动当天支付成功的订单 - JSONObject result = null; - if (orderList != null && !orderList.isEmpty()) { - result = new JSONObject(); - result.put("orderList", orderList); - for (JSONObject order : orderList) { - String redpackOpenId = getRedpackId(order); - if (redpackOpenId != null) { - result.put("redpackOpenId", redpackOpenId); - break; - } - } - } - return result; - } - - // 获取该笔订单的redpackOpenId - // TODO: 2018/10/28 有待商榷 - private String getRedpackId(JSONObject order) { - String redpackOpenId = null; - String channel = order.getString("channel"); - if ("Wechat".equals(channel)) { - JSONObject customerRelation = customerMapper.findCustomerByOpenId(order.getString("customer_id")); - if (customerRelation == null) { - customerRelation = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id")); - } else { - redpackOpenId = customerRelation.getString("redpack_openid"); - if (customerRelation.getString("kanga_openid") == null) { - redpackOpenId = null; - } - } - } - return redpackOpenId; - } - - private String signUrl(UriComponentsBuilder uriComponentsBuilder) { - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - return uriComponentsBuilder.queryParam("appid", CUSTOMER_APP_ID).queryParam("timestamp", timestamp).queryParam("sign", sign).toUriString(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerCommentServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerCommentServiceImpl.java deleted file mode 100644 index 1a0ead10f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerCommentServiceImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.manage.customers.beans.CustomerComment; -import au.com.royalpay.payment.manage.customers.core.CustomerCommentService; -import au.com.royalpay.payment.manage.mappers.system.SysCustomerCommentMapper; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; - -@Service -public class CustomerCommentServiceImpl implements CustomerCommentService { - - @Resource - private SysCustomerCommentMapper customerCommentMapper; - - @Override - public void save(CustomerComment customerComment) { - customerComment.setCreateTime(new Date()); - customerCommentMapper.save(customerComment.insertObject()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerHalloweenCountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerHalloweenCountServiceImpl.java deleted file mode 100644 index 00c44643a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerHalloweenCountServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.digest.DigestUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -@Service -public class CustomerHalloweenCountServiceImpl implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${app.customer.host}") - private String CUSTOMER_HOST; - - @Value("${customer.app.appid}") - private String CUSTOMER_APP_ID; - - @Value("${customer.app.auth-code}") - private String CUSTOMER_AUTH_CODE; - - @Resource - private CustomerMapper customerMapper; - - @Override - public void onApplicationEvent(AfterPaymentFinishEvent event) { - final JSONObject order = event.getFinishedEvent().getOrder(); - //判断是否是pine测试商户,若不是则判断是否在活动时间 - if (order.getIntValue("client_id") != 9) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date newDay = new Date(); - try { - if (newDay.compareTo(sdf.parse("2018-10-31 00:00:00")) < 0) { - return; - } - if (newDay.compareTo(sdf.parse("2018-11-02 00:00:00")) > 0) { - return; - } - } catch (ParseException e) { - - } - } - BigDecimal clearAmount = event.getFinishedEvent().getAudFee(); - String channel = order.getString("channel"); - if ("Wechat".equals(channel)) { - JSONObject customerRelation = customerMapper.findCustomerByOpenId(order.getString("customer_id")); - if (customerRelation == null) { - customerRelation = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id")); - } - if (customerRelation.getString("kanga_openid") == null) { - return; - } - afterPaymentAddHalloweenCount(customerRelation.getString("kanga_openid"), order.getString("order_id"), customerRelation.getString("redpack_openid"),channel, clearAmount); - } - if ("Alipay".equals(channel)) { - afterPaymentAddHalloweenCount(order.getString("customer_id"), order.getString("order_id"), "alipay",channel, clearAmount); - } - } - - private void afterPaymentAddHalloweenCount(String id, String orderId,String redPackId, String channel, BigDecimal clearAmount) { - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "activity/halloween/payment/orders") - .queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp) - .queryParam("sign", sign) - .queryParam("id", id) - .queryParam("orderId", orderId) - .queryParam("channel", channel) - .queryParam("amount", clearAmount) - .queryParam("redpackId", redPackId) - .toUriString(); - if(clearAmount.compareTo(new BigDecimal("1.99"))<0){ - return; - } - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.POST); - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - int statusCode = result.getStatusCode(); - if (statusCode == 200) { - logger.info("万圣节活动次数添加成功"); - } - } - - } catch (Exception ignored) { - ignored.printStackTrace(); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java deleted file mode 100644 index fb2296368..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.digest.DigestUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -@Service -public class CustomerLotteryCountServiceImpl implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${app.customer.host}") - private String CUSTOMER_HOST; - - @Value("${customer.app.appid}") - private String CUSTOMER_APP_ID; - - @Value("${customer.app.auth-code}") - private String CUSTOMER_AUTH_CODE; - - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private CustomerMapper customerMapper; - - @Override - public void onApplicationEvent(AfterPaymentFinishEvent event) { - final JSONObject order = event.getFinishedEvent().getOrder(); - //判断是否是pine测试商户,若不是则判断是否在活动时间 - if (order.getIntValue("client_id") != 9) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date newDay = new Date(); - try { - if (newDay.compareTo(sdf.parse("2018-09-24 00:00:00")) < 0) { - return; - } - if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) { - return; - } - } catch (ParseException e) { - - } - } - BigDecimal clearAmount = event.getFinishedEvent().getAudFee(); - String channel = order.getString("channel"); - if ("Wechat".equals(channel)) { - JSONObject customerRelation = customerMapper.findCustomerByOpenId(order.getString("customer_id")); - if (customerRelation == null) { - customerRelation = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id")); - } - if (customerRelation.getString("kanga_openid") == null) { - return; - } - afterPaymentAddLotteryCount(customerRelation.getString("kanga_openid"), order.getString("order_id"), channel, clearAmount); - } - if ("Alipay".equals(channel)) { - afterPaymentAddLotteryCount(order.getString("customer_id"), order.getString("order_id"), channel, clearAmount); - } - } - - private void afterPaymentAddLotteryCount(String id, String orderId, String channel, BigDecimal clearAmount) { - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "activity/luck_draw/payment/lottery/count") - .queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp) - .queryParam("sign", sign) - .queryParam("id", id) - .queryParam("orderId", orderId) - .queryParam("channel", channel) - .queryParam("amount", clearAmount) - .toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.POST); - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - int statusCode = result.getStatusCode(); - if (statusCode == 200) { - logger.info("抽奖次数添加成功"); - } - } - - } catch (Exception ignored) { - ignored.printStackTrace(); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerNicknameDownloader.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerNicknameDownloader.java deleted file mode 100644 index 4ccc8bb34..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerNicknameDownloader.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-06-29. - */ -@Service -public class CustomerNicknameDownloader implements ApplicationListener { - @Resource - private CustomerMapper customerMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - - @Override - public void onApplicationEvent(AfterPaymentFinishEvent event) { - final JSONObject order = event.getFinishedEvent().getOrder(); - String channel = order.getString("channel"); - if ("Wechat".equals(channel)) { - royalThreadPoolExecutor.execute(() -> checkNickname(order.getString("customer_id"))); - } - } - - private void checkNickname(String customerId) { - JSONObject user = customerMapper.findCustomerByOpenId(customerId); - if (user != null && user.getString("nickname") == null) { - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - JSONObject userinfo = api.userInfoFromWechat(customerId); - if (userinfo.getIntValue("subscribe") == 1) { - user.put("nickname", userinfo.getString("nickname")); - user.put("headimg", userinfo.getString("headimgurl")); - user.put("sex", userinfo.getIntValue("sex")); - customerMapper.update(user); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPaymentInfoImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPaymentInfoImpl.java deleted file mode 100644 index 6e40b71a0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPaymentInfoImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService; -import au.com.royalpay.payment.manage.mappers.system.SysCustomerPaymentInfoMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.id.IdUtil; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -@Service -public class CustomerPaymentInfoImpl implements CustomerPaymentInfoService { - @Resource - private SysCustomerPaymentInfoMapper sysCustomerPaymentInfoMapper; - - @Override - public void save(JSONObject paymentInfo) { - if (sysCustomerPaymentInfoMapper.selectPaymentInfo(paymentInfo.getString("wechat_openid")) != null) { - throw new BadRequestException("openid already exists"); - } - - paymentInfo.put("id", IdUtil.getId()); - sysCustomerPaymentInfoMapper.save(paymentInfo); - } - - @Override - public void update(JSONObject paymentInfo) { - if (paymentInfo.getString("id") == null) { - throw new BadRequestException("ID is empty"); - } - sysCustomerPaymentInfoMapper.update(paymentInfo); - } - - @Override - public JSONObject selectPaymentInfoByOpenId(String open_id) { - return sysCustomerPaymentInfoMapper.selectPaymentInfo(open_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java deleted file mode 100644 index 750b48835..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java +++ /dev/null @@ -1,317 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.core.exceptions.SignInvalidException; -import au.com.royalpay.payment.core.exceptions.SignTimeoutException; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.customers.beans.GatewayParams; -import au.com.royalpay.payment.manage.customers.core.CustomerPointsService; -import au.com.royalpay.payment.manage.mappers.customers.CustomerMembershipMapper; -import au.com.royalpay.payment.manage.mappers.customers.CustomerPointsMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; - -/** - * Created by yishuqian on 24/04/2017. - */ -@Service -public class CustomerPointsServiceImp implements CustomerPointsService { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${app.customer.host}") - private String CUSTOMER_HOST; - - @Value("${customer.app.appid}") - private String CUSTOMER_APP_ID; - - @Value("${customer.app.auth-code}") - private String CUSTOMER_AUTH_CODE; - - @Resource - private OrderMapper orderMapper; - @Resource - private CustomerMapper customerMapper; - @Resource - private CustomerPointsMapper customerPointsMapper; - @Resource - private CustomerMembershipMapper customerMembershipMapper; - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - - private String auth_code = "w2DgCF2cvlNHo3R6"; - - /** - * 创建订单时预先插入积分记录 - * - * @param orderId - * @param amount customer paid amount - * @param openId payment openid - * @param use_point - */ - @Override - public void PreSendOrderPoints(String orderId, Double amount, String openId, int use_point) { - JSONObject customer = customerMembershipMapper.findByPaymentOpenId(openId); - if (customer == null) { - return; - } - int balancePoints = customer.getIntValue("member_point"); - if (use_point > balancePoints) { - throw new BadRequestException("Used points is more than owned points"); - } - JSONObject pointLog = new JSONObject(); - pointLog.put("member_id", customer.getString("member_id")); - pointLog.put("order_id", orderId); - pointLog.put("event_time", new Date()); - pointLog.put("current_points", customer.getIntValue("member_point")); - pointLog.put("in_points", Math.floor(amount / 10)); - pointLog.put("out_points", use_point); - pointLog.put("expire_date", DateUtils.addYears(new Date(), 1)); - customerPointsMapper.save(pointLog); - } - - /** - * 支付成功后获取积分 - * - * @param orderId - * @param amount - * @param openId - */ - @Transactional - @Override - public void afterPaymentPointsHandle(String orderId, Double amount, String openId) { - JSONObject customer = customerMembershipMapper.findByPaymentOpenId(openId); - if (customer == null) { - return; - } - int currentPoints = customer.getIntValue("member_point");//累加前积分数 - JSONObject pointLog = customerPointsMapper.getPointLog(orderId, customer.getString("member_id")); - if (pointLog == null) {//未使用积分 - int addPoints = (int) Math.floor(amount / 10); - currentPoints = currentPoints + addPoints;//累加后积分数 - pointLog = new JSONObject(); - pointLog.put("member_id", customer.getString("member_id")); - pointLog.put("order_id", orderId); - pointLog.put("event_time", new Date()); - pointLog.put("current_points", currentPoints); - pointLog.put("in_points", addPoints); - pointLog.put("out_points", 0); - pointLog.put("expire_date", DateUtils.addYears(new Date(), 1));//积分有限期一年 - pointLog.put("status", 1); - customerPointsMapper.save(pointLog); - } else {//使用积分 - currentPoints = currentPoints + pointLog.getIntValue("in_points") - pointLog.getIntValue("out_points"); - pointLog.put("current_points", currentPoints); - pointLog.put("status", 1); - customerPointsMapper.update(pointLog); - } - int flag = customerMembershipMapper.updateCustomerPoints(customer.getString("member_id"), currentPoints); - if (flag < 1) { - throw new NotFoundException("update customers points failure"); - } - } - - /** - * 退款扣除积分 - * - * @param orderId - * @param refundAmount - * @param openId - */ - public void handleAfterRefund(String orderId, int refundId, Double refundAmount, String openId) { - JSONObject customer = customerMembershipMapper.findByPaymentOpenId(openId); - if (customer == null) { - return; - } - int currentPoints = customer.getIntValue("member_point");//累加前积分数 - JSONObject pointLog = customerPointsMapper.getPointLog(orderId, customer.getString("member_id")); - if (pointLog == null) { - return; - } - if (pointLog.getIntValue("status") == 1) { - int outPoints = (int) Math.floor(refundAmount / 10); - currentPoints = currentPoints - outPoints;//累加后积分数 - JSONObject refundPoints = new JSONObject(); - refundPoints.put("member_id", customer.getString("member_id")); - refundPoints.put("order_id", orderId); - refundPoints.put("event_time", new Date()); - refundPoints.put("current_points", currentPoints); - refundPoints.put("out_points", outPoints); - refundPoints.put("status", 1); - refundPoints.put("refund_id", refundId); - refundPoints.put("remark", "退款扣积分"); - customerPointsMapper.save(pointLog); - if (outPoints > 0) { - customerMembershipMapper.updateCustomerPoints(customer.getString("member_id"), currentPoints); - } - } - } - - /** - * 获取会员目前积分 - * - * @param openId - * @return - */ - @Override - public int getCurrentPoints(String openId) { - JSONObject customer = customerMembershipMapper.findByPaymentOpenId(openId); - if (customer == null) { - JSONObject customer_rel = customerMapper.findCustomerByOpenId(openId); - if (customer_rel == null) { - return 0; - } - int member_point = getOldPoints(openId); - customer = new JSONObject(); - customer.put("payment_openid", openId); - customer.put("kanga_openid", customer_rel.getString("kanga_openid")); - customer.put("redpack_openid", customer_rel.getString("redpack_openid")); - customer.put("attend_time", new Date()); - customer.put("member_point", member_point); - customerMembershipMapper.saveMember(customer); - //增加初始化积分记录 - JSONObject pointLog = new JSONObject(); - pointLog.put("member_id", customer.getString("member_id")); - pointLog.put("order_id", "0"); - pointLog.put("event_time", new Date()); - pointLog.put("current_points", member_point); - pointLog.put("in_points", member_point); - pointLog.put("expire_date", DateUtils.addYears(new Date(), 1));//积分有限期一年 - pointLog.put("status", 1); - pointLog.put("remark", "第一次积分初始化"); - customerPointsMapper.save(pointLog); - return member_point; - } - int member_point = customer.getIntValue("member_point"); - if (member_point == -1) { - member_point = getOldPoints(openId); - customer.put("member_point", member_point); - customerMembershipMapper.updateCustomerPoints(customer.getString("member_id"), member_point); - } else { - int outofdatePoints = getOutofdatePoints(customer.getString("member_id"), new Date()); - //add 过期积分扣除记录 - if (outofdatePoints > 0) { - member_point = member_point - outofdatePoints; - JSONObject pointLog = new JSONObject(); - pointLog.put("member_id", customer.getString("member_id")); - pointLog.put("order_id", "0"); - pointLog.put("event_time", new Date()); - pointLog.put("current_points", member_point); - pointLog.put("out_points", outofdatePoints); - pointLog.put("status", 1); - pointLog.put("remark", "过期积分扣除"); - customerPointsMapper.save(pointLog); - //update 会员信息账户的积分 - customer.put("member_point", member_point); - customerMembershipMapper.updateCustomerPoints(customer.getString("member_id"), member_point); - } - - } - return member_point; - - } - - @Override - public void checkSign(GatewayParams params, boolean checkTimeout) { - long time = Long.parseLong(params.getTime()); - - long now = Calendar.getInstance(TimeZone.getTimeZone("UTC")).getTimeInMillis(); - if (checkTimeout && Math.abs(now - time) > 300_000) {//5min - throw new SignTimeoutException(); - } - String validStr = time + "&" + params.getNonce_str() + "&" + auth_code; - if (!StringUtils.equals(DigestUtils.sha256Hex(validStr).toLowerCase(), params.getSign().toLowerCase())) { - logger.error("Sign Invalid:" + validStr + "<--->" + params.getSign()); - throw new SignInvalidException(); - } - } - - /** - * 获取初始化积分 - * - * @param openId - */ - - private int getOldPoints(String openId) { - return orderMapper.getOldOrdersPoints(openId); - } - - /** - * @param openId 袋鼠星球openid - * @param channel wechat、alipay - * @return - */ - //开放给积分商城 - public int getOldPoints(String openId, String channel) { - switch (channel) { - case "wechat": - JSONObject customer_rel = customerMapper.findCustomerBykangaOpenid(openId); - if (customer_rel != null) { - return getOldPoints(customer_rel.getString("wechat_openid")); - } - return 0; - default: - return getOldPoints(openId); - } - } - - @Override - public int checkPointsAfterPay(String order_id) { - JSONObject order = orderMapper.find(order_id); - if (StringUtils.equals("CNY", order.getString("currency"))) { - return (int) Math.floor(order.getDouble("customer_payment_amount") / 50); - }else { - return (int) Math.floor(order.getDouble("customer_payment_amount") / 10); - } - } - - @Override - public BigDecimal checkLotteryAfterPay(String order_id) { - JSONObject order = transactionAnalysisMapper.getOrderClearAmount(order_id); - if (order.getIntValue("client_id") != 9) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date newDay = new Date(); - try { - if (newDay.compareTo(sdf.parse("2018-09-24 00:00:00")) < 0) { - return BigDecimal.valueOf(0); - } - if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) { - return BigDecimal.valueOf(0); - } - } catch (ParseException e) { - - } - } - return order.getBigDecimal("clearing_amount"); - } - - /** - * 获取过期积分 - * - * @param memberId - * @param date - * @return - */ - public int getOutofdatePoints(String memberId, Date date) { - return customerPointsMapper.getOuttimePoints(memberId, date); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerRewardLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerRewardLogServiceImpl.java deleted file mode 100644 index fc087c270..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerRewardLogServiceImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.manage.customers.core.CustomerRewardLogService; -import au.com.royalpay.payment.manage.mappers.customers.CusRewardConfigMapper; -import au.com.royalpay.payment.manage.mappers.customers.CusRewardCouponMapper; -import au.com.royalpay.payment.manage.mappers.customers.CusRewardLogsMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.ParseException; -import java.util.Date; -import java.util.List; - - -/** - * @Author: james7whm - * @Date: 2019/1/17 16:56 - */ -@Service -public class CustomerRewardLogServiceImpl implements CustomerRewardLogService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private OrderMapper orderMapper; - @Resource - private CusRewardConfigMapper cusRewardConfigMapper; - @Resource - private CusRewardLogsMapper cusRewardLogsMapper; - @Resource - private CusRewardCouponMapper cusRewardCouponMapper; - @Resource - private CustomerMapper customerMapper; - @Override - public JSONObject takeReward(String openid,String channel) { - String redpack_openid = openid; - if(channel.equals("Wechat")){ - JSONObject customerRelation = customerMapper.findCustomerByOpenId(openid); - if (customerRelation == null) { - customerRelation = customerMapper.findCustomerGlobalpayByOpenId(openid); - } - redpack_openid = customerRelation.getString("redpack_openid"); - } - try { - Date now = new Date(); - Date begin = DateUtils.parseDate(cusRewardConfigMapper.getValue("begin").getString("value"),"yyyy-MM-dd"); - if(begin.after(now)){ - throw new ForbiddenException("活动尚未开始"); - } - Date end = DateUtils.parseDate(cusRewardConfigMapper.getValue("end").getString("value"),"yyyy-MM-dd"); - if(end.before(now)){ - throw new ForbiddenException("活动已结束"); - } - List orders = orderMapper.listNewYearOrdersByOpenId(openid, DateFormatUtils.format(now,"yyyy-MM-dd")); - if(orders.isEmpty()){ - throw new ForbiddenException("请至少使用微信或支付宝线下支付一笔"); - } - int limit = cusRewardConfigMapper.getValue("limit").getIntValue("value"); - int currentDayCounts = cusRewardLogsMapper.openIdReceivedCount(redpack_openid,DateUtils.parseDate(DateFormatUtils.format(now,"yyyy-MM-dd")+" 00:00:00","yyyy-MM-dd HH:mm:ss")); - if((limit-currentDayCounts)<=0){ - throw new ForbiddenException("您今日已达到抽奖次数上限"); - }; - //抽完一次后,还想抽下一次 - if((orders.size()-currentDayCounts)<=0){ - throw new ForbiddenException("请使用微信或支付宝再支付一笔"); - }; - String fakeOpenId = redpack_openid + DateFormatUtils.format(now, "HHmmssSSS"); - if(channel.equals("Wechat")){ - if(cusRewardLogsMapper.takeReward(now,fakeOpenId,DateFormatUtils.format(now,"yyyy-MM-dd")) > 0){ - JSONObject reward = cusRewardLogsMapper.findRewardByFakeOpenId(fakeOpenId); - Assert.notNull(reward, "reward is null"); - String rewardId = reward.getString("reward_id"); - reward.put("openid",redpack_openid); - cusRewardLogsMapper.update(reward); - if (reward.getIntValue("type") == 2 || reward.getIntValue("type") == 3) { - reward.put("status",1); - cusRewardLogsMapper.update(reward); - } else { - String sendName = "RoyalPay"; - String actName = cusRewardConfigMapper.getValue("act_name").getString("value"); - String wishing = cusRewardConfigMapper.getValue("wishing").getString("value"); - String notifyUrl = PlatformEnvironment.getEnv().concatUrl("/act/new_year/redpacks/"+rewardId); - MpWechatApi redpackApi = mpWechatApiProvider.getApi("redpack"); - WechatRedpack wechatRedpack = new WechatRedpack(); - wechatRedpack.setSendName(sendName).setOpenId(redpack_openid).setActName(actName) - .setRemark(actName).setAmount(reward.getBigDecimal("amount")).setWishing(wishing).setNotifyUrl(notifyUrl); - JSONObject res = redpackApi.sendRedpack(wechatRedpack); - logger.info("2019新年活动获取的红包信息==>"+res.toJSONString()); - reward.put("status",0); - reward.put("send_listid",res.getString("redpack_id")); - cusRewardLogsMapper.update(reward); - } - return reward; - } - } - if(channel.equals("Alipay")){ - if(cusRewardLogsMapper.takeRewardNotWechat(now,fakeOpenId,DateFormatUtils.format(now,"yyyy-MM-dd")) > 0){ - JSONObject reward = cusRewardLogsMapper.findRewardByFakeOpenId(fakeOpenId); - Assert.notNull(reward, "reward is null"); - reward.put("openid",openid); - reward.put("status",1); - cusRewardLogsMapper.update(reward); - return reward; - } - } - } catch (ParseException e) { - e.printStackTrace(); - } - return getRandomReward(channel.equals("Wechat")?redpack_openid:openid); - } - - @Override - public JSONObject getRewardDetail(String reward_id) { - return cusRewardLogsMapper.findRewardByRewardId(reward_id); - } - - @Override - public void saveReward(int type2, int type3, String type1,String date) { - if(type1!=null){ - String[] configs = type1.split(","); - NumberFormat format = new DecimalFormat("00000"); - int i = 0; - for (String config : configs) { - config = StringUtils.trim(config); - String[] detail = config.split("x"); - int count = Integer.parseInt(detail[1]); - int amount = new BigDecimal(detail[0]).intValue(); - for (int num = 0; num < count; num++) { - JSONObject redpack = new JSONObject(); - String idPrefix = "C"+ DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS") + format.format(i++); - redpack.put("reward_id", idPrefix + RandomStringUtils.random(28 - idPrefix.length(), true, true)); - redpack.put("amount", amount); - redpack.put("status", 0); - redpack.put("date", date); - redpack.put("type", 1); - cusRewardLogsMapper.save(redpack); - } - } - } - if(type2!=0){ - JSONObject coupon = cusRewardCouponMapper.getCoupon(2); - NumberFormat format = new DecimalFormat("00000"); - for (int i = 0; i < type2; i++) { - JSONObject log = new JSONObject(); - String prefix = "C" + DateFormatUtils.format(new Date(), "MMddHHmmssSSS") + format.format(i); - log.put("reward_id", prefix + RandomStringUtils.random(28 - prefix.length(), false, true)); - log.put("type", 2); - log.put("date", date); - log.put("coupon_id", coupon.getString("coupon_id")); - cusRewardLogsMapper.save(log); - } - } - if(type3!=0){ - JSONObject coupon = cusRewardCouponMapper.getCoupon(3); - NumberFormat format = new DecimalFormat("00000"); - for (int i = 0; i < type2; i++) { - JSONObject log = new JSONObject(); - String prefix = "C" + DateFormatUtils.format(new Date(), "MMddHHmmssSSS") + format.format(i); - log.put("reward_id", prefix + RandomStringUtils.random(28 - prefix.length(), false, true)); - log.put("type", 3); - log.put("date", date); - log.put("coupon_id", coupon.getString("coupon_id")); - cusRewardLogsMapper.save(log); - } - } - - - } - - @Override - public void checkRedpacksStatus(String rewardId,String sendListId) { - MpWechatApi redpackApi = mpWechatApiProvider.getApi("redpack"); - JSONObject redpack = redpackApi.redpackStatus(sendListId); - int status = redpack.getIntValue("status"); - JSONObject params = new JSONObject(); - if(status == 2){ - params.put("status",status); - params.put("reward_id",rewardId); - params.put("error_code",redpack.getString("err_code")); - params.put("error_msg",redpack.getString("err_msg")); - cusRewardLogsMapper.update(params); - }else { - params.put("status",status); - params.put("reward_id",rewardId); - cusRewardLogsMapper.update(params); - } - } - - @Override - public void reSendRedPacks() { - List redpacks = cusRewardLogsMapper.resendRewards(); - for(JSONObject pack:redpacks){ - String sendName = "RoyalPay"; - String actName = cusRewardConfigMapper.getValue("act_name").getString("value"); - String wishing = cusRewardConfigMapper.getValue("wishing").getString("value"); - String notifyUrl = PlatformEnvironment.getEnv().concatUrl("/act/new_year/redpacks/"+pack.getString("reward_id")); - MpWechatApi redpackApi = mpWechatApiProvider.getApi("redpack"); - WechatRedpack wechatRedpack = new WechatRedpack(); - wechatRedpack.setSendName(sendName).setOpenId(pack.getString("openid")).setActName(actName) - .setRemark(actName).setAmount(pack.getBigDecimal("amount")).setWishing(wishing).setNotifyUrl(notifyUrl); - JSONObject res = redpackApi.sendRedpack(wechatRedpack); - logger.info("2019新年活动获取的红包信息==>"+res.toJSONString()); - pack.put("status",0); - pack.put("send_listid",res.getString("redpack_id")); - cusRewardLogsMapper.update(pack); - } - } - - - private JSONObject getRandomReward(String openid){ - JSONObject reward = cusRewardCouponMapper.randomType(); - reward.remove("title"); - String prefix = "C" + DateFormatUtils.format(new Date(), "MMddHHmmssSSS"); - reward.put("reward_id", prefix + RandomStringUtils.random(28 - prefix.length(), false, true)); - reward.put("openid",openid); - reward.put("date",DateFormatUtils.format(new Date(),"yyyy-MM-dd")); - reward.put("send_time",new Date()); - reward.put("status",1); - cusRewardLogsMapper.save(reward); - return reward; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/EncourageUseProcessor.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/EncourageUseProcessor.java deleted file mode 100644 index 8e13ac3b4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/EncourageUseProcessor.java +++ /dev/null @@ -1,354 +0,0 @@ -package au.com.royalpay.payment.manage.customers.core.impls; - -import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; -import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.manage.customers.beans.EncourageEventParameters; -import au.com.royalpay.payment.manage.customers.beans.ReceiveLogQueryBean; -import au.com.royalpay.payment.manage.customers.core.EncourageService; -import au.com.royalpay.payment.manage.mappers.customers.CustomerEncourageConfigMapper; -import au.com.royalpay.payment.manage.mappers.customers.CustomerEncourageMoneyAccessLogMapper; -import au.com.royalpay.payment.manage.mappers.customers.CustomerEncourageMoneyUseLogMapper; -import au.com.royalpay.payment.manage.mappers.customers.CustomerMembershipMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.RandomUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.core.Ordered; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * 鼓励金 Created by yixian on 2017-04-24. - */ -@Service -public class EncourageUseProcessor implements Ordered, EncourageService { - - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private CustomerEncourageConfigMapper customerEncourageConfigMapper; - @Resource - private CustomerMembershipMapper customerMembershipMapper; - @Resource - private CustomerEncourageMoneyUseLogMapper customerEncourageMoneyUseLogMapper; - @Resource - private CustomerEncourageMoneyAccessLogMapper customerEncourageMoneyAccessLogMapper; - @Resource - private TransactionService transactionService; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private CustomerMapper customerMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private OrderMapper orderMapper; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - - @Override - public int getOrder() { - return 90; - } - - @Override - @Cacheable(value = ":cus_configs:encourage_fee", key = "''") - public JSONObject currentEncourageConfig() { - return customerEncourageConfigMapper.currentConfig(); - } - - @Override - public JSONObject takeEncourageMoney(String orderId, String visitorOpenId) { - logger.info("=====takeEncourageMoney+"+orderId); - JSONObject config = currentEncourageConfig(); - if (config != null) { - if (customerEncourageMoneyAccessLogMapper.findByOrderId(orderId) != null) { - logger.debug("订单已发放"); - return new JSONObject(); - } - JSONObject income = transactionService.findIncomeByOrderId(orderId); - if (income == null || income.getBigDecimal("clearing_amount").compareTo(config.getBigDecimal("min_pay")) < 0) { - logger.debug("未支付或支付金额小于要求"); - return new JSONObject(); - } - JSONObject order = orderMapper.find(orderId); - String openId = order.getString("customer_id"); - Date tradeDate = DateUtils.truncate(order.getDate("create_time"), Calendar.DATE); - if (tradeDate.before(config.getDate("from_date")) || !tradeDate.before(config.getDate("to_date"))) { - logger.debug("不在有效期"); - return new JSONObject(); - } - String channel = order.getString("channel"); - if ("Wechat".equals(channel)) { - JSONObject relation = customerMapper.findCustomerByOpenId(visitorOpenId); - if (relation == null) { - logger.debug("用户关系不存在"); - return new JSONObject(); - } - String merchantId = order.getString("merchant_id"); - WeChatPayConfig.Merchant mch = WechatPayEnvironment.getEnv().getMerchantConfig(merchantId); - if (mch.getMpId()==null){ - if (!StringUtils.equals(visitorOpenId, openId)) { - logger.debug("不是同一人"); - return new JSONObject(); - } - }else { - JSONObject wxUser = customerMapper.findCustomerByOpenId(visitorOpenId); - MpWechatApi api = mpWechatApiProvider.getApi(mch.getMpId()); - if (!StringUtils.equals(wxUser.getString(api.getOpenIdKey()), openId)) { - logger.debug("不是同一人"); - return new JSONObject(); - } - } - } - if ("Alipay".equals(channel)) { - if (!StringUtils.equals(visitorOpenId, openId)) { - logger.debug("不是同一人"); - return new JSONObject(); - } - } - if (config.getBooleanValue("debug_mode") && !checkIsDeveloper(visitorOpenId)) { - logger.debug("测试模式,不是管理员"); - return new JSONObject(); - } - JSONObject member = customerMembershipMapper.findByPaymentOpenId(visitorOpenId); - if (member == null) { - member = new JSONObject(); - if ("Wechat".equals(channel)) { - JSONObject relation = customerMapper.findCustomerByOpenId(visitorOpenId); - if (relation == null) { - logger.debug("用户关系不存在"); - return new JSONObject(); - } - member.put("payment_openid", visitorOpenId); - member.put("kanga_openid", relation.getString("kanga_openid")); - member.put("redpack_openid", relation.getString("redpack_openid")); - member.put("attend_time", new Date()); - member.put("member_point", -1); - member.put("encourage_balance", 0); - customerMembershipMapper.saveMember(member); - } - if ("Alipay".equals(channel)) { - JSONObject relation = managerCustomerRelationAlipayMapper.findCustomerByUserId(openId); - if (relation == null) { - logger.debug("用户关系不存在"); - return new JSONObject(); - } - member.put("payment_openid", openId); - member.put("kanga_openid", openId.concat("-kanga_openid")); - member.put("redpack_openid", openId.concat("-redpack_openid")); - member.put("attend_time", new Date()); - member.put("member_point", -1); - member.put("encourage_balance", 0); - customerMembershipMapper.saveMember(member); - } - - } - String memberId = member.getString("member_id"); - int usedOrders = customerEncourageMoneyAccessLogMapper.countOrders(memberId, new Date()); - if (usedOrders >= config.getIntValue("max_count")) { - logger.debug("超出领取次数"); - return new JSONObject(); - } - int rand = RandomUtils.nextInt(0, - config.getBigDecimal("max_amount").subtract(config.getBigDecimal("min_amount")).multiply(CommonConsts.HUNDRED).intValue()); - BigDecimal amount = config.getBigDecimal("min_amount").add(BigDecimal.valueOf(rand).divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN)); - customerMembershipMapper.addEncourage(memberId, amount); - JSONObject customer = customerMembershipMapper.findByMemberId(memberId); - JSONObject accessLog = new JSONObject(); - accessLog.put("member_id", memberId); - accessLog.put("order_id", orderId); - accessLog.put("access_time", new Date()); - accessLog.put("access_amount", amount); - accessLog.put("event_id", config.getString("event_id")); - accessLog.put("factor", 1); - accessLog.put("actural_amount", amount); - accessLog.put("current_amount", customer.getBigDecimal("encourage_balance")); - accessLog.put("expire_date", config.getDate("to_date")); - customerEncourageMoneyAccessLogMapper.save(accessLog); - return accessLog; - } - return new JSONObject(); - } - - private boolean checkIsDeveloper(String openId) { - List managers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask()); - for (JSONObject dev : managers) { - if (openId.equals(dev.getString("wx_openid"))) { - return true; - } - } - return false; - } - - @Override - public JSONObject doubleEncourageMoney(String orderId) { - JSONObject config = currentEncourageConfig(); - if (config != null) { - JSONObject log = customerEncourageMoneyAccessLogMapper.findByOrderId(orderId); - if (log == null) { - return new JSONObject(); - } - if (log.getBigDecimal("factor").compareTo(BigDecimal.ONE) == 0) { - int critRate = config.getIntValue("crit_rate"); - if (RandomUtils.nextInt(0, 100) < critRate) { - int factorInt = RandomUtils.nextInt(0, config.getBigDecimal("max_crit").multiply(CommonConsts.HUNDRED).intValue() - 100); - BigDecimal factor = BigDecimal.valueOf(factorInt + 100).divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN); - BigDecimal actural = log.getBigDecimal("access_amount").multiply(factor).setScale(2, RoundingMode.DOWN); - BigDecimal sub = actural.subtract(log.getBigDecimal("actural_amount")); - customerMembershipMapper.addEncourage(log.getString("member_id"), sub); - JSONObject customer = customerMembershipMapper.findByMemberId(log.getString("member_id")); - log.put("factor", factor); - log.put("actural_amount", actural); - log.put("current_amount", customer.getBigDecimal("encourage_balance")); - customerEncourageMoneyAccessLogMapper.update(log); - } - } - return log; - } - return new JSONObject(); - } - - @Override - public JSONObject getBalanceStatus(String openid) { - JSONObject config = customerEncourageConfigMapper.currentConfig(); - if (config == null) { - throw new BadRequestException("活动暂未开始"); - } - JSONObject status = new JSONObject(); - Date fromDate = config.getDate("from_date"); - status.put("from", DateFormatUtils.format(fromDate, "MM-dd")); - Date toDate = config.getDate("to_date"); - status.put("to", DateFormatUtils.format(toDate, "MM-dd")); - JSONObject member = customerMembershipMapper.findByPaymentOpenId(openid); - JSONObject use = customerEncourageMoneyAccessLogMapper.sumMoney(member.getString("memeber_id"),config.getString("event_id")); - BigDecimal balance = BigDecimal.ZERO; - if(use!=null){ - balance = use.getBigDecimal("use_amount"); - } - member.put("used_amount", balance.setScale(2, RoundingMode.DOWN).toPlainString()); - if (member != null) { - status.put("member_info", member); - List balanceLogs = customerMembershipMapper.listEncourageBalanceHistory(fromDate, toDate, member.getString("member_id")); - status.put("logs", balanceLogs); -// BigDecimal usedAmount = customerEncourageMoneyUseLogMapper.sumUsed(member.getString("member_id"), fromDate, toDate); -// member.put("used_amount", usedAmount); - } else { - member = new JSONObject(); - member.put("encourage_balance", 0); -// member.put("used_amount", 0); - } - status.put("member", member); - return status; - } - - @Override - public List listEvents() { - return customerEncourageConfigMapper.listConfigs(new PageBounds(Order.formString("from_date.asc"))); - } - - @Override - public JSONObject eventReport(String eventId) { - JSONObject parameters = customerEncourageConfigMapper.findConfig(eventId); - if (parameters == null) { - throw new NotFoundException("Event Not Exists"); - } - JSONObject report = new JSONObject(); - report.put("parameters", parameters); - List provideAnalysisByDate = customerEncourageMoneyAccessLogMapper.analysisByDate(eventId); - BigDecimal totalProvided = BigDecimal.ZERO; - for (JSONObject analysis : provideAnalysisByDate) { - totalProvided = totalProvided.add(analysis.getBigDecimal("send_amount")); - } - List useAnalysisByDate = customerEncourageMoneyUseLogMapper.analysisByDate(eventId); - BigDecimal totalUsed = BigDecimal.ZERO; - for (JSONObject analysis : useAnalysisByDate) { - totalUsed = totalUsed.add(analysis.getBigDecimal("use_amount")); - } - BigDecimal sumBalance = customerMembershipMapper.sumEncourageBalance(); - report.put("sum_balance", sumBalance); - report.put("sum_access", totalProvided); - report.put("sum_use", totalUsed); - report.put("access_analysis", provideAnalysisByDate); - report.put("use_analysis", useAnalysisByDate); - return report; - } - - @Override - public void updateParameters(String eventId, EncourageEventParameters parameters) { - JSONObject config = customerEncourageConfigMapper.findConfig(eventId); - if (config == null) { - throw new NotFoundException("Event Not Exists"); - } - // todo check date range - config = parameters.toJSON(); - config.put("event_id", eventId); - customerEncourageConfigMapper.update(config); - } - - @Override - public JSONObject newEvent(EncourageEventParameters parameters) { - JSONObject config = parameters.toJSON(); - customerEncourageConfigMapper.newEvent(config); - return config; - } - - @Override - public JSONObject listReceiveLogs(String eventId, ReceiveLogQueryBean query) { - JSONObject config = customerEncourageConfigMapper.findConfig(eventId); - if (config == null) { - throw new NotFoundException("Event not exists"); - } - JSONObject params = query.toParam(); - params.put("event_id", eventId); - PageList receiveLogs = customerEncourageMoneyAccessLogMapper.list(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("access_time.desc"))); - return PageListUtils.buildPageListResult(receiveLogs); - } - - @Override - public JSONObject listUseLogs(String eventId, int page, int limit) { - JSONObject config = customerEncourageConfigMapper.findConfig(eventId); - if (config == null) { - throw new NotFoundException("Event not exists"); - } - JSONObject params = new JSONObject(); - params.put("event_id", eventId); - PageList receiveLogs = customerEncourageMoneyUseLogMapper.list(params, new PageBounds(page, limit, Order.formString("use_time.desc"))); - return PageListUtils.buildPageListResult(receiveLogs); - } - - @Override - public void prepareUserInfo(JSONObject user, String user_id) { - if ("wechat".equals(user.getString("channel"))) { - user.put("headimg", customerMapper.findCustomerByOpenId(user_id).getString("headimg")); - } - if ("alipay".equals(user.getString("channel"))) { - user.put("headimg", managerCustomerRelationAlipayMapper.findCustomerByUserId(user_id).getString("headimg")); - } - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/package-info.java b/src/main/java/au/com/royalpay/payment/manage/customers/package-info.java deleted file mode 100644 index d0561c859..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 会员、鼓励金 - * Created by yixian on 2017-04-24. - */ -package au.com.royalpay.payment.manage.customers; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/task/RedpackSendingTask.java b/src/main/java/au/com/royalpay/payment/manage/customers/task/RedpackSendingTask.java deleted file mode 100644 index 3cebd17c3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/task/RedpackSendingTask.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.customers.task; - -import au.com.royalpay.payment.manage.customers.core.CustomerRewardLogService; -import au.com.royalpay.payment.manage.mappers.customers.CusRewardLogsMapper; -import com.alibaba.fastjson.JSONObject; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @Author: james7whm - * @Date: 2019/2/3 20:26 - */ -@Component -public class RedpackSendingTask { - @Resource - private CustomerRewardLogService customerRewardLogService; - @Resource - private CusRewardLogsMapper cusRewardLogsMapper; - - @Scheduled(cron = "0 0 0/1 * * ?") - public void checkRedpacks() { - List unConfirmedRedpacks = cusRewardLogsMapper.listUnconfirmRewards(); - for (JSONObject redpack : unConfirmedRedpacks) { - customerRewardLogService.checkRedpacksStatus(redpack.getString("reward_id"),redpack.getString("send_listid")); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/CouponValidateController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/CouponValidateController.java deleted file mode 100644 index 5c46782d9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/CouponValidateController.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.core.CouponValidateService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yuan on 2017/10/10. - */ -@Controller -@RequestMapping("/coupon") -public class CouponValidateController { - @Resource - private CouponValidateService couponVerificationService; - - - @PartnerMapping(value = "/get_used_coupon",method = RequestMethod.GET,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getUsedCoupon(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestParam("page") int page){ - - return couponVerificationService.getCoupon(partner,page,10); - } - @PartnerMapping(value = "/getcoupon",method = RequestMethod.GET,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getCoupon(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestParam("coupon_log_id") String coupon_log_id){ - return couponVerificationService.getCouponById(partner,coupon_log_id); - } - @PartnerMapping(value = "/use_coupon/{coupon_log_id}",method = RequestMethod.PUT,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - @ResponseBody - public void useCoupon(@PathVariable String coupon_log_id){ - boolean flage = couponVerificationService.useCoupon(coupon_log_id); - if(!flage){ - throw new BadRequestException("卡券核销失败"); - } - } - - /** - * 万圣节活动当天订单信息 - * @param customerId - * @param actDate - * @return - */ - @GetMapping(value = "/payment/halloween") - @ResponseBody - public JSONObject getHalloweenActOrderInfo(@RequestParam("customer_id") String customerId, - @RequestParam("act_date") String actDate) { - return couponVerificationService.getHalloweenOrderInfo(customerId, actDate); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerCommentController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerCommentController.java deleted file mode 100644 index da2d84f6f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerCommentController.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.beans.CustomerComment; -import au.com.royalpay.payment.manage.customers.core.CustomerCommentService; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * 客户联系 - */ -@RequestMapping("/customer") -@RestController -public class CustomerCommentController { - - @Resource - private CustomerCommentService customerCommentService; - - @RequestMapping("/contact/comment") - public void saveCustomerComment(@RequestBody @Valid CustomerComment customerComment) { - customerCommentService.save(customerComment); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPaymentInfoController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPaymentInfoController.java deleted file mode 100644 index 4ec67a22f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPaymentInfoController.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@RequestMapping(value = "/customer/payment") -public class CustomerPaymentInfoController { - - @Resource - private CustomerPaymentInfoService customerPaymentInfoService; - - @PostMapping("/update") - public void savePaymentInfo(@RequestBody JSONObject paymentInfo) { - customerPaymentInfoService.save(paymentInfo); - } - - @PutMapping("/update") - public void updatePaymentInfo(@RequestBody JSONObject paymentInfo) { - customerPaymentInfoService.update(paymentInfo); - } - - @GetMapping("/{openid}/check") - public JSONObject selectPaymentInfo(@PathVariable String openid) { - return customerPaymentInfoService.selectPaymentInfoByOpenId(openid); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java deleted file mode 100644 index 3163086d7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.core.CustomerPointsService; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -@Controller -@RequestMapping(value = "/customers/points") -public class CustomerPointsController { - - @Resource - private CustomerPointsService customerPointsService; - - @RequestMapping(value = "/{order_id}/check",method = RequestMethod.GET) - @ResponseBody - public int checkPointsAfterPay(@PathVariable String order_id) { - return customerPointsService.checkPointsAfterPay(order_id); - } - - @RequestMapping(value = "/lottery/{order_id}/check",method = RequestMethod.GET) - @ResponseBody - public BigDecimal checkLotteryAfterPay(@PathVariable String order_id) { - return customerPointsService.checkLotteryAfterPay(order_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java deleted file mode 100644 index 57b7b2136..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java +++ /dev/null @@ -1,81 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.core.EncourageService; -import au.com.royalpay.payment.tools.CommonConsts; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-04-28. - */ -@RestController -@RequestMapping("/act/encourage_money") -public class EncourageMoneyController { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private EncourageService encourageService; - - - @GetMapping("/orders/{orderId}") - public JSONObject takeEncourageMoney(@PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, - @ModelAttribute(CommonConsts.ALIUSER) JSONObject aliuser) { - throw new BadRequestException("当前活动暂不支持"); -// String user_id = ""; -// if (wxUser == null) { -// user_id = aliuser.getString("user_id"); -// } else { -// user_id = wxUser.getString("openid"); -// } -// if (StringUtils.isEmpty(user_id)) { -// return new JSONObject(); -// } -// return encourageService.takeEncourageMoney(orderId, user_id); - } - - @PutMapping("/orders/{orderId}/crit") - public JSONObject takeEncourageMoneyCrit(@PathVariable String orderId) { - return encourageService.doubleEncourageMoney(orderId); - } - - @GetMapping("/my") - public ModelAndView encourageLogs(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, @ModelAttribute(CommonConsts.ALIUSER) JSONObject aliuser) { - ModelAndView mav = new ModelAndView("activity/encourage_money/my"); - JSONObject user = new JSONObject(); - String user_id = ""; - if (wxUser == null) { - user.put("headimg", aliuser.getString("avatar")); - user.put("channel","alipay"); - user_id = aliuser.getString("user_id"); - } else { - user.put("headimg", wxUser.getString("headimgurl")); - user.put("channel","wechat"); - user_id = wxUser.getString("openid"); - } - if(StringUtils.isEmpty(user.getString("headimg"))) { - encourageService.prepareUserInfo(user, user_id); - } - JSONObject balanceStatus = encourageService.getBalanceStatus(user_id); - mav.addObject("user", user); - mav.addObject("balance_status", balanceStatus); - return mav; - } - - @GetMapping("/desc") - public ModelAndView descPage() { - return new ModelAndView("activity/encourage_money/desc"); - } - - @GetMapping("/merchants") - public ModelAndView merchantsPage() { - return new ModelAndView("activity/encourage_money/merchants"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyManageController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyManageController.java deleted file mode 100644 index e6633fb49..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyManageController.java +++ /dev/null @@ -1,53 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.beans.EncourageEventParameters; -import au.com.royalpay.payment.manage.customers.beans.ReceiveLogQueryBean; -import au.com.royalpay.payment.manage.customers.core.EncourageService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2017-04-30. - */ -@RestController -@ManagerMapping(value = "/sys/activities/encourage_money", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) -public class EncourageMoneyManageController { - @Resource - private EncourageService encourageService; - - @GetMapping("/events") - public List listEvents() { - return encourageService.listEvents(); - } - - @PostMapping("/events") - public JSONObject newEvent(@RequestBody EncourageEventParameters parameters) { - return encourageService.newEvent(parameters); - } - - @GetMapping("/events/{eventId}") - public JSONObject eventReport(@PathVariable String eventId) { - return encourageService.eventReport(eventId); - } - - @PutMapping("/events/{eventId}/parameters") - public void setEventParameters(@PathVariable String eventId, @RequestBody EncourageEventParameters parameters) { - encourageService.updateParameters(eventId, parameters); - } - - @GetMapping("/events/{eventId}/receive_logs") - public JSONObject listReceiveLogs(@PathVariable String eventId, ReceiveLogQueryBean query) { - return encourageService.listReceiveLogs(eventId, query); - } - - @GetMapping("/events/{eventId}/use_logs") - public JSONObject listUseLogs(@PathVariable String eventId, @RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "20") int limit) { - return encourageService.listUseLogs(eventId, page, limit); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/NewYearRedPacketController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/NewYearRedPacketController.java deleted file mode 100644 index c6f22c59f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/NewYearRedPacketController.java +++ /dev/null @@ -1,82 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.customers.core.CustomerRewardLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -/** - * @Author: james7whm - * @Date: 2019/1/16 14:35 - */ -@Controller -@RequestMapping("/act/new_year") -public class NewYearRedPacketController { -// @Resource -// private MpWechatApi mpWechatApi; - @Resource - private CustomerRewardLogService customerRewardLogService; - - @GetMapping("/reward") - public String takeReward(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, - @ModelAttribute(CommonConsts.ALIUSER) JSONObject aliuser) { -// String user_id = "o32MzuA5H8KNIYAO2a__BGS-3iXs"; - String user_id = ""; - String channel=""; - if(aliuser == null && wxUser == null){ - throw new ForbiddenException("请使用微信或支付宝客户端打开"); - } - if (aliuser != null) { - user_id = aliuser.getString("user_id"); - channel = "Alipay"; - } - if (wxUser != null) { - user_id = wxUser.getString("openid"); - channel = "Wechat"; - } - JSONObject reward = customerRewardLogService.takeReward(user_id,channel); -// ModelAndView mav = new ModelAndView("activity/new_year_reward/reward"); -// JSONObject reward = new JSONObject(); -// reward.put("type",2); -// mav.addObject("reward", reward); - return "redirect:/act/new_year/"+reward.getString("reward_id"); -// return encourageService.takeEncourageMoney(orderId, user_id); - } - - @GetMapping("/{reward_id}") - public ModelAndView getReward(@PathVariable String reward_id){ - ModelAndView mav = new ModelAndView("activity/new_year_reward/reward"); - JSONObject reward = customerRewardLogService.getRewardDetail(reward_id); - mav.addObject("reward", reward); - return mav; - } - - @GetMapping("/description") - public ModelAndView takeDescription(){ - ModelAndView mav = new ModelAndView("activity/new_year_reward/description"); - return mav; - } - - @ResponseBody - @GetMapping("/coupons") - public void saveCoupons(@RequestParam("type2")int type2,@RequestParam("type3")int type3,@RequestParam("type1")String type1,@RequestParam("date")String date){ - customerRewardLogService.saveReward(type2,type3,type1,date); - } - - @PostMapping("/redpacks/{rewardId}") - public void updateRedpackStatus(HttpServletRequest request, @RequestHeader String sign, @RequestHeader long timestamp, @PathVariable String rewardId) { -// mpWechatApi(request.getRequestURI(), sign, timestamp); -// redpackSupport.checkRedpack(rewardId); - } - - @GetMapping("/resendRedpacks") - public void updateRedpackStatus(){ - customerRewardLogService.reSendRedPacks(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/PaymentManagerController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/PaymentManagerController.java deleted file mode 100644 index ed35b736e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/PaymentManagerController.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; - -import au.com.royalpay.payment.manage.apps.AppController; -import au.com.royalpay.payment.manage.customers.core.CouponValidateService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; - -/** - * Created by yuan on 2017/12/27. - */ -@RequestMapping(value = "/manager") -@AppController -public class PaymentManagerController { - - @Resource - private CouponValidateService couponVerificationService; - - @GetMapping(value = "/get_payment_manage") - public JSONObject getPaymentManager(){ - JSONObject json = couponVerificationService.getPaymentManager(); - return json; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/PointsController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/PointsController.java deleted file mode 100644 index b95f456b2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/PointsController.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.customers.web; -import au.com.royalpay.payment.manage.apps.AppController; -import au.com.royalpay.payment.manage.customers.core.CustomerPointsService; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 12/07/2017. - */ -@AppController -@RequestMapping(value = "/api/customers/points") -public class PointsController { - @Resource - private CustomerPointsService customerPointsService; - private String whiteIps = ""; - - @GetMapping("/init/{customer_id}") - @ResponseBody - public String getInitPoints(@PathVariable String customer_id, @RequestParam("channel") String channel) { - int points = customerPointsService.getOldPoints(customer_id, channel); - return String.valueOf(points); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisService.java deleted file mode 100644 index 224e0fe68..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisService.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.dataAnalysis.core; - -import com.alibaba.fastjson.JSONObject; - -import java.text.ParseException; -import java.util.List; - -/** - * @Author lvjian - * @Date 2018/6/28 18:40 - */ -public interface DataAnalysisService { - - /** - * 获取数据分析1 - * @param params - * @param response - * @return - */ - JSONObject getDataAnalysis1(JSONObject params, JSONObject response); - - /** - * 获取数据分析2 - * @param params - * @param response - * @return - */ - JSONObject getDataAnalysis2(JSONObject params, JSONObject response); - - /** - * 新需求 - * 获取cny_amount统计值 - * @param params - * @param response - * @return - */ - JSONObject getCnyAmount(JSONObject params, JSONObject response); - - List getRpIndustryEchartsData(String from, String to, String industry,String managerId) throws ParseException; - - JSONObject getRpTop20IndustryData(String industry, String transDate, int page, String managerId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java deleted file mode 100644 index 27c0c2c20..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package au.com.royalpay.payment.manage.dataAnalysis.core; - -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.ParseException; -import java.util.Date; -import java.util.List; - -/** - * @Author lvjian - * @Date 2018/6/28 18:42 - */ -@Service -public class DataAnalysisServiceImpl implements DataAnalysisService { - - @Resource - private ClientAnalysisMapper clientAnalysisMapper; - - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - - @Override - public JSONObject getDataAnalysis1(JSONObject params, JSONObject response) { - - //新加的商户数 - response.put("new_partners", clientAnalysisMapper.countNewClients(params)); - //总商户数 - response.put("total_partners", clientAnalysisMapper.countClients(params)); - //产生交易的商户数 - response.put("traded_partners", clientAnalysisMapper.countTradedPartners(params)); - //交易总额,该处另外开启新视线接口,专提供pms获取数据 - response.put("trade_amount", transactionAnalysisMapper.analysisTotalAmountProvisionService(params)); - return response; - } - - @Override - public JSONObject getDataAnalysis2(JSONObject params, JSONObject response) { - - //交易笔数 - response.put("trade_count", transactionAnalysisMapper.analysisTotalCount(params)); - List topOrders = transactionAnalysisMapper.getTopOrders(params); - //最大交易额 - if (!topOrders.isEmpty()) { - response.put("max_order", topOrders.get(0).get("aud_fee")); - } else { - response.put("max_order", 0); - } - //总消费人数 - response.put("total_customers", 0); - //老客户人数 - response.put("old_customers", 0); - return response; - } - - @Override - public JSONObject getCnyAmount(JSONObject params, JSONObject response) { - response.put("cny_amount", transactionAnalysisMapper.getCnyAmount(params)); - return response; - } - - @Override - public List getRpIndustryEchartsData(String from, String to, String industry, String managerId) throws ParseException { - Date modifyTo = DateUtils.addDays(DateUtils.parseDate(to, "yyyy-MM-dd"), 1); - List data = transactionAnalysisMapper.getRpIndustryEchartsData(from, DateFormatUtils.format(modifyTo, "yyyy-MM-dd HH:mm:ss"), industry, managerId); - BigDecimal totalClients = new BigDecimal(clientAnalysisMapper.countValidClientsAll(industry)); - for (JSONObject detail : data) { - BigDecimal industryClients = detail.getBigDecimal("industry_trans_clients"); - if (!StringUtils.equalsIgnoreCase("0", industry)) { - industryClients = industryClients.subtract(new BigDecimal(1)); - detail.put("industry_trans_clients", industryClients.setScale(0, RoundingMode.DOWN)); - } - detail.put("total_client", totalClients.setScale(0, RoundingMode.DOWN)); - detail.put("in_total_pcent", industryClients.divide(totalClients, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100))); - } - return data; - } - - @Override - public JSONObject getRpTop20IndustryData(String industry, String transDate, int page, String managerId) { - PageList logs = transactionAnalysisMapper.getTopRpIndustryData(transDate, industry, - new PageBounds(page, 20), managerId); - return PageListUtils.buildPageListResult(logs); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/util/MyUtil.java b/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/util/MyUtil.java deleted file mode 100644 index 9285fb785..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/util/MyUtil.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.dataAnalysis.util; - -import java.util.Calendar; -import java.util.Date; - -/** - * @Author lvjian - * @Date 2018/6/28 18:34 - */ -public class MyUtil { - - /** - * 时分秒清零,保留年月日 - * @param date - * @return - */ - public static Date getYMD(Date date) { - - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - return calendar.getTime(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/web/DataAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/web/DataAnalysisController.java deleted file mode 100644 index 92a07c834..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/web/DataAnalysisController.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.dataAnalysis.web; - -import au.com.royalpay.payment.manage.dataAnalysis.core.DataAnalysisService; -import au.com.royalpay.payment.manage.dataAnalysis.util.MyUtil; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * @Author lvjian - * @Date 2018/6/28 18:32 - */ -@RestController -@RequestMapping(value = "/out") -public class DataAnalysisController { - - @Autowired - private DataAnalysisService dataAnalysisService; - - @RequestMapping(value = "/data_analysis") - @ReadOnlyConnection - public JSONObject dataAnalysis(@RequestParam(value = "begin", required = false) String begin, - @RequestParam(value = "offset", defaultValue = "1") Integer offset) throws ParseException { - - JSONObject params = new JSONObject(); - if (begin == null) { - Date beginInit = MyUtil.getYMD(new Date()); - Date endInit = DateUtils.addDays(beginInit,offset); - params.put("begin",beginInit); - params.put("end",endInit); - } else { - DateFormat format = new SimpleDateFormat("yyyyMMdd"); - if (offset < 0) { - params.put("end", format.parse(begin)); - params.put("begin", DateUtils.addDays(format.parse(begin),offset)); - } else { - params.put("begin", format.parse(begin)); - params.put("end", DateUtils.addDays(format.parse(begin),offset)); - } - } - JSONObject response = new JSONObject(); - response = dataAnalysisService.getDataAnalysis1(params,response); - response = dataAnalysisService.getDataAnalysis2(params,response); - response = dataAnalysisService.getCnyAmount(params, response); - return response; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/datav/core/DatavService.java b/src/main/java/au/com/royalpay/payment/manage/datav/core/DatavService.java deleted file mode 100644 index 394fe9c0a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/datav/core/DatavService.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.datav.core; - - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -public interface DatavService { - List merchantByIndustry(); - - void transactionLoc(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/datav/core/Impl/DatavServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/datav/core/Impl/DatavServiceImpl.java deleted file mode 100644 index e3404217e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/datav/core/Impl/DatavServiceImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -package au.com.royalpay.payment.manage.datav.core.Impl; - -import au.com.royalpay.payment.manage.analysis.core.PartnersAnalysisService; -import au.com.royalpay.payment.manage.datav.core.DatavService; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAndCustomerLocation; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class DatavServiceImpl implements DatavService { - - @Resource - private PartnersAnalysisService partnersAnalysisService; - @Resource - private OrderMapper orderMapper; - @Resource - private ClientAndCustomerLocation clientAndCustomerLocation; - @Override - public List merchantByIndustry() { - List partnersTypesAnalysis = partnersAnalysisService.getPartnersTypesAnalysis(new JSONObject()); - List analysis = new ArrayList<>(); - JSONObject result; - for(JSONObject partner : partnersTypesAnalysis) { - result = new JSONObject(); - result.put("value", partner.getIntValue("count_value")); - switch (partner.getIntValue("mccCode")){ - case 1: - result.put("type", "旅游出行"); - break; - case 2: - result.put("type", "餐饮"); - break; - case 3: - result.put("type", "教育"); - break; - case 4: - result.put("type", "商务咨询"); - break; - case 5: - result.put("type", "传媒"); - break; - case 6: - result.put("type", "医美"); - break; - case 7: - result.put("type", "零售"); - break; - case 8: - result.put("type", "休闲娱乐"); - break; - case 9: - result.put("type", "其他服务类"); - break; - case 10: - result.put("type", "酒店"); - break; - case 11: - result.put("type", "出口贸易"); - break; - case 12: - result.put("type", "家居建材"); - break; - } - analysis.add(result); - } - return analysis; - } - - @Override - public void transactionLoc() { - JSONObject params = new JSONObject(); - long time = 60*60*1000;//60分钟 - Date now = new Date(); - Date beforeDate = new Date(now .getTime() - time);//60分钟前的时间 - params.put("begin", beforeDate); - params.put("end", now); - params.put("limit", 40); - List customerLoc = orderMapper.getClientAndCustomerLoc(params); - JSONObject obj; - for (JSONObject customer : customerLoc) { - //判断数据库是否已经存在该条ip解析 - obj = clientAndCustomerLocation.findByIp(customer.getString("customer_ip")); - if (obj == null) { - try { - HttpRequestResult result = new HttpRequestGenerator("https://ipinfo.io/" + customer.getString("customer_ip") +"/json?token=7fac65b5953bb1", RequestMethod.GET).execute(); - if (result.isSuccess()) { - obj = result.getResponseContentJSONObj(); - String[] locArr = obj.getString("loc").split(","); - obj.put("ip_longitude", locArr[1]); - obj.put("ip_latitude", locArr[0]); - obj.put("moniker_longitude", customer.getString("longitude")); - obj.put("moniker_latitude", customer.getString("latitude")); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - if (obj != null && !customer.getString("order_id").equals(obj.get("order_id"))) { - obj.put("order_id", customer.getString("order_id")); - obj.put("create_time", new Date()); - clientAndCustomerLocation.save(obj); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/datav/web/DatavController.java b/src/main/java/au/com/royalpay/payment/manage/datav/web/DatavController.java deleted file mode 100644 index 34155a772..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/datav/web/DatavController.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.datav.web; - - -import au.com.royalpay.payment.manage.datav.core.DatavService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.List; - -@RestController -@RequestMapping("/api/v1.0/datav") -public class DatavController { - - @Resource - private DatavService datavService; - - /** - * 各类型商家分布 - * @return - */ - @RequestMapping("/merchant/industry") - public List getMerchantAnalysisByIndustry() { - return datavService.merchantByIndustry(); - } - - /** - * 获取支付方与收款方的经纬度 - * @return - */ - @RequestMapping("/payment/loc") - public void getPaymentLonAndLat() { - datavService.transactionLoc(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/bean/AliExcel.java b/src/main/java/au/com/royalpay/payment/manage/dev/bean/AliExcel.java deleted file mode 100644 index ae234f7ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/bean/AliExcel.java +++ /dev/null @@ -1,476 +0,0 @@ -package au.com.royalpay.payment.manage.dev.bean; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import javax.validation.constraints.NotEmpty; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - - -/** - * Created by yixian on 2016-07-01. - */ -public class AliExcel { - private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - private String textType; - private String searchText; - private String client_moniker; - private String state; - private String suburb; - private String short_name; - private String sub_merchant_id; - private String org_id; - private String org_ids; - private String bd; - private String business_structure; - private String industry; - private Integer clean_day; - private String bd_city; - private String surcharge_start_rate; - private String surcharge_end_rate; - private String create_start_time; - private String datefrom; - private String create_end_time; - private String dateto; - private String transaction_start_time; - private String transaction_end_time; - private boolean approving = false; - private int page = 1; - private int limit = 10; - private boolean onlyMe = false; - private boolean tempMchId = false; - private boolean quickPass = false; - private boolean greenChannel = false; - private boolean greenChannelBdTodo = false; - private boolean pass = false; - private boolean completed_contract = false; - private boolean apply_to_back = false; - private boolean bd_upload_material = false; - private boolean is_valid = false; - private String merchant_id; - - public String getClient_moniker() { - return StringUtils.isEmpty(client_moniker) ? null : client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getShort_name() { - return short_name; - } - - public void setShort_name(String short_name) { - this.short_name = short_name; - } - - public String getSub_merchant_id() { - return sub_merchant_id; - } - - public void setSub_merchant_id(String sub_merchant_id) { - this.sub_merchant_id = sub_merchant_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(client_moniker)) { - param.put("client_moniker", getClient_moniker()); - } - if (StringUtils.isNotBlank(short_name)) { - param.put("short_name", short_name); - } - if (StringUtils.isNotBlank(sub_merchant_id)) { - param.put("sub_merchant_id", sub_merchant_id); - } - if (StringUtils.isNotBlank(state)) { - param.put("state", state); - } - if (StringUtils.isNotBlank(suburb)) { - param.put("suburb", suburb); - } - if (StringUtils.isNotBlank(searchText)) { - param.put("search_text", searchText); - if (StringUtils.isNotBlank(textType)) { - param.put("text_type", textType); - } else { - param.put("text_type", "all"); - } - } - if (approving) { - param.put("approving", true); - } - if (org_id != null) { - param.put("org_id", org_id); - } - if (org_ids != null) { - param.put("org_ids", org_ids); - } - if (StringUtils.isNotBlank(bd)) { - param.put("bd_user", bd); - } - if (quickPass){ - param.put("quickPass",true); - } - if (greenChannel){ - param.put("greenChannel",true); - } - if (business_structure!=null && !business_structure.equals("")){ - param.put("business_structure",business_structure); - } - if (industry!=null && !industry.equals("")){ - param.put("industry",industry); - } - if (bd_city!=null && !bd_city.equals("")){ - param.put("bd_city",bd_city); - } - if (clean_day!=null){ - param.put("clean_day",clean_day); - } - if (surcharge_start_rate!=null) { - param.put("surcharge_start_rate",surcharge_start_rate); - } - if (surcharge_end_rate!=null){ - param.put("surcharge_end_rate",surcharge_end_rate); - } - if (transaction_start_time != null) { - try { - param.put("transaction_start_time", format.parse(transaction_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("transaction_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (transaction_end_time != null) { - try { - param.put("transaction_end_time", DateUtils.addDays(format.parse(transaction_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("transaction_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (create_start_time != null) { - try { - param.put("create_start_time", format.parse(create_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("create_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (create_end_time != null) { - try { - param.put("create_end_time", DateUtils.addDays(format.parse(create_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("create_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (datefrom != null) { - try { - param.put("datefrom", format.parse(datefrom)); - } catch (ParseException e) { - throw new ParamInvalidException("approve_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (dateto != null) { - try { - param.put("dateto", DateUtils.addDays(format.parse(dateto), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("approve_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (greenChannelBdTodo){ - param.put("greenChannelBdTodo",true); - } - if (is_valid){ - param.put("is_valid",true); - } - if (pass){ - param.put("pass",true); - } - if (completed_contract){ - param.put("completed_contract",true); - } - if (apply_to_back){ - param.put("apply_to_back",true); - } - if (bd_upload_material){ - param.put("bd_upload_material",true); - } - if (merchant_id != null){ - param.put("merchant_id",merchant_id); - } - return param; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getTextType() { - return textType; - } - - public void setTextType(String textType) { - this.textType = textType; - } - - public String getSearchText() { - return searchText; - } - - public void setSearchText(String searchText) { - this.searchText = searchText; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public void setOnlyMe(boolean onlyMe) { - this.onlyMe = onlyMe; - } - - public boolean getOnlyMe() { - return onlyMe; - } - - public boolean isTempMchId() { - return tempMchId; - } - - public void setTempMchId(boolean tempMchId) { - this.tempMchId = tempMchId; - } - - public String getBusiness_structure() { - return business_structure; - } - - public void setBusiness_structure(String business_structure) { - this.business_structure = business_structure; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public Integer getClean_day() { - return clean_day; - } - - public void setClean_day(Integer clean_day) { - this.clean_day = clean_day; - } - - public String getBd_city() { - return bd_city; - } - - public void setBd_city(String bd_city) { - this.bd_city = bd_city; - } - - public String getCreate_start_time() { - return create_start_time; - } - - public void setCreate_start_time(String create_start_time) { - this.create_start_time = create_start_time; - } - - public String getDatefrom() { - return datefrom; - } - - public void setDatefrom(String datefrom) { - this.datefrom = datefrom; - } - - public String getCreate_end_time() { - return create_end_time; - } - - public void setCreate_end_time(String create_end_time) { - this.create_end_time = create_end_time; - } - - public String getDateto() { - return dateto; - } - - public void setDateto(String dateto) { - this.dateto = dateto; - } - - public String getSurcharge_start_rate() { - return surcharge_start_rate; - } - - public void setSurcharge_start_rate(String surcharge_start_rate) { - this.surcharge_start_rate = surcharge_start_rate; - } - - public String getTransaction_start_time() { - return transaction_start_time; - } - - public void setTransaction_start_time(String transaction_start_time) { - this.transaction_start_time = transaction_start_time; - } - - public String getTransaction_end_time() { - return transaction_end_time; - } - - public void setTransaction_end_time(String transaction_end_time) { - this.transaction_end_time = transaction_end_time; - } - - public String getSurcharge_end_rate() { - return surcharge_end_rate; - } - - public void setSurcharge_end_rate(String surcharge_end_rate) { - this.surcharge_end_rate = surcharge_end_rate; - } - - public boolean isOnlyMe() { - return onlyMe; - } - - public boolean isApproving() { - return approving; - } - - public void setApproving(boolean approving) { - this.approving = approving; - } - - public boolean isQuickPass() { - return quickPass; - } - - public void setQuickPass(boolean quickPass) { - this.quickPass = quickPass; - } - - public boolean isGreenChannel() { - return greenChannel; - } - - public void setGreenChannel(boolean greenChannel) { - this.greenChannel = greenChannel; - } - public void setGreenChannelAndBDtodo(boolean bDTodo){ - this.greenChannelBdTodo = bDTodo; - } - public void setIs_valid(boolean is_valid){ - this.is_valid=is_valid; - } - - public DateFormat getFormat() { - return format; - } - - public boolean isGreenChannelBdTodo() { - return greenChannelBdTodo; - } - - public void setGreenChannelBdTodo(boolean greenChannelBdTodo) { - this.greenChannelBdTodo = greenChannelBdTodo; - } - - public boolean isPass() { - return pass; - } - - public void setPass(boolean pass) { - this.pass = pass; - } - - public boolean isCompleted_contract() { - return completed_contract; - } - - public void setCompleted_contract(boolean completed_contract) { - this.completed_contract = completed_contract; - } - - public boolean isApply_to_back() { - return apply_to_back; - } - - public void setApply_to_back(boolean apply_to_back) { - this.apply_to_back = apply_to_back; - } - - public boolean isBd_upload_material() { - return bd_upload_material; - } - - public void setBd_upload_material(boolean bd_upload_material) { - this.bd_upload_material = bd_upload_material; - } - - public boolean isIs_valid() { - return is_valid; - } - - public String getOrg_ids() { - return org_ids; - } - - public void setOrg_ids(String org_ids) { - this.org_ids = org_ids; - } - - public void setBd(String bd) { - this.bd = bd; - } - - public String getMerchant_id() { - return merchant_id; - } - - public void setMerchant_id(String merchant_id) { - this.merchant_id = merchant_id; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/bean/ClientTestRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/dev/bean/ClientTestRegisterInfo.java deleted file mode 100644 index 126ad75fa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/bean/ClientTestRegisterInfo.java +++ /dev/null @@ -1,355 +0,0 @@ -package au.com.royalpay.payment.manage.dev.bean; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -import javax.validation.constraints.Pattern; -/** - * Created by yangluo on 2018/06/28. - */ -public class ClientTestRegisterInfo { - @JSONField(name = "client_moniker") - @NotEmpty(message = "error.payment.valid.param_missing") - @Pattern(regexp = "^[a-zA-Z0-9]{4}$", message = "Parameter error(partner code):Only letters or numbers are allowed") - private String clientMoniker; - private String companyName; - private String shortName; - private String businessName; - private String businessStructure; - // @NotEmpty(message = "error.payment.valid.param_missing") - private String abn; - private String acn; - // @NotEmpty(message = "error.payment.valid.param_missing") - private String industry; - /* @NotEmpty(message = "error.payment.valid.param_missing")*/ - private String alipayIndustry; - private String companyPhoto; - private String storePhoto; - private String companyWebsite; - private String companyPhone; - private String description; - private String remark; - private String sector; - @JSONField(name = "logo_id") - private String logoId; - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - private String address; - private String suburb; - private String postcode; - private String state; - private String country; - private String timezone; - private String jdindustry; - private String royalpayindustry; - - private String referrer_id; - private String referrer_name; - - private String client_apply_id; - - private String business_hours; - private String merchant_introduction; - private String merchant_tag; - private String merchant_video_url; - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - if (client_apply_id==null){ - res.remove("client_apply_id"); - } - return res; - } - - public JSONObject updateObject() { - JSONObject obj = insertObject(); - obj.remove("client_moniker"); - return obj; - } - - public String getClientMoniker() { - return clientMoniker.toUpperCase(); - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getBusinessName() { - return businessName; - } - - public void setBusinessName(String businessName) { - this.businessName = businessName; - } - - public String getAbn() { - return abn; - } - - public void setAbn(String abn) { - this.abn = abn; - } - - public String getAcn() { - return acn; - } - - public void setAcn(String acn) { - this.acn = acn; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getCompanyPhoto() { - return companyPhoto; - } - - public void setCompanyPhoto(String companyPhoto) { - this.companyPhoto = companyPhoto; - } - - public String getStorePhoto() { - return storePhoto; - } - - public void setStorePhoto(String storePhoto) { - this.storePhoto = storePhoto; - } - - public String getCompanyWebsite() { - return companyWebsite; - } - - public void setCompanyWebsite(String companyWebsite) { - this.companyWebsite = companyWebsite; - } - - public String getCompanyPhone() { - return companyPhone; - } - - public void setCompanyPhone(String companyPhone) { - this.companyPhone = companyPhone; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getSector() { - return sector; - } - - public void setSector(String sector) { - this.sector = sector; - } - - public String getLogoId() { - return logoId; - } - - public void setLogoId(String logoId) { - this.logoId = logoId; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public String getClient_apply_id() { - return client_apply_id; - } - - public void setClient_apply_id(String client_apply_id) { - this.client_apply_id = client_apply_id; - } - - public String getBusinessStructure() { - return businessStructure; - } - - public void setBusinessStructure(String businessStructure) { - this.businessStructure = businessStructure; - } - - public String getReferrer_id() { - return referrer_id; - } - - public void setReferrer_id(String referrer_id) { - this.referrer_id = referrer_id; - } - - public String getReferrer_name() { - return referrer_name; - } - - public void setReferrer_name(String referrer_name) { - this.referrer_name = referrer_name; - } - - public String getAlipayIndustry() { - return alipayIndustry; - } - - public void setAlipayIndustry(String alipayIndustry) { - this.alipayIndustry = alipayIndustry; - } - - public String getJdindustry() { - return jdindustry; - } - - public void setJdindustry(String jdindustry) { - this.jdindustry = jdindustry; - } - - public String getRoyalpayindustry() { - return royalpayindustry; - } - - public void setRoyalpayindustry(String royalpayindustry) { - this.royalpayindustry = royalpayindustry; - } - - public String getBusiness_hours() { - return business_hours; - } - - public void setBusiness_hours(String business_hours) { - this.business_hours = business_hours; - } - - public String getMerchant_introduction() { - return merchant_introduction; - } - - public void setMerchant_introduction(String merchant_introduction) { - this.merchant_introduction = merchant_introduction; - } - - public String getMerchant_tag() { - return merchant_tag; - } - - public void setMerchant_tag(String merchant_tag) { - this.merchant_tag = merchant_tag; - } - - public String getMerchant_video_url() { - return merchant_video_url; - } - - public void setMerchant_video_url(String merchant_video_url) { - this.merchant_video_url = merchant_video_url; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/bean/Message.java b/src/main/java/au/com/royalpay/payment/manage/dev/bean/Message.java deleted file mode 100644 index fa475d94f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/bean/Message.java +++ /dev/null @@ -1,64 +0,0 @@ -package au.com.royalpay.payment.manage.dev.bean; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yuan on 2017/9/7. - */ -public class Message { - @NotEmpty(message = "type can not be null") - public String type; - @NotEmpty(message = "code can not be null") - public String code; - @NotEmpty(message = "title can not be null") - public String title; - @NotEmpty(message = "content can not be null") - public String content; - public String client_type; - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getClient_type() { - return client_type; - } - - public void setClient_type(String client_type) { - this.client_type = client_type; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java b/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java deleted file mode 100644 index 3e2529319..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java +++ /dev/null @@ -1,169 +0,0 @@ -package au.com.royalpay.payment.manage.dev.bean; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yuan on 2017/9/18. - */ -public class SendWechatMessage { - private String partner_code; - private String title; - private String content; - private String open_id; - - private boolean admin; - private boolean operator; - private boolean bd; - private boolean finacial; - private boolean servant; - private boolean accountmanager; - private boolean director; - private boolean sitemanager; - private boolean developer; - private boolean bdleader; - private boolean riskmanager; - private boolean guest; - private boolean orgmanager; - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public String getPartner_code() { - return partner_code; - } - - public void setPartner_code(String partner_code) { - this.partner_code = partner_code; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getOpen_id() { - return open_id; - } - - public void setOpen_id(String open_id) { - this.open_id = open_id; - } - - public boolean isAdmin() { - return admin; - } - - public void setAdmin(boolean admin) { - this.admin = admin; - } - - public boolean isOperator() { - return operator; - } - - public void setOperator(boolean operator) { - this.operator = operator; - } - - public boolean isBd() { - return bd; - } - - public void setBd(boolean bd) { - this.bd = bd; - } - - public boolean isFinacial() { - return finacial; - } - - public void setFinacial(boolean finacial) { - this.finacial = finacial; - } - - public boolean isServant() { - return servant; - } - - public void setServant(boolean servant) { - this.servant = servant; - } - - public boolean isAccountmanager() { - return accountmanager; - } - - public void setAccountmanager(boolean accountmanager) { - this.accountmanager = accountmanager; - } - - public boolean isDirector() { - return director; - } - - public void setDirector(boolean director) { - this.director = director; - } - - public boolean isSitemanager() { - return sitemanager; - } - - public void setSitemanager(boolean sitemanager) { - this.sitemanager = sitemanager; - } - - public boolean isDeveloper() { - return developer; - } - - public void setDeveloper(boolean developer) { - this.developer = developer; - } - - public boolean isBdleader() { - return bdleader; - } - - public void setBdleader(boolean bdleader) { - this.bdleader = bdleader; - } - - public boolean isRiskmanager() { - return riskmanager; - } - - public void setRiskmanager(boolean riskmanager) { - this.riskmanager = riskmanager; - } - - public boolean isGuest() { - return guest; - } - - public void setGuest(boolean guest) { - this.guest = guest; - } - - public boolean isOrgmanager() { - return orgmanager; - } - - public void setOrgmanager(boolean orgmanager) { - this.orgmanager = orgmanager; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/bean/TestMerchantAccountInfo.java b/src/main/java/au/com/royalpay/payment/manage/dev/bean/TestMerchantAccountInfo.java deleted file mode 100644 index 69214a65a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/bean/TestMerchantAccountInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.dev.bean; - -import com.alibaba.fastjson.JSONObject; - -public class TestMerchantAccountInfo { - - private String id; - private String clientMoniker; - private int role; - private String username; - private String password; - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public void setRole(int role) { - this.role = role; - } - - public void setUsername(String username) { - this.username = username; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public int getRole() { - return role; - } - - public String getUsername() { - return username; - } - - public String getPassword() { - return password; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public JSONObject toJSON() { - return (JSONObject) JSONObject.toJSON(this); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java deleted file mode 100644 index 16e9b0ec8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core; - -import au.com.royalpay.payment.manage.dev.bean.AliExcel; -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; - -public interface AliforexcelService { - JSONObject listClients(HttpServletResponse httpResponse, JSONObject manager, AliExcel query); - - JSONObject registerAlipayOnlineMerchant(); - - void registerWechatMerchant(); - - void registerRangeAlipayOnlineMerchant(int start,int end); - - void registerAlipayMerchant(); - - JSONObject registerInsertAlipayMerchant(String partners); - - JSONObject registerInsertAlipayOnlineMerchant(String partners); - - JSONObject getLessPartnerInfo(); - - void initClientPayType(int begin,int end); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AlipayRegisterService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AlipayRegisterService.java deleted file mode 100755 index 00de11834..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AlipayRegisterService.java +++ /dev/null @@ -1,190 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core; - -import au.com.royalpay.payment.channels.alipay.runtime.AlipayOnlineApi; -import au.com.royalpay.payment.channels.alipay.runtime.AlipayRetailApi; -import au.com.royalpay.payment.core.beans.EmptyMerchantApplication; -import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.util.TextUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; - -@Service -public class AlipayRegisterService { - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private MerchantChannelApplicationManager merchantChannelApplicationManager; - - @Resource - private ClientMapper clientMapper; - - public void batchUpdateAlipayApply() { - logger.info("=======>batchUpdateAlipayApply=开始批量更新支付宝"); - String[] alipayonlines = new String[]{ - - }; - HashMap sb = new HashMap(); - HashMap sb2 = new HashMap(); - HashMap sb_failure = new HashMap(); - HashMap sb_failure2 = new HashMap(); - StringBuilder fail_reason = new StringBuilder(); - - fail_reason.append("线上===========\n"); - Arrays.stream(alipayonlines).forEach( - clientMoniker -> { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - logger.info("======>alipayonline:" + clientMoniker + ":client为空"); - - sb_failure.put(clientMoniker, clientMoniker); - fail_reason.append(clientMoniker + ":商户已失效,"); - return; - } - if (TextUtils.isEmpty(client.getString("acn"))) { - client.put("acn", null); - } - logger.info("======>alipayonline:" + clientMoniker); - if (!client.containsKey("company_website") || TextUtils.isEmpty(client.getString("company_website"))) { - client.put("company_website", "https://www.royalpay.com.au/"); - } - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "Registered body(Sole Trader)"); - } - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - logger.info("======>alipayonline:" + clientMoniker + ":alipayindustry为空,给默认值5311"); - client.put("alipayindustry", "5311"); - } - - try { - merchantChannelApplicationManager.getRegister(AlipayOnlineApi.class).apply(client, new EmptyMerchantApplication(), null); - logger.info("======>alipayindustry:register:" + clientMoniker); - sb.put(clientMoniker, clientMoniker); - } catch (Exception e) { - e.printStackTrace(); - logger.info("======>alipayindustry:register2:" + clientMoniker); - if ("DUPLICATE_REQUEST".equalsIgnoreCase(e.getMessage())) { - sb.put(clientMoniker, clientMoniker); - } else { - sb_failure.put(clientMoniker, clientMoniker); - fail_reason.append(clientMoniker + ":" + e.getMessage() + ","); - - } - } - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - - ); - - String[] alipayRetails = new String[]{ - - }; - fail_reason.append("线下===========\n"); - - Arrays.stream(alipayRetails).forEach( - - clientMoniker -> { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - logger.info("======>alipayRetail:" + clientMoniker + ":client为空"); - sb_failure2.put(clientMoniker, clientMoniker); - fail_reason.append(clientMoniker + ":商户已失效,"); - - return; - } - if (TextUtils.isEmpty(client.getString("acn"))) { - client.put("acn", null); - } - logger.info("======>alipayRetail:" + clientMoniker); - if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { - sb_failure2.put(clientMoniker, clientMoniker); - fail_reason.append(clientMoniker + ":store_photo和company_photo为空,"); - - return; - } - - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "Registered body(Sole Trader)"); - } - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - logger.info("======>alipayRetail:" + clientMoniker + ":alipayindustry为空,给默认值5311"); - client.put("alipayindustry", "5311"); - } - - - try { - merchantChannelApplicationManager.getRegister(AlipayRetailApi.class).apply(client, new EmptyMerchantApplication(), null); - logger.info("======>alipayRetail:register:" + clientMoniker); - sb2.put(clientMoniker, clientMoniker); - } catch (Exception e) { - System.out.println("====>Exception:" + e.getMessage()); - e.printStackTrace(); - logger.info("======>alipayRetail:register2:" + clientMoniker); - - if ("DUPLICATE_REQUEST".equalsIgnoreCase(e.getMessage())) { - sb.put(clientMoniker, clientMoniker); - } else { - sb_failure2.put(clientMoniker, clientMoniker); - fail_reason.append(clientMoniker + ":" + e.getMessage() + ","); - - } - } - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - ); -// logger.info("======>as:" + sb.toString()); -// logger.info("======>sb_failure:" + sb_failure.toString()); -// logger.info("======>as2:" + sb2.toString()); -// logger.info("======>sb_failure2:" + sb_failure2.toString()); - - StringBuilder stringBuilder = new StringBuilder(); - StringBuilder stringBuilder2 = new StringBuilder(); - Iterator iterator = sb.keySet().iterator(); - - while (iterator.hasNext()) { - stringBuilder.append(iterator.next() + ","); - } - Iterator iterator2 = sb2.keySet().iterator(); - - while (iterator2.hasNext()) { - stringBuilder2.append(iterator2.next() + ","); - } - StringBuilder stringBuilderFail = new StringBuilder(); - StringBuilder stringBuilderFail2 = new StringBuilder(); - Iterator iterator_fail = sb_failure.keySet().iterator(); - - while (iterator_fail.hasNext()) { - stringBuilderFail.append(iterator_fail.next() + ","); - } - Iterator iterator_fail2 = sb_failure2.keySet().iterator(); - - while (iterator_fail2.hasNext()) { - stringBuilderFail2.append(iterator_fail2.next() + ","); - } - - logger.info("======>stringBuilder:" + stringBuilder.toString()); - logger.info("======>stringBuilder2:" + stringBuilder2.toString()); - logger.info("======>stringBuilderFail:" + stringBuilderFail.toString()); - logger.info("======>stringBuilderFail2:" + stringBuilderFail2.toString()); - logger.info("======>fail_reason:" + fail_reason.toString()); - - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/ManualService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/ManualService.java deleted file mode 100644 index cc083f972..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/ManualService.java +++ /dev/null @@ -1,9 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core; - -/** - * @author kira - * @date 2018/8/2 - */ -public interface ManualService { - void clientPostpone(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java deleted file mode 100644 index 56482064a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core; - -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import com.alibaba.fastjson.JSONObject; -import java.util.List; - -public interface MerchantLocationService { - - List listMerchantsLocations(PartnerQuery query); - - void initClientLocations() throws InterruptedException; - - JSONObject getMerchantLocationByMoniker(String clientMoniker); - - void updateMerchantLocation(JSONObject manager, String clientMoniker, JSONObject geoData); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/NewpartnerService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/NewpartnerService.java deleted file mode 100644 index 9938ce304..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/NewpartnerService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core; - -import au.com.royalpay.payment.manage.dev.bean.ClientTestRegisterInfo; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.transaction.annotation.Transactional; - - -/** - * Created by yangluo on 2018-6-28. - */ -public interface NewpartnerService { - @Transactional - JSONObject registerClient(String clientMoniker, ClientTestRegisterInfo registery, JSONObject manager); - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/WechatMessageService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/WechatMessageService.java deleted file mode 100644 index 5e268113b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/WechatMessageService.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core; - -import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage; - -/** - * Created by yuan on 2017/9/18. - */ -public interface WechatMessageService { - - void sendMessageByMerchant(SendWechatMessage sendWechatMessage); - - void sendMessageByRoles(SendWechatMessage sendWechatMessage); - - void sendMessageByOpenId(SendWechatMessage sendWechatMessage); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java deleted file mode 100644 index f3a58c6c3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ /dev/null @@ -1,561 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core.impl; - -import au.com.royalpay.payment.channels.alipay.config.AlipayConfig; -import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment; -import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient; -import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient; -import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo; -import au.com.royalpay.payment.manage.dev.bean.AliExcel; -import au.com.royalpay.payment.manage.dev.core.AliforexcelService; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.dom4j.Element; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.security.InvalidParameterException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; - -@Service -public class AliforexcelServiceImpl implements AliforexcelService { - @Resource - private ClientMapper clientMapper; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private TransactionMapper transactionMapper; - @Resource - private AlipayClient alipayClient; - @Resource - private OrderMapper orderMapper; - @Resource - private WxPayClient wxPayClient; - @Resource - private SysWxMerchantApplyMapper sysWxMerchantApplyMapper; - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - - - @Override - public JSONObject listClients(HttpServletResponse httpResponse, JSONObject manager, AliExcel query) { - OutputStream ous = null; - try (Workbook wb = new HSSFWorkbook()) { - JSONObject params = query.toJsonParam(); - List partners = clientMapper.passPartners(params); - httpResponse.setContentType("application/octet-stream;"); - httpResponse.setCharacterEncoding("utf-8"); - String fileName = "支付宝进件专用--"; - String codedFileName = java.net.URLEncoder.encode(fileName, "UTF-8"); - httpResponse.addHeader("Content-Disposition", "attachment; filename=" + codedFileName + query.getDatefrom() + "~" + query.getDateto() + ".xls"); - ous = httpResponse.getOutputStream(); - Sheet sheet = wb.createSheet("支付宝进件专用"); - sheet.createFreezePane(1, 2); - sheet.setDefaultColumnWidth((short) 25); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"Company name", "Store name", "Partner Code", "Industry", "Store address", "Business hours", "Contact information", "Video link (optional)", "Store description", "Tags", "Logo", "Company Photo"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - for (JSONObject partner : partners) { - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_name")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("short_name")); - if (!"".equals(partner.getString("ali_sub_merchant_id"))) { - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("ali_sub_merchant_id")); - } else { - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("client_moniker")); - } - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("alipayindustry")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("address") + "," + partner.getString("suburb") + "," + partner.getString("state") + "," + partner.getString("postcode")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("business_hours")); - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_phone")); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("")); - row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("merchant_introduction")); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("")); - row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("logo_url")); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_photo")); - } - wb.write(ous); - ous.flush(); - - - } catch (IOException e) { - logger.error(e.getMessage(), e); - } finally { - IOUtils.closeQuietly(ous); - } - - return null; - } - - @Override - public JSONObject registerAlipayOnlineMerchant() { - JSONObject result = new JSONObject(); - List needRegisterMerchant = new ArrayList<>(); - List registerSuccessMerchant = new ArrayList<>(); - List registerFailMerchant = new ArrayList<>(); - List lessInfoMerchant = new ArrayList<>(); - List useAlipayOnlineMerchant = clientMapper.listUseAlipayMerchant(0, 10000); - for (int clientId : useAlipayOnlineMerchant) { - JSONObject client = clientMapper.findClient(clientId); - if (client == null) { - continue; - } - try { - needRegisterMerchant.add(client.getString("client_moniker")); - if (StringUtils.isBlank(client.getString("company_website"))) { - client.put("company_website", client.getString("ali_sub_merchant_id") + ".royalpay.com.au"); - } - checkPartnerInfo(client, "online"); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - continue; - } - try { - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - registerSuccessMerchant.add(client.getString("client_moniker")); - } catch (Exception e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - registerFailMerchant.add(exception); - } - } - result.put("need_register_merchant", needRegisterMerchant); - result.put("success_register_merchant", registerSuccessMerchant); - result.put("fail_register_merchant", registerFailMerchant); - result.put("less_info_merchant", lessInfoMerchant); - logger.info("-------AlipayOnline Gms end----fail_register_merchant{}", registerFailMerchant.toString()); - return result; - } - - @Override - public void registerWechatMerchant() { - royalThreadPoolExecutor.execute(() -> { - List apClients = clientMapper.findApClient(); - apClients.forEach(client -> { - try { - - JSONObject params = new JSONObject(); - params.put("merchant_name", client.getString("company_name")); - params.put("merchant_shortname", StringUtils.substring(client.getString("short_name"), 0, 20)); - params.put("office_phone", client.getString("contact_phone")); - params.put("contact_phone", client.getString("contact_phone")); - params.put("contact_email", client.getString("contact_email")); - params.put("business_category", "484"); - params.put("merchant_remark", client.getString("client_moniker")); - params.put("website", client.getString("company_website")); - params.put("merchant_introduction", client.getString("short_name")); - SubMerchantInfo subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfo.class); - params.put("merchant_id", client.getString("merchant_id")); - params.put("client_id", client.getString("client_id")); - params.put("create_time", new Date()); - params.put("operator", "System"); - Element elem = wxPayClient.subMerchantApplication(client.getString("merchant_id"), subMerchantInfo); - String sub_merchant_id = elem.elementText("sub_mch_id"); - if (StringUtils.isNotEmpty(sub_merchant_id)) { - params.put("sub_merchant_id", sub_merchant_id); - sysWxMerchantApplyMapper.insertWxMerchantApply(params); - client.put("sub_merchant_id", sub_merchant_id); - clientMapper.update(client); - } else { - throw new BadRequestException(elem.elementText("return_msg")); - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - }); - }); - } - - @Override - public void registerRangeAlipayOnlineMerchant(int start, int end) { - royalThreadPoolExecutor.execute(() -> { - List needRegisterMerchant = new ArrayList<>(); - List registerSuccessMerchant = new ArrayList<>(); - List registerFailMerchant = new ArrayList<>(); - List lessInfoMerchant = new ArrayList<>(); - List alipayApClients = clientMapper.findApClient(); - alipayApClients.forEach(client -> { - try { - needRegisterMerchant.add(client.getString("client_moniker")); - if (StringUtils.isBlank(client.getString("company_website"))) { - client.put("company_website", client.getString("ali_sub_merchant_id") + ".royalpay.com.au"); - } - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - client.put("alipayindustry", "5311"); - } - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "da"); - } - checkPartnerInfo(client, "online"); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - } - try { - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - } - registerSuccessMerchant.add(client.getString("client_moniker")); - } catch (Exception e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - registerFailMerchant.add(exception); - } - }); - }); - } - - @Override - public void registerAlipayMerchant() { - royalThreadPoolExecutor.execute(() -> { - JSONObject result = new JSONObject(); - List needRegisterMerchant = new ArrayList<>(); - List registerSuccessMerchant = new ArrayList<>(); - List registerFailMerchant = new ArrayList<>(); - List lessInfoMerchant = new ArrayList<>(); - List alipayApClients = clientMapper.findApClient(); - alipayApClients.forEach(client -> { - try { - needRegisterMerchant.add(client.getString("client_moniker")); - checkPartnerInfo(client, "offline"); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); - Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - } - registerSuccessMerchant.add(client.getString("client_moniker")); - }); - result.put("need_register_merchant", needRegisterMerchant); - result.put("success_register_merchant", registerSuccessMerchant); - result.put("fail_register_merchant", registerFailMerchant); - result.put("less_info_merchant", lessInfoMerchant); - }); - } - - @Override - public JSONObject registerInsertAlipayMerchant(String partners) { - String[] partner = partners.split(","); - JSONObject result = new JSONObject(); - List needRegisterMerchant = new ArrayList<>(); - List registerSuccessMerchant = new ArrayList<>(); - List registerFailMerchant = new ArrayList<>(); - List lessInfoMerchant = new ArrayList<>(); - for (String clientMoniker : partner) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - continue; - } - try { - needRegisterMerchant.add(client.getString("client_moniker")); - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - client.put("alipayindustry", "5311"); - } - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "da"); - } - if (StringUtils.isBlank(client.getString("store_photo")) || StringUtils.isBlank(client.getString("company_photo"))) { - if (StringUtils.isBlank(client.getString("store_photo")) && !StringUtils.isBlank(client.getString("company_photo"))) { - client.put("store_photo", client.getString("company_photo")); - } - if (!StringUtils.isBlank(client.getString("store_photo")) && StringUtils.isBlank(client.getString("company_photo"))) { - client.put("company_photo", client.getString("store_photo")); - } - if (StringUtils.isBlank(client.getString("store_photo")) && StringUtils.isBlank(client.getString("company_photo"))) { - client.put("store_photo", client.getString("logo_url")); - client.put("company_photo", client.getString("logo_url")); - } - } - checkPartnerInfo(client, "offline"); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - continue; - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); - Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - registerSuccessMerchant.add(client.getString("client_moniker")); - } - result.put("need_register_merchant", needRegisterMerchant); - result.put("success_register_merchant", registerSuccessMerchant); - result.put("fail_register_merchant", registerFailMerchant); - result.put("less_info_merchant", lessInfoMerchant); - return result; - } - - @Override - public JSONObject registerInsertAlipayOnlineMerchant(String partners) { - String[] partner = partners.split(","); - JSONObject result = new JSONObject(); - List needRegisterMerchant = new ArrayList<>(); - List registerSuccessMerchant = new ArrayList<>(); - List registerFailMerchant = new ArrayList<>(); - List lessInfoMerchant = new ArrayList<>(); - for (String clientMoniker : partner) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - continue; - } - try { - needRegisterMerchant.add(client.getString("client_moniker")); - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - client.put("alipayindustry", "5311"); - } - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "da"); - } - if (StringUtils.isBlank(client.getString("company_website"))) { - client.put("company_website", client.getString("ali_sub_merchant_id") + ".royalpay.com.au"); - } - checkPartnerInfo(client, "online"); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - continue; - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - registerSuccessMerchant.add(client.getString("client_moniker")); - } - result.put("need_register_merchant", needRegisterMerchant); - result.put("success_register_merchant", registerSuccessMerchant); - result.put("fail_register_merchant", registerFailMerchant); - result.put("less_info_merchant", lessInfoMerchant); - return result; - } - - @Override - public JSONObject getLessPartnerInfo() { - JSONObject result = new JSONObject(); - List lessInfoMerchant = new ArrayList<>(); - List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); - for (int clientId : useAlipayOnlineMerchant) { - JSONObject client = clientMapper.findClient(clientId); - if (client == null) { - continue; - } - try { - checkPartnerInfo(client, "online"); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - } - } - result.put("less_info_merchant", lessInfoMerchant); - return result; - } - - private void checkPartnerInfo(JSONObject client, String type) { - if ("online".equals(type)) { - if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { - client.put("company_website", "https://www.royalpay.com.au/"); - } - } else { - if (!client.containsKey("store_photo") && !client.containsKey("company_photo")) { - throw new InvalidParameterException("store photo cannot be empty "); - } - if (client.containsKey("store_photo") && !client.containsKey("company_photo")) { - client.put("company_photo", client.getString("store_photo")); - } - if (client.containsKey("company_photo") && !client.containsKey("store_photo")) { - client.put("store_photo", client.getString("company_photo")); - } - } - if (StringUtils.isBlank(client.getString("business_structure"))) { - throw new InvalidParameterException("Business Structure can't be null"); - } - - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - throw new InvalidParameterException("Alipay Industry can't be null"); - } - } - - - @Override - public void initClientPayType(int begin, int end) { - List merchants = clientMapper.clientPayTypeInfoByClientIdRange(begin, end); - for (JSONObject partner : merchants) { - JSONObject clientConfig = new JSONObject(); - List types = new ArrayList<>(); - List descs = new ArrayList<>(); - clientConfig.put("client_id", partner.getIntValue("client_id")); - clientConfig.put("client_moniker", partner.getString("client_moniker")); - List gateways = orderMapper.listGatewayByClientId(partner.getIntValue("client_id")); - if (gateways.isEmpty()) { - unOrdersPartner(partner, clientConfig); - continue; - } - if (gateways.contains(0) || gateways.contains(1) || gateways.contains(2)) { - descs.add("6"); - } - if (gateways.contains(3) || gateways.contains(9) || gateways.contains(14)) { - descs.add("1"); - } - if (gateways.contains(4) || gateways.contains(7)) { - descs.add("4"); - } - if (gateways.contains(5) || gateways.contains(6) || gateways.contains(11)) { - descs.add("8"); - descs.add("12"); - } - if (gateways.contains(8)) { - descs.add("2"); - } - if (gateways.contains(10)) { - descs.add("3"); - } - if (gateways.contains(12)) { - descs.add("5"); - } - if (gateways.contains(13)) { - descs.add("6"); - } - if (descs.contains("1") || descs.contains("2") || descs.contains("3") || descs.contains("4") || - descs.contains("5")) { - types.add("1"); - } - if (descs.contains("6") || descs.contains("7") || descs.contains("8") || descs.contains("9") || - descs.contains("10") || descs.contains("11") || descs.contains("12") || descs.contains("13")) { - types.add("2"); - } - clientConfig.put("client_pay_type", StringUtils.join(types, ',')); - clientConfig.put("client_pay_desc", StringUtils.join(descs, ',')); - clientConfigMapper.update(clientConfig); - } - } - - private void unOrdersPartner(JSONObject partner, JSONObject clientConfig) { - if (StringUtils.isBlank(partner.getString("client_pay_type"))) { - clientConfig.put("client_pay_type", "2"); - clientConfig.put("client_pay_desc", "6"); - } else { - String[] types = partner.getString("client_pay_type").split(","); - List descs = new ArrayList<>(); - if (Arrays.asList(types).contains("1")) { - descs.add("3"); - } - if (Arrays.asList(types).contains("2")) { - descs.add("6"); - } - clientConfig.put("client_pay_desc", StringUtils.join(descs, ',')); - } - clientConfigMapper.update(clientConfig); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java deleted file mode 100644 index d99e2d39c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core.impl; - -import au.com.royalpay.payment.manage.dev.core.ManualService; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; -import au.com.royalpay.payment.manage.task.PostponeClientTask; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author kira - * @date 2018/8/2 - */ -@Service -public class ManualServiceimpl implements ManualService { - - Logger logger = LoggerFactory.getLogger(PostponeClientTask.class); - @Resource - private ClientRateMapper clientRateMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Override - public void clientPostpone() { - logger.info("start doing client postpone"); - synchronizedScheduler.executeProcess("manage_task:postPoneClient", 120_000, () -> { - Date now = new Date(); - Date tomorrow = DateUtils.addDays(now, 1); - Date yearTomorrow = DateUtils.addYears(tomorrow, 1); - String expireDate = DateFormatUtils.format(yearTomorrow, "yyyy-MM-dd"); - List expiryClient = clientRateMapper.getAllExpiry(now); - - if (CollectionUtils.isEmpty(expiryClient)) { - return; - } - Map expiryClients = new HashMap<>(); - expiryClient.forEach(p -> { - expiryClients.put(p.getInteger("client_id"), p); - }); - expiryClients.values().forEach(p -> { - int client_id = p.getIntValue("client_id"); - List adminAccounts = clientAccountMapper.listAdminAccounts(client_id); - List clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null); - JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", p.getIntValue("client_id")); - int cleanDays = 1; - if (wechatRate.getInteger("clean_days") != null) { - cleanDays = wechatRate.getIntValue("clean_days"); - } else { - cleanDays = wechatRate.getIntValue("c_clean_days"); - } - int finalCleanDays = cleanDays; - - modifyClientRates(finalCleanDays,clientRates,client_id,p.getString("client_moniker")); - - }); - }); - logger.info("end doing client postpone"); - - } - - @Transactional - public void modifyClientRates(int finalCleanDays,List clientRates,int client_id,String client_moniker) { - Date now = new Date(); - Date tomorrow = DateUtils.addDays(now, 1); - Date yearTomorrow = DateUtils.addYears(tomorrow, 1); - clientRates.forEach(o -> { - JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name")); - record.remove("client_rate_id"); - record.put("active_time", now); - record.put("manager_id", 0); - record.put("expiry_time", yearTomorrow); - record.put("create_time", now); - record.put("update_time", now); - record.put("clean_days", finalCleanDays); - record.put("manager_name", "System"); - record.put("remark", "费率到期系统自动延期1年"); - clientRateMapper.saveRate(record); -// if ("Rpay".equals(o.getString("rate_name"))) { -// rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id)); -// } - - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java deleted file mode 100644 index ef03f7e06..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core.impl; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; -import au.com.royalpay.payment.manage.mappers.system.ClientLocationsMapper; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.net.URISyntaxException; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -@Service -public class MerchantLocationServiceImpl implements MerchantLocationService { - private Logger logger = LoggerFactory.getLogger(getClass()); - - private static final String GOOGLE_MAPS_API = "https://maps.googleapis.com/maps/api/geocode/json"; - - private static final String GOOGLE_API_KEY = "AIzaSyDUu6qXRV-j24rSdbPOMfVdTN1-2OfC2o8"; - - private ThreadPoolExecutor pool = new ThreadPoolExecutor(5, 100, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - private Set failureSet = ConcurrentHashMap.newKeySet(); - - @Resource - private ClientLocationsMapper clientLocationsMapper; - @Resource - private ClientManager clientManager; - - - @Override - public List listMerchantsLocations(PartnerQuery query) { - JSONObject params = query.toJsonParam(); - return clientLocationsMapper.getAllMerchantsLocations(params); - } - - @Resource - private JdbcTemplate jdbcTemplate; - - @Override - public void initClientLocations() throws InterruptedException { - List> clients = jdbcTemplate.queryForList("select client_id, CONCAT(IFNULL(address,''),' ',IFNULL(suburb,''),' ',IFNULL(state,''),' ',IFNULL(country,'')) as 'address' from royalpay_production.sys_clients where client_id not in (select client_id from royalpay_production.sys_clients_locations) "); - final int totalLen = clients.size(); - logger.info("total length:{}", totalLen); - for (int i = 0; i < totalLen; i++) { - Map client = clients.get(i); - final JSONObject clientObj = new JSONObject(client); - final int idx = i; - pool.execute(() -> { - try { - processClient(clientObj, idx, totalLen); - } catch (URISyntaxException e) { - failureSet.add(clientObj.getIntValue("client_id")); - } - }); - Thread.sleep(120); - - } - pool.shutdown(); - pool.awaitTermination(5, TimeUnit.HOURS); - System.err.println("Failed clients:" + StringUtils.join(failureSet, ",")); - } - - private void processClient(JSONObject client, int idx, int totalLen) throws URISyntaxException { - String url = UriComponentsBuilder.fromHttpUrl(GOOGLE_MAPS_API) - .queryParam("key", GOOGLE_API_KEY) - .queryParam("address", client.get("address")).toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.GET); - int clientId = client.getIntValue("client_id"); - logger.info("start processing index {}/{},client_id={}", idx, totalLen, clientId); - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - try { - JSONObject address = result.getResponseContentJSONObj(); - System.err.println(address); - JSONArray array1 = address.getJSONArray("results"); - JSONObject aarray2 = (JSONObject) array1.get(0); - JSONObject location = aarray2.getJSONObject("geometry").getJSONObject("location"); - String longitude = location.getString("lng"); - String latitude = location.getString("lat"); - String sql = "INSERT royalpay_production.sys_clients_locations values(replace(uuid(),'-','')," + clientId + ",'" + client.getString("address") + "','" + latitude + "','" + longitude + "','System Init',now())"; - jdbcTemplate.update(sql); - } catch (Exception e) { - logger.error(e.getMessage(), e); - failureSet.add(clientId); - } - } else { - System.err.print(result.getStatusCode()); - failureSet.add(clientId); - } - logger.info("finished index {}/{},client_id={}", idx, totalLen, clientId); - } - - @Override - public JSONObject getMerchantLocationByMoniker(String clientMoniker) { - return clientLocationsMapper.findTheLocationByMerchantCode(clientMoniker); - } - - @Override - public void updateMerchantLocation(JSONObject manager, String clientMoniker, JSONObject geoData) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - geoData.put("client_id", client.getIntValue("client_id")); - geoData.put("last_update_by", manager.getString("display_name")); - geoData.put("last_update_date", new Date()); - - JSONObject existParams = clientLocationsMapper.findTheLocationByMerchantCode(clientMoniker); - if (existParams == null || existParams.size() <= 0) { - clientLocationsMapper.save(geoData); - } else { - geoData.put("location_id", existParams.getString("location_id")); - clientLocationsMapper.update(geoData); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/NewpartnerServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/NewpartnerServiceImpl.java deleted file mode 100644 index e9d7dddce..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/NewpartnerServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core.impl; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.dev.bean.ClientTestRegisterInfo; -import au.com.royalpay.payment.manage.dev.core.NewpartnerService; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; - -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Date; - -import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; - -/** - * Created by yangluo on 2018-6-28. - */ -@Service -public class NewpartnerServiceImpl implements NewpartnerService { - @Resource - private ClientMapper clientMapper; - @Resource - private ClientConfigService clientConfigService; - @Resource - private AttachmentClient attachmentClient; - - - - @Cacheable(value = ":app_client_info_moniker:", key = "#clientMoniker") - public JSONObject getClientInfoByMoniker(String clientMoniker) { - return clientMapper.findClientByMoniker(clientMoniker); - } - @Override - @Transactional - public JSONObject registerClient(String clientMoniker, ClientTestRegisterInfo registery, JSONObject manager) { - JSONObject partner = registery.insertObject(); - if (clientMoniker != null && !clientMoniker.equals("")) { - JSONObject superClient = getClientInfoByMoniker(clientMoniker); - if (superClient == null) { - throw new InvalidShortIdException(); - } else { - checkOrgPermission(manager, superClient); - partner.put("parent_client_id", superClient.getIntValue("client_id")); - } - } - partner.put("create_time", new Date()); - partner.put("ali_sub_merchant_id", registery.getClientMoniker()); - partner.put("credential_code", RandomStringUtils.random(32, true, true)); - partner.put("creator", manager.getString("manager_id")); - partner.put("contact_phone", "+611111111111111"); - partner.put("industry", "327"); - partner.put("contact_email", "a@qq.com"); - partner.put("contact_person", "aa"); - partner.put("company_name", "AA"); - partner.put("short_name", "a"); - partner.put("company_phone", "+611111111111111"); - - // if (manager.getIntValue("org_id") == 0) { - // throw new ForbiddenException("You were not belong to any organizations so that you cannot create new - // client"); - // } - partner.put("org_id", 1); - partner.put("approve_result", 1); - partner.put("approve_time", new Date()); - partner.put("open_status", 5); - - if (StringUtils.isNotEmpty(registery.getLogoId())) { - partner.put("logo_url", attachmentClient.getFileUrl(registery.getLogoId())); - partner.put("logo_thumbnail", attachmentClient.getThumbnail(registery.getLogoId(), 600).getString("url")); - } - if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { - partner.put("approve_result", 1); - partner.put("approver", manager.getString("manager_id")); - partner.put("approve_time", new Date()); - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - partner.put("bd_user", manager.getString("manager_id")); - partner.put("bd_user_name", manager.getString("display_name")); - } - if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) { - throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); - } - try { - clientMapper.save(partner); - JSONObject clientConfig = new JSONObject(); - clientConfig.put("client_id", partner.getIntValue("client_id")); - clientConfig.put("client_moniker", partner.getString("client_moniker")); - clientConfigService.save(clientConfig); - } catch (Exception e) { - throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); - } - - - - - - return partner; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java deleted file mode 100644 index b31e7f614..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -package au.com.royalpay.payment.manage.dev.core.impl; - -import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage; -import au.com.royalpay.payment.manage.dev.core.WechatMessageService; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * Created by yuan on 2017/9/18. - */ -@Service -public class WechatMessageServiceImpl implements WechatMessageService { - - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - - @Override - public void sendMessageByMerchant(SendWechatMessage sendWechatMessage) { - JSONObject object = sendWechatMessage.insertObject(); - try { - String partnerCode = object.getString("partner_code"); - String[] partnerCodes = partnerCode.split(","); - for (String partner_code : partnerCodes){ - System.out.println(partner_code); - JSONObject client = clientMapper.findClientByMoniker(partner_code); - if (null == client) { - throw new ServerErrorException("不存在此商户"); - } else { - List clientAccount = clientAccountMapper.listPartnerAccounts(client.getIntValue("client_id")); - if(null != clientAccount){ - for (JSONObject obj : clientAccount) { - if (null != obj.getString("wechat_openid")) { - object.put("open_id", obj.getString("wechat_openid")); - sendWecharMessageByOpenId(object); - } - } - }else { - throw new ServerErrorException("该商户不存在微信登录"); - } - - } - } - - } catch (WechatException e) { - throw new ServerErrorException(e.getMessage()); - } catch (Exception ee) { - ee.printStackTrace(); - throw new ServerErrorException("模板消息发送失败"); - } - } - @Override - public void sendMessageByRoles(SendWechatMessage sendWechatMessage){ - JSONObject object = sendWechatMessage.insertObject(); - Set set = new HashSet<>(); - if (sendWechatMessage.isAccountmanager()){ - set = getOpenIdSet(set, ManagerRole.ACCOUNT_MANAGER.getMask()); - } - if (sendWechatMessage.isAdmin()){ - set = getOpenIdSet(set, ManagerRole.ADMIN.getMask()); - } - if (sendWechatMessage.isBd()){ - set = getOpenIdSet(set, ManagerRole.BD_USER.getMask()); - } - if (sendWechatMessage.isBdleader()){ - set = getOpenIdSet(set, ManagerRole.BD_LEADER.getMask()); - } - if (sendWechatMessage.isDeveloper()){ - set = getOpenIdSet(set, ManagerRole.DEVELOPER.getMask()); - } - if (sendWechatMessage.isFinacial()){ - set = getOpenIdSet(set, ManagerRole.FINANCIAL_STAFF.getMask()); - } - if (sendWechatMessage.isGuest()){ - set = getOpenIdSet(set, ManagerRole.GUEST.getMask()); - } - if (sendWechatMessage.isRiskmanager()){ - set = getOpenIdSet(set, ManagerRole.RISK_MANAGER.getMask()); - } - if (sendWechatMessage.isSitemanager()){ - set = getOpenIdSet(set, ManagerRole.SITE_MANAGER.getMask()); - } - if (sendWechatMessage.isServant()){ - set = getOpenIdSet(set, ManagerRole.SERVANT.getMask()); - } - if(sendWechatMessage.isOperator()){ - set = getOpenIdSet(set, ManagerRole.OPERATOR.getMask()); - } - if(sendWechatMessage.isDirector()){ - set = getOpenIdSet(set, ManagerRole.DIRECTOR.getMask()); - } - if(sendWechatMessage.isOrgmanager()){ - set = getOpenIdSet(set, ManagerRole.ORG_MANAGER.getMask()); - } - for(String open_id : set){ - object.put("open_id",open_id); - sendWecharMessageByOpenId(object); - } - } - private Set getOpenIdSet(Set set,int mask){ - List listOpenids = managerMapper.listOpenIdByRole(mask); - for(JSONObject obj : listOpenids){ - if(StringUtils.isNotBlank(obj.getString("wx_openid"))){ - set.add(obj.getString("wx_openid")); - } - } - return set; - } - - @Override - public void sendMessageByOpenId(SendWechatMessage sendWechatMessage) { - JSONObject object = sendWechatMessage.insertObject(); - try { - String openId = object.getString("open_id"); - String[] openIds = openId.split(","); - for(String open_id : openIds){ - object.put("open_id",open_id); - sendWecharMessageByOpenId(object); - } - } catch (WechatException e) { - throw new ServerErrorException(e.getMessage()); - } catch (Exception ee) { - throw new BadRequestException("发送微信模板消息失败"); - } - } - - public void sendWecharMessageByOpenId(JSONObject object) { - String templateId = mpWechatApiProvider.getNewPaymentApi().getTemplateId("task-finished"); - TemplateMessage msg = new TemplateMessage(object.getString("open_id"), templateId, null); - msg.put("first", object.getString("title"), null); - msg.put("keyword1", object.getString("content"), null); - msg.put("keyword2", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), null); - msg.put("remark", null, null); - try { - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - api.sendTemplateMessage(msg); - }catch (Exception e){ - logger.error("发送模板消息失败:", e); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CheatMonitor.java b/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CheatMonitor.java deleted file mode 100644 index 545956ee9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CheatMonitor.java +++ /dev/null @@ -1,9 +0,0 @@ -package au.com.royalpay.payment.manage.dev.listeners; - -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import com.alibaba.fastjson.JSONObject; - -public interface CheatMonitor { - - void recognizeCheat(PaymentFinishedEvent event, JSONObject sysConfig); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CheatWarningSender.java b/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CheatWarningSender.java deleted file mode 100644 index e0fb4a5d4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CheatWarningSender.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.dev.listeners; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.core.Ordered; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * Created by yixian on 2017-07-03. - */ -@Component -public class CheatWarningSender implements ApplicationListener, Ordered { - @Resource - private CheatMonitor[] monitors; - @Resource - private SysConfigManager sysConfigManager; - private Logger logger = LoggerFactory.getLogger(getClass()); - private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - - @Override - public void onApplicationEvent(final AfterPaymentFinishEvent event) { - final JSONObject sysConfig = sysConfigManager.getSysConfig(); - if (!sysConfig.getBooleanValue("cheat_monitor.enable")) { - return; - } - for (final CheatMonitor monitor : monitors) { - pool.execute(new Runnable() { - @Override - public void run() { - monitor.recognizeCheat(event.getFinishedEvent(), sysConfig); - } - }); - } - - logger.debug("execute in pool,pool size:" + pool.getActiveCount()); - } - - @Override - public int getOrder() { - return LOWEST_PRECEDENCE; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CloseOrderWarningSender.java b/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CloseOrderWarningSender.java deleted file mode 100644 index f85c0f044..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/CloseOrderWarningSender.java +++ /dev/null @@ -1,155 +0,0 @@ -package au.com.royalpay.payment.manage.dev.listeners; - -import au.com.royalpay.payment.core.events.OrderCloseEvent; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.*; - -@Component -public class CloseOrderWarningSender implements ApplicationListener { - private String templateId = "vjeNnggHnnRHvBP80lkEEtPk8ouf7JnvrQYDCyxqx4g"; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private OrderMapper orderMapper; - @Resource - private ClientManager clientManager; - @Resource - private ManagerMapper managerMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - private Hashtable warningList = new Hashtable<>(); - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public void onApplicationEvent(OrderCloseEvent event) { - JSONObject order = event.getOrder(); - int clientId = order.getIntValue("client_id"); - JSONObject config = sysConfigManager.getSysConfig(); - JSONObject client = clientManager.getClientInfo(clientId); - if (client == null) { - return; - } - String whiteList = config.getString("cheat_monitor.white_list"); - String whiteArr[] = whiteList.split(","); - for (String s : whiteArr) { - if (client.getString("client_moniker").equals(s)) { - return; - } - } - - JSONObject params = new JSONObject(); - params.put("client_id", clientId); - Date from = new Date(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String fromStr = format.format(from); - Date to = DateUtils.addDays(from, 1); - String toStr = format.format(to); - params.put("from", fromStr); - params.put("to", toStr); - List recentOrders = orderMapper.listOrdersNoPage(params); - int minOrders = config.getIntValue("cheat_monitor.mch_close_warning_min_orders"); - if (recentOrders.size() < minOrders) { - logger.debug("order count:{} is less than min orders, skip", recentOrders.size()); - return; - } - List closed = new ArrayList<>(); - for (JSONObject orderItem : recentOrders) { - if (orderItem.getIntValue("status") == 3) { - closed.add(orderItem); - } - } - int percentage = closed.size() * 100 / recentOrders.size(); - if (percentage < config.getIntValue("cheat_monitor.close_rate_limit")) { - return; - } - String moniker = client.getString("client_moniker"); - Date lastWarning = warningList.get(moniker); - if (lastWarning != null) { - long noDisturbingMinutes = config.getLongValue("cheat_monitor.no_disturbing"); - if (System.currentTimeMillis() - lastWarning.getTime() < noDisturbingMinutes * 60_000) { - logger.debug("close order warning: no disturbing {}", order.getString("order_id")); - return; - } - } - warningList.put(moniker, new Date()); - List developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask() | ManagerRole.RISK_MANAGER.getMask()); - if (!StringUtils.isEmpty(client.getString("bd_user"))) { - String[] bds = client.getString("bd_user").split(","); - if (bds.length > 0) { - List ids = new LinkedList<>(); - for (String bd : bds) { - ids.add(Integer.valueOf(bd)); - } - List bdinfos = managerMapper.findByIds(ids); - developers.addAll(bdinfos); - } - } - - - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - // List accounts = clientAccountMapper.listAdminAccounts(clientId); - // for (JSONObject account : accounts) { - // try { - // String wxOpenid = account.getString("wechat_openid"); - // String title = client.getString("short_name"); - // String content = "尊敬的商户,RoyalPay检测到您的店铺存在异常交易行为,请确认,RoyalPay将持续关注。"; - // String remark = "最近" + recentOrders.size() + "笔订单中有" + closed.size() + "笔关闭,占比" + percentage + "%;\r\n" + - // "最早一笔:" - // + DateFormatUtils.format(recentOrders.get(1).getDate("create_time"), "yyyy-MM-dd HH:mm:ss") + "\r\n" + - // "最近一笔:" - // + DateFormatUtils.format(recentOrders.get(recentOrders.size() - 1).getDate("create_time"), "yyyy-MM-dd - // HH:mm:ss"); - // if (wxOpenid != null) { - // TemplateMessage msg = WarningSenderHelper.buildCustomerWarningMessage(wxOpenid, templateId, title, content, - // remark); - // api.sendTemplateMessage(msg); - // } - // } catch (Exception ignore) { - // } - // } - - for (JSONObject developer : developers) { - if (developer.getString("manager_id").equals("141")) { - continue; - } - if (StringUtils.isBlank(developer.getString("wx_openid"))) { - continue; - } - try { - String title = client.getString("short_name") + "(" + moniker + ")"; - String content = "最近" + recentOrders.size() + "笔订单中有" + closed.size() + "笔关闭,占比" + percentage + "%;\r\n" + "最早一笔:" - + DateFormatUtils.format(recentOrders.get(1).getDate("create_time"), "yyyy-MM-dd HH:mm:ss") + "\r\n" + "最近一笔:" - + DateFormatUtils.format(recentOrders.get(recentOrders.size() - 1).getDate("create_time"), "yyyy-MM-dd HH:mm:ss"); - String wxOpenid = developer.getString("wx_openid"); - if (wxOpenid != null) { - TemplateMessage msg = WarningSenderHelper.buildCustomerWarningMessage(wxOpenid, templateId, title, content, - "所属BD:" + client.getString("bd_user_name")); - api.sendTemplateMessage(msg); - } - } catch (Exception e) { - logger.info("sendTemplateMessage--发送告警模板消息发生错误" + developer.getString("wx_openid") + "--" + e); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/WarningSenderHelper.java b/src/main/java/au/com/royalpay/payment/manage/dev/listeners/WarningSenderHelper.java deleted file mode 100644 index 5160204dc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/WarningSenderHelper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.dev.listeners; - -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import org.apache.commons.lang3.time.DateFormatUtils; - -import java.util.Date; - -public class WarningSenderHelper { - public static TemplateMessage buildWarningMessage(String wxOpenid, String templateId, String title, String content, String bdUserName) { - TemplateMessage msg = new TemplateMessage(wxOpenid, templateId, null); - msg.put("first", "刷单监测警告", "#ff0000"); - msg.put("keyword1", "Host", "#000000"); - msg.put("keyword2", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword3", "刷单监控", "#00ff00"); - msg.put("keyword4", title, "#ff0000"); - msg.put("keyword5", content, "#000000"); - msg.put("remark", "所属BD:" + bdUserName, "#000000"); - return msg; - } - - public static TemplateMessage buildCustomerWarningMessage(String wxOpenid, String templateId, String title, String content,String remark) { - TemplateMessage msg = new TemplateMessage(wxOpenid, templateId, null); - msg.put("first", title, "#000000"); - msg.put("keyword1", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword2", content, "#ff0000"); - msg.put("remark", remark, "#000000"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/recognizers/PaymentAmountCheatMonitor.java b/src/main/java/au/com/royalpay/payment/manage/dev/listeners/recognizers/PaymentAmountCheatMonitor.java deleted file mode 100644 index c20ecf12e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/listeners/recognizers/PaymentAmountCheatMonitor.java +++ /dev/null @@ -1,137 +0,0 @@ -package au.com.royalpay.payment.manage.dev.listeners.recognizers; - -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.manage.dev.listeners.CheatMonitor; -import au.com.royalpay.payment.manage.dev.listeners.WarningSenderHelper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; - -@Component -public class PaymentAmountCheatMonitor implements CheatMonitor { - private String templateId = "c7DoVmCGnSNNHWVwwkLjwlOqVc78b5HfaLS7Ys3lNt8"; - @Resource - private OrderMapper orderMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private TransactionService transactionService; - @Resource - private ManagerMapper managerMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - private Hashtable warningList = new Hashtable<>(); - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public void recognizeCheat(PaymentFinishedEvent event, JSONObject sysConfig) { - JSONObject order = event.getOrder(); - JSONObject params = new JSONObject(); - - String brush_list_channels = sysConfig.getString("cheat_monitor_brush_list_channels"); - if(StringUtils.isEmpty(brush_list_channels)){ - return; - } - if(!brush_list_channels.contains(order.getString("channel"))){ - return; - } - params.put("channels", Arrays.asList(brush_list_channels.split(","))); - - params.put("client_id", order.getIntValue("client_id")); - BigDecimal amountFrom = sysConfig.getBigDecimal("cheat_monitor.amount_from"); - BigDecimal amountTo = sysConfig.getBigDecimal("cheat_monitor.amount_to"); - BigDecimal currentAmount = event.getAudFee(); - if (currentAmount.compareTo(amountFrom) < 0 || currentAmount.compareTo(amountTo) > 0) { - logger.debug("amount:" + currentAmount.toPlainString() + " out of range, skip"); - return; - } - int limitOrders = sysConfig.getIntValue("cheat_monitor.limit_orders"); - List recentOrders = orderMapper.listPaid(params, new PageBounds(1, limitOrders, Order.formString("create_time.desc"))); - List cleaned = new ArrayList<>(); - int minOrders = sysConfig.getIntValue("cheat_monitor.min_orders"); - - int orderCount = 0; - for (JSONObject recentOrder : recentOrders) { - if (System.currentTimeMillis() - recentOrder.getDate("create_time").getTime() > 36000_000) { - continue; - } - cleaned.add(recentOrder); - JSONObject transaction = transactionService.findIncomeByOrderId(recentOrder.getString("order_id")); - if (transaction == null) { - continue; - } - BigDecimal clearing = transaction.getBigDecimal("clearing_amount"); - if (amountFrom.compareTo(clearing) <= 0 && amountTo.compareTo(clearing) >= 0) { - orderCount++; - } - } - if (cleaned.size() < minOrders) { - logger.debug("order count:" + cleaned.size() + " is less than min orders, skip"); - return; - } - BigDecimal percentage = BigDecimal.valueOf(orderCount).multiply(CommonConsts.HUNDRED).divide(BigDecimal.valueOf(cleaned.size()), 2, RoundingMode.DOWN); - if (percentage.compareTo(sysConfig.getBigDecimal("cheat_monitor.warning_rate")) > 0) { - JSONObject client = clientMapper.findClient(order.getIntValue("client_id")); - String clientMoniker = client.getString("client_moniker"); - - String subMerchantId = order.getString("sub_merchant_id"); - if (sysConfig.getString("cheat_monitor.white_list").contains(subMerchantId)) { - logger.debug("white list:" + subMerchantId); - return; - } - - Date lastWarning = warningList.get(subMerchantId); - if (lastWarning != null) { - long noDisturbingMinutes = sysConfig.getLongValue("cheat_monitor.no_disturbing"); - if (System.currentTimeMillis() - lastWarning.getTime() < noDisturbingMinutes * 60_000) { - logger.debug("no disturbing " + order.getString("order_id")); - return; - } - } - warningList.put(subMerchantId, new Date()); - - List developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask() | ManagerRole.RISK_MANAGER.getMask()); - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - for (JSONObject developer : developers) { - if(developer.getString("manager_id").equals("141")){ - continue; - } - if (StringUtils.isBlank(developer.getString("wx_openid"))) { - continue; - } - try { - String wxOpenid = developer.getString("wx_openid"); - if (wxOpenid != null) { - String title = "刷单警报(" + clientMoniker + "[" + subMerchantId + "])"; - String content = "最近" + cleaned.size() + "笔交易中有" + orderCount + "笔触发预警,占比" + percentage.toPlainString() + "%;" + - "最早一笔交易时间是:" + DateFormatUtils.format(cleaned.get(cleaned.size() - 1).getDate("create_time"), "yyyy-MM-dd HH:mm:ss") + ";" + - "上一笔交易时间是:" + DateFormatUtils.format(cleaned.get(1).getDate("create_time"), "yyyy-MM-dd HH:mm:ss"); - TemplateMessage msg = WarningSenderHelper.buildWarningMessage(wxOpenid, templateId, title, content, client.getString("bd_user_name")); - api.sendTemplateMessage(msg); - } - } catch (Exception e) { - logger.info("sendTemplateMessage--发送告警模板消息发生错误" + developer.getString("wx_openid") + "--" + e); - } - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/ActivityController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/ActivityController.java deleted file mode 100644 index 2bc14607d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/ActivityController.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.mappers.redpack.ActPartnerLMLogMapper; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; -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 javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2017-01-25. - */ -@RestController -@ManagerMapping(role = ManagerRole.DEVELOPER,value = "/dev/activities/luckymoney") -public class ActivityController { - @Resource - private RedpackService redpackService; - @Resource - private ActPartnerLMLogMapper actPartnerLMLogMapper; - - @RequestMapping(method = RequestMethod.PUT,value = "/resend") - public List resendLuckyMoney(){ - List unsend = actPartnerLMLogMapper.listUnsendRedpacks(); - for (JSONObject redpack:unsend){ - try{ - redpackService.doSendLuckyMoney(redpack.getString("open_id"),redpack.getString("lock_key"),redpack.getString("act_name")); - redpack.put("success",true); - } catch (RedPackException e) { - redpack.put("success",false); - redpack.put("errmsg",e.getMessage()); - } - } - return unsend; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/AnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/AnalysisController.java deleted file mode 100644 index 09c22c963..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/AnalysisController.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.analysis.core.BDAnalysisService; -import au.com.royalpay.payment.manage.dataAnalysis.core.DataAnalysisService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -@RestController -@RequestMapping("/analysis") -public class AnalysisController { - - @Resource - private BDAnalysisService bdAnalysisService; - @Resource - private DataAnalysisService dataAnalysisService; - - - @GetMapping("/report/bd/sales") - public void reportDBSalesList(@RequestParam("date") String date) throws ParseException { - Date newDate = new SimpleDateFormat("yyyy-MM-dd").parse(date); - bdAnalysisService.generateReport(DateFormatUtils.format(newDate, "yyyy-MM-dd")); - } - - @GetMapping("/rp_industry/echarts") - public List rpIndustryEchartsData(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam("from") String from, - @RequestParam("to") String to, - @RequestParam(value = "industry",defaultValue = "0") String industry) throws ParseException{ - String managerId = null; - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - managerId = manager.getString("manager_id"); - } - return dataAnalysisService.getRpIndustryEchartsData(from, to, industry, managerId); - } - - @GetMapping("/rp_industry/top_data") - public JSONObject rpTop20IndustryData(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestParam(value = "industry", defaultValue = "0") String industry, - @RequestParam("trans_date") String transDate, - @RequestParam("page") int page) { - String managerId = null; - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - managerId = manager.getString("manager_id"); - } - return dataAnalysisService.getRpTop20IndustryData(industry, transDate, page, managerId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java deleted file mode 100644 index ec2c600b0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.List; - -@RestController -@RequestMapping("/dev/location") -public class ClientLocationsController { - - @Resource - private MerchantLocationService merchantLocationService; - - @RequireManager - @RequestMapping(value = "/json") - public List getClientsLocations(PartnerQuery query) { - return merchantLocationService.listMerchantsLocations(query); - } - - @RequestMapping(value = "/init") - public void initClientLocations() throws InterruptedException { - merchantLocationService.initClientLocations(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/IPController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/IPController.java deleted file mode 100644 index b05dd117a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/IPController.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.tools.geo.GeoIPSupport; -import au.com.royalpay.payment.tools.geo.entity.GeoLocation; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -@RestController -@RequestMapping(value = "/dev/ip") - -public class IPController { - @Resource - private GeoIPSupport geoIPSupport; - - @GetMapping("/{ipAddr}") - public JSONObject getIpInfo(@PathVariable String ipAddr) { - JSONObject result = new JSONObject(); - result.put("city", geoIPSupport.getLocation(ipAddr).map(GeoLocation::getCity).orElse("Unknown")); - return result; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/LogAmountController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/LogAmountController.java deleted file mode 100644 index 42624ec0c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/LogAmountController.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/7/5. - */ -@RestController -@RequestMapping(value = "/dev") -public class LogAmountController { - - @Resource - private EstimateAnalysisService estimateAnalysisService; - - @GetMapping("/create/settle/amountLog/{date}") - public void createSettleAmountLog(@PathVariable String date) throws Exception { - estimateAnalysisService.initSettleAmount(date); - } - - @GetMapping("/create/transaction/amountLog/{date}") - public void createTransactionAmountLog(@PathVariable String date) throws Exception { - estimateAnalysisService.initTransactionData(date); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/MailTestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/MailTestController.java deleted file mode 100644 index f3748948f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/MailTestController.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.support.email.MailSendingEvent; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.mail.MessagingException; -import java.util.Date; - -/** - * Created by yixian on 2017-01-12. - */ -@RestController -@ManagerMapping(value = "/dev", role = ManagerRole.DEVELOPER) -public class MailTestController implements ApplicationEventPublisherAware { - private ApplicationEventPublisher publisher; - - @PostMapping("/mail") - public void sendTestMail() throws MessagingException { - MailSendingEvent evt = new MailSendingEvent(this, "Test"); - evt.password("Daqo5434").username("dev@royalpay.com.au"); - evt.addMailTo("astro.dai@royalpay.com.au") - .content("

    Test Content

    " + DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "

    ") - .attach("helloworld".getBytes(), "text/plain", "A01", "helloworld.txt"); - publisher.publishEvent(evt); - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java deleted file mode 100644 index beed7cbb1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; -import com.alibaba.fastjson.JSONObject; -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 javax.annotation.Resource; -import java.util.List; - -@RestController -@RequestMapping("/app/rules") -public class MangerAppRulesController { - - @Resource - private BDPrizeService bdPrizeService; - - @GetMapping("/org") - public ModelAndView hrefOrgRules() { - ModelAndView view = new ModelAndView("app/org_prize_rules"); - return view; - } - - @GetMapping("/bd") - public ModelAndView hrefBdRules() { - ModelAndView view = new ModelAndView("app/bd_prize_rules"); - return view; - } - - @GetMapping("/bd/config") - public List bdConfigRates() { - return bdPrizeService.getRateConfig(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/ManualController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/ManualController.java deleted file mode 100644 index 32892a63f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/ManualController.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.dev.core.ManualService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-01-25. - */ -@RestController -@ManagerMapping(role = ManagerRole.DEVELOPER,value = "/dev/manual") -public class ManualController { - @Resource - private ManualService manualService; - - @RequestMapping(method = RequestMethod.GET,value = "/client/postpone") - public void clientPostpone(){ - manualService.clientPostpone(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/ReturnPoundageController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/ReturnPoundageController.java deleted file mode 100644 index 60cceaf91..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/ReturnPoundageController.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import org.springframework.web.bind.annotation.RestController; - -/** - * Created by yixian on 2017-03-11. - */ -@RestController -@ManagerMapping(role = ManagerRole.DEVELOPER, value = "/sys/dev/return_poundage") -public class ReturnPoundageController { - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TemplateViewerController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TemplateViewerController.java deleted file mode 100644 index 9d2f2295e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TemplateViewerController.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * Created by yixian on 2016-12-07. - */ -@Controller -@RequestMapping("/dev/templates") -public class TemplateViewerController { - @RequestMapping(value = "/preview",method = RequestMethod.GET) - public String viewTemplate(@RequestParam String template){ - if (PlatformEnvironment.getEnv().isDebug()){ - return template; - } - throw new ForbiddenException(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java deleted file mode 100644 index 2101e2f3c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ /dev/null @@ -1,843 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfoInheritance; -import au.com.royalpay.payment.channels.wechat.runtime.impls.WxPayMerchantRegister; -import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper; -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.PaymentDevHelper; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; -import au.com.royalpay.payment.manage.analysis.core.ATOReportService; -import au.com.royalpay.payment.manage.analysis.core.DashboardService; -import au.com.royalpay.payment.manage.analysis.core.PlatformClearService; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.dev.bean.AliExcel; -import au.com.royalpay.payment.manage.dev.bean.Message; -import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage; -import au.com.royalpay.payment.manage.dev.core.AliforexcelService; -import au.com.royalpay.payment.manage.dev.core.AlipayRegisterService; -import au.com.royalpay.payment.manage.dev.core.WechatMessageService; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.beans.NewSubMerchantIdApply; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.shopify.auth.domain.manage.ShopifyManageService; -import au.com.royalpay.payment.manage.system.core.TradeSecureService; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.defines.PayChannel; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import au.com.royalpay.payment.tools.utils.PdfUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.http.util.TextUtils; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.ui.Model; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.math.RoundingMode; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * Created by yixian on 2016-07-06. - */ -@RestController -@RequestMapping("/dev") -public class TestController { - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private OrderMapper orderMapper; - @Resource - private RefundMapper refundMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ATOReportService atoReportService; - @Value("${app.agreetemplate.classic.path}") - private String pdfPath; - @Value("${app.agreetemplate.aggregate.path}") - private String aggragatePdfPath; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private PlatformClearService platformClearService; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private PaymentApi paymentApi; - @Resource - private TradeLogService tradeLogService; - @Resource - private RetailAppService retailAppService; - @Resource - private WechatMessageService wechatMessageService; - @Resource - private AliforexcelService aliforexcelService; - @Resource - private ClientManager clientManager; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private SysClientLegalPersonMapper sysClientLegalPersonMapper; - @Resource - private TradeSecureService tradeSecureService; - - @Resource - private DashboardService dashboardService; - @Resource - private PaymentDevHelper paymentDevHelper; - @Resource - private SysWxMerchantApplyMapper sysWxMerchantApplyMapper; - @Resource - private PaymentChannelMccGoodMapper paymentChannelMccGoodMapper; - - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private MerchantChannelApplicationManager merchantChannelApplicationManager; - - @Resource - private ShopifyManageService shopifyManageService; - - @Resource - private AlipayRegisterService alipayRegisterService; - - @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - httpResponse.setContentType("application/pdf"); - httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_AGREEMENT_" + new Date() + ".pdf"); - ServletOutputStream sos = httpResponse.getOutputStream(); - - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String address = client.getString("address") + "," + client.getString("suburb") + ',' + client.getString("state") + ',' + client.getString("postcode"); - client.remove("address"); - client.put("address", address); - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "Australia Company Number (ACN) :"); - } else { - client.put("acn_type", "Australia Business Number (ABN) :"); - client.put("acn", client.getString("abn")); - } - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("rate_value", rate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + rate.getString("clean_days")); - client.put("clean_days", rate.getString("clean_days")); - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(pdfPath); - pdu.setPdfTemplate(client); - File file = new File(clientMoniker + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - sos.write(bos.toByteArray()); - sos.close(); - } - - /** - * 第二个版本的合同 - * - * @param clientMoniker - * @param manager - * @param httpResponse - * @throws Exception - */ - @ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) { - logger.info("===>exportAggregateAgreeFile:path:" + aggragatePdfPath); - - httpResponse.setContentType("application/pdf"); - httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_AGREEMENT_" + new Date() + ".pdf"); - try { - ServletOutputStream sos = httpResponse.getOutputStream(); - - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - client.put("located_country", "Australia"); - if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) { -// clean_1 clean_1_friday clean_1_saturday - // first, second, third or fourth - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - } else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - } else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - JSONObject alipayApsCashierRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_CASHIER.getChannelCode()); - if (alipayApsCashierRate != null) { - client.put("aps_cashier_rate", alipayApsCashierRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN) + "%"); - client.put("aps_cashier_service_rate", alipayApsCashierRate.getBigDecimal("transaction_fee").multiply(CommonConsts.HUNDRED).setScale(2, RoundingMode.DOWN) + "%"); - } - JSONObject alipayApsInstoreRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()); - if (alipayApsInstoreRate != null) { - client.put("aps_instore_rate", alipayApsInstoreRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN) + "%"); - client.put("aps_instore_service_rate", alipayApsInstoreRate.getBigDecimal("transaction_fee").multiply(CommonConsts.HUNDRED).setScale(2, RoundingMode.DOWN) + "%"); - client.put("alipayplus_clean", alipayApsInstoreRate.getString("clean_days")); - } - } catch (Exception ignored) { - //do nothing - } - - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } - - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(aggragatePdfPath); - pdu.setPdfTemplate(client); - File file = new File(clientMoniker + "_agreement.pdf"); - - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - - sos.write(bos.toByteArray()); - sos.close(); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 制作卡支付合同 - * - * @param clientMoniker - * @param manager - * @throws Exception - */ - @ManagerMapping(value = "/{clientMoniker}/export/aggregate/card_agree_pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAggregateCardAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - logger.info("=====>exportAggregateCardAgreeFile"); - clientManager.getAggregateCardAgreeFileAgain(clientMoniker, manager); - } - - public JSONObject getBankAccountByClientId(int client_id) { - List list = clientBankAccountMapper.clientBankAccounts(client_id); - return list.isEmpty() ? new JSONObject() : list.get(0); - } - - @ManagerMapping(value = "/fix_transaction/{orderId}", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public void fixTransactionsByOrderId(@PathVariable String orderId) { - JSONObject order = orderMapper.find(orderId); - try { - String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel")); - paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true); - } catch (Exception e) { - logger.error("fix transaction error:{}", order.getString("order_id")); - } - } - - @ManagerMapping(value = "/fix_transaction", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER) - public void fixTransactions() { - List orders = orderMapper.listOrdersWithNoTransactions(); - for (JSONObject order : orders) { - try { - String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel")); - paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true); - } catch (Exception e) { - logger.error("fix transaction error:{}", order.getString("order_id")); - } - } - List refunds = refundMapper.listConfirmedRefundsWithNoTransactions(); - for (JSONObject refund : refunds) { - paymentApi.checkRefundStatus(refund.getString("refund_id"), refund.getString("order_id")); - } - } - - @ManagerMapping(value = "/orders/{orderId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public JSONObject checkOrderDetail(@PathVariable String orderId) { - JSONObject res = new JSONObject(); - res.put("xml", paymentDevHelper.devCheckOrder(orderId)); - return res; - } - - - @ManagerMapping(value = "/order_refunds/{refundId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public JSONObject checkRefundDetail(@PathVariable String refundId) { - JSONObject res = new JSONObject(); - res.put("xml", paymentDevHelper.devCheckRefund(refundId)); - return res; - } - - @ManagerMapping(value = "/austrac/generate", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public void generateAustracData(@RequestParam String datefrom, @RequestParam String dateto) { - tradeLogService.generateAustracData(datefrom, dateto); - } - - @PutMapping("/send_message") - public void sendMassageByCode(@RequestBody @Valid Message message, Errors errors) { - HttpUtils.handleValidErrors(errors); - JSONObject params = message.insertObject(); - retailAppService.sendMassageByCode(params); - } - - @GetMapping("/alipay/doclear/{date}") - public void doAlipayClear(@PathVariable String date) throws Exception { - platformClearService.verifySettleLogByDate(date, date, "Alipay"); - } - - @PutMapping("/send_merchant_message") - public void sendmerchantMessage(@RequestBody SendWechatMessage sendWechatMessage) { - wechatMessageService.sendMessageByMerchant(sendWechatMessage); - - } - - @PutMapping("/send_roles_message") - public void sendRolesMessage(@RequestBody SendWechatMessage sendWechatMessage) { - wechatMessageService.sendMessageByRoles(sendWechatMessage); - - } - - @PutMapping("/send_personal_message") - public void sendPersonalMessage(@RequestBody SendWechatMessage sendWechatMessage) { - wechatMessageService.sendMessageByOpenId(sendWechatMessage); - - } - - @ManagerMapping(value = "/aliforexcel", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public void aliforexcel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse, AliExcel query) throws Exception { - aliforexcelService.listClients(httpResponse, manager, query); - } - - @ManagerMapping(value = "/partner/reset_password", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public void resetPartnerPassword() { - clientManager.updateAllPartnerPassword("PINE"); - } - - @ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) - public void downloadHanyinSecureReports(@PathVariable String date, @RequestParam(defaultValue = "false") boolean upload, HttpServletResponse resp) { - tradeSecureService.manualDownloadHanyinSecureReport(DateTime.parse(date).toDate(), upload, resp); - } - - @ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) - public JSONObject registerAlipayOnlineMerchant() { - return aliforexcelService.registerAlipayOnlineMerchant(); - } - - @GetMapping(value = "/register/wechatGms") - public void registerWechatMerchant() { - aliforexcelService.registerWechatMerchant(); - } - - - @GetMapping(value = "/register/alipayOnlineGms") - public void registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) { - aliforexcelService.registerRangeAlipayOnlineMerchant(start, end); - } - - @GetMapping(value = "/register/alipayGms") - public void registerAlipayMerchant() { - aliforexcelService.registerAlipayMerchant(); - } - - @ManagerMapping(value = "/register/alipayGms/insert_partner", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) - public JSONObject registerInsertAlipayMerchant(@RequestBody JSONObject partners) { - return aliforexcelService.registerInsertAlipayMerchant(partners.getString("partners")); - } - - @ManagerMapping(value = "/register/alipayOnlineGms/insert_partner", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) - public JSONObject registerInsertAlipayOnlineMerchant(@RequestBody JSONObject partners) { - return aliforexcelService.registerInsertAlipayOnlineMerchant(partners.getString("partners")); - } - - @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) - public JSONObject getLessPartnerInfo() { - return aliforexcelService.getLessPartnerInfo(); - } - - @ManagerMapping(value = "/init/client_pay_type", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) - public void initClientPayType(@RequestParam int begin, @RequestParam int end) { - aliforexcelService.initClientPayType(begin, end); - } - - @PutMapping(value = "/open/cb_bankpay") - public void switchCBBankPayLinkPermission() { - List merchants = clientMapper.listNeedOpenCbpayMerchant(); - merchants.forEach(mch -> { - JSONObject client = clientMapper.findClientByMonikerAll(mch.getString("client_moniker")); - if (client == null) { - throw new InvalidShortIdException(); - } - if (StringUtils.isEmpty(client.getString("cb_bankpay_url"))) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link/pc"); - String cb_bankpay_url = getCBBankShortLink(longUrl); - client.put("cb_bankpay_url", cb_bankpay_url); - client.put("enable_cb_bankpay_link", true); - client.put("enable_cb_bankpay", true); - clientMapper.update(client); - } else { - client.put("enable_cb_bankpay_link", true); - clientMapper.update(client); - } - }); - } - - private String getCBBankShortLink(String longUrl) { - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - return api.registerShortUrl(longUrl); - } - - @GetMapping(value = "/task/analysisDashboard") - public void analysisDashboard(@RequestParam("date") String date) { - synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000, - () -> { - try { - dashboardService.generateCustomersAndOrdersStatistics(DateUtils.parseDate(date, "yyyyMMdd")); - } catch (ParseException e) { - logger.error("invalid input date:{}", date); - } - }); - } - - - /** - * 重新生成执行商户下某日消费者数据 - * - * @param date - * @param clientId - */ - @GetMapping("/task/analysisCustomerDashboard") - public void analysisCustomerDashboardForClientMoniker(@RequestParam("date") String date, @RequestParam("clientId") String clientId) { - try { - dashboardService.generateCustomersAndOrdersStatisticsByClientMoniker(DateUtils.addDays(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(date), -1), clientId); - } catch (ParseException e) { - e.printStackTrace(); - } - - } - - @ManagerMapping(value = "/reports/ato_reports/royalpay_ato_report_{year}.bttps", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) - @ReadOnlyConnection - public JSONObject exportATOReport(@PathVariable String year) { - DateTime from = DateTime.parse(year + "-07-01"); - DateTime to = from.plusYears(1).plusDays(-1); - atoReportService.startExportTask(from.toDate(), to.toDate()); - return atoReportService.taskStatus(); - } - - @ManagerMapping(value = "/reports/ato_reports/royalpay_ato_report", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) - public JSONObject exportATOStatus() { - return atoReportService.taskStatus(); - } - - @ManagerMapping(value = "/reports/ato_reports/royalpay_ato_report.bttps", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) - public void downloadReport(HttpServletResponse response) throws IOException { - atoReportService.downloadFile(response); - } - - @ManagerMapping(value = "/custom_declare_check/{reportId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public JSONObject checkCustomDeclareOrderDetail(@PathVariable String reportId) { - String declareResp = paymentDevHelper.devQueryCustomsReport(reportId); - JSONObject res = new JSONObject(); - res.put("xml", declareResp); - return res; - } - - @GetMapping("/client/customer") - public ModelAndView redirectClientCustomer() { - JSONObject result = new JSONObject(); - ModelAndView model = new ModelAndView("app/app_customer"); - JSONObject client = clientManager.getClientInfoByMoniker("PINE"); - result.put("contact_email", client.getString("contact_email")); - result.put("client_id", client.getString("client_id")); - result.put("contact_person", client.getString("contact_person")); - result.put("country", client.getString("country")); - result.put("state", client.getString("state")); - model.addObject("client", result); - return model; - } - - @GetMapping(value = "/trans_flow/pdf") - @ReadOnlyConnection - public ModelAndView exportTransFlowPDFHtml(TradeLogQuery query, @RequestParam String client_moniker, Model model) throws Exception { - return tradeLogService.exportTransFlow(query, getPartnerParams(client_moniker), model); - } - - private JSONObject getPartnerParams(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client Not Exists"); - } - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - params.put("client", client); - params.put("client_moniker", clientMoniker); - return params; - } - - @GetMapping(value = "/securepay/settle/file") - public void sendSecurePaySettleFile(@RequestParam String dateStr) { - tradeSecureService.sendSecurePaySettleFile(dateStr); - } - - @GetMapping(value = "/securepay/invoice/file") - public void sendSecurePayInvoiceFile() { - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - //获取前一个月第一天 - Calendar calendar1 = Calendar.getInstance(); - calendar1.add(Calendar.MONTH, -1); - calendar1.set(Calendar.DAY_OF_MONTH, 1); - String firstDay = sdf.format(calendar1.getTime()); - //获取前一个月最后一天 - Calendar calendar2 = Calendar.getInstance(); - calendar2.set(Calendar.DAY_OF_MONTH, 0); - String lastDay = sdf.format(calendar2.getTime()); - tradeSecureService.sendSecurePayInvoiceFile(firstDay, lastDay); - } - - /** - * 批量更新微信子商户号 - */ - @ManagerMapping(value = "/batch_update_wxsubmerchantId", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) - public void batchUpdateWxSubmerchantId() { - List findSubMerchantIdHistorys = sysWxMerchantApplyMapper.findSubMerchantIdHistorys(); - if (findSubMerchantIdHistorys == null) return; - logger.info("=========>batchUpdateWxSubmerchantId:" + findSubMerchantIdHistorys.size()); - findSubMerchantIdHistorys.parallelStream().forEach(jsonObject -> { - JSONObject clientJson = clientMapper.findClient(jsonObject.getInteger("client_id")); - JSONObject wechatMcc = paymentChannelMccGoodMapper.findWechatPayMccByClientId(jsonObject.getIntValue("client_id")); - JSONObject clientConfig = clientConfigMapper.find(jsonObject.getIntValue("client_id")); - if (clientJson == null) { - logger.info("=========>没有查询到client:" + jsonObject.getInteger("client_id")); - return; - } - if (wechatMcc == null) { - logger.info("=========>没有查询到mcc:" + jsonObject.getInteger("client_id")); - return; - } - // company_name short_name industry company_phone contact_person contact_phone contact_email 这些字段不能为空 - if (TextUtils.isEmpty(clientJson.getString("short_name")) || - TextUtils.isEmpty(clientJson.getString("industry")) || - TextUtils.isEmpty(clientJson.getString("company_phone")) || - TextUtils.isEmpty(clientJson.getString("contact_phone")) || - TextUtils.isEmpty(clientJson.getString("contact_person")) || - TextUtils.isEmpty(clientJson.getString("contact_email")) || - TextUtils.isEmpty(wechatMcc.getString("mc_code"))) { - logger.error("=======>数据不完整:clientid:" + jsonObject.getInteger("client_id") + ""); - return; - } - - NewSubMerchantIdApply newSubMerchantIdApply = new NewSubMerchantIdApply(); - newSubMerchantIdApply.setMerchant_id(jsonObject.getString("merchant_id")); - newSubMerchantIdApply.setSub_mch_id(jsonObject.getString("sub_merchant_id")); - newSubMerchantIdApply.setMerchantRemark(jsonObject.getString("merchant_remark")); - newSubMerchantIdApply.setMerchant_name(cutLength(jsonObject.getString("merchant_name"), 50)); - newSubMerchantIdApply.setAddress(cutLength(clientJson.getString("address"), 128)); - newSubMerchantIdApply.setMerchant_shortname(cutLength(clientJson.getString("short_name"), 64)); - newSubMerchantIdApply.setBusiness_category(clientJson.getString("industry")); - newSubMerchantIdApply.setWebsite(cutLength(clientJson.getString("company_website"), 100)); - newSubMerchantIdApply.setOffice_phone(cutLength(clientJson.getString("company_phone"), 20)); - newSubMerchantIdApply.setContact_phone(cutLength(clientJson.getString("contact_phone"), 16)); - newSubMerchantIdApply.setContact_name(cutLength(clientJson.getString("contact_person"), 32)); - newSubMerchantIdApply.setContact_email(cutLength(clientJson.getString("contact_email"), 50)); - newSubMerchantIdApply.setMcc_code(cutLength(wechatMcc.getString("mc_code"), 10)); - - if (!TextUtils.isEmpty(clientConfig.getString("client_pay_type"))) { - if (clientConfig.getString("client_pay_type").indexOf("1") >= 0 - && clientConfig.getString("client_pay_type").indexOf("2") >= 0) { - newSubMerchantIdApply.setBusiness_type("BOTH"); - } else if (clientConfig.getString("client_pay_type").indexOf("1") >= 0) { - newSubMerchantIdApply.setBusiness_type("ONLINE"); - } else if (clientConfig.getString("client_pay_type").indexOf("2") >= 0) { - newSubMerchantIdApply.setBusiness_type("OFFLINE"); - } - } else { - newSubMerchantIdApply.setBusiness_type("BOTH"); - } - if (!TextUtils.isEmpty(clientJson.getString("business_structure"))) { - newSubMerchantIdApply.setMerchant_type(clientJson.getString("business_structure").equals("Registered body(Sole Trader)") ? "INDIVIDUAL" : "ENTERPRISE"); - } else { - newSubMerchantIdApply.setMerchant_type("INDIVIDUAL"); - } - - newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn")) ? clientJson.getString("abn") : clientJson.getString("acn"), 50)); - if (!TextUtils.isEmpty(clientJson.getString("certificat_expire_date"))) { - newSubMerchantIdApply.setCertificat_expire_date(clientJson.getString("certificat_expire_date")); - } else { - newSubMerchantIdApply.setCertificat_expire_date("PERMANENT"); - } - - - if ("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type()) && TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())) { - logger.error("=======>公司注册号为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); - return; - } - if ("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type()) && (TextUtils.isEmpty(newSubMerchantIdApply.getAddress()) || - TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))) { - logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); - return; - } else if ("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type()) && (TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))) { - logger.error("=======>公司类型为OFFLINE:地址为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); - return; - } else if ("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type()) && - TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())) { - logger.error("=======>公司类型为ONLINE:网址为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); - return; - } - JSONObject params = newSubMerchantIdApply.insertObject(clientJson); - params.put("merchant_app_id", jsonObject.getString("merchant_app_id")); - SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); - params.put("operator", "System"); - - WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) - .orElseThrow(() -> new ServerErrorException("No Register found for wechat")); - - JSONObject manager = new JSONObject(); - manager.put("display_name", "System"); - register.modifyForBatch(jsonObject.getString("merchant_app_id"), clientJson, subMerchantInfo, manager); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - }); - - - } - - /** - * 批量更新微信子商户号 - */ -// @GetMapping(value = "/batch_update_wxsubmerchantId_other") -// public void batchUpdateWxSubmerchantIdForOther() { -// JSONObject clientJson = clientMapper.findClient(9); -// JSONObject wechatMcc = paymentChannelMccGoodMapper.findWechatPayMccByClientId(clientJson.getIntValue("client_id")); -// JSONObject clientConfig = clientConfigMapper.find(clientJson.getIntValue("client_id")); -// if(clientJson==null){ -// logger.info("=========>没有查询到client:"+clientJson.getInteger("client_id")); -// return; -// } -// if(wechatMcc==null){ -// logger.info("=========>没有查询到mcc:"+clientJson.getInteger("client_id")); -// return; -// } -// // company_name short_name industry company_phone contact_person contact_phone contact_email 这些字段不能为空 -// if(TextUtils.isEmpty(clientJson.getString("short_name"))|| -// TextUtils.isEmpty(clientJson.getString("industry"))|| -// TextUtils.isEmpty(clientJson.getString("company_phone"))|| -// TextUtils.isEmpty(clientJson.getString("contact_phone"))|| -// TextUtils.isEmpty(clientJson.getString("contact_person"))|| -// TextUtils.isEmpty(clientJson.getString("contact_email"))|| -// TextUtils.isEmpty(wechatMcc.getString("mc_code"))){ -// logger.error("=======>数据不完整:clientid:"+clientJson.getInteger("client_id")+""); -// return; -// } -// -// NewSubMerchantIdApply newSubMerchantIdApply=new NewSubMerchantIdApply(); -// newSubMerchantIdApply.setMerchant_id(clientJson.getString("merchant_id")); -// newSubMerchantIdApply.setSub_mch_id(clientJson.getString("sub_merchant_id")); -//// newSubMerchantIdApply.setMerchantRemark(jsonObject.getString("merchant_remark")); -// newSubMerchantIdApply.setMerchant_name(cutLength("Pineapple Techology Pty Ltd",128)); -// newSubMerchantIdApply.setAddress(cutLength(clientJson.getString("address"),128)); -// newSubMerchantIdApply.setMerchant_shortname(cutLength(clientJson.getString("short_name"),64)); -// newSubMerchantIdApply.setBusiness_category(clientJson.getString("industry")); -// newSubMerchantIdApply.setWebsite(cutLength(clientJson.getString("company_website"),100)); -// newSubMerchantIdApply.setOffice_phone(cutLength(clientJson.getString("company_phone"),20)); -// newSubMerchantIdApply.setContact_phone(cutLength(clientJson.getString("contact_phone"),16)); -// newSubMerchantIdApply.setContact_name(cutLength(clientJson.getString("contact_person"),32)); -// newSubMerchantIdApply.setContact_email(cutLength(clientJson.getString("contact_email"),50)); -// newSubMerchantIdApply.setMcc_code(cutLength(wechatMcc.getString("mc_code"),10)); -// -// if(!TextUtils.isEmpty(clientConfig.getString("client_pay_type"))){ -// if(clientConfig.getString("client_pay_type").indexOf("1")>=0 -// &&clientConfig.getString("client_pay_type").indexOf("2")>=0){ -// newSubMerchantIdApply.setBusiness_type("BOTH"); -// }else if(clientConfig.getString("client_pay_type").indexOf("1")>=0){ -// newSubMerchantIdApply.setBusiness_type("ONLINE"); -// } -// else if(clientConfig.getString("client_pay_type").indexOf("2")>=0){ -// newSubMerchantIdApply.setBusiness_type("OFFLINE"); -// } -// }else{ -// newSubMerchantIdApply.setBusiness_type("BOTH"); -// } -// if (!TextUtils.isEmpty(clientJson.getString("business_structure"))) { -// newSubMerchantIdApply.setMerchant_type(clientJson.getString("business_structure").equals("Registered body(Sole Trader)")?"INDIVIDUAL":"ENTERPRISE") ; -// }else{ -// newSubMerchantIdApply.setMerchant_type("INDIVIDUAL") ; -// } -// -// newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn"))?clientJson.getString("abn"):clientJson.getString("acn"),50)); -// if (!TextUtils.isEmpty(clientJson.getString("certificat_expire_date"))) { -// newSubMerchantIdApply.setCertificat_expire_date(clientJson.getString("certificat_expire_date")); -// } else { -// newSubMerchantIdApply.setCertificat_expire_date("PERMANENT"); -// } -// -// -// if("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type())&&TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())){ -// logger.error("=======>公司注册号为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); -// return; -// } -// if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress())|| -// TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))){ -// logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); -// return; -// } -// else if("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))){ -// logger.error("=======>公司类型为OFFLINE:地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); -// return; -// } -// else if("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&& -// TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){ -// logger.error("=======>公司类型为ONLINE:网址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); -// return; -// } -// JSONObject params = newSubMerchantIdApply.insertObject(clientJson); -//// params.put("merchant_app_id", jsonObject.getString("merchant_app_id")); -// SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); -// params.put("operator","System"); -// -// WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) -// .orElseThrow(() -> new ServerErrorException("No Register found for wechat")); -// -// JSONObject manager=new JSONObject(); -// manager.put("display_name","System"); -// register.modifyForBatch( clientJson, subMerchantInfo, manager); -// try { -// Thread.sleep(500); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } -// -// -// } - public String cutLength(String str, int maxlen) { - if (TextUtils.isEmpty(str)) return ""; - if (str.length() > maxlen) { - return str.substring(0, maxlen); - } else { - return str; - } - - } - - int st = 0; - - /** - * 批量更新支付宝子商户号报备 - */ - @GetMapping(value = "/batch_update_alipayapply") - public void batchUpdateAlipayApply() { - if (st > 0) { - return; - } - st++; - - - alipayRegisterService.batchUpdateAlipayApply(); - } - - @ManagerMapping(value = "/shopify/rotate_secret", method = RequestMethod.POST, role = ManagerRole.DEVELOPER) - public JSONObject rotateShopifySecret(@RequestBody JSONObject rotateRequest) { - List failedStores = shopifyManageService.rotateAccessToken(rotateRequest.getString("secret"), rotateRequest.getString("refresh_token")); - return new JSONObject(Map.of("failed", failedStores)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestMerchantPassword.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestMerchantPassword.java deleted file mode 100644 index 9759a7154..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestMerchantPassword.java +++ /dev/null @@ -1,100 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Query; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.crypto.*; -import javax.crypto.spec.DESKeySpec; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - - -@Controller -public class TestMerchantPassword { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private ManagerMapper managerMapper; - @Resource - private MongoTemplate mongoTemplate; - - @WechatMapping(value = "/testMerchantPassword",method = RequestMethod.GET) - public String testMerchantPassword(@RequestParam(defaultValue = "") String sign, - @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, Model modelMap) throws Exception{ - String openid = wxUser.getString("openid"); - List royalPayUsers = managerMapper.listRoyalPayUsers(); - List needNotifyUsers = royalPayUsers.stream().filter(user -> StringUtils.isNotEmpty(user.getString("wx_openid"))) - .map(user -> user.getString("wx_openid")).collect(Collectors.toList()); - if (!ArrayUtils.contains(needNotifyUsers.toArray(new String[needNotifyUsers.size()]), openid)) { - throw new ForbiddenException("无权限查看此页面"); - } - if (StringUtils.isNotBlank(sign)) { - String accounts = new String(AESdecrypt(Base64.decodeBase64(sign.replace("%2B", "+")), openid), "utf-8"); - JSONArray array = JSONArray.parseArray(accounts); - modelMap.addAttribute("accounts", array); - }else { - Query query = new Query(); - List accountInfos = mongoTemplate.find(query,TestMerchantAccountInfo.class); - List accounts = new ArrayList<>(); - for (TestMerchantAccountInfo accountInfo : accountInfos) { - accounts.add(accountInfo.toJSON()); - } - modelMap.addAttribute("accounts", accounts); - } - return "testMerchantPassword"; - } - - public static byte[] AESdecrypt(byte[] content, String password) { - try { - KeyGenerator kgen = KeyGenerator.getInstance("AES"); - SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); - random.setSeed(password.getBytes()); - kgen.init(128, random); - SecretKey secretKey = kgen.generateKey(); - byte[] enCodeFormat = secretKey.getEncoded(); - SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES"); - Cipher cipher = Cipher.getInstance("AES"); - cipher.init(Cipher.DECRYPT_MODE, key); - byte[] result = cipher.doFinal(content); - return result; - - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (NoSuchPaddingException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (IllegalBlockSizeException e) { - e.printStackTrace(); - } catch (BadPaddingException e) { - e.printStackTrace(); - } - return null; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/WechatTestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/WechatTestController.java deleted file mode 100644 index 836b78230..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/WechatTestController.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -/** - * Created by yixian on 2017-05-02. - */ - -import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; -import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.AliOauthType; -import au.com.royalpay.payment.tools.permission.alipay.AlipayMapping; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -@Controller -@RequestMapping("/test") -public class WechatTestController { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @WechatMapping(value = "/wx_test", method = RequestMethod.GET, addonMp = {KangaLandWechatApiImpl.class, RedpackWechatApiImpl.class}) - public String testWechatBrowser() { - return "wx_test"; - } - - @WechatMapping(value = "/wx_msg", method = RequestMethod.GET) - public String testMsg() { - return "wx_msg_test"; - } - - @AlipayMapping(value = "/ali_test", method = RequestMethod.GET, oauthType = AliOauthType.USERINFO) - public String aliTest(@ModelAttribute(CommonConsts.ALIUSER) JSONObject aliUser) { - logger.debug("ali user:" + aliUser.toJSONString()); - return "wx_test"; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/WxSettleLogController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/WxSettleLogController.java deleted file mode 100644 index f8da2d798..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/WxSettleLogController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.core.beans.SettlementLog; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import org.apache.commons.lang3.time.DateUtils; -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 javax.annotation.Resource; -import java.text.ParseException; -import java.util.List; - -/** - * Created by yixian on 2017-04-04. - */ -@RestController -@ManagerMapping(role = {ManagerRole.ADMIN, ManagerRole.DEVELOPER}, method = RequestMethod.GET, value = "/dev") -public class WxSettleLogController { - @Resource - private MpPaymentApi mpPaymentApi; - - @RequestMapping("/wx_settlements") - public List listWxSettlements(@RequestParam String from, @RequestParam String to, @RequestParam String merchantId) throws ParseException { - String[] patterns = {"yyyyMMdd"}; - return mpPaymentApi.settlementLogs(DateUtils.parseDate(from, patterns), DateUtils.parseDate(to, patterns), merchantId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/device/bean/DeviceBean.java b/src/main/java/au/com/royalpay/payment/manage/device/bean/DeviceBean.java deleted file mode 100644 index b15c7620d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/device/bean/DeviceBean.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.device.bean; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 19/04/2017. - */ -public class DeviceBean { - private String clientMoniker; - private String client_type; - private String remark; - private int page = 1; - private int limit = 10; - - - public JSONObject queryParams(){ - JSONObject params = new JSONObject(); - if (client_type!=null){ - params.put("client_type",client_type); - } - if (remark!=null){ - params.put("remark",remark); - } - return params; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getClient_type() { - return client_type; - } - - public void setClient_type(String client_type) { - this.client_type = client_type; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/device/core/DeviceManager.java b/src/main/java/au/com/royalpay/payment/manage/device/core/DeviceManager.java deleted file mode 100644 index 8f200db18..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/device/core/DeviceManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.device.core; - -import au.com.royalpay.payment.manage.device.bean.DeviceBean; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 19/04/2017. - */ -public interface DeviceManager { - JSONObject listDevices(JSONObject manager, DeviceBean deviceBean); - - void updateDevice(JSONObject manager, String devId, String remark); - - void toggleDeviceAvailable(JSONObject manager, String devId, boolean enable); - - void deviceOffline(String accountId); - - JSONObject listDevOrders(JSONObject manager, String devId, TradeLogQuery query); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/device/core/impls/DeviceManagerImp.java b/src/main/java/au/com/royalpay/payment/manage/device/core/impls/DeviceManagerImp.java deleted file mode 100644 index c7e513220..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/device/core/impls/DeviceManagerImp.java +++ /dev/null @@ -1,121 +0,0 @@ -package au.com.royalpay.payment.manage.device.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.device.bean.DeviceBean; -import au.com.royalpay.payment.manage.device.core.DeviceManager; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import java.util.Arrays; - -import javax.annotation.Resource; - -import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; - -/** - * Created by yishuqian on 19/04/2017. - */ -@Service -public class DeviceManagerImp implements DeviceManager { - @Resource - private ClientManager clientManager; - @Resource - private ClientDeviceMapper clientDeviceMapper; - @Resource - private OrderMapper orderMapper; - - @Override - public JSONObject listDevices(JSONObject manager, DeviceBean deviceBean) { - JSONObject params = deviceBean.queryParams(); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - - if (deviceBean.getClientMoniker() != null && !deviceBean.getClientMoniker().isEmpty()) { - JSONObject client = clientManager.getClientInfoByMoniker(deviceBean.getClientMoniker()); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - params.put("client_id", client.getIntValue("client_id")); - } - PageList devices = clientDeviceMapper.listDevices(params, new PageBounds(deviceBean.getPage(), deviceBean.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(devices); - } - - @Override - public void updateDevice(JSONObject manager, String devId, String remark) { - JSONObject device = clientDeviceMapper.find(devId); - Assert.notNull(device); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - checkBDPermission(manager, client); - device.put("remark", remark); - clientDeviceMapper.update(device); - } - - public void checkBDPermission(JSONObject manager, JSONObject client) { - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - String bd_user[] = client.getString("bd_user").split(","); - if (!Arrays.asList(bd_user).contains(String.valueOf(manager.getString("manager_id")))) { - throw new ForbiddenException("You have no permission"); - } - } - } - - @Override - public void toggleDeviceAvailable(JSONObject manager, String devId, boolean enable) { - JSONObject device = clientDeviceMapper.find(devId); - Assert.notNull(device); - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - checkBDPermission(manager, client); - device.put("is_valid", enable); - clientDeviceMapper.update(device); - } - - @Override - public void deviceOffline(String accountId) { - clientDeviceMapper.deviceOffline(accountId); - } - - @Override - public JSONObject listDevOrders(JSONObject manager, String devId,TradeLogQuery query) { - JSONObject device = clientDeviceMapper.find(devId); - Assert.notNull(device); - query.setDev_id(devId); - JSONObject params = query.toParams(null); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - PageList logs = orderMapper.listOrdersByClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - return result; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/device/web/DeviceManageController.java b/src/main/java/au/com/royalpay/payment/manage/device/web/DeviceManageController.java deleted file mode 100644 index 187a06b92..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/device/web/DeviceManageController.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.device.web; - -import au.com.royalpay.payment.manage.device.bean.DeviceBean; -import au.com.royalpay.payment.manage.device.core.DeviceManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 19/04/2017. - */ -@RestController -@RequestMapping("/devices") -public class DeviceManageController { - - @Resource - private DeviceManager deviceManager; - - @ManagerMapping(method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) - public JSONObject listDevices(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, DeviceBean deviceBean) { - return deviceManager.listDevices(manager,deviceBean); - } - - @ManagerMapping(value = "/{devId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void modifyDevice(@PathVariable String devId, @RequestBody JSONObject remark, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - deviceManager.updateDevice(manager, devId, remark.getString("remark")); - } - - @ManagerMapping(value = "/{devId}/enable", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void toggleDeviceAvailable(@PathVariable String devId, @RequestBody JSONObject enable, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - deviceManager.toggleDeviceAvailable(manager,devId, enable.getBooleanValue("enable")); - } - - @ManagerMapping(value = "/{devId}/orders",method = RequestMethod.GET) - public JSONObject listDevOrders(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String devId, TradeLogQuery query) { - return deviceManager.listDevOrders(manager,devId,query); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/beans/ClientQueryParams.java b/src/main/java/au/com/royalpay/payment/manage/fund/beans/ClientQueryParams.java deleted file mode 100644 index eda216c6a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/beans/ClientQueryParams.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.fund.beans; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Create by yixian at 2017-09-18 21:47 - */ -public class ClientQueryParams { - private int page = 1; - private int limit = 15; - private String search; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (StringUtils.isNotEmpty(search)) { - params.put("search", search); - } - return params; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getSearch() { - return search; - } - - public void setSearch(String search) { - this.search = search; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/beans/XPlanFundConfig.java b/src/main/java/au/com/royalpay/payment/manage/fund/beans/XPlanFundConfig.java deleted file mode 100644 index 5a80cc3dc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/beans/XPlanFundConfig.java +++ /dev/null @@ -1,95 +0,0 @@ -package au.com.royalpay.payment.manage.fund.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -import java.math.BigDecimal; -import java.math.RoundingMode; - -/** - * Create by yixian at 2017-09-05 19:09 - */ -public class XPlanFundConfig { - @JSONField(name = "interest_rate") - private BigDecimal interestRate;//基准利率 - @JSONField(name = "auto_join") - private boolean autoJoin;//允许自主参加 - @JSONField(name = "max_amount") - private BigDecimal maxAmount;//商户上限金额 - @JSONField(name = "withdraw_rule") - private String withdrawRule; - @JSONField(name = "interest_rule") - private String interestRule; - @JSONField(name = "trade_rule") - private String tradeRule; - - public JSONObject toSysConfigProperties() { - JSONObject prop = new JSONObject(); - prop.put("fund.x-plan.interest-rate", interestRate); - prop.put("fund.x-plan.auto-join-enabled", autoJoin); - prop.put("fund.x-plan.max-money", maxAmount.toPlainString()); - prop.put("fund.x-plan.trade-rule", tradeRule); - prop.put("fund.x-plan.withdraw-rule", withdrawRule); - prop.put("fund.x-plan.interest-rule", interestRule); - return prop; - } - - public static XPlanFundConfig fromSysConfig(JSONObject sysConfig) { - XPlanFundConfig conf = new XPlanFundConfig(); - conf.setInterestRate(sysConfig.getBigDecimal("fund.x-plan.interest-rate").setScale(4, RoundingMode.DOWN)); - conf.setAutoJoin(sysConfig.getBooleanValue("fund.x-plan.auto-join-enabled")); - conf.setMaxAmount(sysConfig.getBigDecimal("fund.x-plan.max-money").setScale(2, RoundingMode.DOWN)); - conf.setTradeRule(sysConfig.getString("fund.x-plan.trade-rule")); - conf.setWithdrawRule(sysConfig.getString("fund.x-plan.withdraw-rule")); - conf.setInterestRule(sysConfig.getString("fund.x-plan.interest-rule")); - return conf; - } - - public BigDecimal getInterestRate() { - return interestRate; - } - - public void setInterestRate(BigDecimal interestRate) { - this.interestRate = interestRate; - } - - public boolean isAutoJoin() { - return autoJoin; - } - - public void setAutoJoin(boolean autoJoin) { - this.autoJoin = autoJoin; - } - - public BigDecimal getMaxAmount() { - return maxAmount; - } - - public void setMaxAmount(BigDecimal maxAmount) { - this.maxAmount = maxAmount; - } - - public String getWithdrawRule() { - return withdrawRule; - } - - public void setWithdrawRule(String withdrawRule) { - this.withdrawRule = withdrawRule; - } - - public String getInterestRule() { - return interestRule; - } - - public void setInterestRule(String interestRule) { - this.interestRule = interestRule; - } - - public void setTradeRule(String tradeRule) { - this.tradeRule = tradeRule; - } - - public String getTradeRule() { - return tradeRule; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/core/FundsConfigService.java b/src/main/java/au/com/royalpay/payment/manage/fund/core/FundsConfigService.java deleted file mode 100644 index b5f3aa737..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/core/FundsConfigService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.fund.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Create by yixian at 2017-09-13 18:39 - */ -public interface FundsConfigService { - - /** - * 理财产品列表 - * - * @return - */ - List listAvailableFunds(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/core/XPlanFundConfigService.java b/src/main/java/au/com/royalpay/payment/manage/fund/core/XPlanFundConfigService.java deleted file mode 100644 index 54808e9fd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/core/XPlanFundConfigService.java +++ /dev/null @@ -1,102 +0,0 @@ -package au.com.royalpay.payment.manage.fund.core; - -import au.com.royalpay.payment.manage.fund.beans.XPlanFundConfig; -import com.alibaba.fastjson.JSONObject; -import java.math.BigDecimal; - -/** - * 营销账户配置接口 - * Create by yixian at 2017-09-05 19:03 - */ -public interface XPlanFundConfigService { - - /** - * 配置基础参数 - * - * @param config 基础参数 - * @param manager - */ - void configuration(XPlanFundConfig config, JSONObject manager); - - /** - * 获取基础参数 - * - * @return - */ - XPlanFundConfig configuration(); - - /** - * 总览统计(总金额、商户数、利息支出等) - * - * @return - */ - JSONObject analysisStatus(); - - /** - * 配置商户 - * - * @param clientMoniker 商户moniker - * @param manager manager - */ - void configClient(String clientMoniker, JSONObject manager); - - /** - * 已配置商户列表和余额情况 - * - * - * @param params params - * @param page 页码 - * @param limit limit - * @return 商户列表 - */ - JSONObject clients(JSONObject params, int page, int limit); - - - /** - * fund desc - * @param moniker client moniker - * @return {join:true/false,fund:{rate,achieve_amount:万份收益率,rules:[]}} - */ - JSONObject fundDesc(String moniker); - - /** - * 商户详情(余额、利息) - * - * @param clientMoniker 商户moniker - * @return {join:true/false,fund:{rate,achieve_amount(万份收益),rules:[]},account:{balance,achieve_total,achieve_yesterday}} - */ - JSONObject clientAnalysis(String clientMoniker); - - /** - * 自助开通申请 - * - * @param clientMoniker 商户moniker - * @param account 操作人账号 - */ - void clientJoinRequest(String clientMoniker, String account); - - /** - * 配置自动转入 - * - * @param clientMoniker 商户moniker - * @param account 操作人账号 - * @param autoDeposit 是否自动转入 - */ - void switchAutoDeposit(String clientMoniker, String account, boolean autoDeposit); - - /** - * 配置自动转入预留金额 - * - * @param clientMoniker 商户moniker - * @param account 操作人账号 - * @param limit 预留金额 - */ - void configAutoDepositLimitAmount(String clientMoniker, String account, BigDecimal limit); - - /** - * 近期利率历史 - * @param limit 条数 - * @return {avg:xxx,history:[{date,rate}]} - */ - JSONObject interestRateHistory(int limit); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/core/XPlanFundProcesor.java b/src/main/java/au/com/royalpay/payment/manage/fund/core/XPlanFundProcesor.java deleted file mode 100644 index 9980dbec7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/core/XPlanFundProcesor.java +++ /dev/null @@ -1,92 +0,0 @@ -package au.com.royalpay.payment.manage.fund.core; - -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * Create by yixian at 2017-09-05 19:03 - */ -public interface XPlanFundProcesor { - /** - * 计算利息 - * - * @param processDate 计息日(通常为前一天) - */ - void calculateInterest(Date processDate); - - /** - * 存款检验 - * - * @param accountId 操作人账号(商户) - * @return {available:可用余额} - */ - JSONObject depositCheck(String accountId); - - /** - * 存款 - * - * @param requestId request id - * @param accountId 操作人账号(商户) - * @param devId 设备id - * @param amount 金额 - */ - JSONObject deposit(String requestId, String accountId, String devId, BigDecimal amount); - - /** - * 转出前检查 - * - * @param accountId account id - * @return {balance:可用余额,finish_time:清算到账时间} - */ - JSONObject withdrawCheck(String accountId); - - /** - * 取款 - * - * @param requestId request id - * @param accountId 操作人账号(商户) - * @param devId 设备id - * @param amount 金额 - */ - JSONObject withdraw(String requestId, String accountId, String devId, BigDecimal amount); - - /** - * 流水记录 - * - * @param clientMoniker 商户moniker - * @param type deposit/interest/withdraw - * @param page 页码 - * @param limit 条数 @return {data:[{type,amount,balance,time,transaction_id}]} - */ - JSONObject listTransactionHistory(String clientMoniker, String type, int page, int limit); - - /** - * 单笔流水详情 - * - * @param clientMoniker 商户moniker - * @param transactionId 流水id - * @return 取决于类别 - */ - JSONObject transactionStatus(String clientMoniker, String transactionId); - - /** - * 结息日志 - * - * @param from yyyyMMdd,nullable - * @param to yyyyMMdd,nullable - * @param page page - * @param limit limit - * @return list - */ - JSONObject interestHistory(String from, String to, int page, int limit); - - /** - * 结息详情 - * - * @param date yyyyMMdd - * @return {} - */ - JSONObject interestDetail(String date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/FundsConfigServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/FundsConfigServiceImpl.java deleted file mode 100644 index 902632d97..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/FundsConfigServiceImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.fund.core.impls; - -import au.com.royalpay.payment.manage.fund.core.FundsConfigService; -import au.com.royalpay.payment.manage.mappers.funds.FundsConfigMapper; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.RoundingMode; -import java.util.List; - -/** - * Create by yixian at 2017-09-14 17:23 - */ -@Service -public class FundsConfigServiceImpl implements FundsConfigService { - @Resource - private FundsConfigMapper fundsConfigMapper; - - @Override - public List listAvailableFunds() { - List configs = fundsConfigMapper.listAll(); - for (JSONObject conf : configs) { - conf.put("tags", conf.getString("tags").split(",")); - switch (conf.getIntValue("type_desc")) { - case 1: - case 2: - conf.put("rate", conf.getBigDecimal("rate").setScale(2, RoundingMode.DOWN).toPlainString() + "%"); - break; - } - } - return configs; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/XPlanFundConfigServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/XPlanFundConfigServiceImpl.java deleted file mode 100644 index 9c444d9aa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/XPlanFundConfigServiceImpl.java +++ /dev/null @@ -1,247 +0,0 @@ -package au.com.royalpay.payment.manage.fund.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.fund.beans.XPlanFundConfig; -import au.com.royalpay.payment.manage.fund.core.XPlanFundConfigService; -import au.com.royalpay.payment.manage.mappers.funds.FundsConfigMapper; -import au.com.royalpay.payment.manage.mappers.funds.XPlanMerchantMapper; -import au.com.royalpay.payment.manage.mappers.funds.XPlanOperationLogMapper; -import au.com.royalpay.payment.manage.mappers.funds.XPlanTransactionMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Create by yixian at 2017-09-14 17:33 - */ -@Service -public class XPlanFundConfigServiceImpl implements XPlanFundConfigService { - private boolean debugging = true; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClientManager clientManager; - @Resource - private FundsConfigMapper fundsConfigMapper; - @Resource - private XPlanOperationLogMapper xPlanOperationLogMapper; - @Resource - private XPlanMerchantMapper xPlanMerchantMapper; - @Resource - private XPlanTransactionMapper xPlanTransactionMapper; - @Resource - private ClientConfigService clientConfigService; - - @Override - public void configuration(XPlanFundConfig config, JSONObject manager) { - sysConfigManager.updateProperties(config.toSysConfigProperties()); - fundsConfigMapper.updateRate("xplan", config.getInterestRate()); - } - - @Override - public XPlanFundConfig configuration() { - JSONObject conf = sysConfigManager.getSysConfig(); - return XPlanFundConfig.fromSysConfig(conf); - } - - @Override - public JSONObject analysisStatus() { - //todo - return null; - } - - @Override - public void configClient(String clientMoniker, JSONObject manager) { - JSONObject client = getClient(clientMoniker); - if (xPlanMerchantMapper.findMerchantConfig(client.getIntValue("client_id")) == null) { - JSONObject config = initMerchantConfig(client); - config.put("applyer_type", 1); - config.put("account_id", manager.getString("manager_id")); - - xPlanMerchantMapper.save(config); - } - } - - @Override - public JSONObject clients(JSONObject params, int page, int limit) { - PageList clients = xPlanMerchantMapper.listClients(params, new PageBounds(page, limit, Order.formString("join_time.desc"))); - return PageListUtils.buildPageListResult(clients); - } - - @Override - public JSONObject fundDesc(String moniker) { - JSONObject client = getClient(moniker); - int clientId = client.getIntValue("client_id"); - JSONObject merchantConfig = xPlanMerchantMapper.findMerchantConfig(clientId); - JSONObject res = new JSONObject(); - res.put("join", merchantConfig != null); - JSONObject fundInfo = new JSONObject(); - if (merchantConfig != null) { - fundInfo.put("balance", merchantConfig.getBigDecimal("balance")); - } - XPlanFundConfig xPlanFundConfig = configuration(); - BigDecimal interestRate = xPlanFundConfig.getInterestRate(); - fundInfo.put("rate", interestRate.toPlainString() + "%"); - BigDecimal achieve = calculateInterest(interestRate, BigDecimal.valueOf(10_000)); - fundInfo.put("achieve_amount", achieve); - List rules = new ArrayList<>(); - rules.add(initRule("交易规则", xPlanFundConfig.getTradeRule())); - rules.add(initRule("收益规则", xPlanFundConfig.getInterestRule())); - rules.add(initRule("转出规则", xPlanFundConfig.getWithdrawRule())); - fundInfo.put("rules", rules); - res.put("fund", fundInfo); - return res; - } - - public static BigDecimal calculateInterest(BigDecimal interestRate, BigDecimal amount) { - return amount.multiply(interestRate.divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).divide(BigDecimal.valueOf(365), 2, RoundingMode.HALF_UP); - } - - private JSONObject getClient(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - return client; - } - - @Override - public JSONObject clientAnalysis(String clientMoniker) { - JSONObject client = getClient(clientMoniker); - int clientId = client.getIntValue("client_id"); - JSONObject merchantConfig = xPlanMerchantMapper.findMerchantConfig(clientId); - - if (merchantConfig != null) { - JSONObject merchantAnalysis = new JSONObject(); - merchantAnalysis.put("balance", merchantConfig.getBigDecimal("balance")); - merchantAnalysis.put("auto_deposit", merchantConfig.getBooleanValue("auto_deposit")); - merchantAnalysis.put("auto_deposit_amount", merchantConfig.getBigDecimal("auto_deposit_amount")); - BigDecimal achieveTotal = xPlanTransactionMapper.analysisMerchantTotalAchieve(clientId); - merchantAnalysis.put("achieve_total", achieveTotal); - merchantAnalysis.put("join_time", merchantConfig.getDate("join_time")); - JSONObject params = new JSONObject(); - params.put("client_id", clientId); - params.put("type", "interest"); - List achieves = xPlanTransactionMapper.listMerchantTransactions(params, new PageBounds(1, 1, Order.formString("time.desc"))); - if (achieves.isEmpty()) { - merchantAnalysis.put("achieve_yesterday", 0); - } else { - merchantAnalysis.put("achieve_yesterday", achieves.get(0).getBigDecimal("amount")); - } - - //fund info - JSONObject fundInfo = new JSONObject(); - XPlanFundConfig xPlanFundConfig = configuration(); - BigDecimal interestRate = xPlanFundConfig.getInterestRate(); - fundInfo.put("rate", interestRate.toPlainString() + "%"); - BigDecimal achieve = calculateInterest(interestRate, BigDecimal.valueOf(10_000)); - fundInfo.put("achieve_amount", achieve); - merchantAnalysis.put("fund", fundInfo); - return merchantAnalysis; - } - throw new BadRequestException("Not Joined Project"); - } - - private JSONObject initRule(String title, String content) { - JSONObject rule = new JSONObject(); - rule.put("title", title); - rule.put("content", content); - return rule; - } - - @Override - public void clientJoinRequest(String clientMoniker, String account) { - if (debugging && !"PINE".equals(clientMoniker)) { - throw new ForbiddenException("error.payment.xplan.enable"); - } - XPlanFundConfig fundCfg = configuration(); - if (!fundCfg.isAutoJoin()) { - throw new ForbiddenException("error.payment.xplan.not-auto-join"); - } - JSONObject client = getClient(clientMoniker); - if (xPlanMerchantMapper.findMerchantConfig(client.getIntValue("client_id")) == null) { - JSONObject config = initMerchantConfig(client); - config.put("applyer_type", 2); - config.put("account_id", account); - - - xPlanMerchantMapper.save(config); - } - JSONObject opLog = initOperationLog(account, client.getIntValue("client_id"), "join"); - xPlanOperationLogMapper.saveLog(opLog); - } - - public static JSONObject initOperationLog(String account, int clientId, String type) { - JSONObject opLog = new JSONObject(); - opLog.put("client_id", clientId); - opLog.put("account", account); - opLog.put("create_time", new Date()); - opLog.put("client_ip", RequestEnvironment.getClientIp()); - return opLog; - } - - private JSONObject initMerchantConfig(JSONObject client) { - JSONObject config = new JSONObject(); - config.put("client_id", client.getIntValue("client_id")); - config.put("join_time", new Date()); - config.put("auto_deposit", false); - config.put("auto_deposit_amount", 0); - config.put("balance", 0); - //todo params - return config; - } - - @Override - public void switchAutoDeposit(String clientMoniker, String account, boolean autoDeposit) { - if (debugging && !"PINE".equals(clientMoniker)) { - throw new ForbiddenException("error.payment.xplan.enable"); - } - JSONObject client = getClient(clientMoniker); - JSONObject update = new JSONObject(); - update.put("client_id", client.getIntValue("client_id")); - update.put("auto_deposit", autoDeposit); - xPlanMerchantMapper.update(update); - JSONObject op = initOperationLog(account, client.getIntValue("client_id"), "switch_auto_deposit"); - op.put("remark", autoDeposit ? "enabled" : "disabled"); - xPlanOperationLogMapper.saveLog(op); - } - - @Override - public void configAutoDepositLimitAmount(String clientMoniker, String account, BigDecimal limit) { - if (debugging && !"PINE".equals(clientMoniker)) { - throw new ForbiddenException("error.payment.xplan.enable"); - } - JSONObject client = getClient(clientMoniker); - JSONObject update = new JSONObject(); - update.put("client_id", client.getIntValue("client_id")); - update.put("auto_deposit_amount", limit); - xPlanMerchantMapper.update(update); - JSONObject op = initOperationLog(account, client.getIntValue("client_id"), "auto_deposit_amount"); - op.put("remark", limit); - xPlanOperationLogMapper.saveLog(op); - } - - @Override - public JSONObject interestRateHistory(int limit) { - //todo - return null; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/XPlanFundProcessorImpl.java b/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/XPlanFundProcessorImpl.java deleted file mode 100644 index a638f06d1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/core/impls/XPlanFundProcessorImpl.java +++ /dev/null @@ -1,502 +0,0 @@ -package au.com.royalpay.payment.manage.fund.core.impls; - -import au.com.royalpay.payment.core.SettlementDetailCalculator; -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.fund.beans.XPlanFundConfig; -import au.com.royalpay.payment.manage.fund.core.XPlanFundConfigService; -import au.com.royalpay.payment.manage.fund.core.XPlanFundProcesor; -import au.com.royalpay.payment.manage.mappers.funds.*; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.CalendarMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.merchants.beans.TransactionBizSubType; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.*; - -/** - * Create by yixian at 2017-09-15 14:53 - */ -@Service -public class XPlanFundProcessorImpl implements XPlanFundProcesor { - private boolean debugging = true; - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private XPlanMerchantMapper xPlanMerchantMapper; - @Resource - private XPlanTransactionMapper xPlanTransactionMapper; - @Resource - private XPlanOperationLogMapper xPlanOperationLogMapper; - @Resource - private ClientManager clientManager; - @Resource - private TransactionService transactionService; - @Resource - private TransactionMapper transactionMapper; - @Resource - private Locker locker; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private CalendarMapper calendarMapper; - @Resource - private XPlanInterestLogMapper xPlanInterestLogMapper; - @Resource - private XPlanInterestClientLogMapper xPlanInterestClientLogMapper; - @Resource - private XPlanFundConfigService xPlanFundConfigService; - @Resource - private ClientConfigService clientConfigService; - @Resource(name = "systemCalculator") - private SettlementDetailCalculator systemCalculator; - - @Override - @Transactional - public void calculateInterest(Date processDate) { - logger.info("process xplan interest start!"); - List clients = xPlanMerchantMapper.listClients(new JSONObject(), new PageBounds()); - Date today = DateUtils.truncate(new Date(), Calendar.DATE); - if (xPlanInterestLogMapper.getTransLogByDate(today) != null) { - throw new BadRequestException("Interest Generated today!" + DateFormatUtils.format(today, "yyyyMMdd")); - } - List interestProces = new ArrayList<>(); - BigDecimal totalBalance = BigDecimal.ZERO; - BigDecimal totalInterest = BigDecimal.ZERO; - XPlanFundConfig config = xPlanFundConfigService.configuration(); - BigDecimal interestRate = config.getInterestRate(); - for (JSONObject client : clients) { - int clientId = client.getIntValue("client_id"); - List transactions = xPlanTransactionMapper.listDailyTransactions(clientId, DateUtils.addDays(today, -1)); - BigDecimal balance = client.getBigDecimal("balance"); - for (JSONObject trans : transactions) { - switch (trans.getString("type")) { - case "deposit"://存款 - balance = balance.subtract(trans.getBigDecimal("amount")); - logger.debug("reduce deposit:" + trans.getString("transaction_id") + "_______amount:" + trans.getBigDecimal("amount")); - break; - case "withdraw"://提现 - break; - default: - continue; - } - } - if (balance.compareTo(BigDecimal.ZERO) <= 0) { - continue; - } - BigDecimal interest = XPlanFundConfigServiceImpl.calculateInterest(interestRate, balance); - if (interest.compareTo(BigDecimal.ZERO) <= 0) { - logger.debug("Interest Less than 0.01,skip:" + clientId); - continue; - } - JSONObject processInfo = new JSONObject(); - processInfo.put("client_id", clientId); - processInfo.put("balance", balance); - processInfo.put("interest", interest); - processInfo.put("interest_rate", interestRate); - interestProces.add(processInfo); - totalBalance = totalBalance.add(balance); - totalInterest = totalInterest.add(interest); - } - JSONObject interestHistory = new JSONObject(); - interestHistory.put("rate", interestRate); - interestHistory.put("total_amount", totalBalance); - interestHistory.put("total_interest", totalInterest); - interestHistory.put("process_merchants", interestProces.size()); - interestHistory.put("date", today); - interestHistory.put("process_time", new Date()); - xPlanInterestLogMapper.save(interestHistory); - String historyId = interestHistory.getString("history_id"); - for (JSONObject process : interestProces) { - process.put("history_id", historyId); - process.put("process_date", today); - process.put("process_time", new Date()); - - xPlanInterestClientLogMapper.save(process); - int clientId = process.getIntValue("client_id"); - String clientKey = "fund:xplan:clients:" + clientId; - locker.lock(clientKey, 10_000, 10_000); - try { - JSONObject mch = xPlanMerchantMapper.findMerchantConfig(clientId); - JSONObject fundTransaction = new JSONObject(); - fundTransaction.put("client_id", clientId); - fundTransaction.put("request_id", "SYSTEM" + DateFormatUtils.format(new Date(), "yyyyMMdd") + RandomStringUtils.random(5, true, true).toUpperCase()); - fundTransaction.put("operator", "SYSTEM"); - fundTransaction.put("time", DateUtils.truncate(new Date(), Calendar.SECOND)); - fundTransaction.put("type", "interest"); - fundTransaction.put("dev_id", "SYSTEM"); - BigDecimal interest = process.getBigDecimal("interest"); - fundTransaction.put("amount", interest); - fundTransaction.put("balance", mch.getBigDecimal("balance").add(interest)); - xPlanTransactionMapper.saveTransaction(fundTransaction); - xPlanMerchantMapper.deposit(clientId, interest); - } finally { - locker.unlock(clientKey); - } - } - logger.info("process xplan interest finished"); - } - - @Override - public JSONObject depositCheck(String accountId) { - - //检查账号有效 - JSONObject account = clientAccountMapper.findById(accountId); - if (account == null) { - throw new ForbiddenException("Account Not Exists or disabled"); - } - //检查账号权限 - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - int clientId = account.getIntValue("client_id"); - if (debugging && 9 != clientId) { - throw new ForbiddenException("error.payment.xplan.enable"); - } - JSONObject merchant = xPlanMerchantMapper.findMerchantConfig(clientId); - if (merchant == null) { - throw new ForbiddenException("Not Joined yet"); - } - //检查余额 - double available = transactionMapper.getClientUnClearedAmount(clientId); - JSONObject res = new JSONObject(); - res.put("available", available); - Date start = DateUtils.addDays(determineInterestStart(new Date()), 1); - res.put("interest_time", DateFormatUtils.format(start, TimeZoneUtils.PATTERN_DATE)); - return res; - } - - @Override - @Transactional - public JSONObject deposit(String requestId, String accountId, String devId, BigDecimal amount) { - //检查账号有效 - JSONObject account = clientAccountMapper.findById(accountId); - if (account == null) { - throw new ForbiddenException("Account Not Exists or disabled"); - } - //检查账号权限 - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - int clientId = account.getIntValue("client_id"); - if (debugging && 9 != clientId) { - throw new ForbiddenException("error.payment.xplan.enable"); - } - String clientKey = "fund:xplan:clients:" + clientId; - locker.lock(clientKey, 10_000, 10_000); - try { - //检查是否开通 - JSONObject merchant = xPlanMerchantMapper.findMerchantConfig(clientId); - if (merchant == null) { - throw new ForbiddenException("Not Joined yet"); - } - String transactionKey = "transaction:debit:clients:" + clientId; - locker.lock(transactionKey, 10_000, 10_000); - try { - //检查request id - JSONObject client = clientManager.getClientInfo(clientId); - if (client == null) { - throw new BadRequestException("Merchant Account Invalid"); - } - List requests = xPlanTransactionMapper.findByRequestId(clientId, requestId); - if (!requests.isEmpty()) { - return transactionStatus(client.getString("client_moniker"), requests.get(0).getString("transaction_id")); - } - //检查余额 - double available = transactionMapper.getClientUnClearedAmount(clientId); - if (amount.compareTo(BigDecimal.valueOf(available)) > 0) { - throw new BadRequestException("Not Enough Balance"); - } - //检查最大金额限制 - BigDecimal balance = merchant.getBigDecimal("balance"); - XPlanFundConfig config = xPlanFundConfigService.configuration(); - if (balance.add(amount).compareTo(config.getMaxAmount()) > 0) { - throw new BadRequestException("Over max amount"); - } - JSONObject fundTransaction = new JSONObject(); - fundTransaction.put("client_id", clientId); - fundTransaction.put("request_id", requestId); - fundTransaction.put("operator", accountId); - fundTransaction.put("time", DateUtils.truncate(new Date(), Calendar.SECOND)); - fundTransaction.put("type", "deposit"); - fundTransaction.put("dev_id", devId); - fundTransaction.put("amount", amount); - fundTransaction.put("balance", balance.add(amount)); - xPlanTransactionMapper.saveTransaction(fundTransaction); - String fundTransactionId = fundTransaction.getString("transaction_id"); - savePmtTransaction(devId, amount, client, fundTransactionId, "Debit", "Deposit to X-Plan"); - xPlanMerchantMapper.deposit(clientId, amount); - JSONObject operation = XPlanFundConfigServiceImpl.initOperationLog(accountId, clientId, "deposit"); - operation.put("remark", "amount=" + amount.toPlainString()); - xPlanOperationLogMapper.saveLog(operation); - return transactionStatus(client.getString("client_moniker"), fundTransactionId); - } finally { - locker.unlock(transactionKey); - } - } finally { - locker.unlock(clientKey); - } - } - - @Override - public JSONObject withdrawCheck(String accountId) { - //检查账号有效 - JSONObject account = clientAccountMapper.findById(accountId); - if (account == null) { - throw new ForbiddenException("Account Not Exists or disabled"); - } - //检查账号权限 - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - int clientId = account.getIntValue("client_id"); - //检查是否开通 - JSONObject merchant = xPlanMerchantMapper.findMerchantConfig(clientId); - if (merchant == null) { - throw new ForbiddenException("Not Joined yet"); - } - //检查余额 - BigDecimal balance = merchant.getBigDecimal("balance"); - JSONObject res = new JSONObject(); - res.put("balance", balance); - Date settleDate = calendarMapper.findNextClearingDate(DateUtils.addDays(DateUtils.truncate(new Date(), Calendar.DATE), 1)); - res.put("finish_time", DateFormatUtils.format(settleDate, TimeZoneUtils.PATTERN_DATE)); - return res; - } - - private JSONObject savePmtTransaction(String devId, BigDecimal amount, JSONObject client, String fundTransactionId, String transactionType, String remark) { - JSONObject tradeTransaction = new JSONObject(); - tradeTransaction.put("client_id", client.getIntValue("client_id")); - tradeTransaction.put("org_id", client.getIntValue("org_id")); - tradeTransaction.put("system_transaction_id", fundTransactionId); - tradeTransaction.put("order_id", fundTransactionId); - tradeTransaction.put("transaction_amount", amount); - tradeTransaction.put("transaction_currency", "AUD"); - tradeTransaction.put("clearing_amount", amount); - tradeTransaction.put("clearing_currency", "AUD"); - tradeTransaction.put("transaction_time", new Date()); - tradeTransaction.put("transaction_type", transactionType); - tradeTransaction.put("exchange_rate", 1); - tradeTransaction.put("device_id", devId); - tradeTransaction.put("clearing_status", 0); - tradeTransaction.put("channel", "System"); - tradeTransaction.put("system_generate", 1); - tradeTransaction.put("remark", remark); - transactionService.saveTransaction(tradeTransaction, TransactionBizSubType.DEPOSIT); - return tradeTransaction; - } - - @Override - public JSONObject withdraw(String requestId, String accountId, String devId, BigDecimal amount) { - //检查账号有效 - JSONObject account = clientAccountMapper.findById(accountId); - if (account == null) { - throw new ForbiddenException("Account Not Exists or disabled"); - } - //检查账号权限 - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission"); - } - - int clientId = account.getIntValue("client_id"); - String clientKey = "fund:xplan:clients:" + clientId; - locker.lock(clientKey, 10_000, 10_000); - try { - //检查是否开通 - JSONObject merchant = xPlanMerchantMapper.findMerchantConfig(clientId); - if (merchant == null) { - throw new ForbiddenException("Not Joined yet"); - } - if (amount.compareTo(BigDecimal.ZERO) <= 0) { - throw new BadRequestException("Invalid Amount"); - } - //检查request id - JSONObject client = clientManager.getClientInfo(clientId); - if (client == null) { - throw new BadRequestException("Merchant Account Invalid"); - } - List requests = xPlanTransactionMapper.findByRequestId(clientId, requestId); - if (!requests.isEmpty()) { - return transactionStatus(client.getString("client_moniker"), requests.get(0).getString("transaction_id")); - } - //检查余额 - BigDecimal balance = merchant.getBigDecimal("balance"); - if (amount.compareTo(balance) > 0) { - throw new BadRequestException("Not Enough Balance"); - } - JSONObject fundTransaction = new JSONObject(); - fundTransaction.put("client_id", clientId); - fundTransaction.put("request_id", requestId); - fundTransaction.put("operator", accountId); - fundTransaction.put("time", DateUtils.truncate(new Date(), Calendar.SECOND)); - fundTransaction.put("type", "withdraw"); - fundTransaction.put("dev_id", devId); - fundTransaction.put("amount", amount.multiply(BigDecimal.valueOf(-1))); - fundTransaction.put("balance", balance.subtract(amount)); - xPlanTransactionMapper.saveTransaction(fundTransaction); - String fundTransactionId = fundTransaction.getString("transaction_id"); - savePmtTransaction(devId, amount, client, fundTransactionId, "Credit", "Withdraw from X-Plan"); - xPlanMerchantMapper.withdraw(clientId, amount); - JSONObject operation = XPlanFundConfigServiceImpl.initOperationLog(accountId, clientId, "withdraw"); - operation.put("remark", "amount=" + amount.toPlainString()); - xPlanOperationLogMapper.saveLog(operation); - return transactionStatus(client.getString("client_moniker"), fundTransactionId); - - - } finally { - locker.unlock(clientKey); - } - } - - @Override - public JSONObject listTransactionHistory(String clientMoniker, String type, int page, int limit) { - JSONObject client = getClient(clientMoniker); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - if (StringUtils.isNotEmpty(type)) { - params.put("type", type); - } - PageList transactions = xPlanTransactionMapper.listMerchantTransactions(params, new PageBounds(page, limit, Order.formString("time.desc"))); - List availableKeys = Arrays.asList("type", "transaction_id", "time", "amount", "remark", "balance"); - for (JSONObject trans : transactions) { - List keysToRemove = new ArrayList<>(); - for (String key : trans.keySet()) { - if (!availableKeys.contains(key)) { - keysToRemove.add(key); - } - } - for (String key : keysToRemove) { - trans.remove(key); - } - TimeZoneUtils.switchTimeZone(trans, client.getString("timezone"), "time"); - BigDecimal amount = trans.getBigDecimal("amount"); - trans.put("amount", amount.compareTo(BigDecimal.ZERO) > 0 ? "+" + amount.toPlainString() : amount.toPlainString()); - } - return PageListUtils.buildPageListResult(transactions); - } - - private JSONObject getClient(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - return client; - } - - @Override - public JSONObject transactionStatus(String clientMoniker, String transactionId) { - JSONObject client = getClient(clientMoniker); - JSONObject trans = xPlanTransactionMapper.findTransaction(transactionId); - if (trans.getIntValue("client_id") != client.getIntValue("client_id")) { - throw new ForbiddenException("Invalid Request"); - } - Date time = trans.getDate("time"); - List events = new ArrayList<>(); - events.add(initTimeNode(time, client.getString("timezone"), TimeZoneUtils.PATTERN_DATE)); - String type = trans.getString("type"); - switch (type) { - case "deposit": { - Date interestStart = determineInterestStart(time); - events.add(initTimeNode(interestStart, client.getString("timezone"), TimeZoneUtils.PATTERN_DATE)); - Date interestReceive = DateUtils.addDays(interestStart, 1); - events.add(initTimeNode(interestReceive, client.getString("timezone"), TimeZoneUtils.PATTERN_DATE)); - break; - } - case "withdraw": { - Date settled = calendarMapper.findNextClearingDate(DateUtils.addDays(time, 1)); - if (settled != null) { - events.add(initTimeNode(time, client.getString("timezone"), TimeZoneUtils.PATTERN_NORMAL)); - events.add(initTimeNode(settled, client.getString("timezone"), TimeZoneUtils.PATTERN_DATE)); - } - break; - } - } - trans.put("events", events); - try { - if (trans.getIntValue("operator") > 0) { - JSONObject account = clientAccountMapper.findById(trans.getString("operator")); - trans.put("account", account); - } - } catch (Exception ignore) { - } - return trans; - } - - @Override - public JSONObject interestHistory(String from, String to, int page, int limit) { - JSONObject params = new JSONObject(); - if (StringUtils.isNotEmpty(from)) { - try { - Date fromDate = DateUtils.parseDate(from, new String[]{"yyyyMMdd"}); - params.put("from", fromDate); - } catch (ParseException e) { - throw new BadRequestException("Invalid From Date Format"); - } - } - if (StringUtils.isNotEmpty(to)) { - try { - Date toDate = DateUtils.parseDate(to, new String[]{"yyyyMMdd"}); - params.put("to", toDate); - } catch (ParseException e) { - throw new BadRequestException("Invalid To Date Format"); - } - } - PageList interests = xPlanInterestLogMapper.list(params, new PageBounds(page, limit, Order.formString("date.desc"))); - for (JSONObject interest : interests) { - Date date = interest.getDate("date"); - interest.put("date", DateFormatUtils.format(date, "yyyy-MM-dd")); - interest.put("date_str", DateFormatUtils.format(date, "yyyyMMdd")); - } - return PageListUtils.buildPageListResult(interests); - } - - @Override - public JSONObject interestDetail(String date) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); - JSONObject history = xPlanInterestLogMapper.getTransLogByDate(dt); - String historyId = history.getString("history_id"); - List merchantLogs = xPlanInterestClientLogMapper.listMerchantLogs(historyId, new PageBounds(Order.formString("client_moniker.asc"))); - history.put("merchants", merchantLogs); - return history; - } catch (ParseException e) { - throw new BadRequestException("Invalid Date Format"); - } - } - - private JSONObject initTimeNode(Date date, String timezone, String pattern) { - JSONObject timeNode = new JSONObject(); - timeNode.put("date", TimeZoneUtils.formatTime(date, pattern, timezone)); - logger.debug("comparing aceived:" + System.currentTimeMillis() + "-->" + date.getTime()); - timeNode.put("actived", System.currentTimeMillis() >= date.getTime()); - return timeNode; - } - - private Date determineInterestStart(Date time) { - return DateUtils.truncate(DateUtils.addDays(time, 1), Calendar.DATE); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/package-info.java b/src/main/java/au/com/royalpay/payment/manage/fund/package-info.java deleted file mode 100644 index c232f7d02..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 余额增值计划 - */ -package au.com.royalpay.payment.manage.fund; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/fund/web/XPlanFundSysConfigController.java b/src/main/java/au/com/royalpay/payment/manage/fund/web/XPlanFundSysConfigController.java deleted file mode 100644 index 8b556cd00..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/fund/web/XPlanFundSysConfigController.java +++ /dev/null @@ -1,81 +0,0 @@ -package au.com.royalpay.payment.manage.fund.web; - -import au.com.royalpay.payment.manage.fund.beans.ClientQueryParams; -import au.com.royalpay.payment.manage.fund.beans.XPlanFundConfig; -import au.com.royalpay.payment.manage.fund.core.XPlanFundConfigService; -import au.com.royalpay.payment.manage.fund.core.XPlanFundProcesor; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Create by yixian at 2017-09-06 11:08 - */ -@RestController -@ManagerMapping(value = "/funds/xplan/sysconfig", role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF}) -public class XPlanFundSysConfigController { - @Resource - private XPlanFundConfigService xPlanFundConfigService; - @Resource - private XPlanFundProcesor xPlanFundProcesor; - - @GetMapping("/base") - public XPlanFundConfig getBaseConfig() { - return xPlanFundConfigService.configuration(); - } - - @PutMapping("/base") - public void updateFundConfig(@RequestBody @Valid XPlanFundConfig xPlanFundConfig, Errors errors, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - xPlanFundConfigService.configuration(xPlanFundConfig, manager); - } - - @GetMapping("/analysis") - public JSONObject getAnalysis() { - return xPlanFundConfigService.analysisStatus(); - } - - @GetMapping("/clients") - public JSONObject listClients(ClientQueryParams params) { - return xPlanFundConfigService.clients(params.toParams(), params.getPage(), params.getLimit()); - } - - @PutMapping("/clients/{clientMoniker}") - public void configClient(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - xPlanFundConfigService.configClient(clientMoniker, manager); - } - - @GetMapping("/clients/{clientMoniker}") - public JSONObject getClientInfo(@PathVariable String clientMoniker) { - return xPlanFundConfigService.clientAnalysis(clientMoniker); - } - - @GetMapping("/clients/{clientMoniker}/transactions") - public JSONObject clientTransaction(@PathVariable String clientMoniker, @RequestParam(required = false) String type, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "15") int limit) { - return xPlanFundProcesor.listTransactionHistory(clientMoniker, type, page, limit); - } - - @GetMapping("/clients/{clientMoniker}/transactions/{transactionId}") - public JSONObject getTransactionInfo(@PathVariable String clientMoniker, @PathVariable String transactionId) { - return xPlanFundProcesor.transactionStatus(clientMoniker, transactionId); - } - - @GetMapping("/interests") - public JSONObject listInterests(@RequestParam(required = false) String from, @RequestParam(required = false) String to, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "15") int limit) { - return xPlanFundProcesor.interestHistory(from, to, page, limit); - } - - @RequestMapping(value = "/interests/{date}",method = RequestMethod.GET) - public JSONObject interestDetail(@PathVariable String date){ - return xPlanFundProcesor.interestDetail(date); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/advice/Gtw2Ctrl.java b/src/main/java/au/com/royalpay/payment/manage/gateway/advice/Gtw2Ctrl.java deleted file mode 100644 index 042e1871f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/advice/Gtw2Ctrl.java +++ /dev/null @@ -1,9 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.advice; - -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Gtw2Ctrl { -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/advice/Gtw2SignAspect.java b/src/main/java/au/com/royalpay/payment/manage/gateway/advice/Gtw2SignAspect.java deleted file mode 100644 index e35834636..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/advice/Gtw2SignAspect.java +++ /dev/null @@ -1,164 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.advice; - -import au.com.royalpay.payment.core.exceptions.InvalidGatewayShortIdException; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.core.exceptions.SignInvalidException; -import au.com.royalpay.payment.manage.mappers.system.OrgSignInfoMapper; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.serializer.SerializerFeature; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.server.ServletServerHttpRequest; -import org.springframework.stereotype.Component; -import org.springframework.util.MultiValueMap; -import org.springframework.web.context.request.*; -import org.springframework.web.servlet.View; -import org.springframework.web.util.UriComponents; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; -import java.security.*; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import static au.com.royalpay.payment.tools.codec.RSACrypt.loadPrivateKey; -import static au.com.royalpay.payment.tools.codec.RSACrypt.loadPublicKey; - -/** - * @author taylor - */ -@Aspect -@Component -public class Gtw2SignAspect { - private Logger logger = LoggerFactory.getLogger(getClass()); - - private static final String V2_SIGN_TYPE = "RSA2"; - @Resource - private OrgSignInfoMapper orgSignRsaMapper; - - - @Pointcut("within(au.com.royalpay.payment.manage.gateway.web..*) && " + - "!execution(* au.com.royalpay.payment.manage.gateway.web.*.handlePartner*(..))") - private void anyMethod() { - } - - - @Around(value = "anyMethod()") - public JSONObject aroundHandleRequest(ProceedingJoinPoint pjp) throws Throwable { - RequestAttributes ra = RequestContextHolder.getRequestAttributes(); - ServletRequestAttributes sra = (ServletRequestAttributes) ra; - UriComponents components = UriComponentsBuilder.fromHttpRequest(new ServletServerHttpRequest(sra.getRequest())).build(); - String requestUrl = UriComponentsBuilder.fromHttpUrl(components.toUriString()).replaceQuery(null).toUriString(); - MultiValueMap requireParams = components.getQueryParams(); - if (!requireParams.containsKey("nonce_str")) { - throw new ParamInvalidException("nonce_str", "error.payment.valid.param_missing"); - } - if (!requireParams.containsKey("sign")) { - throw new ParamInvalidException("sign", "error.payment.valid.param_missing"); - } - if (!requireParams.containsKey("sign_type")) { - throw new ParamInvalidException("sign_type", "error.payment.valid.param_missing"); - } - if (!StringUtils.equals(V2_SIGN_TYPE, requireParams.getFirst("sign_type"))) { - throw new ParamInvalidException("sign_type", "error.payment.valid.invalid_param"); - } - NativeWebRequest webRequest = new ServletWebRequest(sra.getRequest()); - Map pathVariables = (Map) webRequest.getAttribute(View.PATH_VARIABLES, RequestAttributes.SCOPE_REQUEST); - if (!pathVariables.containsKey("shortId")) { - throw new InvalidShortIdException(); - } - Object[] requestArgs = pjp.getArgs(); - JSONObject requestBody = null; - for (Object arg : requestArgs) { - try { - if (arg instanceof JSONObject) { - requestBody = JSON.parseObject(arg.toString()); - } - } catch (Exception e) { - throw new ParamInvalidException("Request Body", "error.payment.valid.invalid_param"); - } - } - if (!StringUtils.equals("GET", sra.getRequest().getMethod()) && requestBody == null - && !requestUrl.contains("/attachment/files")) { - throw new ParamInvalidException("Request Body", "error.payment.valid.invalid_param"); - } - AtomicBoolean isTrueSign = new AtomicBoolean(buildSign(pathVariables.get("shortId"), - requestBody == null ? new JSONObject() : requestBody, - requestUrl, - requireParams.getFirst("nonce_str"), - requireParams.getFirst("sign"))); - if (!isTrueSign.get()) { - throw new SignInvalidException(); - } - Object result = pjp.proceed(); - JSONObject data = JSON.parseObject(result.toString()); - return buildResponseData(pathVariables.get("shortId"), requestUrl, data); - } - - private JSONObject buildResponseData(String clientMoniker, String requestUrl, JSONObject data) { - data.put("nonce_str", RandomStringUtils.random(15, true, true)); - data.put("sign_type", V2_SIGN_TYPE); - data.put("url", requestUrl); - JSONObject signInfo = orgSignRsaMapper.findOrgSignInfo(clientMoniker); - String signStr = sign(JSONObject.toJSONBytes(data, SerializerFeature.MapSortField), signInfo.getString("platform_private_key")); - JSONObject respJson = new JSONObject(); - respJson.put("data", data); - respJson.put("sign", signStr); - logger.info("ApiV2 Response : {}", JSONObject.toJSONString(respJson, SerializerFeature.MapSortField)); - return respJson; - } - - private boolean buildSign(String clientMoniker, JSONObject requestData, String url, String nonceStr, String requestSign) { - requestData.put("url", url); - requestData.put("sign_type", V2_SIGN_TYPE); - requestData.put("nonce_str", nonceStr); - logger.info("ApiV2 Request : {}, RequestSign : {}", JSONObject.toJSONString(requestData, SerializerFeature.MapSortField), requestSign); - JSONObject signInfo = orgSignRsaMapper.findOrgSignInfo(clientMoniker); - if (signInfo == null) { - throw new InvalidGatewayShortIdException(); - } - if (!signInfo.containsKey("mch_public_key")) { - throw new ServerErrorException("error.payment.valid.invalid.mch_public_key"); - } - return checkSign(JSONObject.toJSONBytes(requestData, SerializerFeature.MapSortField), requestSign, signInfo.getString("mch_public_key")); - } - - public String sign(byte[] source, String privateKey) { - try { - PrivateKey priKey = loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes(StandardCharsets.UTF_8))); - Signature signature = Signature.getInstance("SHA256withRSA"); - signature.initSign(priKey); - signature.update(source); - byte[] signed = signature.sign(); - return Base64.encodeBase64URLSafeString(signed); - } catch (NoSuchAlgorithmException | SignatureException | InvalidKeyException e) { - //shall never happen - throw new ServerErrorException(e); - } - } - - public boolean checkSign(byte[] source, String sign, String publicKey) { - try { - PublicKey pubKey = loadPublicKey(new ByteArrayInputStream(publicKey.getBytes(StandardCharsets.UTF_8))); - Signature signature = Signature.getInstance("SHA256withRSA"); - signature.initVerify(pubKey); - signature.update(source); - return signature.verify(Base64.decodeBase64(sign)); - } catch (NoSuchAlgorithmException | SignatureException | InvalidKeyException e) { - //shall never happen - throw new ServerErrorException(e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientCompanyConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientCompanyConfig.java deleted file mode 100644 index 5c737c49a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientCompanyConfig.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; -import org.apache.commons.lang3.StringUtils; - -import java.lang.reflect.Field; -import java.util.Arrays; - -@Data -public class ClientCompanyConfig { - - @JSONField(name = "company_name") - private String companyName; - @JSONField(name = "short_name") - private String shortName; - @JSONField(name = "store_name") - private String storeName; - @JSONField(name = "business_name") - private String businessName; - @JSONField(name = "business_structure") - private String businessStructure; - private String abn; - private String acn; - @JSONField(name = "company_phone") - private String companyPhone; - @JSONField(name = "logo_url") - private String logoId; - - private static String[] WHITE_LIST = {"businessName","abn", "acn"}; - - - public void checkParamsInvalid() throws IllegalAccessException { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null && !Arrays.asList(WHITE_LIST).contains(field.getName())) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() +" not found"); - } - } - if (StringUtils.equalsIgnoreCase(businessStructure, "Company")) { - if (StringUtils.isBlank(acn) || acn.length() != 9) { - throw new ParamInvalidException("acn", "Required Param acn not found"); - } - }else { - if (StringUtils.isBlank(abn)) { - throw new ParamInvalidException("abn", "Required Param abn not found"); - } - } - } - - - public JSONObject basicInfo() { - return (JSONObject) JSON.toJSON(this); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientComplianceFileConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientComplianceFileConfig.java deleted file mode 100644 index e4bc78572..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientComplianceFileConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; -import org.apache.commons.lang3.StringUtils; - -import java.lang.reflect.Field; -import java.util.Arrays; - -@Data -public class ClientComplianceFileConfig { - @JSONField(name = "id_type") - private String idType; - @JSONField(name = "id_title") - private String idTitle; - @JSONField(name = "id_title_description") - private String idTitleDesc; - @JSONField(name = "bank_statement") - private String bankStatement; - @JSONField(name = "certificate_of_registration") - private String certOfRegistration; - @JSONField(name = "id_file") - private String id; - @JSONField(name = "utility_bill") - private String utilityBill; - - private static String[] WHITE_LIST = {"utilityBill","idTitleDesc"}; - - public void checkParamsInvalid() throws IllegalAccessException { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null && !Arrays.asList(WHITE_LIST).contains(field.getName())) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() +" not found"); - } - } - if (!StringUtils.equalsIgnoreCase(idTitle, "Ultimate beneficiary owner")) { - if (StringUtils.isBlank(idTitleDesc)) { - throw new ParamInvalidException("id_title_description", "Required Param id_title_description not found"); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientContactConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientContactConfig.java deleted file mode 100644 index 1fcc450e9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientContactConfig.java +++ /dev/null @@ -1,72 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; -import org.apache.commons.lang3.StringUtils; - -import java.lang.reflect.Field; -import java.util.regex.Matcher; - -@Data -public class ClientContactConfig { - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - @JSONField(name = "contact_job") - private String contactJob; - private String address; - private String suburb; - private String postcode; - private String state; - private String country; - @JSONField(name = "registered_address") - private String registeredAddress; - @JSONField(name = "registered_suburb") - private String registeredSuburb; - @JSONField(name = "registered_postcode") - private String registeredPostcode; - @JSONField(name = "registered_state") - private String registeredState; - private String timezone; - - private static java.util.regex.Pattern TIMEZONE_PATTERN = java.util.regex.Pattern.compile("^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$"); - - public void checkParamsInvalid() throws IllegalAccessException { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() +" not found"); - } - } - Matcher matcher = TIMEZONE_PATTERN.matcher(timezone); - if (!matcher.matches()) { - throw new BadRequestException("PARAM_ERROR:Timezone not acceptable!"); - } - } - - public JSONObject contractInfo() { - JSONObject contract = (JSONObject) JSON.toJSON(this); - if (StringUtils.equalsIgnoreCase(state, "OTHER")) { - contract.put("state", "其他(Other)"); - } - return contract; - } - - public JSONObject legalAddressInfo() { - JSONObject address = new JSONObject(); - address.put("address", registeredAddress); - address.put("suburb", registeredSuburb); - address.put("postcode", registeredPostcode); - if (StringUtils.equalsIgnoreCase(registeredState, "OTHER")) { - address.put("state", "其他(Other)"); - } - return address; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientLegalConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientLegalConfig.java deleted file mode 100644 index ede6d5920..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientLegalConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; - -import java.lang.reflect.Field; - -@Data -public class ClientLegalConfig { - - @JSONField(name = "legal_representative_person") - private String representativePerson ; - @JSONField(name = "legal_representative_phone") - private String representativePhone; - @JSONField(name = "legal_representative_email") - private String representativeEmail; - @JSONField(name = "legal_representative_job") - private String representativeJobTitle; - - public void checkParamsInvalid() throws IllegalAccessException { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() +" not found"); - } - } - } - - public JSONObject clientLegalInfo() { - JSONObject legal = new JSONObject(); - legal.put("representative_person", representativePerson); - legal.put("job_title", representativeJobTitle); - legal.put("phone", representativePhone); - legal.put("email", representativeEmail); - return legal; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java deleted file mode 100644 index 54d8b54af..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; -import org.apache.commons.lang3.StringUtils; - -import java.lang.reflect.Field; -import java.util.Arrays; - -@Data -public class ClientPayConfig { - @JSONField(name = "client_pay_type") - private String clientPayType; - @JSONField(name = "client_pay_desc") - private String clientPayDesc; - @JSONField(name = "royalpay_industry") - private String royalpayindustry; - @JSONField(name = "company_photo") - private String companyPhoto; - @JSONField(name = "store_photo") - private String storePhoto; - @JSONField(name = "company_website") - private String companyWebsite; - - private static String[] WHITE_LIST = {"companyWebsite","storePhoto", "companyPhoto"}; - - - public void checkParamsInvalid() throws IllegalAccessException { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null && !Arrays.asList(WHITE_LIST).contains(field.getName())) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() +" not found"); - } - } - if (clientPayType.indexOf("1") != -1) { - if (StringUtils.isBlank(companyWebsite)) { - throw new ParamInvalidException("company_website", "Required Param company_website not found"); - } - } - if (clientPayType.indexOf("2") != -1) { - if (StringUtils.isBlank(companyPhoto)) { - throw new ParamInvalidException("company_photo", "Required Param company_photo not found"); - } - if (StringUtils.isBlank(storePhoto)) { - throw new ParamInvalidException("store_photo", "Required Param store_photo not found"); - } - } - } - - public JSONObject payConfig() { - JSONObject config = (JSONObject) JSON.toJSON(this); - config.put("alipayindustry", "5311"); - config.put("industry", "336"); - config.put("royalpayindustry", royalpayindustry); - return config; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientRegisterInfo.java deleted file mode 100644 index da3c6907d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientRegisterInfo.java +++ /dev/null @@ -1,141 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.Date; - -/** - * Created by yixian on 2016-06-29. - */ -@Data -public class ClientRegisterInfo { - private static final String[] DATE_PATTERNS = {"yyyy-MM-dd HH:mm:ss"}; - - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - @JSONField(name = "apply_id") - private String applyId; - @JSONField(name = "parent_partner_code") - private String parentPartnerCode; - @JSONField(name = "notify_url") - private String notifyUrl; - @JSONField(name = "company_info") - private ClientCompanyConfig companyConfig; - @JSONField(name = "contact_info") - private ClientContactConfig contactConfig; - @JSONField(name = "legal_info") - private ClientLegalConfig legalConfig; - @JSONField(name = "pay_info") - private ClientPayConfig payConfig; - @JSONField(name = "settle_info") - private ClientSettleConfig settleConfig; - @JSONField(name = "compliance_file_info") - private ClientComplianceFileConfig complianceFileConfig; - - private static String[] WHITE_LIST = {"parentPartnerCode", "notifyUrl"}; - - public void checkParamsInvalid(boolean sandboxMode) { - try { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null && !Arrays.asList(WHITE_LIST).contains(field.getName())) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() +" not found"); - } - } - companyConfig.checkParamsInvalid(); - contactConfig.checkParamsInvalid(); - legalConfig.checkParamsInvalid(); - payConfig.checkParamsInvalid(); - settleConfig.checkParamsInvalid(sandboxMode); - complianceFileConfig.checkParamsInvalid(); - } catch (IllegalAccessException e) { - logger.error("gateway api register client error : {}", e.getMessage()); - throw new BadRequestException("Params Format Error"); - } - } - - public JSONObject insertClientInfo(String clientMoniker, String bdUserName, boolean hasParentBoolean, int parentClientId) { - JSONObject client = new JSONObject(); - client.putAll(companyConfig.basicInfo()); - client.put("logo_thumbnail", companyConfig.getLogoId()); - client.putAll(contactConfig.contractInfo()); - client.putAll(payConfig.payConfig()); - client.put("create_time", new Date()); - client.put("ali_sub_merchant_id", clientMoniker); - client.put("credential_code", RandomStringUtils.random(32, true, true)); - client.put("creator", applyId); - client.put("bd_user", applyId); - client.put("bd_user_name", bdUserName); - client.put("client_moniker", clientMoniker); - if (hasParentBoolean && parentClientId != 0) { - client.put("parent_client_id", parentClientId); - } - client.put("source", 5); - return client; - } - - public JSONObject insertClientConfigInfo(int clientId, String clientMoniker) { - JSONObject clientConfig = new JSONObject(); - clientConfig.putAll(payConfig.payConfig()); - clientConfig.put("notify_url", notifyUrl); - clientConfig.put("client_id", clientId); - clientConfig.put("client_moniker", clientMoniker); - return clientConfig; - } - - public JSONObject insertClientLegalInfo(int clientId) { - JSONObject clientLegalInfo = new JSONObject(); - clientLegalInfo.putAll(legalConfig.clientLegalInfo()); - clientLegalInfo.putAll(contactConfig.legalAddressInfo()); - clientLegalInfo.put("client_id", clientId); - return clientLegalInfo; - } - - public JSONObject insertBankInfo(int clientId) { - JSONObject bankInfo = settleConfig.insertBankInfo(); - bankInfo.put("client_id", clientId); - return bankInfo; - } - - public ClientAuthFilesInfo insertClientComplianceInfo() { - ClientAuthFilesInfo file = new ClientAuthFilesInfo(); - file.setFile_bank_info(complianceFileConfig.getBankStatement()); - file.setFile_id_info(complianceFileConfig.getId()); - file.setFile_company_info(complianceFileConfig.getCertOfRegistration()); - file.setUtility_bill_info(complianceFileConfig.getUtilityBill()); - file.setId_type(complianceFileConfig.getIdType()); - file.setBeneficiary_id_title(complianceFileConfig.getIdTitle()); - file.setOther_id_title_desc(complianceFileConfig.getIdTitleDesc()); - return file; - } - - public JSONObject insertClientRateInfo(JSONObject defaultRateConfig) { - JSONObject rate = new JSONObject(); - rate.put("clean_days", settleConfig.getCleanDays()); - Date lessActiveTime = DateUtils.addDays(settleConfig.getActiveTimeDate(), -1); - rate.put("active_time", DateFormatUtils.format(lessActiveTime,"yyyy-MM-dd HH:mm:ss")); - rate.put("expiry_time", settleConfig.getExpireTime()); - rate.put("wechat_rate_value", settleConfig.getWechatRate()); - rate.put("alipay_rate_value", settleConfig.getAlipayRate()); - rate.put("alipayonline_rate_value", settleConfig.getAlipayOnlineRate()); - rate.put("Rpay_rate_value", getDefaultRate(defaultRateConfig, String.valueOf(settleConfig.getCleanDays()),"Rpay")); - rate.put("cb_bankpay_rate_value", getDefaultRate(defaultRateConfig, String.valueOf(settleConfig.getCleanDays()),"CB_Bankpay")); - rate.put("transaction_fee", settleConfig.getTransactionFee()); - return rate; - } - - private String getDefaultRate(JSONObject defaultRateConfig, String cleanDays, String rateKey) { - JSONObject config = defaultRateConfig.getJSONObject("t" + cleanDays); - return config.getString(rateKey); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientSettleConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientSettleConfig.java deleted file mode 100644 index cd79c2e62..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientSettleConfig.java +++ /dev/null @@ -1,109 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBank; -import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankInfo; -import au.com.royalpay.payment.manage.system.core.impl.ClientContractServiceImpl; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.text.ParseException; -import java.util.Arrays; -import java.util.Date; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@Data -public class ClientSettleConfig { - private Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class); - - @JSONField(name = "swift_code") - private String swiftCode; - @JSONField(name = "bsb_no") - private String bsbNo; - @JSONField(name = "account_no") - private String accountNo; - @JSONField(name = "account_name") - private String accountName; - @JSONField(name = "clean_days") - private int cleanDays; - @JSONField(name = "wechat_rate") - private String wechatRate; - @JSONField(name = "alipay_rate") - private String alipayRate; - @JSONField(name = "alipay_online_rate") - private String alipayOnlineRate; - @JSONField(name = "transaction_fee") - private String transactionFee = "0.00"; - @JSONField(name = "active_time") - private String activeTime; - @JSONField(name = "expire_time") - private String expireTime; - private AustraliaBankInfo bankQueryInfo; - private Date activeTimeDate; - - private static String[] WHITE_LIST = {"bankQueryInfo", "activeTimeDate"}; - private static Pattern ACCOUNT_NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9 &]+$"); - - public void checkParamsInvalid(boolean sandboxMode) throws IllegalAccessException { - for (Field field : getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.get(this) == null && !Arrays.asList(WHITE_LIST).contains(field.getName())) { - throw new ParamInvalidException(field.getName(), "Required Param " + field.getName() + " not found"); - } - } - if (swiftCode.length() > 12) { - throw new BadRequestException("PARAM_ERROR:Switft code must be less than 12 characters"); - } - if (bsbNo.length() > 6) { - throw new BadRequestException("PARAM_ERROR:BSB No must be less than 6 characters"); - } - if (accountNo.length() > 20) { - throw new BadRequestException("PARAM_ERROR:Account No must be less than 20 characters"); - } - if (accountName.length() > 50) { - throw new BadRequestException("PARAM_ERROR:Account Name must be less than 50 characters"); - } - - Matcher matcher = ACCOUNT_NAME_PATTERN.matcher(accountName); - if (!matcher.matches()) { - throw new BadRequestException("PARAM_ERROR:Invalid Account Name format"); - } - - if (sandboxMode) { - bankQueryInfo = new AustraliaBankInfo(); - } else { - bankQueryInfo = AustraliaBank.getBankInfo(bsbNo); - if (bankQueryInfo.isNone()) { - throw new BadRequestException("PARAM_ERROR:BSB No is invalid"); - } - } - try { - activeTimeDate = DateUtils.parseDate(activeTime, new String[]{"yyyy-MM-dd HH:mm:ss"}); - } catch (ParseException e) { - throw new BadRequestException("PARAM_ERROR:Invalid ActiveTime format"); - } - } - - public JSONObject insertBankInfo() { - JSONObject bankInfo = new JSONObject(); - bankInfo.put("swift_code", swiftCode); - bankInfo.put("bsb_no", bsbNo); - bankInfo.put("account_no", accountNo); - bankInfo.put("account_name", accountName); - bankInfo.putAll((JSONObject) JSON.toJSON(bankQueryInfo)); - return bankInfo; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/core/GatewayMerchantApply.java b/src/main/java/au/com/royalpay/payment/manage/gateway/core/GatewayMerchantApply.java deleted file mode 100644 index 4d13cc221..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/core/GatewayMerchantApply.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.core; - -import com.alibaba.fastjson.JSONObject; - -public interface GatewayMerchantApply { - - JSONObject validOrgV200(String shortId); - - JSONObject applicationMerchant(JSONObject org, JSONObject registerInfo); - - JSONObject getMerchantStatus(JSONObject org, String clientMoniker); - - void notifyOrgMerchantStatus(JSONObject client); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/core/impls/GatewayMerchantApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/gateway/core/impls/GatewayMerchantApplyImpl.java deleted file mode 100644 index 2d55edc2d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/core/impls/GatewayMerchantApplyImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.gateway.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.gateway.core.GatewayMerchantApply; -import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; -import au.com.royalpay.payment.manage.mappers.log.GatewayClientApplyNotifyLogMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.organizations.beans.DefaultClientProfile; -import au.com.royalpay.payment.manage.organizations.core.OrgClientProfileUtils; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.serializer.SerializerFeature; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; -import java.security.*; -import java.util.Date; - -import static au.com.royalpay.payment.tools.codec.RSACrypt.loadPrivateKey; - -@Service -public class GatewayMerchantApplyImpl implements GatewayMerchantApply { - private final Logger logger = LoggerFactory.getLogger(GatewayMerchantApplyImpl.class); - - @Resource - private OrgMapper orgMapper; - @Resource - private OrgSignInfoMapper orgSignRsaMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private SysClientLegalPersonMapper sysClientLegalPersonMapper; - @Resource - private PermissionPartnerManagerImpl permissionPartnerManagerImpl; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private ClientManager clientManager; - @Resource - private SysConfigManager sysConfigManager; - @Value("${app.sandbox:false}") - private boolean sandboxMode; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private GatewayClientApplyNotifyLogMapper gatewayClientApplyNotifyLogMapper; - - @Override - public JSONObject validOrgV200(String shortId) { - JSONObject orgSignJson = orgSignRsaMapper.findOrgSignInfo(shortId); - JSONObject org = orgMapper.findOne(orgSignJson.getInteger("org_id")); - if (org == null) { - throw new InvalidShortIdException(); - } - return org; - } - - @Override - @Transactional - public JSONObject applicationMerchant(JSONObject org, JSONObject registerInfo) { - ClientRegisterInfo registerBean = JSON.toJavaObject(registerInfo, ClientRegisterInfo.class); - registerBean.checkParamsInvalid(sandboxMode); - JSONObject result = new JSONObject(); - JSONObject manager = managerMapper.findAvailableByLoginIdAndOrgId(registerBean.getApplyId(), org.getString("org_id")); - if (manager == null) { - throw new ParamInvalidException("applyId", "applyId is invalid"); - } - boolean hasParentBoolean = StringUtils.isNotBlank(registerBean.getParentPartnerCode()); - int parentClientId = 0; - if (hasParentBoolean) { - JSONObject parentClient = clientMapper.findClientByMoniker(registerBean.getParentPartnerCode()); - if (parentClient == null) { - throw new ParamInvalidException("parentPartnerCode", "parentPartnerCode is invalid"); - } - parentClientId = parentClient.getIntValue("client_id"); - } - try { - JSONObject client = registerBean.insertClientInfo(clientManager.initMerchantCode(), manager.getString("display_name"), hasParentBoolean, parentClientId); - client.put("org_id", org.getString("org_id")); - DefaultClientProfile defaultProfile = OrgClientProfileUtils.getOrgProfile(org); - defaultProfile.applyToClientConfig(client); - clientMapper.save(client); - JSONObject clientConfig = registerBean.insertClientConfigInfo(client.getIntValue("client_id"), client.getString("client_moniker")); - defaultProfile.applyToClientConfig(clientConfig); - clientConfigMapper.save(clientConfig); - sysClientLegalPersonMapper.save(registerBean.insertClientLegalInfo(client.getIntValue("client_id"))); - permissionPartnerManagerImpl.permissionClientModuleSave(client.getIntValue("client_id"), client.getString("client_moniker")); - JSONObject clientBd = new JSONObject(); - clientBd.put("client_id", client.getIntValue("client_id")); - clientBd.put("bd_id", manager.getString("manager_id")); - clientBd.put("bd_name", manager.getString("display_name")); - clientBd.put("create_time", new Date()); - clientBd.put("create_id", manager.getString("manager_id")); - clientBd.put("start_date", new Date()); - clientBd.put("proportion", 1); - clientBDMapper.saveBD(clientBd); - clientBankAccountMapper.save(registerBean.insertBankInfo(client.getIntValue("client_id"))); - - ClientAuthFilesInfo clientAuthFilesInfo = registerBean.insertClientComplianceInfo(); - clientManager.uploadAuthFiles(manager, client.getString("client_moniker"), clientAuthFilesInfo); - JSONObject rateConfig = registerBean.insertClientRateInfo(JSON.parseObject(sysConfigManager.getSysConfig().getString("sys_rates"))); - clientManager.newConfigRate(manager, client.getString("client_moniker"), rateConfig); - clientManager.commitToCompliance(client.getString("client_moniker"), manager); - result.put("partner_code", client.getString("client_moniker")); - result.put("credential_code", client.getString("credential_code")); - result.put("company_name", client.getString("company_name")); - result.put("short_name", client.getString("short_name")); - } catch (BadRequestException e) { - logger.error("gateway api register fail :{}", e.getMessage()); - throw new BadRequestException("PARAM_ERROR:" + e.getMessage()); - } catch (Exception e) { - logger.error("gateway api register fail :{}", e.getMessage()); - throw new BadRequestException("PARAM_ERROR:Params length too long"); - } - result.put("partner_status", "PROCESSING"); - return result; - } - - @Override - public JSONObject getMerchantStatus(JSONObject org, String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (client.getIntValue("org_id") != org.getIntValue("org_id")) { - logger.error("This client was not belong to your organization,queryClient:{},orgID:{}", clientMoniker, org.getIntValue("org_id")); - throw new InvalidShortIdException(); - } - JSONObject result = new JSONObject(); - result.put("partner_code", clientMoniker); - result.put("credential_code", client.getString("credential_code")); - result.put("company_name", client.getString("company_name")); - result.put("short_name", client.getString("short_name")); - result.put("apply_time", DateFormatUtils.format(client.getDate("create_time"), "yyyy-MM-dd HH:mm:ss")); - result.put("apply_id", client.getString("creator")); - int approveResult = client.getIntValue("approve_result"); - String clientStatus = ""; - switch (approveResult) { - case 1: - clientStatus = "PASS"; - break; - case 4: - clientStatus = "PROCESSING"; - break; - case 5: - clientStatus = "REFUSED"; - break; - default: - clientStatus = "PROCESSING"; - break; - } - result.put("partner_status", clientStatus); - if (approveResult == 1 || approveResult == 5) { - result.put("approve_time", DateFormatUtils.format(client.getDate("approve_time"), "yyyy-MM-dd HH:mm:ss")); - if (approveResult == 5) { - result.put("refuse_description", client.getString("refuse_remark")); - } - } - return result; - } - - @Override - public void notifyOrgMerchantStatus(JSONObject client) { - String clientMoniker = client.getString("client_moniker"); - if (client.getIntValue("source") != 5) { - return; - } - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - if (StringUtils.isBlank(clientConfig.getString("notify_url"))) { - return; - } - String notifyUrl = clientConfig.getString("notify_url"); - - JSONObject org = orgMapper.findOne(client.getInteger("org_id")); - JSONObject merchantStatus = getMerchantStatus(org, clientMoniker); - merchantStatus.put("nonce_str", RandomStringUtils.random(15, true, true)); - merchantStatus.put("sign_type", "RSA2"); - merchantStatus.put("url", notifyUrl); - JSONObject signInfo = orgSignRsaMapper.findByOrgId(org.getInteger("org_id")); - String signStr = sign(JSONObject.toJSONBytes(merchantStatus, SerializerFeature.MapSortField), signInfo.getString("platform_private_key")); - JSONObject respJson = new JSONObject(); - respJson.put("data", merchantStatus); - respJson.put("sign", signStr); - logger.info("ApiV2 Response : {}", JSONObject.toJSONString(respJson, SerializerFeature.MapSortField)); - JSONObject log = preInsertServerNotifyLog(client, notifyUrl); - royalThreadPoolExecutor.execute(() -> { - logger.debug("开始推送商户状态[{}]异步通知[{}]:", clientMoniker, notifyUrl); - HttpRequestGenerator gen = new HttpRequestGenerator(notifyUrl, RequestMethod.POST); - gen.setJSONEntity(respJson); - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - log.put("success", true); - log.put("http_code", result.getStatusCode()); - log.put("updatetime", new Date()); - gatewayClientApplyNotifyLogMapper.update(log); - logger.debug("商户状态[{}]异步通知[{}]推送完成:[{}]", clientMoniker, notifyUrl, result.getStatusCode()); - } else { - Throwable exp = result.getException(); - log.put("success", false); - log.put("http_code", result.getStatusCode()); - log.put("err_msg", exp == null ? null : exp.getMessage()); - log.put("updatetime", new Date()); - gatewayClientApplyNotifyLogMapper.update(log); - logger.debug("商户状态[{}]异步通知[{}]推送失败:[{}]-[{}]", clientMoniker, notifyUrl, result.getStatusCode(), exp.getMessage()); - } - }); - - } - - private JSONObject preInsertServerNotifyLog(JSONObject client, String notifyUrl) { - int clientId = client.getIntValue("client_id"); - JSONObject log = gatewayClientApplyNotifyLogMapper.findHistoryByClientId(clientId); - if (log == null) { - log = new JSONObject(); - log.put("org_id", client.getString("org_id")); - log.put("client_id", clientId); - log.put("notify_url", notifyUrl); - log.put("addtime", new Date()); - log.put("success", 0); - log.put("http_code", 0); - gatewayClientApplyNotifyLogMapper.saveLog(log); - } - return log; - } - - private String sign(byte[] source, String privateKey) { - try { - PrivateKey priKey = loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes(StandardCharsets.UTF_8))); - Signature signature = Signature.getInstance("SHA256withRSA"); - signature.initSign(priKey); - signature.update(source); - byte[] signed = signature.sign(); - return Base64.encodeBase64URLSafeString(signed); - } catch (NoSuchAlgorithmException | SignatureException | InvalidKeyException e) { - //shall never happen - throw new ServerErrorException(e); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java b/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java deleted file mode 100644 index 280863f6d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java +++ /dev/null @@ -1,69 +0,0 @@ -package au.com.royalpay.payment.manage.gateway.web; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.utils.PaymentValidUtils; -import au.com.royalpay.payment.manage.gateway.advice.Gtw2Ctrl; -import au.com.royalpay.payment.manage.gateway.core.GatewayMerchantApply; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; - -/** - * @author taylor - */ -@RestController -@RequestMapping("/api/v1.0/org_gateway/partners/{shortId}") -@Gtw2Ctrl -public class GtwPayController { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private GatewayMerchantApply gatewayMerchantApply; - @Resource - private AttachmentClient attachmentClient; - - - @PostMapping(value = "/merchant/application") - public JSONObject applicationMerchant(@RequestBody JSONObject registerInfo, Errors errors, - @PathVariable String shortId) { - JSONObject org = gatewayMerchantApply.validOrgV200(shortId); - PaymentValidUtils.handleValidErrors(errors); - return gatewayMerchantApply.applicationMerchant(org, registerInfo); - } - - @GetMapping(value = "/merchant/{partner_code}/status") - public JSONObject getMerchantStatus(@PathVariable String shortId, - @PathVariable String partner_code) { - JSONObject org = gatewayMerchantApply.validOrgV200(shortId); - return gatewayMerchantApply.getMerchantStatus(org, partner_code); - } - - @PostMapping("/attachment/files") - public JSONObject uploadFile(@PathVariable String shortId,@RequestParam MultipartFile file) { - JSONObject org = gatewayMerchantApply.validOrgV200(shortId); - if (org == null) { - throw new InvalidShortIdException(); - } - JSONObject fileInfo = new JSONObject(); - try { - fileInfo = attachmentClient.uploadFile(file, false); - } catch (Exception e) { - logger.error("file upload fail :{}" , e.getMessage()); - throw new BadRequestException("File upload failed"); - } - fileInfo.put("file_type", fileInfo.getString("filetype")); - fileInfo.remove("filepath"); - fileInfo.remove("length"); - fileInfo.remove("fileid"); - fileInfo.remove("filetype"); - fileInfo.put("file_url", fileInfo.getString("url")); - return fileInfo; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java b/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java deleted file mode 100644 index 0e32fb03d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java +++ /dev/null @@ -1,142 +0,0 @@ -package au.com.royalpay.payment.manage.goods.bean; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import javax.validation.constraints.NotEmpty; - -import java.util.List; - - -/** - * Created by yishuqian on 8/30/16. - */ -public class GoodInfo { - - @NotEmpty(message = "error.payment.valid.param_missing") - private String title; - private String price; - @NotEmpty(message = "error.payment.valid.param_missing") - private String actual_price; - private String cny_price; - private String actual_cny_price; - - private int inventory = -1; - private String origin; - private String type; - private String order_desc; - private String description; - private List images; -// private String image_thumbnail; - - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public int getInventory() { - return inventory; - } - - public void setInventory(int inventory) { - this.inventory = inventory; - } - - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); -// if (price == null) { -// res.put("price",0); -// } -// if (inventory == 0) { -// res.put("inventory",0); -// } -// if (cny_price == null) { -// res.put("cny_price",0); -// } -// if (actual_cny_price == null) { -// res.put("actual_cny_price",0); -// } - return res; - } - - public JSONObject updateObject() { - JSONObject obj = insertObject(); - return obj; - } - - - public String getActual_price() { - return actual_price; - } - - public void setActual_price(String actual_price) { - this.actual_price = actual_price; - } - - public List getImages() { - return images; - } - - public void setImages(List images) { - this.images = images; - } - - public String getCny_price() { - return cny_price; - } - - public void setCny_price(String cny_price) { - this.cny_price = cny_price; - } - - public String getActual_cny_price() { - return actual_cny_price; - } - - public void setActual_cny_price(String actual_cny_price) { - this.actual_cny_price = actual_cny_price; - } - - public String getOrder_desc() { - return order_desc; - } - - public void setOrder_desc(String order_desc) { - this.order_desc = order_desc; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodOrderQuery.java b/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodOrderQuery.java deleted file mode 100644 index 7bf2a5be2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodOrderQuery.java +++ /dev/null @@ -1,77 +0,0 @@ -package au.com.royalpay.payment.manage.goods.bean; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; - -/** - * Created by yishuqian on 9/1/16. - */ -public class GoodOrderQuery { - private static final String[] DATE_PATTERNS = {"yyyyMMdd"}; - private int page = 1; - private int limit = 20; - private String date; - private String status; - private String datefrom; - private String dateto; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (datefrom != null) { - try { - params.put("from", DateUtils.parseDate(datefrom, DATE_PATTERNS)); - } catch (ParseException e) { - throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format"); - } - } - if (dateto != null) { - try { - params.put("to", DateUtils.parseDate(dateto, DATE_PATTERNS)); - } catch (ParseException e) { - throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format"); - } - } - if (date != null) { - try { - params.put("date", DateUtils.parseDate(date, new String[]{"yyyyMMdd"})); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - if (status != null){ - params.put("order_status", status); - } - return params; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodQuery.java b/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodQuery.java deleted file mode 100644 index 1a2c6c773..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodQuery.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.goods.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yishuqian on 8/30/16. - */ -public class GoodQuery { - private String title; - private String type; - private int page = 1; - private int limit = 10; - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(title)) { - param.put("title", getTitle()); - } - if (StringUtils.isNotBlank(type)) { - param.put("type", getType()); - } - return param; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java b/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java deleted file mode 100644 index 5c3f388ef..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.goods.core; - -import au.com.royalpay.payment.manage.goods.bean.GoodInfo; -import au.com.royalpay.payment.manage.goods.bean.GoodQuery; -import com.alibaba.fastjson.JSONObject; -import org.springframework.transaction.annotation.Transactional; - -/** - * Created by yishuqian on 8/30/16. - */ -public interface GoodManage { - JSONObject listGoods(JSONObject partner, GoodQuery goodQuery); - - @Transactional - JSONObject addGood(JSONObject partner, GoodInfo goodInfo); - - JSONObject getGoodDetail(String goodId); - @Transactional - void updateGoodInfo(JSONObject partner, String goodId, GoodInfo goodInfo) throws Exception; - - void updateDisplayInventory(JSONObject partner, String goodId, boolean displayInventory); - - @Transactional - void delete(JSONObject partner, String goodId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodOrder.java b/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodOrder.java deleted file mode 100644 index 9f192c290..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodOrder.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.goods.core; - -import au.com.royalpay.payment.manage.goods.bean.GoodOrderQuery; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 9/1/16. - */ -public interface GoodOrder { - - JSONObject listGoodOrders(JSONObject partner, GoodOrderQuery goodOrderQuery); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java b/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java deleted file mode 100644 index 1c8ebfb95..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -package au.com.royalpay.payment.manage.goods.core.impls; - -import au.com.royalpay.payment.manage.goods.bean.GoodInfo; -import au.com.royalpay.payment.manage.goods.bean.GoodQuery; -import au.com.royalpay.payment.manage.goods.core.GoodManage; -import au.com.royalpay.payment.manage.mappers.client.GoodMapper; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 8/30/16. - */ -@Service -public class GoodManageImpl implements GoodManage { - @Resource - private GoodMapper goodMapper; - @Resource - private AttachmentClient attachmentClient; - - @Override - public JSONObject listGoods(JSONObject partner, GoodQuery goodQuery) { - JSONObject params = goodQuery.toJsonParam(); - int clientId = partner.getIntValue("client_id"); - params.put("client_id", clientId); - PageList goods = goodMapper.listGoods(params, new PageBounds(goodQuery.getPage(), goodQuery.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(goods); - } - - @Override - public JSONObject addGood(JSONObject partner, GoodInfo goodInfo) { - JSONObject good = goodInfo.insertObject(); - good.put("create_time", new Date()); - good.put("creator", partner.getString("account_id")); - good.put("client_id", partner.getIntValue("client_id")); - good.remove("images"); - if (goodInfo.getImages().size() > 0) { - for (JSONObject image : goodInfo.getImages()) { - image.put("thumbnailUrl", attachmentClient.getThumbnail(image.getString("fileId"), 30).getString("url")); - image.put("mobileUrl", attachmentClient.getThumbnail(image.getString("fileId"), 350).getString("url")); - } - good.put("images", goodInfo.getImages().toString()); - } - if (good.containsKey("inventory")) { - good.put("real_inventory", good.getIntValue("inventory")); - } - goodMapper.save(good); - return good; - } - - @Override - public JSONObject getGoodDetail(String goodId) { - JSONObject good = goodMapper.findGood(goodId); - final String cnyUrl = PlatformEnvironment.getEnv().concatUrl("/client/goods/" + goodId + "/qrcode/CNY"); - final String audUrl = PlatformEnvironment.getEnv().concatUrl("/client/goods/" + goodId + "/qrcode/AUD"); - good.put("cny_url", cnyUrl); - good.put("cny_url_qrcode", QRCodeUtils.qrcodeImageCode(cnyUrl, 250,false)); - good.put("aud_url", audUrl); - good.put("aud_url_qrcode", QRCodeUtils.qrcodeImageCode(audUrl, 250,false)); - String images = good.getString("images"); - if (!StringUtils.isEmpty(images)) { - List imageList = (List) JSON.parse(images); - good.put("mobileUrl", imageList.get(0).getString("mobileUrl")); - good.put("thumbnailUrl", imageList.get(0).getString("thumbnailUrl")); - } - return good; - } - - @Override - public void updateGoodInfo(JSONObject partner, String goodId, GoodInfo goodInfo) throws Exception { - JSONObject good = goodMapper.findGood(goodId); - Assert.notNull(good); - JSONObject updateObject = goodInfo.updateObject(); - updateObject.remove("images"); - if (goodInfo.getImages().size() > 0) { - for (JSONObject image : goodInfo.getImages()) { - image.put("thumbnailUrl", attachmentClient.getThumbnail(image.getString("fileId"), 30).getString("url")); - image.put("mobileUrl", attachmentClient.getThumbnail(image.getString("fileId"), 350).getString("url")); - } - updateObject.put("images", goodInfo.getImages().toString()); - } -// if (updateObject.containsKey("inventory")) { -// if (updateObject.getIntValue("inventory") != good.getIntValue("inventory")) { -// if (updateObject.getIntValue("inventory") < good.getIntValue("real_inventory")){ -// throw new Exception("The update inventory is less than real_inventory"); -// } -// updateObject.put("real_inventory",updateObject.getIntValue("inventory")); -// } -// } - updateObject.put("id", goodId); - goodMapper.update(updateObject); - } - - @Override - public void updateDisplayInventory(JSONObject partner,String goodId, boolean displayInventory) { - JSONObject good = goodMapper.findGood(goodId); - Assert.notNull(good); - good.put("inventory_display", displayInventory); - goodMapper.update(good); - } - - @Override - public void delete(JSONObject partner, String goodId) { - JSONObject good = goodMapper.findGood(goodId); - Assert.notNull(good); - if (partner.getIntValue("client_id")!=good.getIntValue("client_id")){ - throw new ForbiddenException("You have no permission"); - } - good.put("is_using",0); - goodMapper.update(good); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodOrderImp.java b/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodOrderImp.java deleted file mode 100644 index 900480520..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodOrderImp.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.goods.core.impls; - -import au.com.royalpay.payment.manage.goods.bean.GoodOrderQuery; -import au.com.royalpay.payment.manage.goods.core.GoodOrder; -import au.com.royalpay.payment.manage.mappers.client.GoodOrderMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 9/1/16. - */ -@Service -public class GoodOrderImp implements GoodOrder { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private GoodOrderMapper goodOrderMapper; - - - @Override - public JSONObject listGoodOrders(JSONObject partner, GoodOrderQuery goodOrderQuery) { - JSONObject params = goodOrderQuery.toParams(); - int clientId = partner.getIntValue("client_id"); - params.put("client_id", clientId); - PageList goodOrders = goodOrderMapper.listGoodOrder(params, new PageBounds(goodOrderQuery.getPage(), goodOrderQuery.getLimit(), Order.formString("create_time.desc"))); - - return PageListUtils.buildPageListResult(goodOrders); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java b/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java deleted file mode 100644 index 54591db38..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java +++ /dev/null @@ -1,82 +0,0 @@ -package au.com.royalpay.payment.manage.goods.web; - -import au.com.royalpay.payment.manage.goods.bean.GoodInfo; -import au.com.royalpay.payment.manage.goods.bean.GoodOrderQuery; -import au.com.royalpay.payment.manage.goods.bean.GoodQuery; -import au.com.royalpay.payment.manage.goods.core.GoodManage; -import au.com.royalpay.payment.manage.goods.core.GoodOrder; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Created by yishuqian on 8/30/16. - */ - -@RestController -@RequestMapping("/sys/client/goods") -public class GoodManageController { - @Resource - private GoodManage goodManage; - - @Resource - private GoodOrder goodOrder; - - @PartnerMapping(method = RequestMethod.GET) - public JSONObject listClients(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, GoodQuery goodQuery) { - return goodManage.listGoods(partner, goodQuery); - } - - @PartnerMapping(method = RequestMethod.POST) - public JSONObject addGood(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody @Valid GoodInfo goodInfo, - Errors errors) { - HttpUtils.handleValidErrors(errors); - return goodManage.addGood(partner, goodInfo); - } - - @PartnerMapping(value = "/{goodId}", method = RequestMethod.GET) - public JSONObject getGoodDetail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String goodId) throws Exception { - if (partner == null) { - throw new Exception("商户未知!"); - } - return goodManage.getGoodDetail(goodId); - } - @PartnerMapping(value ="/{goodId}",method = RequestMethod.DELETE) - public void deleteGood(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String goodId) throws Exception { - if (partner == null) { - throw new Exception("商户未知!"); - } - goodManage.delete(partner,goodId); - } - - @PartnerMapping(value = "/{goodId}", method = RequestMethod.PUT) - public void updateGoodInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String goodId, @RequestBody GoodInfo goodInfo) throws Exception { - if (partner == null) { - throw new Exception("商户未知!"); - } - goodManage.updateGoodInfo(partner, goodId, goodInfo); - - } - - @PartnerMapping(value = "/{goodId}/inventory_display", method = RequestMethod.PUT) - public void updateDisplayInventory(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String goodId, @RequestBody JSONObject params) throws Exception { - if (partner == null) { - throw new Exception("商户未知!"); - } - goodManage.updateDisplayInventory(partner, goodId,params.getBooleanValue("inventory_display")); - } - - @PartnerMapping(value = "/goodOrders", method = RequestMethod.GET) - @ResponseBody - public JSONObject listGoodOrders(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, GoodOrderQuery goodOrderQuery) { - return goodOrder.listGoodOrders(partner, goodOrderQuery); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java b/src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java deleted file mode 100644 index 37ddd5fc2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.kyc.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yishuqian on 8/30/16. - */ -public class KycPartnersQuery { - private String client_moniker; - private String status; - private int page = 1; - private int limit = 10; - private boolean onlyMe = false; - - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public boolean isOnlyMe() { - return onlyMe; - } - - public void setOnlyMe(boolean onlyMe) { - this.onlyMe = onlyMe; - } - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(client_moniker)) { - param.put("client_moniker", getClient_moniker()); - } - if (StringUtils.isNotBlank(status)) { - param.put("status", getStatus()); - } - return param; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java deleted file mode 100644 index e358d8316..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.kyc.core; - -import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -public interface KycService { - - JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query); - - JSONObject listCompletedClients(JSONObject manager, KycPartnersQuery query); - - JSONObject getKycDashboard(JSONObject manager); - - List listNeedHelpClients(JSONObject manager, KycPartnersQuery query); - - void sendNotify(JSONObject complianceInfo); - - void kycNotifyBd(JSONObject account, String source); - - JSONObject getKycFilesForBdHelp(JSONObject manager, String clientMoniker); - - void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source); - - void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo kycFilesInfo); - - void deleteAuthFiles(String fileId, JSONObject manager); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java deleted file mode 100644 index dbe16abbe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java +++ /dev/null @@ -1,334 +0,0 @@ -package au.com.royalpay.payment.manage.kyc.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; -import au.com.royalpay.payment.manage.kyc.core.KycService; -import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class KycServiceImpl implements KycService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private MailService mailService; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private FinancialBDConfigMapper financialBDConfigMapper; - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private SignInAccountService signInAccountService; - - @Override - public JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query) { - JSONObject params = query.toJsonParam(); - checkManagerPermission(manager, params, query); - PageList progressClients = clientComplianceCompanyMapper.listKycProgressClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(progressClients); - } - - @Override - public JSONObject listCompletedClients(JSONObject manager, KycPartnersQuery query) { - JSONObject params = query.toJsonParam(); - checkManagerPermission(manager, params, query); - PageList completedClients = clientMapper.listCompletedContractKycClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(completedClients); - } - - @Override - public JSONObject getKycDashboard(JSONObject manager) { - JSONObject params = new JSONObject(); - JSONObject result = new JSONObject(); - checkManagerPermission(manager,params,null); - List needHelps = clientComplianceCompanyMapper.listNeedHelpClients(params); - result.put("total_need_help", needHelps != null ? needHelps.size() : 0); - result.put("total_partner", clientMapper.countKycClients(params)); - result.put("total_progressing", clientComplianceCompanyMapper.countKycProgressClients(params)); - params.put("status", 1); - result.put("total_pass_partner", clientComplianceCompanyMapper.countKycProgressClients(params)); - params.put("status", 2); - result.put("total_refuse_partner", clientComplianceCompanyMapper.countKycProgressClients(params)); - return result; - } - - @Override - public List listNeedHelpClients(JSONObject manager, KycPartnersQuery query) { - JSONObject params = query.toJsonParam(); - checkManagerPermission(manager, params, query); - return clientComplianceCompanyMapper.listNeedHelpClients(params); - } - - @Override - public void sendNotify(JSONObject complianceInfo) { - JSONObject client = clientMapper.findClient(complianceInfo.getIntValue("client_id")); - List bds = clientBDMapper.listClientBDInfoAvailable(complianceInfo.getIntValue("client_id"), new Date()); - List emails = new ArrayList<>(); - List openIds = new ArrayList<>(); - String bdNames = ""; - for (JSONObject bd : bds) { - String email = bd.getString("email"); - if (StringUtils.isNotEmpty(email)) { - emails.add(email); - bdNames += bd.getString("display_name"); - } - if (StringUtils.isNotEmpty(bd.getString("wx_openid"))) { - openIds.add(bd.getString("wx_openid")); - } - } - Context ctx = new Context(); - ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png")); - ctx.setVariable("name", bdNames); - ctx.setVariable("client_moniker", client.getString("client_moniker")); - ctx.setVariable("contact_person", client.getString("contact_person")); - ctx.setVariable("contact_phone", client.getString("contact_phone")); - ctx.setVariable("contact_email", client.getString("contact_email")); - ctx.setVariable("submit_time", DateFormatUtils.format(complianceInfo.getDate("submit_time"),"yyyy-MM-dd HH:mm:ss")); - final String content = thymeleaf.process("mail/kyc_email_notice", ctx); - if (!emails.isEmpty()) { - royalThreadPoolExecutor.execute(() -> { - try { - mailService.sendEmail("[RoyalPay]商户需要您协助补充KYC材料,请尽快查看", StringUtils.join(emails, ","), "", content); - } catch (Exception e) { - logger.error("邮件发送失败", e); - } - }); - } - if (!openIds.isEmpty()) { - for (String openId : openIds) { - try { - MpWechatApi mpWechatApi = mpWechatApiProvider.getApiFromOpenId(openId); - if (mpWechatApi == null) { - return; - } - String templateId = mpWechatApi.getTemplateId("commission"); - if (templateId == null) { - return; - } - TemplateMessage message = new TemplateMessage(openId, templateId, null); - message.put("first", "有新商户需要您协助补充KYC材料,请尽快查看", "#ff0000"); - message.put("keyword1", "KYC认证", "#0000ff"); - message.put("keyword2", client.getString("company_name")+"("+client.getString("client_moniker")+")", "#000000"); - message.put("keyword3", DateFormatUtils.format(complianceInfo.getDate("submit_time"),"yyyy-MM-dd HH:mm:ss"), "#000000"); - message.put("keyword4", "联系人:" + client.getString("contact_person") + " 电话:" + client.getString("contact_phone"), "#000000"); - message.put("remark", "您可以在后台帮助商户提交材料或填写无法提供材料文件的原因", "#ff0000"); - mpWechatApi.sendTemplateMessage(message); - } catch (Exception e) { - logger.error("notify bdhelp message failed:", e); - } - } - } - - } - - @Override - public void kycNotifyBd(JSONObject account, String source) { - JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - int sourceEnum = 2; - if ("app".equals(source.toLowerCase())) { - sourceEnum = 1; - } - JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (fileComp == null) { - fileComp = new JSONObject(); - fileComp.put("client_id", client.getIntValue("client_id")); - fileComp.put("submit_time", new Date()); - fileComp.put("status", 9); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.getString("account_id")); - fileComp.put("type", 2); - fileComp.put("is_valid", 1); - clientComplianceCompanyMapper.save(fileComp); - } else if (fileComp.getIntValue("status") == 2) { - fileComp.put("status", 9); - fileComp.put("submit_time", new Date()); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.getString("account_id")); - clientComplianceCompanyMapper.update(fileComp); - } else { - throw new BadRequestException("please do not repeat submission!"); - } - sendNotify(fileComp); - } - - @Override - public JSONObject getKycFilesForBdHelp(JSONObject manager, String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkClientBelongBd(client.getIntValue("client_id"), manager); - JSONObject kycInfo = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (kycInfo == null || kycInfo.getIntValue("status") != 9) { - throw new BadRequestException("This Partner is not application submitted"); - } - return clientManager.getKycFilesForBD(client, manager, "client"); - } - - @Override - public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (account.containsKey("manager_id")) { - checkClientBelongBd(client.getIntValue("client_id"), account); - } - int sourceEnum = 2; - List clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - if (clientAllAuthFiles == null || clientAllAuthFiles.isEmpty()) { - throw new BadRequestException("Please check the information is uploaded completely"); - } - if (StringUtils.isNotBlank(account.getString("beneficiary_id_title"))) { - if (!StringUtils.equalsIgnoreCase("Ultimate beneficiary owner", account.getString("beneficiary_id_title"))) { - if (StringUtils.isBlank(account.getString("other_id_title_desc"))) { - throw new BadRequestException("Please provide a reason that the beneficial owner’s ID cannot be provided."); - } - } - } - String[] fileKeys = {"client_company_file", "client_id_file"}; - String[] fileNames = {"ASIC File", "ID"}; - if(StringUtils.equalsIgnoreCase("passport",account.getString("id_type")) ){ - String[] fileKeysPassport = {"client_company_file", "kyc_utility_bill_file", "client_id_file"}; - String[] fileNamesPassport = {"ASIC File", "Utility Bill Files", "ID"}; - fileKeys = fileKeysPassport; - fileNames = fileNamesPassport; - } - if( !(account.getString("bd_handle") !=null && account.getString("bd_handle").length() > 0) ){ - for (int i = 0; i < fileKeys.length; i++) { - String fileKey = fileKeys[i]; - if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { - throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely"); - } - } - } - if ("app".equals(source.toLowerCase())) { - sourceEnum = 1; - } - - JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (fileComp == null) { - fileComp = new JSONObject(); - fileComp.put("client_id", client.getIntValue("client_id")); - fileComp.put("submit_time", new Date()); - fileComp.put("status", 0); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.containsKey("account_id") ? account.getString("account_id") : account.getString("manager_id")); - fileComp.put("type", 2); - fileComp.put("id_type", account.getString("id_type")); - fileComp.put("beneficiary_id_title", account.getString("beneficiary_id_title")); - fileComp.put("other_id_title_desc", account.getString("other_id_title_desc")); - clientComplianceCompanyMapper.save(fileComp); - } else if (fileComp.getIntValue("status") == 2 || fileComp.getIntValue("status") == 9) { - fileComp.put("status", 0); - fileComp.put("submit_time", new Date()); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.containsKey("account_id") ? account.getString("account_id") : account.getString("manager_id")); - fileComp.put("id_type", account.getString("id_type")); - fileComp.put("beneficiary_id_title", account.getString("beneficiary_id_title")); - fileComp.put("other_id_title_desc", account.getString("other_id_title_desc")); - fileComp.put("bd_handle", account.getString("bd_handle")); - clientComplianceCompanyMapper.update(fileComp); - } else { - throw new BadRequestException("please do not repeat submission!"); - } - clientFilesMapper.updateFilesAuthStatus(client.getIntValue("client_id"), - FilesAuthEnum.COMMIT_OPR.getAfterStatus(), - FilesAuthEnum.COMMIT_OPR.getBeforeStatus(), - FilesAuthEnum.COMMIT_OPR.getAuthType("kyc")); - if (account.containsKey("account_id")) { - signInAccountService.clearAccountCache(account.getString("account_id")); - } - } - - @Override - public void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo kycFilesInfo) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkClientBelongBd(client.getIntValue("client_id"), manager); - clientManager.uploadKycFilesForWaitCompliance(manager, clientMoniker, kycFilesInfo); - } - - @Override - public void deleteAuthFiles(String fileId, JSONObject manager) { - JSONObject file = clientFilesMapper.findFileById(fileId); - if (file.getIntValue("status") == 1 || file.getIntValue("status") == 2) { - throw new BadRequestException("The file has passed and cannot be deleted"); - } - JSONObject client = clientManager.getClientInfo(file.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - checkClientBelongBd(file.getIntValue("client_id"), manager); - clientFilesMapper.deleteByClientAndFileId(fileId); - } - - private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", "186"); - } - } - - private void checkClientBelongBd(int clientId, JSONObject manager) { - if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { - manager.put("manager_id","186"); - } - int permissionInt = clientBDMapper.checkBDPermission(clientId, manager.getString("manager_id")); - if (permissionInt < 1) { - throw new BadRequestException("This Partner is not belongs to you"); - } - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthEnum.java b/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthEnum.java deleted file mode 100644 index 549ebd8ba..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthEnum.java +++ /dev/null @@ -1,41 +0,0 @@ - -package au.com.royalpay.payment.manage.kyc.enums; - - /** - * @Author: liuxinxin - * @Date: 2019-12-13 - */ - public enum FilesAuthEnum { - - PASS_OPR(new int[]{2},1), - COMMIT_OPR(new int[]{0,3},2), - REFUSE_OPR(new int[]{2},3); - - private final int[] beforeStatus; - private final int afterStatus; - - public int[] getBeforeStatus() { - return beforeStatus; - } - - public int getAfterStatus() { - return afterStatus; - } - - FilesAuthEnum(int[] beforeStatus, int afterStatus) { - this.beforeStatus = beforeStatus; - this.afterStatus = afterStatus; - } - - public String[] getAuthType(String type) { - switch (type) { - case "kyc": - return new String[]{"client_company_file","client_id_file","kyc_utility_bill_file"}; - case "compliance": - return new String[]{"client_bank_file","client_id_file","client_agree_file","client_company_file"}; - default: - return null; - } - } - } - diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthStatusEnum.java b/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthStatusEnum.java deleted file mode 100644 index 17da2bfb2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthStatusEnum.java +++ /dev/null @@ -1,38 +0,0 @@ - -package au.com.royalpay.payment.manage.kyc.enums; - - /** - * @Author: liuxinxin - * @Date: 2019-12-25 - */ - public enum FilesAuthStatusEnum { - - STATUS(0); - - private final int TYPE; - - public int getTYPE() { - return TYPE; - } - - FilesAuthStatusEnum(int TYPE) { - this.TYPE = TYPE; - } - - public String getAuthStatus(int status) { - switch (status) { - case 0: - case 9: - return "WAIT_AUTH"; - case 1: - return "PASSED"; - case 2: - return "REFUSED"; - case -1: - return "NOT_SUBMITTED"; - default: - return null; - } - } - } - diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthTypeEnum.java b/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthTypeEnum.java deleted file mode 100644 index 8f07a33a7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/enums/FilesAuthTypeEnum.java +++ /dev/null @@ -1,22 +0,0 @@ - -package au.com.royalpay.payment.manage.kyc.enums; - - /** - * @Author: liuxinxin - * @Date: 2019-12-20 - */ - public enum FilesAuthTypeEnum { - KYC("kyc"), - COMPLIANCE("compliance"); - - private final String authType; - - public String getAuthType() { - return authType; - } - - FilesAuthTypeEnum(String authType) { - this.authType = authType; - } - } - diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java deleted file mode 100644 index b56323362..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.kyc.web; - -import au.com.royalpay.payment.manage.kyc.core.KycService; -import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@RequestMapping("/sys/kyc/partner") -public class KycController { - @Resource - private KycService kycService; - @Resource - private ClientManager clientManager; - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - - @PartnerMapping(value = "/notifyBd", method = RequestMethod.PUT) - @ResponseBody - public void clientKycBdIntervention(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - kycService.kycNotifyBd(account, "web"); - } - - @PartnerMapping(value = "/update/wait_kyc_file", method = RequestMethod.PUT) - @ResponseBody - public void updateWaitKycFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientKycFilesInfo filesInfo) { - JSONObject kycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(account.getIntValue("client_id")); - if (kycFilesAuth != null) { - throw new BadRequestException("已通过审核,暂不能提交和修改"); - } - clientManager.uploadKycFilesForWaitCompliance(account, account.getString("client_moniker"), filesInfo); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java deleted file mode 100644 index 7892b37e8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java +++ /dev/null @@ -1,61 +0,0 @@ -package au.com.royalpay.payment.manage.kyc.web; - -import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; -import au.com.royalpay.payment.manage.kyc.core.KycService; -import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -@RestController -@RequestMapping("/sys/kyc/manage") -public class KycManageController { - @Resource - private KycService kycService; - - @ManagerMapping(value = "/partner/progressing", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public JSONObject listProgressClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { - return kycService.listProgressClients(manager, query); - } - - @ManagerMapping(value = "/partner/completed", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public JSONObject listCompletedClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { - return kycService.listCompletedClients(manager, query); - } - - @ManagerMapping(value = "/partner/need_help", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public List listNeedHelpClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { - return kycService.listNeedHelpClients(manager, query); - } - - @ManagerMapping(value = "/partner/dashboard", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public JSONObject getKycDashboard(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return kycService.getKycDashboard(manager); - } - - @ManagerMapping(value = "/{clientMoniker}/bd_help",method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public JSONObject getKycFilesForBdHelp(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return kycService.getKycFilesForBdHelp(manager,clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/kycCommit", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void clientKycFilesViewCommit(@PathVariable String clientMoniker ,@RequestBody JSONObject params,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - manager.putAll(params); - kycService.commitAuthKycFilesToCompliance(clientMoniker, manager, "Web"); - } - - @ManagerMapping(value = "/{clientMoniker}/update", role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void updateKycFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ClientKycFilesInfo filesInfo) { - kycService.uploadKycFiles(manager, clientMoniker, filesInfo); - } - - @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - kycService.deleteAuthFiles(fileId, manager); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/descriptor/LoanApplicationDescriptor.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/descriptor/LoanApplicationDescriptor.java deleted file mode 100644 index f1c072c6f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/descriptor/LoanApplicationDescriptor.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.descriptor; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.sql.Timestamp; - -/** - * 贷款申请信息描述 - */ -@Data -@Accessors(chain = true) -@NoArgsConstructor -@EqualsAndHashCode(callSuper = false) -public class LoanApplicationDescriptor { - - private String id; - - private Timestamp createTime; - - private String clientId; - - private String name; - - private String phone; - - private String email; - - private String businessName; - - private String industry; - - /** - * 处理状态 - */ - private String status; - - /** - * 处理状态值 - */ - private String statusDescription; - - /** - * 备注信息 - */ - private String remark; - - /** - * 申请来源 - */ - private Integer source; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/LoanApplication.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/LoanApplication.java deleted file mode 100644 index b9117657f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/LoanApplication.java +++ /dev/null @@ -1,83 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.entity; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.descriptor.LoanApplicationDescriptor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.sql.Timestamp; - -/** - * 贷款申请信息 - */ -@Data -@Accessors(chain = true) -@NoArgsConstructor -@EqualsAndHashCode(callSuper = false) -public class LoanApplication { - - private String id; - - private Timestamp createTime; - - private Timestamp modifyTime; - - private String creator; - - private String modifier; - - private String clientId; - - /** - * 联系人姓名 - */ - private String name; - /** - * 联系人手机 - */ - private String phone; - /** - * 联系人邮箱 - */ - private String email; - /** - * 商业名称 - */ - private String businessName; - /** - * 行业 - */ - private String industry; - - /** - * 处理状态 - */ - private LoanApplicationStatus status; - - /** - * 备注信息 - */ - private String remark; - - /** - * 申请来源 - */ - private Integer source; - - public LoanApplicationDescriptor describe() { - return new LoanApplicationDescriptor() - .setId(this.id) - .setClientId(this.clientId) - .setCreateTime(this.createTime) - .setName(this.name) - .setPhone(this.phone) - .setEmail(this.email) - .setBusinessName(this.businessName) - .setIndustry(this.industry) - .setStatus(this.status.value()) - .setStatusDescription(this.status.description()) - .setRemark(this.remark) - .setSource(this.source); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/LoanApplicationStatus.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/LoanApplicationStatus.java deleted file mode 100644 index 1177745a1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/LoanApplicationStatus.java +++ /dev/null @@ -1,90 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.entity; - -/** - * 贷款申请状态 0:待处理、1:处理中、2:已处理 - */ -public enum LoanApplicationStatus { - - /** - * 待处理 - */ - READY { - @Override - public int code() { - return 0; - } - - @Override - public String value() { - return "READY"; - } - - @Override - public String description() { - return "待处理"; - } - }, - /** - * 处理中 - */ - PROCESSING { - @Override - public int code() { - return 1; - } - - @Override - public String value() { - return "PROCESSING"; - } - - @Override - public String description() { - return "处理中"; - } - }, - /** - * 已处理 - */ - COMPLETED { - @Override - public int code() { - return 2; - } - - @Override - public String value() { - return "COMPLETED"; - } - - @Override - public String description() { - return "已处理"; - } - }; - - /** - * 获取代码。 - * - * @return 代码 - */ - public abstract int code(); - - /** - * 获取代码对应的值。 - * - * @return 代码值 - */ - public abstract String value(); - - public abstract String description(); - - public static LoanApplicationStatus codeOf(int code) { - for (LoanApplicationStatus status : LoanApplicationStatus.values()) { - if (status.code() == code) { - return status; - } - } - return LoanApplicationStatus.READY; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/request/ModifyLoanApplicationRequest.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/request/ModifyLoanApplicationRequest.java deleted file mode 100644 index 1ca7c3a17..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/entity/request/ModifyLoanApplicationRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.request; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.LoanApplicationStatus; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@EqualsAndHashCode(callSuper = false) -public class ModifyLoanApplicationRequest { - - private String id; - - /** - * 状态信息 - */ - private Integer status; - - /** - * 备注信息 - */ - private String remark; - - public ModifyLoanApplicationRequest build(String id, String status, String remark) { - return new ModifyLoanApplicationRequest() - .setId(id) - .setStatus(LoanApplicationStatus.valueOf(status).code()) - .setRemark(remark); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/repository/LoanApplicationRepository.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/repository/LoanApplicationRepository.java deleted file mode 100644 index ce8303faf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/repository/LoanApplicationRepository.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.repository; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.LoanApplication; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.request.ModifyLoanApplicationRequest; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.Map; - -public interface LoanApplicationRepository { - - PageList listPagedLoanApplication(Map params, PageBounds pageBounds); - - LoanApplication getById(String id); - - void changeLoanApplication(ModifyLoanApplicationRequest request); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/service/LoanApplicationService.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/service/LoanApplicationService.java deleted file mode 100644 index 983705096..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/service/LoanApplicationService.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.service; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.descriptor.LoanApplicationDescriptor; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.web.command.ModifyLoanApplicationCommand; -import au.com.royalpay.payment.manage.support.representation.PageListRepresentation; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import java.util.Map; - -public interface LoanApplicationService { - - PageListRepresentation listPagedLoanApplication(Map params, PageBounds pageBounds); - - LoanApplicationDescriptor getById(String id); - - void changeLoanApplication(String id, ModifyLoanApplicationCommand command); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/RestLoanApplicationController.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/RestLoanApplicationController.java deleted file mode 100644 index 9786e57f4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/RestLoanApplicationController.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.web; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.descriptor.LoanApplicationDescriptor; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.service.LoanApplicationService; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.web.command.ModifyLoanApplicationCommand; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * 贷款申请资源 - */ -@RestController -@RequestMapping(value = "/partners") -public class RestLoanApplicationController { - - @Resource - private LoanApplicationService applicationService; - - /** - * 获取贷款申请详情 - * - * @param id 编号 - * @return - */ - @RequestMapping(value = "/loanApplications/{id}", method = RequestMethod.GET) - public LoanApplicationDescriptor getLoanApplication(@PathVariable("id") String id) { - return applicationService.getById(id); - } - - /** - * 更新贷款申请信息 - * - * @param id 编号 - * @param command 入参 - */ - @RequestMapping(value = "/loanApplications/{id}", method = RequestMethod.PUT) - public void changeLoanApplication(@PathVariable("id") String id, - @RequestBody ModifyLoanApplicationCommand command) { - applicationService.changeLoanApplication(id, command); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/RestLoanApplicationsController.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/RestLoanApplicationsController.java deleted file mode 100644 index bc35affac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/RestLoanApplicationsController.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.web; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.descriptor.LoanApplicationDescriptor; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.service.LoanApplicationService; -import au.com.royalpay.payment.manage.support.representation.PageListRepresentation; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -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 javax.annotation.Resource; -import javax.validation.constraints.Min; -import java.util.Map; - -/** - * 贷款申请列表资源 - */ -@RestController -@RequestMapping(value = "/partners") -public class RestLoanApplicationsController { - - @Resource - private LoanApplicationService applicationService; - - /** - * 贷款申请分页列表 - * - * @param params - * @param page - * @param pageSize - * @return - */ - @RequestMapping(value = "/loanApplications", method = RequestMethod.GET) - public Object listPagedLoanApplication(@RequestParam Map params, - @Min(1) @RequestParam(value = "page", required = false, defaultValue = "1") int page, - @Min(1) @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize) { - PageBounds pageBounds = new PageBounds(page, pageSize, Order.formString("create_time.desc")); - PageListRepresentation result = applicationService.listPagedLoanApplication(params, pageBounds); - return result; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/command/ModifyLoanApplicationCommand.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/command/ModifyLoanApplicationCommand.java deleted file mode 100644 index 716111cfd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/domain/web/command/ModifyLoanApplicationCommand.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.domain.web.command; - - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@EqualsAndHashCode(callSuper = false) -public class ModifyLoanApplicationCommand { - - @NotBlank(message = "error.payment.valid.param_missing") - private String remark; - - @NotBlank(message = "error.payment.valid.param_missing") - private String status; - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/infrastructure/repository/LoanApplicationRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/infrastructure/repository/LoanApplicationRepositoryImpl.java deleted file mode 100644 index 91120ce89..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/infrastructure/repository/LoanApplicationRepositoryImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.infrastructure.repository; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.LoanApplication; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.request.ModifyLoanApplicationRequest; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.repository.LoanApplicationRepository; -import au.com.royalpay.payment.manage.mappers.loanapplication.LoanApplicationMapper; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Repository; - -import javax.annotation.Resource; -import java.util.Map; - -@Repository -public class LoanApplicationRepositoryImpl implements LoanApplicationRepository { - - @Resource - private LoanApplicationMapper mapper; - - @Override - public PageList listPagedLoanApplication(Map params, PageBounds pageBounds) { - return mapper.listPagedLoanApplication(params, pageBounds); - } - - @Override - public LoanApplication getById(String id) { - return mapper.findById(id); - } - - @Override - public void changeLoanApplication(ModifyLoanApplicationRequest request) { - mapper.updateLoanApplication(request); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/infrastructure/service/LoanApplicationServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/infrastructure/service/LoanApplicationServiceImpl.java deleted file mode 100644 index 79606ba95..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/loanapplicaiton/infrastructure/service/LoanApplicationServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.loanapplicaiton.infrastructure.service; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.descriptor.LoanApplicationDescriptor; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.LoanApplication; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.request.ModifyLoanApplicationRequest; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.repository.LoanApplicationRepository; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.service.LoanApplicationService; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.web.command.ModifyLoanApplicationCommand; -import au.com.royalpay.payment.manage.support.representation.PageListRepresentation; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Map; - -@Service -public class LoanApplicationServiceImpl implements LoanApplicationService { - - @Resource - private LoanApplicationRepository repository; - - @Override - public PageListRepresentation listPagedLoanApplication(Map params, PageBounds pageBounds) { - PageList loanApplications = repository.listPagedLoanApplication(params, pageBounds); - PageList loanApplicationDescriptors = new PageList<>(loanApplications.getPaginator()); - loanApplications.forEach(item -> { - loanApplicationDescriptors.add(item.describe()); - }); - return new PageListRepresentation<>(loanApplicationDescriptors); - } - - @Override - public LoanApplicationDescriptor getById(String id) { - LoanApplication application = this.getLoanApplication(id); - return application.describe(); - } - - @Override - public void changeLoanApplication(String id, ModifyLoanApplicationCommand command) { - LoanApplication application = this.getLoanApplication(id); - repository.changeLoanApplication(new ModifyLoanApplicationRequest().build(application.getId(), command.getStatus(), command.getRemark())); - } - - private LoanApplication getLoanApplication(String id) { - LoanApplication application = repository.getById(id); - if (application == null) { - throw new BadRequestException("Loan is not exist"); - } - return application; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/ClientLoginLogQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/ClientLoginLogQueryBean.java deleted file mode 100644 index 57337fc09..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/ClientLoginLogQueryBean.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.logview.beans; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-10-18. - */ -public class ClientLoginLogQueryBean extends LogQueryBean { - private String client_moniker; - - @Override - public JSONObject toJSON() { - JSONObject params = super.toJSON(); - if (client_moniker != null && client_moniker.matches("^[A-Z0-9]{4}$")) { - params.put("client_moniker", client_moniker); - } - return params; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/ConfigOperationQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/ConfigOperationQueryBean.java deleted file mode 100644 index 7911de836..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/ConfigOperationQueryBean.java +++ /dev/null @@ -1,89 +0,0 @@ -package au.com.royalpay.payment.manage.logview.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.TimeZone; - -/** - * Created by yixian on 2016-10-18. - */ -public class ConfigOperationQueryBean { - private static final String[] pattern = {"yyyyMMdd"}; - private String begin; - private String end; - private int page = 1; - private int limit = 20; - private String client_moniker; - - public JSONObject toJSON() { - SimpleDateFormat utcFormater = new SimpleDateFormat("yyyyMMdd"); - utcFormater.setTimeZone(TimeZone.getTimeZone("UTC"));//时区定义并进行时间获取 - JSONObject res = new JSONObject(); - if (begin != null) { - try { - - res.put("begin", utcFormater.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_time"); - } - } - if (end != null) { - try { - res.put("end", DateUtils.addDays(utcFormater.parse(end),1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_time"); - } - } - if(StringUtils.isNotEmpty(this.client_moniker)){ - res.put("client_moniker",this.client_moniker); - } - return res; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/LogQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/LogQueryBean.java deleted file mode 100644 index 720f92a59..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/LogQueryBean.java +++ /dev/null @@ -1,78 +0,0 @@ -package au.com.royalpay.payment.manage.logview.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; - -/** - * Created by yixian on 2016-10-18. - */ -public class LogQueryBean { - private static final String[] pattern = {"yyyyMMdd"}; - private String begin; - private String end; - private String username; - private int page = 1; - private int limit = 20; - - public JSONObject toJSON() { - JSONObject res = new JSONObject(); - if (begin != null) { - try { - res.put("begin", DateUtils.parseDate(begin, pattern)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_time"); - } - } - if (end != null) { - try { - res.put("end", DateUtils.parseDate(end, pattern)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_time"); - } - } - if (StringUtils.isNotEmpty(username)) { - res.put("username", username); - } - return res; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public void setUsername(String username) { - this.username = username; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/LogRiskQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/LogRiskQueryBean.java deleted file mode 100644 index f93467be0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/LogRiskQueryBean.java +++ /dev/null @@ -1,114 +0,0 @@ -package au.com.royalpay.payment.manage.logview.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import javax.validation.constraints.NotEmpty; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Created by wangning on 2017/9/6. - */ -public class LogRiskQueryBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - @NotEmpty(message = "error.payment.valid.param_missing") - private String begin; - private String end; - private String client_id; - private int page = 1; - private int limit = 10; - private String customer_id; - private String type; - private String client_moniker; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - - if (begin != null) { - try { - params.put("begin", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("end", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - params.put("client_id", client_id); - params.put("customer_id", customer_id); - params.put("type", type); - params.put("client_moniker",client_moniker); - return params; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public String getClient_id() { - return client_id; - } - - public void setClient_id(String client_id) { - this.client_id = client_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getCustomer_id() { - return customer_id; - } - - public void setCustomer_id(String customer_id) { - this.customer_id = customer_id; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java deleted file mode 100644 index 72ec88677..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package au.com.royalpay.payment.manage.logview.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * Created by yixian on 2016-11-07. - */ -public class NotifyQueryBean { - private int page = 1; - private int limit = 20; - private String moniker; - - // 新增orderId查询字段 - private String orderId; - - private String clientOrderId; - private String date; - private Boolean success; - - public JSONObject toParams() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotEmpty(moniker)) { - param.put("client_moniker", moniker); - } - - if (StringUtils.isNotEmpty(orderId)) { - param.put("order_id", orderId); - } - - if (StringUtils.isNotEmpty(clientOrderId)) { - param.put("client_order_id", clientOrderId); - } - if (StringUtils.isNotEmpty(date)) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); - param.put("date", dt); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - if (success!=null){ - param.put("success", success); - } - return param; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getMoniker() { - return moniker; - } - - public void setMoniker(String moniker) { - this.moniker = moniker; - } - - public String getClientOrderId() { - return clientOrderId; - } - - public void setClientOrderId(String clientOrderId) { - this.clientOrderId = clientOrderId; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public Boolean getSuccess() { - return success; - } - - public void setSuccess(Boolean success) { - this.success = success; - } - - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/WechatMsgQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/WechatMsgQueryBean.java deleted file mode 100644 index 6a01c06a0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/WechatMsgQueryBean.java +++ /dev/null @@ -1,93 +0,0 @@ -package au.com.royalpay.payment.manage.logview.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * Created by Tayl0r on 2017/5/3. - */ -public class WechatMsgQueryBean { - - private int page = 1; - private int limit = 20; - private String moniker; - private String accountId; - private String date; - private Integer status; - - - public JSONObject toParams() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotEmpty(moniker)) { - param.put("client_moniker", moniker); - } - if (StringUtils.isNotEmpty(accountId)){ - param.put("account_id",accountId); - } - if (StringUtils.isNotEmpty(date)) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); - param.put("date", dt); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - if (status!=null && !status.equals("")){ - param.put("status", status); - } - return param; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getMoniker() { - return moniker; - } - - public void setMoniker(String moniker) { - this.moniker = moniker; - } - - public String getAccountId() { - return accountId; - } - - public void setAccountId(String accountId) { - this.accountId = accountId; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/NotifyLogRepository.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/NotifyLogRepository.java deleted file mode 100644 index 7e4eda09e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/NotifyLogRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core; - -import au.com.royalpay.payment.manage.logview.beans.NotifyQueryBean; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-11-07. - */ -public interface NotifyLogRepository { - JSONObject listNotifyLogs(NotifyQueryBean notifyQueryBean); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/OperationLogService.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/OperationLogService.java deleted file mode 100644 index a8b60c127..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/OperationLogService.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core; - -import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import java.util.List; - -/** - * @author kira - * @date 2018/6/15 - */ -public interface OperationLogService { - - List query(JSONObject params); - - JSONObject query(JSONObject params, PageBounds pageBounds); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/SignInLogRepository.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/SignInLogRepository.java deleted file mode 100644 index a5e9b3f10..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/SignInLogRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-10-18. - */ -public interface SignInLogRepository { - JSONObject listManagerLoginLogs(JSONObject params, int page, int limit); - - JSONObject listAllClientsLoginLogs(JSONObject params, int page, int limit); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/WechatMsgRepository.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/WechatMsgRepository.java deleted file mode 100644 index 604205e8d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/WechatMsgRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core; - -import au.com.royalpay.payment.manage.logview.beans.WechatMsgQueryBean; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by Tayl0r on 2017/5/3. - */ -public interface WechatMsgRepository { - - JSONObject listWechatMsgs(WechatMsgQueryBean wechatMsgQueryBean); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/NotifyLogRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/NotifyLogRepositoryImpl.java deleted file mode 100644 index 546d052bd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/NotifyLogRepositoryImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core.impl; - -import au.com.royalpay.payment.manage.logview.beans.NotifyQueryBean; -import au.com.royalpay.payment.manage.logview.core.NotifyLogRepository; -import au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-11-07. - */ -@Service -public class NotifyLogRepositoryImpl implements NotifyLogRepository { - @Resource - private NotifyErrorLogMapper notifyErrorLogMapper; - - @Override - public JSONObject listNotifyLogs(NotifyQueryBean query) { - PageList notifyLogs = notifyErrorLogMapper.listErrorLogs(query.toParams(), new PageBounds(query.getPage(), query.getLimit(), Order.formString("addtime.desc"))); - return PageListUtils.buildPageListResult(notifyLogs); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java deleted file mode 100644 index 0e29be584..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core.impl; - -import au.com.royalpay.payment.manage.logview.core.OperationLogService; -import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.Paginator; -import org.apache.commons.lang3.StringUtils; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @author kira - * @date 2018/6/15 - */ -@Service -public class OperationLogServiceImpl implements OperationLogService { - @Resource - private MongoTemplate mongoTemplate; - @Resource - private ClientManager clientManager; - - @Override - public JSONObject query(JSONObject params, PageBounds pageBounds) { - if (StringUtils.isNotEmpty(params.getString("client_moniker"))) { - JSONObject client = clientManager.getClientInfoByMoniker(params.getString("client_moniker")); - if (client != null) { - params.put("client_id", client.getIntValue("client_id")); - } - } - Query query = new Query(); - query.with(Sort.by(Sort.Direction.DESC, "createTime")); - if (params.getIntValue("client_id") != 0) { - query.addCriteria(Criteria.where("clientId").is(params.getIntValue("client_id"))); - } - query.with(PageRequest.of(pageBounds.getPage() - 1, pageBounds.getLimit())); - query.addCriteria(Criteria.where("createTime").gt((params.getDate("begin"))).lt(params.getDate("end"))); - List clientConfigLogList = mongoTemplate.find(query, ClientConfigLog.class); - return buildPageListResult(clientConfigLogList, - new Paginator(pageBounds.getPage(), pageBounds.getLimit(), (int) mongoTemplate.count(query, ClientConfigLog.class))); - - } - - @Override - public List query(JSONObject params) { - Query query = new Query(); - query.addCriteria(Criteria.where("clientId").is(params.getIntValue("client_id"))); - List clientConfigLogList = mongoTemplate.find(query, ClientConfigLog.class); - Paginator paginator = new Paginator(1, 1, 1); - - return null; - } - - public static JSONObject buildPageListResult(List datas, Paginator paginator) { - JSONObject res = new JSONObject(); - res.put("data", datas); - res.put("pagination", paginator); - return res; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/SignInLogRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/SignInLogRepositoryImpl.java deleted file mode 100644 index 5e47c4c6a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/SignInLogRepositoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core.impl; - -import au.com.royalpay.payment.manage.logview.core.SignInLogRepository; -import au.com.royalpay.payment.manage.mappers.log.ClientLoginLogMapper; -import au.com.royalpay.payment.manage.mappers.log.ManagerLoginLogMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-10-18. - */ -@Service -public class SignInLogRepositoryImpl implements SignInLogRepository { - @Resource - private ClientLoginLogMapper clientLoginLogMapper; - @Resource - private ManagerLoginLogMapper managerLoginLogMapper; - - @Override - public JSONObject listManagerLoginLogs(JSONObject params, int page, int limit) { - PageList loginLogs = managerLoginLogMapper.listManagerLoginLog(params, new PageBounds(page, limit, Order.formString("login_time.desc"))); - return PageListUtils.buildPageListResult(loginLogs); - } - - @Override - public JSONObject listAllClientsLoginLogs(JSONObject params, int page, int limit) { - PageList loginLogs = clientLoginLogMapper.listClientLog(params,new PageBounds(page,limit,Order.formString("login_time.desc"))); - return PageListUtils.buildPageListResult(loginLogs); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/WechatMsgRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/WechatMsgRepositoryImpl.java deleted file mode 100644 index 42427abe9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/WechatMsgRepositoryImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.logview.core.impl; - -import au.com.royalpay.payment.manage.logview.beans.WechatMsgQueryBean; -import au.com.royalpay.payment.manage.logview.core.WechatMsgRepository; -import au.com.royalpay.payment.manage.mappers.log.WechatTemplateMsgSendLogMapper; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/5/3. - */ -@Service -public class WechatMsgRepositoryImpl implements WechatMsgRepository { - @Resource - private WechatTemplateMsgSendLogMapper wechatMsgMapper; - - @Override - public JSONObject listWechatMsgs(WechatMsgQueryBean query) { - PageList wechatMsgs = (PageList) wechatMsgMapper.listWechatMsg(query.toParams(), - new PageBounds(query.getPage(), query.getLimit(), Order.formString("send_time.desc"))); - return PageListUtils.buildPageListResult(wechatMsgs); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/package-info.java b/src/main/java/au/com/royalpay/payment/manage/logview/package-info.java deleted file mode 100644 index 3815bd074..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 日志浏览 - * Created by yixian on 2016-10-18. - */ -package au.com.royalpay.payment.manage.logview; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java b/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java deleted file mode 100644 index 694374aab..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.logview.web; - -import au.com.royalpay.payment.manage.logview.beans.ConfigOperationQueryBean; -import au.com.royalpay.payment.manage.logview.core.OperationLogService; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/5/3. - */ -@RestController -@RequestMapping(value = "/sys_logs/config/operation") -public class ConfigOperationController { - @Resource - private OperationLogService operationLogService; - - @RequestMapping(method = RequestMethod.GET) - public JSONObject list(ConfigOperationQueryBean configOperationQueryBean){ - return operationLogService.query(configOperationQueryBean.toJSON(),new PageBounds(configOperationQueryBean.getPage(),configOperationQueryBean.getLimit())); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/web/LogRiskController.java b/src/main/java/au/com/royalpay/payment/manage/logview/web/LogRiskController.java deleted file mode 100644 index 72372e9ce..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/web/LogRiskController.java +++ /dev/null @@ -1,95 +0,0 @@ -package au.com.royalpay.payment.manage.logview.web; - -import au.com.royalpay.payment.core.risk.bean.RiskTypeEnum; -import au.com.royalpay.payment.manage.logview.beans.LogRiskQueryBean; -import au.com.royalpay.payment.manage.mappers.log.LogRiskMapper; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * Created by wangning on 2017/9/6. - */ -@RestController -@ManagerMapping(value = "/sys_logs",role = {ManagerRole.DEVELOPER}) -public class LogRiskController { - @Resource - private LogRiskMapper logRiskMapper; - @Resource - private TradeLogService tradeLogService; - - @GetMapping(value = "/risk_log/list") - public JSONObject listLogRisk(LogRiskQueryBean logRiskQueryBean) { - return PageListUtils.buildPageListResult( - logRiskMapper.listWithClientInfo(logRiskQueryBean.toParams(), new PageBounds(logRiskQueryBean.getPage(), logRiskQueryBean.getLimit()))); - - } - - @GetMapping(value = "/risk_log/typeCharts") - public JSONObject typeCharts(LogRiskQueryBean logRiskQueryBean) { - List statisticsRiskLogList = logRiskMapper.statisticsRiskLog(logRiskQueryBean.toParams()); - if (CollectionUtils.isEmpty(statisticsRiskLogList)) { - return null; - } - Map> resultMap = new LinkedHashMap<>(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - for (JSONObject jsonObject : statisticsRiskLogList) { - String resultMapKey = format.format(jsonObject.getDate("date")); - if (resultMap.containsKey(resultMapKey)) { - resultMap.get(resultMapKey).add(jsonObject); - } else { - List list = new LinkedList<>(); - list.add(jsonObject); - resultMap.put(resultMapKey, list); - } - } - - // 初始化折线数据 - Map> typeChartDataMap = new HashMap<>(); - for (RiskTypeEnum e : RiskTypeEnum.values()) { - typeChartDataMap.put(e.name(), new LinkedList()); - } - - JSONObject result = new JSONObject(); - List dateList = new LinkedList<>(); - result.put("date", dateList); - for (Map.Entry> entry : resultMap.entrySet()) { - dateList.add(entry.getKey()); - for (Map.Entry> chartData : typeChartDataMap.entrySet()) { - List resultList = chartData.getValue(); - resultList.add(0); - for (JSONObject jsonObject : entry.getValue()) { - if(chartData.getKey().equals(jsonObject.getString("type"))){ - resultList.remove(resultList.size()-1); - resultList.add(jsonObject.getInteger("count")); - } - } - } - } - for (Map.Entry> chartData : typeChartDataMap.entrySet()) { - result.put(chartData.getKey(),chartData.getValue()); - } - return result; - } - - @GetMapping(value = "/pre_refund/list") - public JSONObject listPreRefund(PreRefundQueryBean preRefundQueryBean) { - return tradeLogService.listPreRefundClients(preRefundQueryBean,null); - } - - @GetMapping(value = "/pre_geek_cost/list") - public JSONObject listPreGeekCost(PreRefundQueryBean preRefundQueryBean) { - return tradeLogService.listPreRefundClients(preRefundQueryBean, "geek"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/web/NotifyLogController.java b/src/main/java/au/com/royalpay/payment/manage/logview/web/NotifyLogController.java deleted file mode 100644 index d8deb78a1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/web/NotifyLogController.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.logview.web; - -import au.com.royalpay.payment.manage.logview.beans.NotifyQueryBean; -import au.com.royalpay.payment.manage.logview.core.NotifyLogRepository; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-11-07. - */ -@RestController -@RequestMapping(value = "/sys_logs/notify", method = RequestMethod.GET) -@RequireManager(role = ManagerRole.ADMIN) -public class NotifyLogController { - @Resource - private NotifyLogRepository notifyLogRepository; - - @GetMapping - public JSONObject listNotifyLogs(NotifyQueryBean notifyQueryBean) { - return notifyLogRepository.listNotifyLogs(notifyQueryBean); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/web/SignInLogController.java b/src/main/java/au/com/royalpay/payment/manage/logview/web/SignInLogController.java deleted file mode 100644 index 881ae42f0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/web/SignInLogController.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.logview.web; - -import au.com.royalpay.payment.manage.logview.beans.ClientLoginLogQueryBean; -import au.com.royalpay.payment.manage.logview.beans.LogQueryBean; -import au.com.royalpay.payment.manage.logview.core.SignInLogRepository; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -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 javax.annotation.Resource; - -/** - * Created by yixian on 2016-10-18. - */ -@RestController -@ManagerMapping(value = "/sys_logs/sign_in", method = RequestMethod.GET, role = ManagerRole.ADMIN) -public class SignInLogController { - @Resource - private SignInLogRepository signInLogRepository; - - @RequestMapping("/managers") - public JSONObject listManagerSignInLogs(LogQueryBean query) { - return signInLogRepository.listManagerLoginLogs(query.toJSON(), query.getPage(), query.getLimit()); - } - - @RequestMapping("/clients") - public JSONObject listAllClientsLoginLogs(ClientLoginLogQueryBean query){ - return signInLogRepository.listAllClientsLoginLogs(query.toJSON(),query.getPage(),query.getLimit()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/web/WechatMsgController.java b/src/main/java/au/com/royalpay/payment/manage/logview/web/WechatMsgController.java deleted file mode 100644 index 7b159eb47..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/logview/web/WechatMsgController.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.logview.web; - -import au.com.royalpay.payment.manage.logview.beans.WechatMsgQueryBean; -import au.com.royalpay.payment.manage.logview.core.WechatMsgRepository; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -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 javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/5/3. - */ -@RestController -@ManagerMapping(value = "/sys_logs/wechat_msg", method = RequestMethod.GET, role = ManagerRole.ADMIN) -public class WechatMsgController { - @Resource - private WechatMsgRepository wechatMsgRepository; - - @RequestMapping - public JSONObject listWechatMsgs(WechatMsgQueryBean wechatMsgQueryBean){ - return wechatMsgRepository.listWechatMsgs(wechatMsgQueryBean); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFile.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFile.java deleted file mode 100644 index f1a26bf68..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFile.java +++ /dev/null @@ -1,123 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -import au.com.royalpay.payment.core.ChannelBillValidator; -import au.com.royalpay.payment.core.beans.ChannelBillPackage; -import au.com.royalpay.payment.core.exceptions.ChannelNotSupportedException; -import au.com.royalpay.payment.tools.defines.PayChannel; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.io.IOUtils; -import org.springframework.stereotype.Component; -import org.thymeleaf.util.ListUtils; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -/** - * @Description - * @title: 渠道对账文件 - * @Date 2020/11/5 15:06 - * @author: zhangTao - */ -@Component -public class ChannelReconciliationFile { - - private ChannelReconciliationFileTunnel tunnel; - private final Map validatorMap ; - - public ChannelReconciliationFile(ChannelReconciliationFileTunnel tunnel ,ChannelBillValidator[] validators) { - this.tunnel = tunnel; - validatorMap = Arrays.stream(validators).collect(Collectors.toMap(ChannelBillValidator::payChannel,channelBillValidator -> channelBillValidator)); - } - - public PageList list(ChannelReconciliationFileQueryParameter channelReconciliationFileQueryParameter) { - return this.tunnel.list(channelReconciliationFileQueryParameter); - } - - - public ChannelReconciliationFileContent download(ChannelReconciliationFileDownloadParameter from) { - Optional> channel = findChannels(from.getChannel()); - - if (!channel.isPresent()) { - throw new ChannelNotSupportedException(); - } - - Map.Entry channelChannelBillValidatorEntry = channel.get(); - - ChannelBillValidator channelBillValidator = channelChannelBillValidatorEntry.getValue(); - - List channelBillPackageList = selectTypeDown(from ,channelBillValidator); - - if (isNull(channelBillPackageList)) { - throw new ChannelReconciliationFileEmptyException(); - } - - - if (isMultiFile(channelBillPackageList)) { - return genMultiFile(channelBillPackageList); - } - - return genSingleFile(channelBillPackageList.get(0)); - } - - private List selectTypeDown(ChannelReconciliationFileDownloadParameter from, ChannelBillValidator channelBillValidator) { - - if (from.billType().equals("SETTLEMENT")){ - return channelBillValidator - .downloadRawSettlementFiles(from.pid(), from.billDate(), from.isUseCash()); - - } - return channelBillValidator.downloadRawTransactionFiles(from.pid(), from.billDate(), from.isUseCash()); - - } - - private boolean isMultiFile(List channelBillPackageList) { - return channelBillPackageList.size() > 1; - } - - private boolean isNull(List channelBillPackageList){ - return ListUtils.isEmpty(channelBillPackageList); - } - - private ChannelReconciliationFileContent genSingleFile(ChannelBillPackage channelBillPackage) { - return ChannelReconciliationFileContent.instance(channelBillPackage.getFilename(), - channelBillPackage.getBillContent()); - } - - private ChannelReconciliationFileContent genMultiFile(List channelBillPackageList) { - try (ByteArrayOutputStream stream = new ByteArrayOutputStream(); ZipOutputStream zipOutputStream = new ZipOutputStream(stream)) { - - channelBillPackageList.forEach(bill -> toZipOutputStream(bill, zipOutputStream)); - - zipOutputStream.close(); - stream.close(); - return ChannelReconciliationFileContent.instance("reconciliationFile.zip", stream.toByteArray()); - } catch (IOException e) { - throw new MultiFileChannelReconciliationException(); - } - } - - private void toZipOutputStream(ChannelBillPackage channelBillPackage ,ZipOutputStream zipOutputStream){ - try (ByteArrayInputStream fis = new ByteArrayInputStream(channelBillPackage.getBillContent())) { - ZipEntry zipEntryXtv = new ZipEntry(channelBillPackage.getFilename()); - zipOutputStream.putNextEntry(zipEntryXtv); - IOUtils.copy(fis, zipOutputStream); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - private Optional> findChannels(String channel) { - return validatorMap.entrySet().stream().filter(entry -> channel.equals(entry.getKey().getChannelCode())).findAny(); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileContent.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileContent.java deleted file mode 100644 index 78510f04b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileContent.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - - -import org.apache.commons.io.FilenameUtils; - -/** - * 渠道对账文件内容 - * @Date 2020/11/5 17:21 - * @author: zhangTao - */ -public class ChannelReconciliationFileContent { - - private static String SUFFIX =".txt"; - private final FileName fileName; - private final byte[] content; - - private ChannelReconciliationFileContent(String fileName, byte[] content) { - this.fileName = new FileName(fileName) ; - this.content = content; - } - - public String name() { - return this.fileName.getName(); - } - - - public int length() { - return this.content.length; - } - - public byte[] content() { - return this.content; - } - - public static ChannelReconciliationFileContent instance(String fileName, byte[] billContent) { - if (!checkFileName(fileName)){ - fileName = fileName+SUFFIX; - // throw new ChannelReconciliationFileNameSuffixException(); - } - return new ChannelReconciliationFileContent(fileName, billContent); - } - - private static boolean checkFileName(String fileName) { - return fileName.contains("."); - } - - private class FileName { - - private final String name; - private final String type; - - public FileName(String name) { - this.name = name; - this.type = FilenameUtils.getExtension(name); - } - - public String getName() { - return name; - } - - public String getType() { - return type; - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDTO.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDTO.java deleted file mode 100644 index 3cb10dfd4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -import lombok.Data; - -/** - * @Description - * @title: - * @Date 2020/11/4 16:40 - * @author: zhangTao - */ -@Data -public class ChannelReconciliationFileDTO { - - - private String batchId; - /** - * - */ - private String channel; - /** - * - */ - private String pid; - /** - * - */ - private String billDate; - /** - * - */ - private String billType; - /** - * - */ - private String createTime; - - private String fileId; - - - private String filename; - - private String fileType; - - private String attachId; - /** - * - */ - private String attachUrl; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDownloadParameter.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDownloadParameter.java deleted file mode 100644 index 2810248e9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDownloadParameter.java +++ /dev/null @@ -1,51 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -import java.util.Date; - -/** - * @Description - * @title: - * @Date 2020/11/16 14:42 - * @author: zhangTao - */ -public class ChannelReconciliationFileDownloadParameter { - private DownloadParameter parameter; - private boolean useCashFlag; - - public ChannelReconciliationFileDownloadParameter(String pid, Date billDate, String channel, boolean isUseCash,String billType) { - this.parameter = new DownloadParameter(pid, billDate, channel,billType); - this.useCashFlag = isUseCash; - } - - public String getChannel() { - return this.parameter.channel; - } - - public boolean isUseCash() { - return this.useCashFlag; - } - - public String pid(){ - return this.parameter.pid; - } - public Date billDate(){ - return this.parameter.billDate; - } - public String billType(){ - return this.parameter.billType; - } - - - private static class DownloadParameter { - private String pid; - private String channel; - private Date billDate; - private String billType; - public DownloadParameter(String pid, Date billDate, String channel,String billType) { - this.pid = pid; - this.billDate = billDate; - this.channel = channel; - this.billType = billType; - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileEmptyException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileEmptyException.java deleted file mode 100644 index bed1072e1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileEmptyException.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -/** - * @Description - * @title: - * @Date 2020/11/12 11:27 - * @author: zhangTao - */ -public class ChannelReconciliationFileEmptyException extends RuntimeException { - - public ChannelReconciliationFileEmptyException() { - super("渠道对账文件查询为空"); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileNameSuffixException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileNameSuffixException.java deleted file mode 100644 index bdcf5977d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileNameSuffixException.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -/** - * @Description - * @title: - * @Date 2020/11/19 18:35 - * @author: zhangTao - */ -public class ChannelReconciliationFileNameSuffixException extends RuntimeException { - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileQueryParameter.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileQueryParameter.java deleted file mode 100644 index 744f45446..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileQueryParameter.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - - -import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.TimeRangeAndPageSizeQueryParameter; - -/** - * @Description - * @title: 渠道对账文件查询参数 - * @Date 2020/11/16 11:54 - * @author: zhangTao - */ -public class ChannelReconciliationFileQueryParameter { - - private TimeRangeAndPageSizeQueryParameter timeRangeAndPageSizeQueryParameter; - private String channel; - private String billType; - - public ChannelReconciliationFileQueryParameter(TimeRangeAndPageSizeQueryParameter timeRangeAndPageSizeQueryParameter, String channel ,String billType) { - this.timeRangeAndPageSizeQueryParameter = timeRangeAndPageSizeQueryParameter; - this.channel = channel; - this.billType = billType; - } - - public String getChannel() { - return channel; - } - - public String getBillType() { - return billType; - } - - public TimeRangeAndPageSizeQueryParameter getTimeRangeAndPageSizeQueryParameter() { - return timeRangeAndPageSizeQueryParameter; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileTunnel.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileTunnel.java deleted file mode 100644 index 99654c9f4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileTunnel.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -/** - * @Description - * @title: - * @Date 2020/11/5 16:50 - * @author: zhangTao - */ -public interface ChannelReconciliationFileTunnel { - - PageList list(ChannelReconciliationFileQueryParameter channelReconciliationFileQueryParameter); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/FileDownloadException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/FileDownloadException.java deleted file mode 100644 index cbe6c8897..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/FileDownloadException.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -/** - * @Description - * @title: - * @Date 2020/11/6 11:24 - * @author: zhangTao - */ -public class FileDownloadException extends RuntimeException { - - public FileDownloadException() { - super("文件下载异常"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/MultiFileChannelReconciliationException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/MultiFileChannelReconciliationException.java deleted file mode 100644 index 451cb4c92..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/MultiFileChannelReconciliationException.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile; - -/** - * @Description - * @title: - * @Date 2020/11/6 11:24 - * @author: zhangTao - */ -public class MultiFileChannelReconciliationException extends RuntimeException { - - public MultiFileChannelReconciliationException() { - super("渠道多文件异常"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/PageSize.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/PageSize.java deleted file mode 100644 index 8784a4162..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/PageSize.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile.common; - -/** - * @Description - * @title: - * @Date 2020/11/16 13:36 - * @author: zhangTao - */ -public class PageSize { - - private int page; - protected int rows; - - public PageSize(int page, int rows) { - this.page = page; - this.rows = rows; - } - - public int getPage() { - if (page == 0) { - return 1; - } - return page; - } - - public int getRows() { - return rows; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRange.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRange.java deleted file mode 100644 index 4ad8d01ca..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRange.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile.common; - -/** - * @Description - * @title: 时间区间 - * @Date 2020/11/16 11:59 - * @author: zhangTao - */ -public class TimeRange { - - private String startTime; - private String endTime; - - public TimeRange(String startTime, String endTime) { - this.startTime = startTime; - this.endTime = endTime; - } - - public String getStartTime() { - return startTime; - } - - public String getEndTime() { - return endTime; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRangeAndPageSizeQueryParameter.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRangeAndPageSizeQueryParameter.java deleted file mode 100644 index 77187cf86..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRangeAndPageSizeQueryParameter.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.management.channelreconciliationfile.common; - -/** - * @Description - * @title: - * @Date 2020/11/16 13:47 - * @author: zhangTao - */ -public class TimeRangeAndPageSizeQueryParameter { - - private TimeRange timeRange; - private PageSize pageSize; - - public TimeRangeAndPageSizeQueryParameter(TimeRange timeRange, PageSize pageSize) { - this.timeRange = timeRange; - this.pageSize = pageSize; - } - - public TimeRange getTimeRange() { - return timeRange; - } - - public PageSize getPageSize() { - return pageSize; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/CustomizedSettleRequest.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/CustomizedSettleRequest.java deleted file mode 100644 index f45100ae2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/CustomizedSettleRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.beans; - -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import com.alibaba.fastjson.PropertyNamingStrategy; -import com.alibaba.fastjson.annotation.JSONType; - -import java.math.BigDecimal; - -@JSONType(naming = PropertyNamingStrategy.SnakeCase) -public class CustomizedSettleRequest { - private String clientMoniker; - private BigDecimal amount; - private int clearingStatus = 0; - private BalanceGroup balanceGroup = BalanceGroup.NORMAL_CROSS_BORDER; - private boolean forceSettle = false; - - public String getClientMoniker() { - return clientMoniker; - } - - public CustomizedSettleRequest setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - return this; - } - - public BigDecimal getAmount() { - return amount; - } - - public CustomizedSettleRequest setAmount(BigDecimal amount) { - this.amount = amount; - return this; - } - - public int getClearingStatus() { - return clearingStatus; - } - - public CustomizedSettleRequest setClearingStatus(int clearingStatus) { - this.clearingStatus = clearingStatus; - return this; - } - - public BalanceGroup getBalanceGroup() { - return balanceGroup; - } - - public CustomizedSettleRequest setBalanceGroup(BalanceGroup balanceGroup) { - this.balanceGroup = balanceGroup; - return this; - } - - public boolean isForceSettle() { - return forceSettle; - } - - public CustomizedSettleRequest setForceSettle(boolean forceSettle) { - this.forceSettle = forceSettle; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/PriorityModifyLog.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/PriorityModifyLog.java deleted file mode 100644 index eef0c9336..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/PriorityModifyLog.java +++ /dev/null @@ -1,76 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.beans; - -import com.alibaba.fastjson.PropertyNamingStrategy; -import com.alibaba.fastjson.annotation.JSONType; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.data.mongodb.core.mapping.Document; - -import java.util.Date; - -@Document(collection = "settle_priority_modify") -@JSONType(naming = PropertyNamingStrategy.SnakeCase) -public class PriorityModifyLog { - public static final String OP_ADD = "ADD"; - public static final String OP_REMOVE = "REMOVE"; - private long id; - private String clientMoniker; - private String operation; - private String operatorId; - private String operatorName; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+10") - private Date createTime; - - public long getId() { - return id; - } - - public PriorityModifyLog setId(long id) { - this.id = id; - return this; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public PriorityModifyLog setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - return this; - } - - public String getOperation() { - return operation; - } - - public PriorityModifyLog setOperation(String operation) { - this.operation = operation; - return this; - } - - public String getOperatorId() { - return operatorId; - } - - public PriorityModifyLog setOperatorId(String operatorId) { - this.operatorId = operatorId; - return this; - } - - public String getOperatorName() { - return operatorName; - } - - public PriorityModifyLog setOperatorName(String operatorName) { - this.operatorName = operatorName; - return this; - } - - public Date getCreateTime() { - return createTime; - } - - public PriorityModifyLog setCreateTime(Date createTime) { - this.createTime = createTime; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/SettleDelayConfig.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/SettleDelayConfig.java deleted file mode 100644 index c61c96274..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/SettleDelayConfig.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.beans; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.time.DateUtils; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.Date; - -/** - * Create by yixian at 2017-09-07 17:10 - */ -public class SettleDelayConfig { - - @JSONField(name = "to_date") - private String toDate; - @JSONField(name = "surcharge_discount") - private BigDecimal surchargeDiscount; - - public String getToDate() { - return toDate; - } - - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public BigDecimal getSurchargeDiscount() { - return surchargeDiscount; - } - - public void setSurchargeDiscount(BigDecimal surchargeDiscount) { - this.surchargeDiscount = surchargeDiscount; - } - - public Date toDate() { - try { - return DateUtils.parseDate(toDate, new String[]{"yyyy-MM-dd"}); - } catch (ParseException e) { - throw new BadRequestException("Invalid To Date"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/TransactionStatus.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/TransactionStatus.java deleted file mode 100644 index 9c8a4bc1e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/TransactionStatus.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.beans; - -import com.alibaba.fastjson.annotation.JSONField; - - -/** - * Create by Todking at 2020-12-28 - */ -public class TransactionStatus { - - @JSONField(name = "status") - private Integer status; - - @JSONField(name = "time") - private String time; - - private String statusInfo; - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public String getStatusInfo() { - return statusInfo; - } - - public void setStatusInfo(String statusInfo) { - this.statusInfo = statusInfo; - } - - public TransactionStatus toSet() { - TransactionStatus transactionStatus = new TransactionStatus(); - switch (status) { - case 0: - transactionStatus.setStatusInfo("Ready To Clear"); - break; - case 1: - transactionStatus.setStatusInfo("Cleared"); - break; - case 2: - transactionStatus.setStatusInfo("Preauthorised"); - break; - } - transactionStatus.setStatus(status); - transactionStatus.setTime(time); - return transactionStatus; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java deleted file mode 100644 index 19b8f81fe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java +++ /dev/null @@ -1,124 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core; - -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileContent; -import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; -import au.com.royalpay.payment.manage.support.abafile.ABAFile; -import au.com.royalpay.payment.manage.tradelog.beans.ClearingLogQuery; -import com.alibaba.fastjson.JSONObject; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.transaction.annotation.Transactional; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.Writer; -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * Created by davep on 2016-08-29. - */ -public interface CleanService { - - List listValidatedDays(Date month); - - List listClientCleanLogsForMonth(Date date, int clientId); - - JSONObject getClientCleanLogJson(int clientId, int clearId); - - void getClientCleanLogPDF(int clientId, int clearId, Writer writer); - - void getClientCleanLogCSV(int clientId, int clearId, PrintWriter writer) throws IOException; - - JSONObject getClearDetails(Date dt, String managerId); - - JSONObject getCleanLogTransactions(int detailId, JSONObject manager); - - JSONObject getCleanLogTransactionsOfMergeSettle(int clientId, String repotDate, JSONObject manager); - - Map getDayAndChannelOfAnalysisMap(int detailId, String channel,JSONObject manager); - - JSONObject getCleanLogTransactions(int client_id, String detailId); - - void settlementCsv(Date dt, HttpServletResponse resp) throws IOException; - - void transactionCsv(Date dt, HttpServletResponse resp) throws IOException; - - void settlementXlsx(Date date, HttpServletResponse response) throws IOException; - - List getXlsx(Date dt, List logs) throws IOException; - - List getSettleLogs(Date dt, List clearIds); - - List getAba(Date dt, List logs) throws IOException; - - void settlementAba(Date date, HttpServletResponse response) throws IOException; - - List getCustomizedSettleDaily(Date date); - - void getCustomizedSettleABA(int logId, HttpServletResponse response); - - JSONObject sendCustomizedSettleMail(List logIds); - - void getSettlementFilesForBatch(String batchId, HttpServletResponse resp) throws IOException; - - List getCleanLogs(ClearingLogQuery query, JSONObject manager); - - JSONObject getCleanLogsInClients(ClearingLogQuery query, JSONObject manager); - - JSONObject analysisCleanLogs(ClearingLogQuery query, JSONObject manager); - - JSONObject rateWarnings(); - - @Transactional - JSONObject autoGenerateRate(String clientMoniker, JSONObject manager); - - List listSettledDatesInMonth(Date mon); - - JSONObject listClearingTransactions(int client_id, String clearingDetailId, JSONObject partner); - - JSONObject listClearingTransactionsByMergeSettle(int client_id, String clearingDetailId, JSONObject partner); - - Map channelAndDayOfAnalysis(int client_id, String clearingDetailId, String channel,JSONObject partner); - - Map channelAndDayOfMergeSettleAnalysis(int client_id, String reportDate, String channel,JSONObject partner); - - void exportListClearingTransactions(int client_id, String clearingDetailId, JSONObject partner, HttpServletResponse resp); - - void exportTransactionsByReportDate(String reportDate, JSONObject partner, HttpServletResponse resp); - - List getSettlementMonthReport(int year, int monthOfYear); - - void writeSettlementMonthReportToExcel(int year, int monthOfYear, OutputStream ous) throws IOException; - - JSONObject getSettlementLogs(ClearingLogQuery query, JSONObject manager); - - void getTodaySettlementLogs(); - - - JSONObject sendSettlementMail(Date date, List clearIds, boolean autoMarkSent); - - void sendCheckCode(Date date, JSONObject manager); - - List findLogSettleByDate(Date date); - - JSONObject validTransactions(Date date, boolean fix, boolean b, boolean b1,boolean isSendMessage); - - void distributeBank(Date date, int clearingId, JSONObject bankDistribution); - - void lockClearingLog(Date date, int clearingId); - - void undoSettle(Date date, int clearingId); - - ByteArrayResource downloadBatchSettleReportXlsx(int batchId); - - JSONObject findSettleLog(int clearingId); - - JSONObject findClearingDetail(int clearingId, String clientMoniker); - - ChannelReconciliationFileContent downloadChannelReconciliationFile(String pid, Date billDate, boolean noCache, String channel, String billType); - - TransactionStatus getTransactionStatus(String transactionId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/PriorityListManager.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/PriorityListManager.java deleted file mode 100644 index 513362ae1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/PriorityListManager.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core; - -import au.com.royalpay.payment.manage.management.clearing.beans.PriorityModifyLog; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -public interface PriorityListManager { - List listPriorityMerchants(); - - JSONObject setMerchantPriority(String clientMoniker, JSONObject manager); - - void removePriorityMerchant(String clientMoniker, JSONObject manager); - - List getMerchantsModifyHistory(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleDelayConfigurer.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleDelayConfigurer.java deleted file mode 100644 index d39a1082b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleDelayConfigurer.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core; - -import au.com.royalpay.payment.manage.management.clearing.beans.SettleDelayConfig; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; -import java.util.List; - -/** - * Create by yixian at 2017-09-07 17:08 - */ -public interface SettleDelayConfigurer { - JSONObject listAttendingClients(JSONObject params, int page, int limit); - - void configClient(String clientMoniker, SettleDelayConfig config, JSONObject manager); - - void disableClient(JSONObject account,String clientMoniker); - - List getWeekendAnalysis(JSONObject params); - - PageList getClientRank(JSONObject params); - - @Transactional - void addCashback(Date date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java deleted file mode 100644 index 15e7ee7cf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core; - -import au.com.royalpay.payment.manage.management.clearing.beans.CustomizedSettleRequest; -import au.com.royalpay.payment.manage.management.clearing.web.ManualSettleTask; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -public interface SettleTasksService { - List listPlans(); - - JSONObject currentProcessingStatus(); - - List listMerchantsInfo(String mchMonikers); - - void submitTasks(List tasks); - - JSONObject submitCustomizedSettle(CustomizedSettleRequest settleRequest, JSONObject manager); - - List analysisYesterdayTransaction(); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java deleted file mode 100644 index 8c0a9b695..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ /dev/null @@ -1,1959 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core.impl; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.beans.OrderValidationChannelResult; -import au.com.royalpay.payment.core.beans.OrderValidationResult; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.core.impls.LogChannelValidationStorage; -import au.com.royalpay.payment.core.tasksupport.SettlementSupport; -import au.com.royalpay.payment.core.utils.ExtParamsUtils; -import au.com.royalpay.payment.core.validation.domain.ChannelValidationTask; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFile; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileContent; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileDownloadParameter; -import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.mappers.log.*; -import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.signin.beans.TodoNotice; -import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider; -import au.com.royalpay.payment.manage.support.abafile.ABAConfig; -import au.com.royalpay.payment.manage.support.abafile.ABAFile; -import au.com.royalpay.payment.manage.support.abafile.ABATemplate; -import au.com.royalpay.payment.manage.support.abafile.SettleRemarkTemplateDescriber; -import au.com.royalpay.payment.manage.support.poi.ExcelFileBuilder; -import au.com.royalpay.payment.manage.support.poi.ExcelTemplate; -import au.com.royalpay.payment.manage.support.poi.FontFactory; -import au.com.royalpay.payment.manage.tradelog.beans.ClearingLogQuery; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.defines.TradeType; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.tasksupport.TaskFinishNotifyEvent; -import au.com.royalpay.payment.tools.utils.DateVaildUtil; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.joda.time.DateTime; -import org.joda.time.Days; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.format.number.CurrencyStyleFormatter; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URISyntaxException; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; - -/** - * 清算 Created by davep on 2016-08-29. - */ -@Service -public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider, ApplicationEventPublisherAware { - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private SettlementSupport settlementSupport; - @Resource - private TransactionMapper transactionMapper; - @Resource - private ClearingLogMapper clearingLogMapper; - @Resource - private ClearingDetailMapper clearingDetailMapper; - @Resource - private CustomizedSettleLogMapper customizedSettleLogMapper; - @Resource - private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper; - @Resource - private TaskManualSettleMapper taskManualSettleMapper; - @Resource - private PreSettleTaskMapper preSettleTaskMapper; - @Resource - private ValidationLogMapper validationLogMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientRateMapper clientRateMapper; - @Resource - private RateMapper rateMapper; - @Resource - private ClientManager clientManager; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private MailService mailService; - @Resource - private LogSettleMailMapper logSettleMailMapper; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private PaymentApi paymentApi; - @Resource - private CalendarMapper calendarMapper; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private ClientConfigService clientConfigService; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper; - @Resource - private ClearingDistributedSurchargeMapper clearingDistributedSurchargeMapper; - @Resource - private Locker locker; - @Resource - private ClientIncrementalMapper clientIncrementalMapper; - @Resource - private ChannelReconciliationFile channelReconciliationFile; - @Resource - private ChannelValidationTask channelValidationTask; - - @Resource - private LogChannelValidationStorage logChannelValidationStorage; - - @Resource - private ClientDeviceMapper clientDeviceMapper; - private static final int MAX_TRACK_DAYS = 31; - @Value("${app.redis.settle.check-code.prefix}") - private String reidsCheckCodeKey; - - private final String[] open_ids = {"o32MzuEeb5ZT_DJQYbzZf6VCu1HQ", "o32MzuIsa3OBOkvC9pL90h9pgHPg", "o32MzuCpqGQJTlvTK7VQ7m_LVXiQ"}; - private ApplicationEventPublisher publisher; - - @Override - public List listValidatedDays(Date month) { - List originOriginReports = validationLogMapper.listValidatedDates(month); - List newReports = logChannelValidationStorage.listMonthReports(month); - Map reports = new TreeMap<>(); - for (JSONObject report : originOriginReports) { - JSONObject item = new JSONObject(); - String dateStr = DateFormatUtils.format(report.getDate("valid_date"), "yyyy/MM/dd"); - item.put("date", dateStr); - item.put("isOld", true); - JSONObject result = JSON.parseObject(report.getString("result")); - int warningLevel = result.getBooleanValue("valid") ? 0 : 1; - if (!result.getJSONArray("not_exists").isEmpty()) { - warningLevel = 2; - } - item.put("warning_level", warningLevel); - item.put("success", result.getBooleanValue("valid")); - reports.put(dateStr, item); - } - for (OrderValidationResult res : newReports) { - JSONObject item = new JSONObject(); - String dateStr = DateFormatUtils.format(res.getTransDate(), "yyyy/MM/dd"); - item.put("date", dateStr); - item.put("isOld", false); - item.put("warning_level", res.getWarningLevel()); - item.put("success", res.getWarningLevel() == OrderValidationResult.LEVEL_SUCCESS); - reports.put(dateStr, item); - } - return new ArrayList<>(reports.values()); - } - - @Override - public List listClientCleanLogsForMonth(Date date, int clientId) { - return clearingDetailMapper.listReports(clientId, date); - } - - @Override - public JSONObject getClientCleanLogJson(int clientId, int clearId) { - // todo clear id value not determined - if (true) { - throw new BadRequestException(); - } - JSONObject cleanLog = clearingDetailMapper.find(clientId, clearId); - List transactions = transactionMapper.listTransactionsOfClearingOrder(clearId, new PageBounds(Order.formString("order_id.asc"))); - cleanLog.put("report", transactions); - return cleanLog; - } - - @Override - public void getClientCleanLogPDF(int clientId, int clearId, Writer writer) { - // todo convert to pdf - } - - @Override - public void getClientCleanLogCSV(int clientId, int clearId, PrintWriter writer) throws IOException { - JSONObject report = getClientCleanLogJson(clientId, clearId); - CSVPrinter printer = new CSVPrinter(writer, CSVFormat.DEFAULT); - String[] headers = "Transaction Id,Order Id,Client Moniker,Device Id,Transaction Currency,Transaction Amount,Clearing Currency,Clearing Amount,Channel,Transaction Time,Clearing Status" - .split(","); - printer.printRecord((Object[]) headers); - JSONArray reportDetail = report.getJSONArray("report"); - for (int i = 0, len = reportDetail.size(); i < len; i++) { - JSONObject detail = reportDetail.getJSONObject(i); - if (isClientIgnored(detail)) { - continue; - } - printer.printRecord(detail.getString("transaction_id"), detail.getString("order_id"), detail.getString("client_moniker"), - detail.getString("device_id"), detail.getString("transaction_currency"), detail.getString("transaction_amount"), - detail.getString("clearing_currency"), detail.getString("clearing_amount"), detail.getString("channel"), - DateFormatUtils.format(detail.getDate("transaction_time"), "yyyy-MM-dd HH:mm:ss"), detail.getString("clearing_status")); - } - printer.flush(); - printer.close(); - } - - @Override - public JSONObject getClearDetails(Date settleDate, String managerId) { - List logs = clearingLogMapper.findByDate(settleDate); - if (logs.isEmpty()) { - throw new NotFoundException(); - } - JSONObject total = new JSONObject(); - total.put("settle_date", settleDate); - total.put("total_credit", 0); - total.put("total_debit", 0); - total.put("gross_amount", 0); - total.put("wechat_charge", 0); - total.put("royalpay_charge", 0); - total.put("net_amount", 0); - total.put("total_charge", 0); - total.put("tax_amount", 0); - total.put("charge_cashback", 0); - - for (JSONObject log : logs) { - addBigDecimal(total, log, "total_credit"); - addBigDecimal(total, log, "total_debit"); - addBigDecimal(total, log, "gross_amount"); - addBigDecimal(total, log, "wechat_charge"); - addBigDecimal(total, log, "royalpay_charge"); - addBigDecimal(total, log, "net_amount"); - addBigDecimal(total, log, "total_charge"); - addBigDecimal(total, log, "charge_cashback"); - addBigDecimal(total, log, "tax_amount"); - int clearingId = log.getIntValue("clearing_id"); - List logDetails = clearingDetailMapper.listReportsOfSettlement(clearingId); - List banks = logDetails.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList()); - List bankStatistics = banks.stream().map(bank -> { - JSONObject data = new JSONObject(); - data.put("bank", bank); - List bankCleanLogs = logDetails.stream() - .filter(detail -> bank.equals(detail.getString("settle_bank"))) - .collect(Collectors.toList()); - data.put("total_settle", bankCleanLogs.stream() - .map(detail -> detail.getBigDecimal("clearing_amount")) - .reduce(BigDecimal::add) - .orElse(BigDecimal.ZERO) - ); - data.put("clients", bankCleanLogs.size()); - return data; - }).collect(Collectors.toList()); - log.put("bank_statistics", bankStatistics); - Map cleanDaysStatistics = Stream.of(1, 2, 3).map(cleanDays -> { - JSONObject data = new JSONObject(); - List cleanDaysDetails = logDetails.stream() - .filter(detail -> detail.getIntValue("clear_days") == cleanDays) - .collect(Collectors.toList()); - data.put("clean_days", "T+" + cleanDays); - data.put("total_settle", cleanDaysDetails.stream() - .map(detail -> detail.getBigDecimal("clearing_amount")) - .reduce(BigDecimal::add) - .orElse(BigDecimal.ZERO)); - data.put("clients", cleanDaysDetails.size()); - data.put("reports", cleanDaysDetails.size() < 20 ? cleanDaysDetails : cleanDaysDetails.subList(0, 20)); - return data; - }).collect(TreeMap::new, (map, data) -> map.put(data.getString("clean_days"), data), Map::putAll); - - log.put("clean_days", cleanDaysStatistics); - if (StringUtils.isNotEmpty(log.getString("plan_detail"))) { - try { - JSONObject planDetail = JSON.parseObject(log.getString("plan_detail")); - JSONObject planDetailCut = new JSONObject(); - planDetailCut.put("plan_id", planDetail.getString("plan_id")); - planDetailCut.put("remark", planDetail.getString("remark")); - log.put("plan_detail", planDetailCut); - } catch (JSONException ignore) { - } - } - log.put("editable", DateUtils.isSameDay(log.getDate("settle_date"), new Date()) && log.getBooleanValue("editable")); - log.put("channel_analysis", clearingDetailAnalysisMapper.analysisChannelReport(clearingId)); - } - Map totalCleanDaysSatistics = Stream.of(1, 2, 3).map(cleanDays -> { - JSONObject cleanDaysReport = new JSONObject(); - cleanDaysReport.put("clean_days", "T+" + cleanDays); - cleanDaysReport.put("clients", logs.stream().mapToInt(log -> log.getJSONObject("clean_days").getJSONObject("T+" + cleanDays).getIntValue("clients")).sum()); - cleanDaysReport.put("total_settle", logs.stream().map(log -> log.getJSONObject("clean_days").getJSONObject("T+" + cleanDays).getBigDecimal("total_settle")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - return cleanDaysReport; - }).collect(TreeMap::new, (map, report) -> map.put(report.getString("clean_days"), report), Map::putAll); - total.put("logs", logs); - total.put("clean_days", totalCleanDaysSatistics); - List channels = clearingDetailAnalysisMapper.analysisChannelReportDaily(settleDate); - total.put("channel_analysis", channels); - return total; - } - - private void addBigDecimal(JSONObject total, JSONObject log, String key) { - total.put(key, total.getBigDecimal(key).add(log.getBigDecimal(key))); - } - - @Override - public JSONObject getCleanLogTransactions(int detailId, JSONObject manager) { - JSONObject cleanLog = clearingDetailMapper.findByDetailId(detailId); - if (cleanLog == null) { - throw new NotFoundException(); - } - JSONObject client = clientManager.getClientInfo(cleanLog.getIntValue("client_id")); - Assert.notNull(client, "Client ID invalid"); - checkOrgPermission(manager, client); - List transactions = transactionMapper.listTransactionsOfClearingOrder(detailId, new PageBounds(Order.formString("order_id.asc"))); - cleanLog.put("report", transactions); - List channels = clearingDetailAnalysisMapper.listReportChannels(cleanLog.getString("clear_detail_id")); - JSONObject channelsObj = new JSONObject(); - for (JSONObject channel : channels) { - channelsObj.put(channel.getString("channel"), channel); - } - cleanLog.put("channels", channelsObj); - cleanLog.put("client_moniker", client.getString("client_moniker")); - //跨境商城支持 -// JSONObject incremental = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); -// if (incremental != null) { -// cleanLog.put("incremental_rate", incremental.getBigDecimal("incremental_rate_value")); -// cleanLog.putAll(incrementalAnalysisTransLogs(transactions)); -// BigDecimal royalpayTax = cleanLog.getBigDecimal("tax_amount").subtract(cleanLog.getBigDecimal("incremental_tax")); -// cleanLog.put("royalpay_tax", royalpayTax.setScale(2, RoundingMode.HALF_UP)); -// } - return cleanLog; - } - - @Override - public JSONObject getCleanLogTransactionsOfMergeSettle(int clientId, String reportDate, JSONObject manager) { - JSONObject clearClient = clearingDetailMapper.listReportOfMergeSettle(reportDate, clientId); - if (clearClient == null) { - throw new NotFoundException(); - } - JSONObject client = clientManager.getClientInfo(clientId); - Assert.notNull(client, "Client ID invalid"); - checkOrgPermission(manager, client); - List transactions = transactionMapper.listTransactionsOfMergeSettleClearingOrder(reportDate, clientId, - new PageBounds(Order.formString("order_id.asc"))); - clearClient.put("report", transactions); - List channels = clearingDetailAnalysisMapper.listReportChannelsOfMergeSettle(reportDate, clientId); - JSONObject channelsObj = new JSONObject(); - for (JSONObject channel : channels) { - channelsObj.put(channel.getString("channel"), channel); - } - clearClient.put("channels", channelsObj); - clearClient.put("client_moniker", client.getString("client_moniker")); - return clearClient; - } - - @Override - public Map getDayAndChannelOfAnalysisMap(int detailId, String channel, JSONObject manager) { - JSONObject cleanLog = clearingDetailMapper.findByDetailId(detailId); - if (cleanLog == null) { - throw new NotFoundException(); - } - JSONObject client = clientManager.getClientInfo(cleanLog.getIntValue("client_id")); - Assert.notNull(client, "Client ID invalid"); - checkOrgPermission(manager, client); - - return getDayAnalysisMap(String.valueOf(detailId), channel, client); - } - - @Override - public JSONObject getCleanLogTransactions(int clientId, String clearingDetailId) { - return settlementSupport.listSettlementTransactionsForClient(clientId, clearingDetailId); - } - - @Override - public void settlementCsv(Date dt, HttpServletResponse resp) throws IOException { - List logs = clearingLogMapper.findByDate(dt); - if (logs.isEmpty()) { - throw new NotFoundException(); - } - resp.setContentType("application/octet-stream;"); - - String zipName = "Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd") + RandomStringUtils.random(8, false, true) + ".zip"; - resp.addHeader("Content-Disposition", "attachment; filename=" + zipName); - OutputStream ous = resp.getOutputStream(); - ZipOutputStream zos = new ZipOutputStream(ous); - for (JSONObject log : logs) { - String dateString = DateFormatUtils.format(log.getDate("operate_time"), "yyyyMMddHHmmss"); - String filename = "Merchant_Settlement_Info_" + dateString + RandomStringUtils.random(8, false, true) + ".csv"; - zos.putNextEntry(new ZipEntry(filename)); - List details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id")); - details = mergeBatchSettleClients(details); - byte[] csv = generateSettleCSVFile(dt, details); - IOUtils.write(csv, zos); - } - zos.flush(); - IOUtils.closeQuietly(zos); - } - - @Override - public void transactionCsv(Date dt, HttpServletResponse resp) throws IOException { - List logs = clearingLogMapper.findByDate(dt); - if (logs.isEmpty()) { - throw new NotFoundException(); - } - String zipName = "Transaction_" + DateFormatUtils.format(dt, "yyyyMMdd") + RandomStringUtils.random(8, false, true) + ".zip"; - resp.addHeader("Content-Disposition", "attachment; filename=" + zipName); - resp.setContentType("application/octet-stream;"); - OutputStream ous = resp.getOutputStream(); - ZipOutputStream zos = new ZipOutputStream(ous); - for (JSONObject log : logs) { - String dateString = DateFormatUtils.format(log.getDate("operate_time"), "yyyyMMddHHmmss"); - String filename = "Transaction_" + dateString + RandomStringUtils.random(8, false, true) + ".csv"; - zos.putNextEntry(new ZipEntry(filename)); - List transactions = transactionMapper.listTransactionsOfClearingTask(log.getIntValue("clearing_id")); - byte[] csv = generateTransactionCSVFile(transactions); - IOUtils.write(csv, zos); - } - zos.flush(); - IOUtils.closeQuietly(zos); - } - - @Override - public void settlementXlsx(Date dt, HttpServletResponse resp) throws IOException { - List logs = clearingLogMapper.findByDate(dt); - if (logs.isEmpty()) { - throw new NotFoundException(); - } - String zipName = "Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd") + RandomStringUtils.random(8, false, true) + "_xlsx.zip"; - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + zipName); - OutputStream ous = resp.getOutputStream(); - ZipOutputStream zos = new ZipOutputStream(ous); - logger.info("using newest version test"); - for (JSONObject log : logs) { - List details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id")); - details = mergeBatchSettleClients(details); - exportAllBankXlsFiles(zos, details, log.getDate("operate_time")); - } - zos.flush(); - IOUtils.closeQuietly(zos); - } - - private void exportAllBankXlsFiles(ZipOutputStream zos, List details, Date operateTime) throws IOException { - String dateString = DateFormatUtils.format(operateTime, "yyyyMMddHHmmss"); - List bankList = details.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList()); - for (String bank : bankList) { - String filename = "Merchant_Settlement_Info_" + dateString + "_" + bank + ".xlsx"; - zos.putNextEntry(new ZipEntry(filename)); - byte[] xlsx = generateSettleXlsxFile(operateTime, details, bank); - IOUtils.write(xlsx, zos); - } - } - - @Override - public List getXlsx(Date dt, List logs) throws IOException { - List result = new ArrayList<>(); - for (JSONObject log : logs) { - List details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id")); - List banks = details.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList()); - for (String bank : banks) { - String filename = String.format("Merchant_Setlement_Info_%s_%s.xlsx", bank, DateFormatUtils.format(log.getDate("operate_time"), "yyyyMMddHHmmss")); - JSONObject file = new JSONObject(); - file.put("name", filename); - List mergedDetails = mergeBatchSettleClients(details.stream().filter(detail -> bank.equals(detail.getString("settle_bank"))).collect(Collectors.toList())); - file.put("byteArr", generateSettleXlsxFile(dt, mergedDetails, bank)); - result.add(file); - } - } - - return result; - } - - @Override - public List getSettleLogs(Date dt, List clearIds) { - List logs = clearingLogMapper.findByDate(dt); - logs = logs.stream().filter(log -> log.getBooleanValue("editable")) - .filter(log -> clearIds.isEmpty() || clearIds.contains(log.getString("clearing_id"))) - .collect(Collectors.toList()); - if (logs.isEmpty()) { - throw new NotFoundException(); - } - return logs; - } - - private List mergeBatchSettleClients(List details) { - Map> sameBankDetails = details.stream() - .filter(this::detailEnabledMergeSettle) - .collect(Collectors.groupingBy(this::detailGroupingId)); - List mergedSettleDetails = sameBankDetails.values().stream() - .map(this::mergeDetailGroup).collect(Collectors.toList()); - List relatedDetailIds = sameBankDetails.values().stream() - .flatMap(group -> group.stream().map(detail -> detail.getInteger("clear_detail_id"))) - .collect(Collectors.toList()); - details.removeIf(detail -> relatedDetailIds.contains(detail.getInteger("clear_detail_id"))); - details.addAll(mergedSettleDetails); - return details; - } - - private JSONObject mergeDetailGroup(List details) { - JSONObject first = details.get(0); - int clientId = details.stream().map(detail -> detail.getInteger("parent_client_id")) - .filter(Objects::nonNull) - .findAny().orElse(first.getIntValue("client_id")); - JSONObject cli = clientManager.getClientInfo(clientId); - String moniker = cli.getString("client_moniker"); - String bsb = first.getString("bsb_no"); - String accountNo = first.getString("account_no"); - String accountName = first.getString("account_name"); - String settleBank = first.getString("settle_bank"); - BigDecimal clearingAmount = details.stream().map(detail -> detail.getBigDecimal("clearing_amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - JSONObject merged = new JSONObject(); - merged.put("client_id", clientId); - merged.put("client_moniker", moniker); - merged.put("bsb_no", bsb); - merged.put("account_no", accountNo); - merged.put("account_name", accountName); - merged.put("settle_bank", settleBank); - merged.put("clearing_amount", clearingAmount); - return merged; - } - - private String detailGroupingId(JSONObject detail) { - String cliPId = detail.getString("parent_client_id"); - if (cliPId == null) { - cliPId = detail.getString("client_id"); - } - String bsb = detail.getString("bsb_no"); - String accountNo = detail.getString("account_no"); - return String.join("_", cliPId, bsb, accountNo); - } - - private boolean detailEnabledMergeSettle(JSONObject detail) { - String extParams = detail.getString("ext_params"); - if (extParams != null) { - try { - JSONObject ext = JSON.parseObject(extParams); - return ext.getBooleanValue("merge_settle"); - } catch (JSONException e) { - return false; - } - } - return false; - } - - @Override - public List getAba(Date dt, List logs) { - List files = new ArrayList<>(); - for (JSONObject log : logs) { - List details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id")); - details = mergeBatchSettleClients(details); - String remark = extractSettleRemark(log); - BalanceGroup group = BalanceGroup.valueOf(log.getString("balance_group")); - files.addAll(generateSettleAbaFiles(dt, group, details, log.getDate("operate_time"), remark)); - } - return files; - } - - public String extractSettleRemark(JSONObject log) { - return Optional.ofNullable(StringUtils.defaultIfEmpty(log.getString("plan_detail"), null)) - .map(JSON::parseObject) - .map(plan -> StringUtils.defaultIfEmpty(plan.getString("remark"), plan.getString("plan_id"))) - .orElse(""); - } - - private byte[] generateSettleXlsxFile(Date dt, List settlements, String bank) throws IOException { - try (Workbook wb = new XSSFWorkbook()) { - Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd")); - int rowNum = 0; - for (JSONObject settle : settlements) { - if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { - continue; - } - if (bank != null && !Objects.equals(settle.getString("settle_bank"), bank)) { - continue; - } - Row row = sheet.createRow(rowNum++); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("bsb_no")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("account_no")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("account_name")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - } - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - wb.write(bos); - bos.flush(); - return bos.toByteArray(); - } - } - - @Override - public void settlementAba(Date dt, HttpServletResponse resp) throws IOException { - List logs = clearingLogMapper.findByDate(dt); - if (logs.isEmpty()) { - throw new NotFoundException(); - } - List files = new ArrayList<>(); - - for (JSONObject log : logs) { - List details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id")); - details = mergeBatchSettleClients(details); - BalanceGroup group = BalanceGroup.valueOf(log.getString("balance_group")); - files.addAll(generateSettleAbaFiles(dt, group, details, log.getDate("operate_time"), extractSettleRemark(log))); - } - OutputStream ous = resp.getOutputStream(); - if (files.size() == 1) { - ABAFile file = files.get(0); - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + file.filename()); - ous.write(file.output(1)); - ous.flush(); - IOUtils.closeQuietly(ous); - } else { - String zipName = "Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd") + RandomStringUtils.random(8, false, true) + "_aba.zip"; - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + zipName); - ZipOutputStream zos = new ZipOutputStream(ous); - Map bankCounts = new HashMap<>(); - for (ABAFile file : files) { - String filename = file.filename(); - zos.putNextEntry(new ZipEntry(filename)); - int serializeNo = bankCounts.get(file.bank()) == null ? 1 : bankCounts.get(file.bank()) + 1; - bankCounts.put(file.bank(), serializeNo); - IOUtils.write(file.output(serializeNo), zos); - } - zos.flush(); - IOUtils.closeQuietly(zos); - } - } - - @Override - public List getCustomizedSettleDaily(Date date) { - DateTime dtFrom = new DateTime(date); - DateTime dtTo = dtFrom.plusDays(1); - List logs = customizedSettleLogMapper.listByDate(dtFrom.toDate(), dtTo.toDate()); - logs.forEach(log -> log.put("aba_file", String.format("/sys/settlement/customized_settle/%s/aba_file", log.getIntValue("log_id")))); - return logs; - } - - @Override - public void getCustomizedSettleABA(int logId, HttpServletResponse response) { - JSONObject log = customizedSettleLogMapper.find(logId); - if (log == null) { - throw new NotFoundException("Settle log not found"); - } - ABAFile file = buildCustomizedABAFile(log); - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=" + file.filename()); - try (OutputStream ous = response.getOutputStream()) { - ous.write(file.output(1)); - ous.flush(); - } catch (IOException e) { - throw new ServerErrorException("Output failed", e); - } - } - - private ABAFile buildCustomizedABAFile(JSONObject log) { - String bank = log.getString("settle_bank"); - BalanceGroup group = BalanceGroup.valueOf(log.getString("balance_group")); - JSONObject settle = new JSONObject(); - settle.put("settle_bank", bank); - settle.put("clearing_amount", log.getBigDecimal("amount")); - settle.put("client_id", log.getIntValue("client_id")); - settle.put("bsb_no", log.getString("bsb_no")); - settle.put("account_no", log.getString("account_no")); - settle.put("account_name", log.getString("account_name")); - settle.put("client_moniker", log.getString("client_moniker")); - ABAFile file = generateSettleAbaFile(bank, group, new Date(), Collections.singletonList(settle)); - String filename = String.format("[%s]Manual_Settle_%s_%s.aba", log.getIntValue("log_id"), log.getString("client_moniker"), DateTime.now().toString("yyyyMMdd")); - file.setFilename(filename); - return file; - } - - @Override - public JSONObject sendCustomizedSettleMail(List logIds) { - JSONObject result = new JSONObject(); - try { - Date date = DateTime.now().withTimeAtStartOfDay().toDate(); - String title = (PlatformEnvironment.getEnv().isDebug() ? "[TEST]" : "") + "Royalpay Manual Settlement Files " + DateFormatUtils.format(date, "yyyyMMdd"); - List customizedLogs = logIds.stream().map(customizedSettleLogMapper::find) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - List abaFileList = customizedLogs.stream().map(this::buildCustomizedABAFile).collect(Collectors.toList()); - List attachList = abaFileList.stream() - .map(aba -> new JSONObject(Map.of("name", aba.filename(), - "content", Base64.encodeBase64String(aba.output(0))))) - .collect(Collectors.toList()); - - Context ctx = new Context(); - ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy")); - ctx.setVariable("abaFiles", abaFileList); - BigDecimal total = abaFileList.stream().map(ABAFile::getTotalSettleAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - ctx.setVariable("totalAmount", total.setScale(2, RoundingMode.DOWN).toPlainString()); - final String content = thymeleaf.process("mail/settlement_mail", ctx); - // 测试用地址 - JSONObject config = sysConfigManager.getSysConfig(); - String mailId = mailService.sendEmail(title, config.getString("settle_mail_to"), config.getString("settle_mail_cc"), content, attachList); - - JSONObject settleMailRecord = new JSONObject(); - settleMailRecord.put("send_date", new Date()); - settleMailRecord.put("clearing_date", date); - settleMailRecord.put("email_id", mailId); - if (StringUtils.isEmpty(mailId)) { - result.put("result", 1); - result.put("msg", "System error"); - settleMailRecord.put("mail_status", 0); - settleMailRecord.put("notice_status", 0); - logSettleMailMapper.save(settleMailRecord); - return result; - } else { - settleMailRecord.put("mail_status", 1); - settleMailRecord.put("notice_status", 0); - logSettleMailMapper.save(settleMailRecord); - } - String detailDescription = customizedLogs.stream() - .map(log -> String.format("[%s]%s-%s", log.getString("log_id"), - log.getString("client_moniker"), log.getBigDecimal("amount"))) - .collect(Collectors.joining(",")); - sendTaskFinishMessages(ManagerRole.FINANCIAL_STAFF, "人工清算文件已发送清算方:" + detailDescription, "发送清算通知"); - } catch (URISyntaxException | IOException e) { - logger.error("调用服务发送邮件时错误", e); - throw new ServerErrorException("IOError", e); - } - result.put("result", 0); - result.put("msg", "已发送"); - return result; - } - - @Override - public void getSettlementFilesForBatch(String batchId, HttpServletResponse resp) throws IOException { - int clearingId = Integer.parseInt(batchId); - JSONObject clearing = clearingLogMapper.findById(clearingId); - if (clearing == null) { - throw new NotFoundException("Clearing batch " + batchId + " not found"); - } - List details = clearingDetailMapper.listReportsOfSettlement(clearingId); - details = mergeBatchSettleClients(details); - Date settleDate = clearing.getDate("settle_date"); - Date opTime = clearing.getDate("operate_time"); - String zipName = "Merchant_Settlement_Info_" + DateFormatUtils.format(opTime, "yyyyMMddHHmmss") + "_all.zip"; - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + zipName); - OutputStream ous = resp.getOutputStream(); - - BalanceGroup group = BalanceGroup.valueOf(clearing.getString("balance_group")); - List abaFiles = generateSettleAbaFiles(settleDate, group, details, opTime, extractSettleRemark(clearing)); - try (ZipOutputStream zos = new ZipOutputStream(ous)) { - for (ABAFile aba : abaFiles) { - zos.putNextEntry(new ZipEntry(aba.filename())); - IOUtils.write(aba.output(1), zos); - } - exportAllBankXlsFiles(zos, details, opTime); - zos.flush(); - } - } - - private List generateSettleAbaFiles(Date dt, BalanceGroup group, List settlements, Date operateTime, String remark) { - List banks = settlements.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList()); - return banks.stream().map(bank -> generateSettleAbaFile(bank, group, dt, settlements)) - .peek(file -> file.setOperateTime(operateTime)) - .peek(file -> file.setRemark(remark)) - .collect(Collectors.toList()); - } - - private ABAFile generateSettleAbaFile(String bank, BalanceGroup group, Date dt, List settlements) { - ABAFile aba = ABATemplate.getConfig().initFile(group, bank, dt); - for (JSONObject settle : settlements) { - if (!bank.equals(settle.getString("settle_bank"))) { - continue; - } - if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { - continue; - } - JSONObject client = clientManager.getClientInfo(settle.getIntValue("client_id")); - String remarkTpl = client.getString("settle_remark_tpl"); - if (StringUtils.isEmpty(remarkTpl)) { - remarkTpl = sysConfigManager.getSysConfig().getString("settle.remark_template"); - if (StringUtils.isEmpty(remarkTpl)) { - remarkTpl = "RoyalPay{date(MMdd)}{moniker}"; - } - } - - String remark = new SettleRemarkTemplateDescriber(remarkTpl, settle, dt).compile(); - aba.addSettleMerchant(settle.getString("bsb_no"), settle.getString("account_no"), settle.getString("account_name"), - settle.getBigDecimal("clearing_amount"), remark); - } - return aba; - } - - private byte[] generateSettleCSVFile(Date settleDate, List details) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - CSVPrinter csv = new CSVPrinter(new BufferedWriter(new OutputStreamWriter(bos)), CSVFormat.DEFAULT); - String heading = "Client Moniker,Currency,Gross Amount,Service Charge,Net Amount,BSB,Account No,Account Name,Settlement Date"; - csv.printRecord((Object[]) heading.split(",")); - String settlementDate = DateFormatUtils.format(settleDate, "dd/MM/yyyy"); - for (JSONObject detail : details) { - if (detail.getDoubleValue("clearing_amount") == 0) { - continue; - } - String grossAmount = detail.getBigDecimal("gross_amount").setScale(2, RoundingMode.HALF_UP).toPlainString() + " @ " - + detail.getBigDecimal("rate").setScale(2, RoundingMode.HALF_UP).toPlainString() + "%"; - String totalCharge = detail.getBigDecimal("total_charge").setScale(2, RoundingMode.HALF_UP).toPlainString(); - String clearingAmount = detail.getBigDecimal("clearing_amount").setScale(2, RoundingMode.HALF_UP).toPlainString(); - String[] values = {detail.getString("client_moniker"), "AUD", grossAmount, totalCharge, clearingAmount, detail.getString("bsb_no"), - detail.getString("account_no"), detail.getString("account_name"), settlementDate}; - csv.printRecord((Object[]) values); - } - csv.flush(); - csv.close(); - return bos.toByteArray(); - } - - private byte[] generateTransactionCSVFile(List transactions) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - CSVPrinter csv = new CSVPrinter(new BufferedWriter(new OutputStreamWriter(bos)), CSVFormat.DEFAULT); - String heading = "System Transaction Id,Order Id,Client Moniker,Device Id,Transaction Currency,Transaction Amount,Clearing Currency,Clearing Amount,Channel,Transaction Time,Clearing Status"; - csv.printRecord((Object[]) heading.split(",")); - - for (JSONObject transaction : transactions) { - String transactionTime = DateFormatUtils.format(transaction.getDate("transaction_time"), "dd/MM/yyyy h:mm:ss a", Locale.ENGLISH); - int multiply = "Credit".equals(transaction.getString("transaction_type")) ? 1 : -1; - BigDecimal transactionAmount = transaction.getBigDecimal("transaction_amount").multiply(BigDecimal.valueOf(multiply)).setScale(2, - RoundingMode.HALF_DOWN); - BigDecimal clearingAmount = transaction.getBigDecimal("clearing_amount").multiply(BigDecimal.valueOf(multiply)).setScale(2, - RoundingMode.HALF_DOWN); - String[] values = {transaction.getString("system_transaction_id"), transaction.getString("order_id"), transaction.getString("client_id"), - transaction.getString("device_id"), transaction.getString("transaction_currency"), transactionAmount.toPlainString(), - transaction.getString("clearing_currency"), clearingAmount.toPlainString(), transaction.getString("channel"), transactionTime, "0"}; - csv.printRecord((Object[]) values); - } - csv.flush(); - csv.close(); - return bos.toByteArray(); - } - - private boolean isClientIgnored(JSONObject transaction) { - int clientId = transaction.getIntValue("client_id"); - JSONObject clientConfig = clientConfigService.find(clientId); - return clientConfig.getBooleanValue("skip_clearing"); - } - - @Override - public List getCleanLogs(ClearingLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - return transactionMapper.listSettlementLogTotal(params); - } - - @Override - public JSONObject getCleanLogsInClients(ClearingLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(); - DateVaildUtil.validDateDuration(params.getDate("from"), params.getDate("to"), MAX_TRACK_DAYS); - if (query.getClientMoniker() != null && !query.getClientMoniker().isEmpty()) { - JSONObject client = clientManager.getClientInfoByMoniker(query.getClientMoniker()); - } - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - PageList logs = transactionMapper.listSettlementLogInClients(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("total.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public JSONObject analysisCleanLogs(ClearingLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(); - DateVaildUtil.validDateDuration(params.getDate("from"), params.getDate("to"), MAX_TRACK_DAYS); - if (query.getClientMoniker() != null && !query.getClientMoniker().isEmpty()) { - JSONObject client = clientManager.getClientInfoByMoniker(query.getClientMoniker()); - } - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - return transactionMapper.analysisSettlementLog(params); - } - - @Override - public JSONObject rateWarnings() { - JSONObject warnings = new JSONObject(); - List rateInDanger = clientRateMapper.listClientsWithNoRateConfig(); - for (JSONObject client : rateInDanger) { - Date expiryTime = client.getDate("expiry_time"); - client.put("generatable", expiryTime != null); - if (expiryTime != null) { - client.put("expiry_time", DateFormatUtils.format(client.getDate("expiry_time"), "dd/MM/yyyy")); - } - } - warnings.put("no_rate", rateInDanger); - List rateExpiring = clientRateMapper.listClientsWithRateExpiring(PlatformEnvironment.getEnv().rateWarningDays()); - for (JSONObject client : rateExpiring) { - Calendar expiry = Calendar.getInstance(); - expiry.setTime(client.getDate("expiry_time")); - client.put("generatable", rateGeneratable(expiry)); - client.put("expiry_time", DateFormatUtils.format(client.getDate("expiry_time"), "dd/MM/yyyy")); - client.put("active_time", DateFormatUtils.format(client.getDate("active_time"), "dd/MM/yyyy")); - } - warnings.put("rate_warning", rateExpiring); - return warnings; - } - - @Override - public JSONObject autoGenerateRate(String clientMoniker, JSONObject manager) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - List clientRates = clientRateMapper.listClientRates(clientId, "Wechat"); - Calendar expire = Calendar.getInstance(); - if (clientRates.isEmpty()) { - expire.setTime(DateUtils.truncate(new Date(), Calendar.DATE)); - } else { - JSONObject latestRate = clientRates.get(clientRates.size() - 1); - expire.setTime(latestRate.getDate("expiry_time")); - } - if (!rateGeneratable(expire)) { - throw new BadRequestException("error.settlement.season_invalid"); - } - - Calendar prevQuarterStart = previousQuarter(expire); - Calendar prevQuarterEnd = Calendar.getInstance(); - prevQuarterEnd.setTime(prevQuarterStart.getTime()); - prevQuarterEnd.add(Calendar.MONTH, 3); - prevQuarterEnd.add(Calendar.DATE, -1); - double total = transactionMapper.analysisTotalTransactions(clientId, prevQuarterStart.getTime(), prevQuarterEnd.getTime()); - JSONObject rateCfg = rateMapper.getRateConfig("wechat", total); - JSONObject newRate = new JSONObject(); - newRate.put("client_id", clientId); - newRate.put("rate_name", "Wechat"); - newRate.put("rate_value", rateCfg.getDoubleValue("rate_value")); - Calendar start = Calendar.getInstance(); - start.setTime(expire.getTime()); - start.add(Calendar.DATE, 1); - newRate.put("active_time", start.getTime()); - Calendar end = previousQuarter(Calendar.getInstance()); - end.add(Calendar.MONTH, 6); - end.add(Calendar.DATE, -1); - newRate.put("expiry_time", end.getTime()); - clientRateMapper.saveRate(newRate); - - return newRate; - } - - @Override - public List listSettledDatesInMonth(Date mon) { - List settledDates = clearingLogMapper.listSettlementDatesInMonth(mon); - List datePatterns = new ArrayList<>(); - for (Date dt : settledDates) { - datePatterns.add(DateFormatUtils.format(dt, "yyyy-MM-dd")); - } - return datePatterns; - } - - @Override - public JSONObject listClearingTransactions(int client_id, String clearingDetailId, JSONObject partner) { - JSONObject client = clientManager.getClientInfo(client_id); - Assert.notNull(client, "Client not exists"); - int parent_client_id = client.getIntValue("parent_client_id"); - if (partner.get("client_id") != null) { - if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) { - throw new ForbiddenException("No Permission"); - } - } - JSONObject clearClient = clearingDetailMapper.listReport(clearingDetailId, client_id); - if (clearClient == null) { - throw new NotFoundException(); - } - List transactions = transactionMapper.listTransactionsOfClearingOrder(clearClient.getIntValue("clear_detail_id"), - new PageBounds(Order.formString("order_id.asc"))); - String timezone_client = client.getString("timezone"); - if (timezone_client != null) { - transactions.parallelStream().forEach(p -> { - TimeZoneUtils.switchTimeZone(p, timezone_client, "transaction_time"); - }); - } - clearClient.put("report", transactions); - List channels = clearingDetailAnalysisMapper.listReportChannels(clearClient.getString("clear_detail_id")); - JSONObject channelsObj = new JSONObject(); - for (JSONObject channel : channels) { - channelsObj.put(channel.getString("channel"), channel); - } - clearClient.put("channels", channelsObj); - clearClient.put("client_moniker", client.getString("client_moniker")); - return clearClient; - } - - @Override - public JSONObject listClearingTransactionsByMergeSettle(int client_id, String reportDate, JSONObject partner) { - JSONObject client = clientManager.getClientInfo(client_id); - Assert.notNull(client, "Client not exists"); - int parent_client_id = client.getIntValue("parent_client_id"); - if (partner.get("client_id") != null) { - if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) { - throw new ForbiddenException("No Permission"); - } - } - JSONObject clearClient = clearingDetailMapper.listReportOfMergeSettle(reportDate, client_id); - if (clearClient == null) { - throw new NotFoundException(); - } - List transactions = transactionMapper.listTransactionsOfMergeSettleClearingOrder(reportDate, client_id, - new PageBounds(Order.formString("order_id.asc"))); - - String timezone_client = client.getString("timezone"); - if (timezone_client != null) { - transactions.parallelStream().forEach(p -> { - TimeZoneUtils.switchTimeZone(p, timezone_client, "transaction_time"); - }); - } - clearClient.put("report", transactions); - List channels = clearingDetailAnalysisMapper.listReportChannelsOfMergeSettle(reportDate, client_id); - JSONObject channelsObj = new JSONObject(); - for (JSONObject channel : channels) { - channelsObj.put(channel.getString("channel"), channel); - } - clearClient.put("channels", channelsObj); - clearClient.put("client_moniker", client.getString("client_moniker")); - return clearClient; - } - - @Override - public Map channelAndDayOfAnalysis(int client_id, String clearingDetailId, String channel, JSONObject partner) { - JSONObject client = clientManager.getClientInfo(client_id); - Assert.notNull(client, "Client not exists"); - int parent_client_id = client.getIntValue("parent_client_id"); - - if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) { - throw new ForbiddenException("No Permission"); - } - return getDayAnalysisMap(clearingDetailId, channel, client); - } - - @Override - public Map channelAndDayOfMergeSettleAnalysis(int client_id, String reportDate, String channel, JSONObject partner) { - JSONObject client = clientManager.getClientInfo(client_id); - Assert.notNull(client, "Client not exists"); - int parent_client_id = client.getIntValue("parent_client_id"); - - if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) { - throw new ForbiddenException("No Permission"); - } - JSONObject parentClient = clientManager.getClientInfo(parent_client_id); - return getDayAnalysisMapOfMergeSettle(reportDate, channel, parentClient); - } - - private Map getDayAnalysisMap(String clearingDetailId, String channel, JSONObject client) { - List transactions = transactionMapper.listTransactionsOfClearingOrder(Integer.parseInt(clearingDetailId), - new PageBounds(Order.formString("order_id.asc"))); - String timezone_client = client.getString("timezone"); - if (!channel.equals("null")) { - transactions = transactions.stream().filter(t -> t.getString("channel").equals(channel)).collect(Collectors.toList()); - } - List dateKeysList = new ArrayList<>(); - dateKeysList.add("transaction_time"); - if (timezone_client != null) { - transactions.parallelStream().forEach(p -> { - TimeZoneUtils.switchTimeZone(p, timezone_client, "transaction_time"); - }); - TimeZoneUtils.switchTimeZoneToString(transactions, timezone_client, TimeZoneUtils.PATTERN_DATE, dateKeysList); - } - - Map> dayTransactionsMap = transactions.stream().collect(Collectors.groupingBy(x -> x.getString("transaction_time").substring(0, 10))); - Map dayAnalysisMap = new TreeMap<>(); - for (Map.Entry> entry : dayTransactionsMap.entrySet()) { - JSONObject analysis = new JSONObject(); - List transactionsOfDay = entry.getValue(); - - BigDecimal total_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("clearing_amount")).map(t -> t.getBigDecimal("clearing_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal total_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("clearing_amount")).map(t -> t.getBigDecimal("clearing_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal total_charge_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("total_surcharge")).map(t -> t.getBigDecimal("total_surcharge")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal total_charge_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("total_surcharge")).map(t -> t.getBigDecimal("total_surcharge")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal net_amount_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("settle_amount")).map(t -> t.getBigDecimal("settle_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal net_amount_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("settle_amount")).map(t -> t.getBigDecimal("settle_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal tax_amount_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("tax_amount")).map(t -> t.getBigDecimal("tax_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal tax_amount_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("tax_amount")).map(t -> t.getBigDecimal("tax_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - - BigDecimal tax_amount = tax_amount_credit.subtract(tax_amount_debit); - analysis.put("total_credit", total_credit.setScale(2, RoundingMode.HALF_UP)); - analysis.put("total_debit", total_debit.setScale(2, RoundingMode.HALF_UP)); - analysis.put("net_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP)); - analysis.put("clearing_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP)); - analysis.put("tax_amount", tax_amount.setScale(2, RoundingMode.HALF_UP)); - analysis.put("total_surcharge", total_charge_credit.subtract(total_charge_debit).setScale(2, RoundingMode.HALF_UP)); - analysis.put("total_charge", total_charge_credit.subtract(total_charge_debit).add(tax_amount).setScale(2, RoundingMode.HALF_UP)); - analysis.put("gross_amount", total_credit.subtract(total_debit).setScale(2, RoundingMode.HALF_UP)); - dayAnalysisMap.put(entry.getKey(), analysis); - } - return dayAnalysisMap; - } - - private Map getDayAnalysisMapOfMergeSettle(String reportDate, String channel, JSONObject client) { - List transactions = transactionMapper.listTransactionsOfMergeSettleClearingOrder(reportDate, client.getIntValue("client_id"), - new PageBounds(Order.formString("order_id.asc"))); - String timezone_client = client.getString("timezone"); - if (!channel.equals("null")) { - transactions = transactions.stream().filter(t -> t.getString("channel").equals(channel)).collect(Collectors.toList()); - } - List dateKeysList = new ArrayList<>(); - dateKeysList.add("transaction_time"); - if (timezone_client != null) { - transactions.parallelStream().forEach(p -> { - TimeZoneUtils.switchTimeZone(p, timezone_client, "transaction_time"); - }); - TimeZoneUtils.switchTimeZoneToString(transactions, timezone_client, TimeZoneUtils.PATTERN_DATE, dateKeysList); - } - - Map> dayTransactionsMap = transactions.stream().collect(Collectors.groupingBy(x -> x.getString("transaction_time").substring(0, 10))); - Map dayAnalysisMap = new TreeMap<>(); - for (Map.Entry> entry : dayTransactionsMap.entrySet()) { - JSONObject analysis = new JSONObject(); - List transactionsOfDay = entry.getValue(); - - BigDecimal total_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("clearing_amount")).map(t -> t.getBigDecimal("clearing_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal total_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("clearing_amount")).map(t -> t.getBigDecimal("clearing_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal total_charge_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("total_surcharge")).map(t -> t.getBigDecimal("total_surcharge")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal total_charge_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("total_surcharge")).map(t -> t.getBigDecimal("total_surcharge")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal net_amount_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("settle_amount")).map(t -> t.getBigDecimal("settle_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal net_amount_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("settle_amount")).map(t -> t.getBigDecimal("settle_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal tax_amount_credit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Credit")).filter(t -> t.containsKey("tax_amount")).map(t -> t.getBigDecimal("tax_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal tax_amount_debit = transactionsOfDay.stream().filter(t -> t.getString("transaction_type").equals("Debit")).filter(t -> t.containsKey("tax_amount")).map(t -> t.getBigDecimal("tax_amount")).reduce(BigDecimal.ZERO, BigDecimal::add); - - BigDecimal tax_amount = tax_amount_credit.subtract(tax_amount_debit); - analysis.put("total_credit", total_credit.setScale(2, RoundingMode.HALF_UP)); - analysis.put("total_debit", total_debit.setScale(2, RoundingMode.HALF_UP)); - analysis.put("net_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP)); - analysis.put("clearing_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP)); - analysis.put("tax_amount", tax_amount.setScale(2, RoundingMode.HALF_UP)); - analysis.put("total_surcharge", total_charge_credit.subtract(total_charge_debit).setScale(2, RoundingMode.HALF_UP)); - analysis.put("total_charge", total_charge_credit.subtract(total_charge_debit).add(tax_amount).setScale(2, RoundingMode.HALF_UP)); - analysis.put("gross_amount", total_credit.subtract(total_debit).setScale(2, RoundingMode.HALF_UP)); - dayAnalysisMap.put(entry.getKey(), analysis); - } - return dayAnalysisMap; - } - - @Override - public void exportListClearingTransactions(int clientId, String clearingDetailId, JSONObject partner, HttpServletResponse resp) { - OutputStream ous = null; - try { - JSONObject clearTransation = listClearingTransactions(clientId, clearingDetailId, partner); - resp.setContentType("application/octet-stream;"); - Date reportDate = clearTransation.getDate("report_date"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyy-MM-dd") + ".xlsx"); - ous = resp.getOutputStream(); - Workbook wb = new XSSFWorkbook(); - Cell cell = null; - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - - //红色字体提示 - Font font2 = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font2.setFontHeightInPoints((short) 10); - font2.setColor(HSSFColor.RED.index); - CellStyle analysisStyle2 = wb.createCellStyle(); - analysisStyle2.setFont(font2); - - Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd")); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"process date", "description", "order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", - "Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No", "Dev Remark"}; - String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - JSONObject channels = clearTransation.getJSONObject("channels"); - - for (Object o : clearTransation.getJSONArray("report")) { - JSONObject settle = (JSONObject) o; - if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { - continue; - } - row = sheet.createRow(++rowNum); - Date cleartime = (Date) settle.get("clearing_time"); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(cleartime, "yyyy-MM-dd")); - - - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("description")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); - Calendar calendar = (Calendar) settle.get("transaction_time"); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone())); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); - if (settle.getInteger("gateway") != null) { - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); - } else { - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue("-"); - } - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).toPlainString()); - cell = row.createCell(8, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getString("transaction_type")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); - cell = row.createCell(10, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("display_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("display_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("display_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(11, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("transaction_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("transaction_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("transaction_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(12, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("clearing_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? "" - : channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%"); - //手续费 + gst - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" - : settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString()); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? "" - : settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell = row.createCell(16, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("settle_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("settle_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.containsKey("order_detail") ? settle.getString("order_detail") : settle.getString("remark")); - String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-"); - JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); - String clientDevRemark = "-"; - if (device != null) { - clientDevId = device.getString("client_dev_id"); - clientDevRemark = device.getString("remark"); - } - row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); - row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); - } - row = sheet.createRow(++rowNum); - for (int i = 0; i < analysis.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(analysisStyle); - cell.setCellValue(analysis[i]); - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_payment")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_refund")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("gross_amount")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("tax_amount")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_charge")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("clearing_amount")); - wb.write(ous); - ous.flush(); - } catch (IOException e) { - } finally { - IOUtils.closeQuietly(ous); - } - } - - @Override - public void exportTransactionsByReportDate(String reportDate, JSONObject partner, HttpServletResponse resp) { - OutputStream ous = null; - try { - JSONObject clearTransation = listClearingTransactionsByMergeSettle(partner.getIntValue("client_id"), reportDate, partner); - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + "Merchant_Settlement_Info_" + reportDate + ".xlsx"); - ous = resp.getOutputStream(); - Workbook wb = new XSSFWorkbook(); - Cell cell = null; - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - - //红色字体提示 - Font font2 = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font2.setFontHeightInPoints((short) 10); - font2.setColor(HSSFColor.RED.index); - CellStyle analysisStyle2 = wb.createCellStyle(); - analysisStyle2.setFont(font2); - - Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + reportDate); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"Client Moniker", "Short Name", "order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", - "Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No", "Dev Remark"}; - String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - JSONObject channels = clearTransation.getJSONObject("channels"); - - for (Object o : clearTransation.getJSONArray("report")) { - JSONObject settle = (JSONObject) o; - if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { - continue; - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_moniker")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("short_name")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); - Calendar calendar = (Calendar) settle.get("transaction_time"); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone())); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); - if (settle.getInteger("gateway") != null) { - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); - } else { - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue("-"); - } - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).toPlainString()); - cell = row.createCell(8, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getString("transaction_type")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); - cell = row.createCell(10, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("display_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("display_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("display_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(11, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("transaction_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("transaction_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("transaction_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(12, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("clearing_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? "" - : channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%"); - //手续费 + gst - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" - : settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString()); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? "" - : settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell = row.createCell(16, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? "" - : "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal("settle_amount").setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal("settle_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail")); - String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-"); - JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); - String clientDevRemark = "-"; - if (device != null) { - clientDevId = device.getString("client_dev_id"); - clientDevRemark = device.getString("remark"); - } - row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); - row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); - } - row = sheet.createRow(++rowNum); - for (int i = 0; i < analysis.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(analysisStyle); - cell.setCellValue(analysis[i]); - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_payment")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_refund")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("gross_amount")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("tax_amount")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_charge")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("clearing_amount")); - wb.write(ous); - ous.flush(); - } catch (IOException e) { - } finally { - IOUtils.closeQuietly(ous); - } - } - - @Override - public List getSettlementMonthReport(int year, int monthOfYear) { - return clearingLogMapper.getSettlementMonthReport(year, monthOfYear); - } - - @Override - public void writeSettlementMonthReportToExcel(int year, int monthOfYear, OutputStream ous) throws IOException { - try { - Workbook workbook = new XSSFWorkbook(); - Sheet sheet = workbook.createSheet(); - Row titleRow = sheet.createRow(0); - CellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setAlignment(CellStyle.ALIGN_CENTER); - setCellStringValue(titleRow, 0, "清算日期", titleStyle); - setCellStringValue(titleRow, 1, "净交易额(扣除退款)", titleStyle); - setCellStringValue(titleRow, 2, "腾讯清算总额", titleStyle); - setCellStringValue(titleRow, 3, "清算给商户总额", titleStyle); - setCellStringValue(titleRow, 4, "RoyalPay手续费", titleStyle); - NumberFormat format = DecimalFormat.getInstance(); - format.setMinimumFractionDigits(2); - format.setMaximumFractionDigits(2); - List report = getSettlementMonthReport(year, monthOfYear); - int row = 1; - CurrencyStyleFormatter currencyFormatter = new CurrencyStyleFormatter(); - currencyFormatter.setCurrency(Currency.getInstance("AUD")); - currencyFormatter.setRoundingMode(RoundingMode.DOWN); - for (JSONObject settlement : report) { - Row dataRow = sheet.createRow(row++); - CellStyle dataStyle = workbook.createCellStyle(); - dataStyle.setAlignment(CellStyle.ALIGN_RIGHT); - setCellStringValue(dataRow, 0, DateFormatUtils.format(settlement.getDate("settle_date"), "yyyy-MM-dd"), dataStyle); - setCellStringValue(dataRow, 1, format.format(settlement.getDoubleValue("gross_amount")), dataStyle); - setCellStringValue(dataRow, 2, format.format(settlement.getDoubleValue("wechat_settlement")), dataStyle); - setCellStringValue(dataRow, 3, format.format(settlement.getDoubleValue("net_amount")), dataStyle); - setCellStringValue(dataRow, 4, format.format(settlement.getDoubleValue("royalpay_charge")), dataStyle); - } - for (int c = 0; c < 5; c++) { - sheet.autoSizeColumn(c); - } - workbook.write(ous); - ous.flush(); - } finally { - IOUtils.closeQuietly(ous); - } - } - - private void setCellStringValue(Row row, int column, String value, CellStyle dataStyle) { - Cell cell = row.createCell(column); - cell.setCellStyle(dataStyle); - cell.setCellType(Cell.CELL_TYPE_STRING); - cell.setCellValue(value); - } - - private boolean rateGeneratable(Calendar expire) { - Calendar now = Calendar.getInstance(); - expire = new GregorianCalendar(expire.get(Calendar.YEAR), expire.get(Calendar.MONTH), expire.get(Calendar.DATE)); - expire.add(Calendar.DATE, 1); - Calendar expireQuarter = previousQuarter(expire); - - int quarterNow = now.get(Calendar.MONTH) / 4; - int yearNow = now.get(Calendar.YEAR); - Calendar currentQuarter = new GregorianCalendar(yearNow, quarterNow * 3, 1); - return currentQuarter.after(expireQuarter); - } - - private Calendar previousQuarter(Calendar calendar) { - int month = calendar.get(Calendar.MONTH); - int year = calendar.get(Calendar.YEAR); - int quarter = month / 3 - 1; - return new GregorianCalendar(year, quarter * 3, 1); - } - - @Override - public JSONObject getSettlementLogs(ClearingLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(); - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - PageList logs = clearingDetailMapper.listReportsOfSettlementLogs(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("report_date.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public void getTodaySettlementLogs() { - settlementSupport.sendSettleNotify(); - } - - @Override - public JSONObject sendSettlementMail(Date date, List clearIds, boolean autoMarkSent) { - JSONObject result = new JSONObject(); - try { - String title = (PlatformEnvironment.getEnv().isDebug() ? "[TEST]" : "") + "Royalpay Settlement File " + DateFormatUtils.format(date, "yyyyMMdd"); - String fileName1 = "Merchant_Settlement_Info_xlsx_" + DateFormatUtils.format(date, "yyyyMMdd"); - List attachList = new ArrayList<>(); - JSONObject attach1 = new JSONObject(); - List clearLogs = getSettleLogs(date, clearIds); - List xlsxFileList = getXlsx(date, clearLogs); - if (xlsxFileList.size() > 1) { - fileName1 += ".zip"; - attach1.put("content", Base64.encodeBase64String(getZipByteArr(xlsxFileList))); - } else { - fileName1 += ".xlsx"; - attach1.put("content", Base64.encodeBase64String((byte[]) xlsxFileList.get(0).get("byteArr"))); - } - attach1.put("name", fileName1); - attachList.add(attach1); - - JSONObject attach2 = new JSONObject(); - List abaFileList = getAba(date, clearLogs); - String fileName2 = "Merchant_Settlement_Info_aba_" + DateFormatUtils.format(date, "yyyyMMdd"); - if (abaFileList.size() > 1) { - fileName2 += ".zip"; - List entities = new ArrayList<>(); - int index = 0; - for (ABAFile file : abaFileList) { - JSONObject entity = new JSONObject(); - entity.put("name", file.filename()); - entity.put("byteArr", file.output(index++)); - entities.add(entity); - } - attach2.put("content", Base64.encodeBase64String(getZipByteArr(entities))); - - } else { - fileName2 += ".aba"; - attach2.put("content", Base64.encodeBase64String(abaFileList.get(0).output(1))); - } - attach2.put("name", fileName2); - attachList.add(attach2); - - Context ctx = new Context(); - ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy")); - ctx.setVariable("abaFiles", abaFileList); - BigDecimal total = abaFileList.stream().map(ABAFile::getTotalSettleAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - ctx.setVariable("totalAmount", total.setScale(2, RoundingMode.DOWN).toPlainString()); - final String content = thymeleaf.process("mail/settlement_mail", ctx); - // 测试用地址 - JSONObject config = sysConfigManager.getSysConfig(); - String mailId = mailService.sendEmail(title, config.getString("settle_mail_to"), config.getString("settle_mail_cc"), content, attachList); - - JSONObject settleMailRecord = new JSONObject(); - settleMailRecord.put("send_date", new Date()); - settleMailRecord.put("clearing_date", date); - settleMailRecord.put("email_id", mailId); - if (StringUtils.isEmpty(mailId)) { - result.put("result", 1); - result.put("msg", "System error"); - settleMailRecord.put("mail_status", 0); - settleMailRecord.put("notice_status", 0); - logSettleMailMapper.save(settleMailRecord); - return result; - } else { - settleMailRecord.put("mail_status", 1); - settleMailRecord.put("notice_status", 0); - logSettleMailMapper.save(settleMailRecord); - } - String detailDescription = clearLogs.stream() - .map(log -> String.format("[%s]%s", log.getString("clearing_id"), - ExtParamsUtils.getExtParamsValue(log.getString("plan_detail"), - detail -> StringUtils.defaultIfEmpty(detail.getString("remark"), detail.getString("plan_id"))))) - .collect(Collectors.joining(",")); - sendTaskFinishMessages(ManagerRole.FINANCIAL_STAFF, "清算文件已发送清算方:" + detailDescription, "发送清算通知"); - if (autoMarkSent) { - if (!clearIds.isEmpty()) { - clearingLogMapper.lockSettlementsById(clearLogs.stream().map(log -> log.getString("clearing_id")).collect(Collectors.toList())); - } else { - clearingLogMapper.lockSettlements(date); - } - } - } catch (IOException e) { - logger.error("生成excel字节数组发生错误", e); - throw new ServerErrorException("IOError", e); - } catch (URISyntaxException e) { - logger.error("调用服务发送邮件时错误", e); - throw new ServerErrorException("IOError", e); - } - result.put("result", 0); - result.put("msg", "已发送"); - return result; - } - - @Override - public void sendCheckCode(Date date, JSONObject manager) { - String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); - if (!StringUtils.isEmpty(value)) { - throw new ForbiddenException("The verification code has been sent"); - } - String bindId = RandomStringUtils.random(6, false, true); - stringRedisTemplate.boundValueOps(reidsCheckCodeKey).set(bindId, 10, TimeUnit.MINUTES); - MpWechatApi mpWechatApi = mpWechatApiProvider.getApi("wepay"); - String templateId = mpWechatApi.getTemplateId("settlement-check-code"); - for (String s : open_ids) { - TemplateMessage msg = new TemplateMessage(s, templateId, null); - msg.put("first", manager.getString("display_name") + "正在发送清算文件,请及时确认。", "#990033"); - msg.put("keyword1", bindId, "#000000"); - msg.put("keyword2", "10分钟内有效", "#000000"); - mpWechatApi.sendTemplateMessage(msg); - } - - } - - // 清算通知发送完成 - private void sendTaskFinishMessages(ManagerRole managerRole, String statusString, String taskName) { - try { - List managers = managerMapper.listDetailsByRole(null, managerRole.getMask()); - publisher.publishEvent(new TaskFinishNotifyEvent(this, taskName, statusString, managers, true)); - } catch (Exception e) { - logger.error("发送模板消息失败", e); - } - } - - private TemplateMessage initManagerTemplate(String openId, String url, String templateId, String first, String keyword1) { - TemplateMessage msg = new TemplateMessage(openId, templateId, url); - msg.put("first", first, "#00c000"); - msg.put("keyword1", keyword1, "#000000"); - msg.put("keyword2", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"), "#000000"); - msg.put("remark", "更多信息请查看后台", "#00c000"); - return msg; - } - - @Override - public List findLogSettleByDate(Date date) { - return logSettleMailMapper.findByDate(date); - } - - @Override - public JSONObject validTransactions(Date dt, boolean fix, boolean b, boolean b1, boolean isSendMessage) { - if (!b) { - JSONObject reportItem = validationLogMapper.findByDate(dt); - if (reportItem != null) { - return JSON.parseObject(reportItem.getString("result")); - } - } - OrderValidationResult report = channelValidationTask.validTransactions(dt); - JSONObject log = new JSONObject(); - log.put("valid_date", dt); - log.put("create_time", new Date()); - log.put("result", report.getReport().toJSONString()); - validationLogMapper.removeByDate(dt); - validationLogMapper.save(log); - // 是否发送消息通知 - if (isSendMessage) { - List developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask()); - List channelResults = report.getChannelResults(); - boolean valid = channelResults.stream().map(OrderValidationChannelResult::isSuccess).reduce(Boolean::logicalAnd).orElse(true); - StringBuilder statusString = new StringBuilder("订单校对已完成,状态:" + (valid ? "🌤️【成功】" : "🌨️【失败】")); - statusString.append("\r\n"); - for (OrderValidationChannelResult info : channelResults) { - if (info.isSuccess()) { - continue; - } - statusString.append(info.getChannel().getChannelCode()).append(": [ ").append(info.isSuccess() ? "成功" : "失败") - .append(StringUtils.defaultIfBlank(info.getErrorMsg(), "")).append(" ]").append("\r\n"); - } - publisher.publishEvent(new TaskFinishNotifyEvent(this, PlatformEnvironment.getEnv().getCompany() + " 订单校对", statusString.toString(), developers, valid)); - } - return JSON.parseObject(log.getString("result")); - } - - @Override - @Transactional - public void distributeBank(Date date, int clearingId, JSONObject bankDistribution) { - if (!DateUtils.isSameDay(date, new Date())) { - throw new ForbiddenException("Only today's settlement file can be modified"); - } - JSONObject log = clearingLogMapper.findById(clearingId); - if (log == null || !DateUtils.isSameDay(log.getDate("settle_date"), date)) { - throw new NotFoundException("Settlement log not found"); - } - if (!log.getBooleanValue("editable")) { - throw new ForbiddenException("Settlement log has been sent and unable to edit"); - } - ABAConfig config = ABATemplate.getConfig(); - BalanceGroup group = BalanceGroup.valueOf(log.getString("balance_group")); - String defaultBank = config.getRemainsTo(group); - clearingDetailMapper.updateAllBanks(defaultBank, clearingId); - List details = clearingDetailMapper.listReportsOfSettlement(clearingId); - details = mergeBatchSettleClients(details); - details.sort((log1, log2) -> { - if (StringUtils.equals(defaultBank, log1.getString("account_bank")) == - StringUtils.equals(defaultBank, log2.getString("account_bank"))) { - //两个银行都是defaultBank或者都不是defaultBank, all true or all false,比较清算金额,金额大的在前 - return log2.getBigDecimal("clearing_amount").compareTo(log1.getBigDecimal("clearing_amount")); - } - //有一个是defaultBank,defaultBank在后 - if (defaultBank.equals(log1.getString("account_bank"))) { - return -1; - } else { - return 1; - } - }); - bankDistribution.remove(defaultBank); - for (String bank : bankDistribution.keySet()) { - List detailIds = new ArrayList<>(); - ABAConfig.ABABase base = config.getBankBase(bank); - if (base == null) { - throw new BadRequestException("Invalid bank code:" + bank); - } - if (base.acceptBalanceGroup(group)) { - throw new BadRequestException("Balance group not match:" + group + ":" + bank); - } - BigDecimal bankAmount = bankDistribution.getBigDecimal(bank); - for (JSONObject detail : details) { - String detailBank = detail.getString("settle_bank"); - if (defaultBank.equals(detailBank)) { - BigDecimal amount = detail.getBigDecimal("clearing_amount"); - if (amount.compareTo(BigDecimal.ZERO) > 0 && bankAmount.compareTo(amount) > 0) { - detailIds.add(detail.getString("clear_detail_id")); - bankAmount = bankAmount.subtract(amount); - detail.put("settle_bank", bank); - } - } - } - clearingDetailMapper.updateBanks(bank, detailIds); - - } - } - - @Override - public void lockClearingLog(Date date, int clearingId) { - if (!DateUtils.isSameDay(date, new Date())) { - throw new ForbiddenException("Only today's settlement file can be modified"); - } - JSONObject log = clearingLogMapper.findById(clearingId); - if (log == null || !DateUtils.isSameDay(log.getDate("settle_date"), date)) { - throw new NotFoundException("Settlement log not found"); - } - clearingLogMapper.setLogEditable(false, clearingId); - } - - @Override - @Transactional - public void undoSettle(Date date, int clearingId) { - if (!DateUtils.isSameDay(date, new Date())) { - throw new ForbiddenException("Only today's settlement file can be modified"); - } - JSONObject log = clearingLogMapper.findById(clearingId); - if (log == null || !DateUtils.isSameDay(log.getDate("settle_date"), date)) { - throw new NotFoundException("Settlement log not found"); - } - if (!log.getBooleanValue("editable")) { - throw new ForbiddenException("Settlement log has been sent and unable to edit"); - } - if (!locker.lock("settle_task", 3600_000)) { - throw new ServerErrorException("Settle Task Running!"); - } - try { - List details = clearingDetailMapper.listReportsOfSettlement(clearingId); - List detailsWithDistributedSurcharge = details.stream().filter(detail -> detail.getBigDecimal("distributed_surcharge").compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList()); - if (!detailsWithDistributedSurcharge.isEmpty()) { - for (JSONObject detail : detailsWithDistributedSurcharge) { - releaseDistributedSurcharge(detail); - } - } - transactionMapper.deleteSettlementTransaction(clearingId); -// transactionMapper.removePreSettleRemark(clearingId); - transactionMapper.removeSettleRemark(clearingId); - preSettleTaskMapper.resetClearStatus(clearingId); - clearingDetailAnalysisMapper.clearAnalysis(clearingId); - taskManualSettleMapper.rollbackExecutedTask(clearingId); - clearingDetailMapper.deleteSettleLogs(clearingId); - clearingLogMapper.deleteSettleLogs(clearingId); - } finally { - locker.unlock("settle_task"); - } - } - - @Override - public ByteArrayResource downloadBatchSettleReportXlsx(int batchId) { - List mchList = clearingDetailMapper.batchReport(batchId); - if (mchList.isEmpty()) { - throw new NotFoundException("No batch found"); - } - ExcelTemplate template = new ExcelTemplate() - .addSheet("Report") - .addStringColumn("client_moniker").setFontFactory(new FontFactory(true)).ok() - .addStringColumn("short_name").ok() - .addStringColumn("org_name").ok() - .addStringColumn("bd_user_name").ok() - .addStringColumn("city").ok() - .addStringColumn("clean_days").ok() - .addColumn(Cell.CELL_TYPE_NUMERIC, "clearing_amount", json -> json.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN)).setCellStyle(ExcelTemplate.STYLE_RIGHT).ok() - .addDateColumn("yyyy-MM-dd", "settle_date_from").ok() - .addDateColumn("yyyy-MM-dd", "settle_date_to").ok() - .build(); - ExcelFileBuilder builder = new ExcelFileBuilder(template); - builder.bindSingleSheetData(mchList); - try (ByteArrayOutputStream bout = new ByteArrayOutputStream()) { - builder.build(bout); - bout.flush(); - return new ByteArrayResource(bout.toByteArray()) { - @Override - public String getFilename() { - return "settle_report_" + DateFormatUtils.format(mchList.get(0).getDate("report_date"), "yyyyMMdd") + "_" + batchId + ".xlsx"; - } - }; - } catch (IOException e) { - throw new RuntimeException("Export excel failed", e); - } - } - - @Override - public JSONObject findSettleLog(int clearingId) { - JSONObject clearing = clearingLogMapper.findById(clearingId); - if (clearing == null) { - throw new NotFoundException("Settle record not found:" + clearingId); - } - return clearing; - } - - @Override - public JSONObject findClearingDetail(int clearingId, String clientMoniker) { - List reports = clearingDetailMapper.listReportsOfSettlement(clearingId); - return reports.stream().filter(report -> report.getString("client_moniker").equals(clientMoniker)).findFirst() - .orElseThrow(() -> new NotFoundException("No clearing log found for " + clientMoniker)); - } - - @Override - public ChannelReconciliationFileContent downloadChannelReconciliationFile(String pid, Date billDate, boolean noCache, String channel, String billType) { - return channelReconciliationFile.download(new ChannelReconciliationFileDownloadParameter(pid, billDate, channel, noCache, billType)); - } - - @Override - public TransactionStatus getTransactionStatus(String transactionId) { - TransactionStatus transactionStatus = transactionMapper.getTransactionStatusById(transactionId); - if (transactionStatus == null) { - throw new ParamInvalidException("date", "The transaction was not found"); - } - return transactionStatus.toSet(); - } - - private void releaseDistributedSurcharge(JSONObject clearingDetail) { - int clientId = clearingDetail.getIntValue("client_id"); - BigDecimal distributedSurcharge = clearingDetail.getBigDecimal("distributed_surcharge"); - String lockKey = "client_surcharge_account_processing:" + clientId; - locker.lock(lockKey, 30_000, 1000); - try { - JSONObject account = getClientSurchargeAccount(clientId); - BigDecimal balance = account.getBigDecimal("balance"); - BigDecimal newBalance = balance.add(distributedSurcharge); - JSONObject surchargeLog = new JSONObject(); - String logId = DateFormatUtils.format(new Date(), "yyyyMMdd") + clientId + RandomStringUtils.random(5, true, true).toUpperCase(); - surchargeLog.put("log_id", logId); - surchargeLog.put("client_id", clientId); - surchargeLog.put("clearing_detail_id", clearingDetail.getString("clear_detail_id")); - surchargeLog.put("settle_date", clearingDetail.getDate("report_date")); - surchargeLog.put("create_time", new Date()); - surchargeLog.put("amount", distributedSurcharge); - surchargeLog.put("total_surcharge", clearingDetail.getBigDecimal("total_charge")); - surchargeLog.put("tax_amount", clearingDetail.getBigDecimal("tax_amount")); - surchargeLog.put("type", "Credit"); - surchargeLog.put("post_balance", newBalance); - surchargeLog.put("remark", "settle revoke"); - clearingDistributedSurchargeMapper.save(surchargeLog); - clientsSurchargeAccountsMapper.updateBalance(clientId, newBalance); - } finally { - locker.unlock(lockKey); - } - } - - private JSONObject getClientSurchargeAccount(int clientId) { - JSONObject account = clientsSurchargeAccountsMapper.find(clientId); - if (account == null) { - account = new JSONObject(); - account.put("client_id", clientId); - account.put("create_time", new Date()); - account.put("balance", 0); - clientsSurchargeAccountsMapper.save(account); - } - return account; - } - - private byte[] getZipByteArr(List fileByteArrWithName) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ZipOutputStream zos = new ZipOutputStream(bos); - for (JSONObject jsonObject : fileByteArrWithName) { - zos.putNextEntry(new ZipEntry(jsonObject.getString("name"))); - IOUtils.write((byte[]) jsonObject.get("byteArr"), zos); - } - zos.flush(); - IOUtils.closeQuietly(zos); - return bos.toByteArray(); - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @Override - public void checkTodo(JSONObject manager, List notices) { - if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { - checkSettleDateConfig(notices); - rateWarningsCheck(notices); - } - } - - private void rateWarningsCheck(List notices) { - JSONObject rateWarnings = rateWarnings(); - if (rateWarnings.getJSONArray("no_rate").size() + rateWarnings.getJSONArray("rate_warning").size() > 0) { - String rateWarningSettingMsg = LocaleSupport.localeMessage("todo.rate.expire_warning"); - notices.add(new TodoNotice("clearing_rate", rateWarningSettingMsg, "#/analysis/clearing_logs/rate_warnings")); - } - } - - private void checkSettleDateConfig(List notices) { - Date lastSettleDate = calendarMapper.getLastSettleDate(); - Date today = DateUtils.truncate(new Date(), Calendar.DATE); - int days = Days.daysBetween(new DateTime(today), new DateTime(lastSettleDate)).getDays(); - if (days < 7) { - String settleDateSettingMsg = LocaleSupport.localeMessage("todo.settlement.date_setting"); - notices.add(new TodoNotice("settlement", settleDateSettingMsg, "#/analysis/clearing_logs/date_setting")); - } - } - - private JSONObject incrementalAnalysisTransLogs(List logs) { - final JSONObject analysis = new JSONObject(); - analysis.put("real_royalpay_charge", logs.parallelStream() - .map(log -> getSymbol(log).multiply(log.getBigDecimal("royal_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("incremental_charge", logs.parallelStream() - .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("incremental_tax", logs.parallelStream() - .filter(log -> StringUtils.equalsIgnoreCase("RP跨境商城", log.getString("source"))) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge")).divide(new BigDecimal(10), 2, RoundingMode.HALF_UP)) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - return analysis; - } - - private BigDecimal getSymbol(JSONObject log) { - return "Credit".equals(log.getString("transaction_type")) || "Settlement".equals(log.getString("channel")) ? BigDecimal.ONE : BigDecimal.valueOf(-1); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/MonikerStringUtils.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/MonikerStringUtils.java deleted file mode 100644 index f3e07037c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/MonikerStringUtils.java +++ /dev/null @@ -1,51 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core.impl; - -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import java.util.Arrays; -import java.util.stream.Stream; - -public class MonikerStringUtils { - private MonikerStringUtils() { - } - - public static String formatStringArray(String str) { - str = str.replace(",", ","); - str = str.replace(" ", ","); - str = str.replace("\r\n", ","); - str = str.replace("\n", ","); - str = str.replace("\r", ","); - String nStr = str.replace(",,", ","); - while (!nStr.equals(str)) { - str = nStr; - nStr = str.replace(",,", ","); - } - str = nStr; - if (str.endsWith(",")) { - str = StringUtils.substring(str, 0, -1); - } - if (str.startsWith(",")) { - str = StringUtils.substring(str, 1); - } - return str; - } - - public static Stream splitStringArray(String str) { - return Arrays.stream(formatStringArray(str).split(",")); - } - - public static JSONObject getSimplifiedClientsInfo(MerchantInfoProvider mchInfoProvider, String moniker) { - JSONObject info = mchInfoProvider.getClientInfoByMoniker(moniker); - if (info == null) { - return null; - } - JSONObject simple = new JSONObject(); - simple.put("client_moniker", info.getString("client_moniker")); - simple.put("company_name", info.getString("company_name")); - simple.put("clean_days", info.getIntValue("clean_days")); - simple.put("bd_user_name", info.getString("bd_user_name")); - return simple; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/PriorityListManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/PriorityListManagerImpl.java deleted file mode 100644 index 5745f2e08..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/PriorityListManagerImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core.impl; - -import au.com.royalpay.payment.manage.management.clearing.beans.PriorityModifyLog; -import au.com.royalpay.payment.manage.management.clearing.core.PriorityListManager; -import au.com.royalpay.payment.manage.mappers.system.SysSettlePlanMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.utils.id.IdUtil; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.data.domain.Sort; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -@Service -public class PriorityListManagerImpl implements PriorityListManager { - private static final String PRIORITY_ID = "id1_priority"; - private static final String PRIORITY_WEEKENDS_ID = "priority_weekend"; - public static final String KEY_WHITELIST_CLIENTS = "whitelist_clients"; - private final Logger logger = LoggerFactory.getLogger(getClass()); - private final MerchantInfoProvider mchInfoProvider; - private final MongoTemplate mongoTemplate; - private final SysSettlePlanMapper planMapper; - - public PriorityListManagerImpl(MerchantInfoProvider mchInfoProvider, MongoTemplate mongoTemplate, SysSettlePlanMapper planMapper) { - this.mchInfoProvider = mchInfoProvider; - this.mongoTemplate = mongoTemplate; - this.planMapper = planMapper; - } - - @Override - public List listPriorityMerchants() { - JSONObject detail = planMapper.findPlanDetail(PRIORITY_ID); - return MonikerStringUtils.splitStringArray(detail.getString(KEY_WHITELIST_CLIENTS)) - .map(moniker -> MonikerStringUtils.getSimplifiedClientsInfo(mchInfoProvider, moniker)) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - @Override - public JSONObject setMerchantPriority(String clientMoniker, JSONObject manager) { - JSONObject client = MonikerStringUtils.getSimplifiedClientsInfo(mchInfoProvider, clientMoniker); - if (client == null) { - throw new NotFoundException("Client " + clientMoniker + " not found"); - } - JSONObject detail = planMapper.findPlanDetail(PRIORITY_ID); - String clientMonikers = detail.getString(KEY_WHITELIST_CLIENTS); - List monikerList = MonikerStringUtils.splitStringArray(clientMonikers).collect(Collectors.toList()); - if (monikerList.stream().anyMatch(moniker -> moniker.equalsIgnoreCase(clientMoniker))) { - logger.debug("{} exists,ignore", clientMoniker); - throw new BadRequestException("Client exists"); - } - monikerList.add(clientMoniker.toUpperCase()); - String joinedMonikers = String.join(",", monikerList); - planMapper.setWhitelistClients(PRIORITY_ID, joinedMonikers); - planMapper.setWhitelistClients(PRIORITY_WEEKENDS_ID, joinedMonikers); - try { - PriorityModifyLog log = new PriorityModifyLog() - .setId(IdUtil.getId()) - .setClientMoniker(clientMoniker) - .setOperation(PriorityModifyLog.OP_ADD) - .setOperatorId(manager.getString("manager_id")) - .setOperatorName(manager.getString("display_name")) - .setCreateTime(new Date()); - mongoTemplate.insert(log); - } catch (Exception ignore) { - } - return client; - } - - @Override - public void removePriorityMerchant(String clientMoniker, JSONObject manager) { - JSONObject detail = planMapper.findPlanDetail(PRIORITY_ID); - String clientMonikers = detail.getString(KEY_WHITELIST_CLIENTS); - List monikerList = MonikerStringUtils.splitStringArray(clientMonikers).collect(Collectors.toList()); - if (!monikerList.removeIf(moniker -> moniker.equalsIgnoreCase(clientMoniker))) { - logger.debug("{} not exists,ignore", clientMoniker); - return; - } - String joinedMonikers = String.join(",", monikerList); - planMapper.setWhitelistClients(PRIORITY_ID, joinedMonikers); - planMapper.setWhitelistClients(PRIORITY_WEEKENDS_ID, joinedMonikers); - try { - PriorityModifyLog log = new PriorityModifyLog() - .setId(IdUtil.getId()) - .setClientMoniker(clientMoniker) - .setOperation(PriorityModifyLog.OP_REMOVE) - .setOperatorId(manager.getString("manager_id")) - .setOperatorName(manager.getString("display_name")) - .setCreateTime(new Date()); - mongoTemplate.insert(log); - } catch (Exception ignore) { - } - } - - @Override - public List getMerchantsModifyHistory() { - Date twoMonthAgo = DateUtils.addMonths(new Date(), -2); - Query query = new Query() - .limit(20) - .with(Sort.by(Sort.Direction.DESC, "createTime")) - .addCriteria(Criteria.where("createTime").gt(twoMonthAgo)); - return mongoTemplate.find(query, PriorityModifyLog.class); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleDelayConfigurerImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleDelayConfigurerImpl.java deleted file mode 100644 index d5eb104f7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleDelayConfigurerImpl.java +++ /dev/null @@ -1,283 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core.impl; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.management.clearing.beans.SettleDelayConfig; -import au.com.royalpay.payment.manage.management.clearing.core.SettleDelayConfigurer; -import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientSettleDelayConfMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeConstants; -import org.joda.time.LocalDate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import javax.annotation.Resource; - -/** - * Create by yixian at 2017-09-08 15:06 - */ -@Service -public class SettleDelayConfigurerImpl implements SettleDelayConfigurer { - @Resource - private ClientSettleDelayConfMapper clientSettleDelayConfMapper; - @Resource - private ClientManager clientManager; - @Resource - private CashbackService cashbackService; - @Resource - private TransactionMapper transactionMapper; - @Resource - private ClearingLogMapper clearingLogMapper; - @Resource - private ClearingDetailMapper clearingDetailMapper; - @Resource - private Locker locker; - @Resource - private RetailAppService retailAppService; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public JSONObject listAttendingClients(JSONObject params, int page, int limit) { - PageList clients = clientSettleDelayConfMapper.listClients(params, new PageBounds(page, limit, Order.formString("update_time.desc"))); - for (JSONObject client : clients) { - client.put("to_date", DateFormatUtils.format(client.getDate("to_date"), "yyyy/MM/dd")); - } - return PageListUtils.buildPageListResult(clients); - } - - @Override - public void configClient(String clientMoniker, SettleDelayConfig config, JSONObject manager) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - JSONObject conf = clientSettleDelayConfMapper.findClientConfIncludingDisabled(clientId); - if (conf == null) { - conf = new JSONObject(); - conf.put("add_time", new Date()); - conf.put("client_id", clientId); - } - conf.put("from_date", DateUtils.addDays(DateUtils.truncate(new Date(), Calendar.DATE), 1)); - if (manager != null) { - conf.put("config_manager", manager.getString("manager_id")); - } - conf.put("enabled", 1); - conf.put("update_time", new Date()); - conf.put("to_date", config.toDate()); - conf.put("surcharge_discount", config.getSurchargeDiscount()); - if (conf.getString("config_id") != null) { - clientSettleDelayConfMapper.update(conf); - } else { - clientSettleDelayConfMapper.save(conf); - } - - clientManager.setWeekendDelay(manager,clientMoniker,clientId, true); - - } - - @Override - public void disableClient(JSONObject account,String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - clientSettleDelayConfMapper.disableClient(client.getIntValue("client_id")); - clientManager.setWeekendDelay(account,clientMoniker,client.getIntValue("client_id"), false); - } - - @Override - public List getWeekendAnalysis(JSONObject params) { - List result = new ArrayList<>(); - List mondayClearingLog = clearingLogMapper.getMondayClearing(params.getDate("begin"), params.getDate("end")); - Map mondayClearingLogMap = new HashMap<>(); - for (JSONObject jsonObject : mondayClearingLog) { - mondayClearingLogMap.put(jsonObject.getInteger("operate_time"), jsonObject); - } - - List weekendAnalysisList = transactionMapper.getSettleDelayAnalysis(params.getDate("begin"), params.getDate("end")); - Map weekendAnalysisMap = new LinkedHashMap<>(); - for (JSONObject weekendAnalysis : weekendAnalysisList) { - - JSONObject tmpMapValue = weekendAnalysisMap.get(weekendAnalysis.getInteger("weekend")); - if (tmpMapValue != null) { - tmpMapValue.put("settle_amount", tmpMapValue.getBigDecimal("settle_amount").add(weekendAnalysis.getBigDecimal("settle_amount"))); - } else { - tmpMapValue = new JSONObject(); - tmpMapValue.put("weekend", weekendAnalysis.getIntValue("weekend")); - tmpMapValue.put("settle_amount", weekendAnalysis.getBigDecimal("settle_amount")); - tmpMapValue.put("transaction_amount", BigDecimal.ZERO); - weekendAnalysisMap.put(weekendAnalysis.getInteger("weekend"), tmpMapValue); - } - } - - List total_settle_amount = transactionMapper.getSettleDelayTotalTransaction(params.getDate("begin"), params.getDate("end")); - - for (JSONObject weekendAnalysis : total_settle_amount) { - - JSONObject tmpMapValue = weekendAnalysisMap.get(weekendAnalysis.getInteger("weekend")); - if (tmpMapValue != null) { - tmpMapValue.put("transaction_amount", tmpMapValue.getBigDecimal("transaction_amount").add(weekendAnalysis.getBigDecimal("settle_amount"))); - } else { - tmpMapValue = new JSONObject(); - tmpMapValue.put("weekend", weekendAnalysis.getIntValue("weekend")); - tmpMapValue.put("transaction_amount", weekendAnalysis.getBigDecimal("settle_amount")); - tmpMapValue.put("settle_amount", BigDecimal.ZERO); - weekendAnalysisMap.put(weekendAnalysis.getInteger("weekend"), tmpMapValue); - } - } - - - List cashBackList = cashbackService.getSettleDelayRecord(params); - Map cashBackMap = new HashMap<>(); - for (JSONObject jsonObject : cashBackList) { - DateTime dt = new DateTime(jsonObject.getDate("create_time")); - int weekOfYear = dt.getWeekOfWeekyear(); - JSONObject cashBackMapElement = cashBackMap.get(weekOfYear); - if (cashBackMapElement != null) { - cashBackMapElement.put("cashback_amount", cashBackMapElement.getBigDecimal("cashback_amount").add(jsonObject.getBigDecimal("cashback_amount"))); - } else { - cashBackMap.put(weekOfYear, jsonObject); - } - } - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMdd"); - for (Map.Entry entry : weekendAnalysisMap.entrySet()) { - JSONObject resultEntry = entry.getValue(); - JSONObject sunday = weekendAnalysisMap.get(resultEntry.getInteger("weekend") + 1); - Date saturday = null; - try { - saturday = sf.parse(String.valueOf(resultEntry.getInteger("weekend"))); - } catch (ParseException e) { - logger.info("获取延迟清算金额时 日期转换错误"); - } - if (sunday != null) { - if (resultEntry.getBigDecimal("settle_amount") == null) { - continue; - } - resultEntry.put("weekend", resultEntry.getIntValue("weekend") + 2); - resultEntry.put("settle_amount", resultEntry.getBigDecimal("settle_amount").add(sunday.getBigDecimal("settle_amount"))); - resultEntry.put("transaction_amount", resultEntry.getBigDecimal("transaction_amount").add(sunday.getBigDecimal("transaction_amount"))); - if (cashBackMap.containsKey(new DateTime(saturday).getWeekOfWeekyear() + 1)) { - resultEntry.put("cashback", cashBackMap.get(new DateTime(saturday).getWeekOfWeekyear() + 1).getBigDecimal("cashback_amount")); - } else { - resultEntry.put("cashback", 0); - } - if (mondayClearingLogMap.containsKey(resultEntry.getInteger("weekend"))) { - resultEntry.put("mon_net_amount", mondayClearingLogMap.get(resultEntry.getInteger("weekend")).getBigDecimal("net_amount")); - } else { - resultEntry.put("mon_net_amount", 0); - } - result.add(resultEntry); - } - } - return result; - } - - @Override - public PageList getClientRank(JSONObject params) { - return cashbackService.getSettleDelayRank(params, new PageBounds(params.getIntValue("page"), params.getIntValue("limit"))); - } - - @Override - @Transactional - public void addCashback(Date date) { - String key = "settle_delay_cashback"; - if (!locker.lock(key, 600_000)) { - return; - } - try { - date = DateUtils.truncate(date, Calendar.DATE); - LocalDate processDate = LocalDate.fromDateFields(date); - if (processDate.getDayOfWeek() != DateTimeConstants.TUESDAY) { - throw new BadRequestException("Not tuesday"); - } - LocalDate sunday = processDate.minusDays(processDate.getDayOfWeek()); - LocalDate saturday = sunday.minusDays(1); - List clientAttends = clientSettleDelayConfMapper.listClients(new JSONObject(), new PageBounds()); - for (JSONObject attend : clientAttends) { - Date monday = DateUtils.addDays(date, -1); - if (attend.getDate("from_date").after(monday) || attend.getDate("to_date").before(monday)) { - continue; - } - int clientId = attend.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - if (client == null) { - continue; - } - String clientMoniker = client.getString("client_moniker"); - JSONObject clearing = clearingDetailMapper.listReportByDate(date, clientId); - if (clearing == null) { - continue; - } - int detailId = clearing.getIntValue("clear_detail_id"); - List settleTrans = transactionMapper.listSettlementTransactions(detailId); - Assert.notEmpty(settleTrans, "No Settle History"); - String transactionOrderId = settleTrans.get(0).getString("order_id"); - List transactions = transactionMapper.listTransactionsOfClearingOrder(detailId, new PageBounds()); - BigDecimal totalSurcharge = BigDecimal.ZERO; - for (JSONObject transaction : transactions) { - Date day = transaction.getDate("transaction_time"); - LocalDate transactionDate = LocalDate.fromDateFields(day); - if (transactionDate.equals(sunday) || transactionDate.equals(saturday)) { - continue; - } - BigDecimal surcharge = transaction.getBigDecimal("clearing_amount").subtract(transaction.getBigDecimal("settle_amount")); - if ("Debit".equals(transaction.getString("transaction_type"))) { - surcharge = surcharge.multiply(BigDecimal.valueOf(-1)); - } - totalSurcharge = totalSurcharge.add(surcharge); - } - BigDecimal cashbackAmount = CurrencyAmountUtils.scale(totalSurcharge.multiply(attend.getBigDecimal("surcharge_discount")).divide(CommonConsts.HUNDRED, 2, RoundingMode.HALF_UP), PlatformEnvironment.getEnv().getForeignCurrency()); - String remark = "Surcharge cashback for " + saturday.toString("dd/MMM/yyyy", Locale.ENGLISH) + " ~ " + sunday.toString("dd/MMM/yyyy", Locale.ENGLISH); - if (cashbackAmount.compareTo(BigDecimal.ZERO) > 0) { - cashbackService.saveSurchargeDiscountCashback(clientId, clientMoniker, transactionOrderId, cashbackAmount, date, remark); - try { - if (!PlatformEnvironment.getEnv().isDebug()) { - JSONObject order = new JSONObject(); - order.put("order_id", transactionOrderId); - order.put("client_id", clientId); - retailAppService.sendCashbackMessage(cashbackAmount.toPlainString(), order);// app message - } - } catch (Exception e) { - logger.error("发送App消息失败", e); - } - } - } - } finally { - locker.unlock(key); - } - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java deleted file mode 100644 index 29c8fad34..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.core.impl; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.manage.management.clearing.beans.CustomizedSettleRequest; -import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksService; -import au.com.royalpay.payment.manage.management.clearing.web.ManualSettleTask; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.SysSettlePlanMapper; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.livecheck.AppLiveCheck; -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.http.MediaType; -import org.springframework.http.RequestEntity; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.ByteArrayHttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestClientResponseException; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.util.UriComponentsBuilder; - -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.util.Date; -import java.util.List; -import java.util.Objects; -import java.util.TimeZone; -import java.util.stream.Collectors; - -@Service -public class SettleTaskServiceImpl implements SettleTasksService { - private final Logger logger = LoggerFactory.getLogger(getClass()); - private final SysSettlePlanMapper planMapper; - private final StringRedisTemplate redisTemplate; - private final MerchantInfoProvider mchInfoProvider; - private final PaymentApi paymentApi; - private final TransactionMapper transactionMapper; - private final String prefix; - private final RestTemplate restTemplate; - private final String transactionHost; - private final AppLiveCheck appLiveCheck; - private static final String SETTLE_TASK_URI = "/dev/manual/settle_tasks"; - private static final String CUSTOMIZED_SETTLE_URI = "/dev/manual/customized_settle"; - - public SettleTaskServiceImpl(SysSettlePlanMapper planMapper, StringRedisTemplate redisTemplate, - MerchantInfoProvider mchInfoProvider, PaymentApi paymentApi, TransactionMapper transactionMapper, @Value("${app.redis.prefix}") String prefix, - @Value("${platform.services.transaction:http://127.0.0.1:6012}") String transactionHost, AppLiveCheck appLiveCheck) { - this.planMapper = planMapper; - this.redisTemplate = redisTemplate; - this.mchInfoProvider = mchInfoProvider; - this.paymentApi = paymentApi; - this.transactionMapper = transactionMapper; - this.prefix = prefix; - this.appLiveCheck = appLiveCheck; - this.restTemplate = new RestTemplateBuilder() - .messageConverters(new ByteArrayHttpMessageConverter(), - new StringHttpMessageConverter(StandardCharsets.UTF_8)) - .build(); - this.transactionHost = transactionHost; - } - - @Override - public List listPlans() { - return planMapper.listPlans(); - } - - private String statusKey() { - return prefix + ":settlement_progress"; - } - - @Override - public JSONObject currentProcessingStatus() { - String std = redisTemplate.boundValueOps(statusKey()).get(); - if (StringUtils.isEmpty(std)) { - JSONObject idleStatus = new JSONObject(); - idleStatus.put("processing", false); - idleStatus.put("interrupted", false); - return idleStatus; - } - JSONObject stdObj = JSON.parseObject(std); - boolean live = appLiveCheck.listLiveApps().contains(stdObj.getString("server_id")); - stdObj.put("processing", live); - if (!stdObj.getBooleanValue("processing")) { - stdObj.put("interrupted", true); - } - return stdObj; - } - - @Override - public List listMerchantsInfo(String mchMonikers) { - List monikers = MonikerStringUtils.splitStringArray(mchMonikers).collect(Collectors.toList()); - return monikers.parallelStream().map(moniker -> MonikerStringUtils.getSimplifiedClientsInfo(mchInfoProvider, moniker)) - .filter(Objects::nonNull).collect(Collectors.toList()); - } - - @Override - public void submitTasks(List tasks) { - URI uri = UriComponentsBuilder.fromHttpUrl(transactionHost).replacePath(SETTLE_TASK_URI) - .build().toUri(); - try { - String taskStr = JSON.toJSONString(tasks); - logger.info("submitting settlement task:{}--------->{}", uri, taskStr); - restTemplate.exchange(RequestEntity.post(uri).contentType(MediaType.APPLICATION_JSON) - .body(taskStr.getBytes(StandardCharsets.UTF_8)), String.class); - } catch (RestClientResponseException e) { - String resp = e.getResponseBodyAsString(); - try { - throw new ServerErrorException("Transaction response error:" + JSON.parseObject(resp).getString("message")); - } catch (JSONException e1) { - throw new ServerErrorException("Connect Transaction error:" + resp); - } - } catch (RestClientException e) { - throw new ServerErrorException("Connect Transaction error:" + e.getMessage()); - } - } - - @Override - public JSONObject submitCustomizedSettle(CustomizedSettleRequest settleRequest, JSONObject manager) { - URI uri = UriComponentsBuilder.fromHttpUrl(transactionHost).replacePath(CUSTOMIZED_SETTLE_URI) - .build().toUri(); - try { - JSONObject req = new JSONObject(); - req.put("client_moniker", settleRequest.getClientMoniker()); - req.put("amount", settleRequest.getAmount()); - req.put("clearing_status", settleRequest.getClearingStatus()); - req.put("balance_group", settleRequest.getBalanceGroup().name()); - req.put("operator", manager.getString("manager_id")); - req.put("force_settle", settleRequest.isForceSettle()); - String taskStr = JSON.toJSONString(req); - logger.info("submitting customized settlement task:{}--------->{}", uri, taskStr); - ResponseEntity result = restTemplate.exchange(RequestEntity.post(uri).contentType(MediaType.APPLICATION_JSON) - .body(taskStr.getBytes(StandardCharsets.UTF_8)), String.class); - return JSON.parseObject(result.getBody()); - } catch (RestClientResponseException e) { - String resp = e.getResponseBodyAsString(); - try { - JSONObject respJson = JSON.parseObject(resp); - throw new ServerErrorException(respJson.getString("message")); - } catch (JSONException e1) { - throw new ServerErrorException(resp); - } - } catch (RestClientException e) { - throw new ServerErrorException(e.getMessage()); - } - } - - @Override - public List analysisYesterdayTransaction() { - Date from = DateTime.now().withMillisOfDay(0).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone("Asia/Shanghai"))) - .minusDays(1).toDate(); - Date to = new DateTime(from).plusDays(1).toDate(); - List channels = paymentApi.channelsInGroup(BalanceGroup.NORMAL_CROSS_BORDER); - channels.remove("System"); - return transactionMapper.analysisByChannels(from, to, channels); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/handlers/SendWeekendDelayCashbackSaver.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/handlers/SendWeekendDelayCashbackSaver.java deleted file mode 100644 index 881694f43..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/handlers/SendWeekendDelayCashbackSaver.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.handlers; - -import au.com.royalpay.payment.core.events.SettleNotifySendingEvent; -import au.com.royalpay.payment.manage.management.clearing.core.SettleDelayConfigurer; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Calendar; -import java.util.Date; - -/** - * Create by yixian at 2017-12-25 13:48 - */ -@Service -public class SendWeekendDelayCashbackSaver implements ApplicationListener { - @Resource - private SettleDelayConfigurer settleDelayConfigurer; - - @Override - public void onApplicationEvent(SettleNotifySendingEvent event) { - Date eventTime = new Date(event.getEventTime()); - settleDelayConfigurer.addCashback(DateUtils.truncate(eventTime, Calendar.DATE)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/package-info.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/package-info.java deleted file mode 100644 index 63ce5a835..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 费率配置预警、读取清算结果 - * Created by yixian on 2017-01-09. - */ -package au.com.royalpay.payment.manage.management.clearing; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java deleted file mode 100644 index 6286ac685..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java +++ /dev/null @@ -1,59 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.mappers.log.ValidationLogMapper; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.util.*; - -/** - * @Description: - * @Author: lujian - * @Date: 2019/1/30 13:50 - */ -@Controller -@RequestMapping("/sys/financial") -public class ArrivalNoticeController { - - @Resource - private ValidationLogMapper validationLogMapper; - - @GetMapping("/notice") - public String noticePage(HashMap map, - @RequestParam("date") String date) throws ParseException { - - JSONArray reports = new JSONArray(); - Date dt = DateUtils.parseDate(date, "yyyyMMdd"); - JSONObject reportItem = validationLogMapper.findByDate(dt); - if (reportItem != null) { - JSONObject result = JSON.parseObject(reportItem.getString("result")); - reports = result.getJSONArray("channel_details"); - for (int i = 0; i < reports.size(); i++) { - JSONObject channelItem = reports.getJSONObject(i); - String channel = channelItem.getString("channel"); - if (channel.equals("Wechat") && result.containsKey("wechat_analysis")) { - JSONObject wechatAnalysis = result.getJSONObject("wechat_analysis"); - List analysis = new ArrayList<>(); - for (Map.Entry entry : wechatAnalysis.entrySet()) { - JSONObject oneMerchant = new JSONObject(); - oneMerchant.put("merchant_id", entry.getKey()); - oneMerchant.put("order_amount", ((JSONObject) JSON.toJSON(entry.getValue())).getJSONObject("wechat_analysis").getBigDecimal("order_amount")); - analysis.add(oneMerchant); - } - channelItem.put("analysis", analysis); - } - } - } - map.put("reports", reports); - map.put("title", "到账提醒"); - return "reports/arrival_notice"; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java deleted file mode 100644 index 59bb2dde9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java +++ /dev/null @@ -1,95 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.text.ParseException; -import java.util.List; -import java.util.Map; - -/** - * Created by davep on 2016-08-29. - */ -@RestController -@PartnerMapping(value = "/client/clean_logs", method = RequestMethod.GET) -public class CleanLogClientController { - @Resource - private CleanService cleanService; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @RequestMapping - public List listMonthCleanLogs(@RequestParam String month, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject client) { - try { - return cleanService.listClientCleanLogsForMonth(DateUtils.parseDate(month, new String[]{"yyyyMM"}), client.getIntValue("client_id")); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @RequestMapping("/{client_id}/settlement_logs/{clearingDetailId}") - public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - return cleanService.listClearingTransactions(client_id, clearingDetailId, partner); - } - - @RequestMapping("/{client_id}/settlement_logs/report_date/{reportDate}") - public JSONObject listClearingTransactionsOfMergeSettle(@PathVariable int client_id, @PathVariable String reportDate, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - JSONObject data = cleanService.listClearingTransactionsByMergeSettle(partner.getIntValue("client_id"), reportDate, partner); - data.put("report_date", reportDate); - return data; - } - - @RequestMapping("/{client_id}/settlement_logs/{clearingDetailId}/analysis/{channel}") - public Map channelAndDayOfAnalysis(@PathVariable int client_id, @PathVariable String clearingDetailId, - @PathVariable String channel, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - return cleanService.channelAndDayOfAnalysis(client_id, clearingDetailId,channel,partner); - } - - @RequestMapping("/{client_id}/settlement_logs/report_date/{reportDate}/analysis/{channel}") - public Map channelAndDayOfMergeSettleAnalysis(@PathVariable int client_id, @PathVariable String reportDate, - @PathVariable String channel, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - return cleanService.channelAndDayOfMergeSettleAnalysis(client_id, reportDate,channel,partner); - } - - @PartnerMapping("/{client_id}/settlement_logs/{clearingDetailId}/export") - public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse resp) { - cleanService.exportListClearingTransactions(client_id, clearingDetailId, partner, resp); - } - - @PartnerMapping("/{client_id}/settlement_logs/report_date/{reportDate}/export") - public void exportTransactionsByReportDate(@PathVariable int client_id, @PathVariable String reportDate, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse resp) { - cleanService.exportTransactionsByReportDate(reportDate, partner, resp); - } - - // @RequestMapping(value = "/{clearId}.json") - // public JSONObject getCleanLog(@PathVariable int clearId, @ModelAttribute(Consts.PARTNER_STATUS) JSONObject - // client) { - // return cleanService.getClientCleanLogJson(client.getIntValue("client_id"), clearId); - // } - // - // @RequestMapping(value = "/{clearId}.pdf") - // public void getCleanLogPDF(@PathVariable int clearId, @ModelAttribute(Consts.PARTNER_STATUS) JSONObject client, - // HttpServletResponse response) throws IOException { - // response.setContentType("application/pdf"); - // cleanService.getClientCleanLogPDF(client.getIntValue("client_id"), clearId, response.getWriter()); - // } - // - // @RequestMapping(value = "/{clearId}.csv") - // public void getCleanLogCSV(@PathVariable int clearId, @ModelAttribute(Consts.PARTNER_STATUS) JSONObject client, - // HttpServletResponse response) throws IOException { - // response.setContentType("application/csv"); - // cleanService.getClientCleanLogCSV(client.getIntValue("client_id"), clearId, response.getWriter()); - // } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogManagementController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogManagementController.java deleted file mode 100644 index e80798a7e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogManagementController.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.tradelog.beans.ClearingLogQuery; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yishuqian on 04/11/2016. - */ -@RestController -@RequestMapping(value = "/sys/clean_logs", method = RequestMethod.GET) -@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DIRECTOR, ManagerRole.FINANCIAL_STAFF}) -public class CleanLogManagementController { - @Resource - private CleanService cleanService; - - @RequestMapping(value = "/logs") - public List getCleanLog(ClearingLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getCleanLogs(query, manager); - } - - @RequestMapping(value = "/clients") - public JSONObject getCleanLogInClients(ClearingLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getCleanLogsInClients(query, manager); - } - - @RequestMapping(value = "/analysis") - public JSONObject analysisCleanLog(ClearingLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.analysisCleanLogs(query, manager); - } - - @RequestMapping(value = "/settlement") - public JSONObject getSettlements(ClearingLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getSettlementLogs(query, manager); - } - - @PartnerMapping("/{client_id}/settlement_logs/{clearingDetailId}/export") - public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject partner, HttpServletResponse resp) { - cleanService.exportListClearingTransactions(client_id, clearingDetailId, partner, resp); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ClearingConfigController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ClearingConfigController.java deleted file mode 100644 index 89a9e4a61..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ClearingConfigController.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-01-09. - */ -@RestController -@RequestMapping("/manage/clearing") -public class ClearingConfigController { - @Resource - private CleanService cleanService; - - @ManagerMapping(value = "/rate_warnings", method = RequestMethod.GET, role = { ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF }) - public JSONObject getRateWarnings() { - return cleanService.rateWarnings(); - } - - @ManagerMapping(value = "/clients/{clientMoniker}/auto_rate", method = RequestMethod.PUT, role = { ManagerRole.ADMIN, ManagerRole.OPERATOR }) - public JSONObject generateRateAutomatically(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.autoGenerateRate(clientMoniker, manager); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java deleted file mode 100644 index 961caefda..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java +++ /dev/null @@ -1,170 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.core.beans.OrderValidationChannelResult; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.core.impls.LogChannelValidationStorage; -import au.com.royalpay.payment.core.validation.domain.ChannelValidationTask; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileContent; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.FileDownloadException; -import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.Charsets; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.ParseException; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Created by davep on 2016-09-02. - */ -@ManagerMapping(value = "/sys/financial", role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF}) -@RestController -public class FinancialController { - @Resource - private CleanService cleanService; - - @Resource - private LogChannelValidationStorage logChannelValidationStorage; - - @Resource - private ChannelValidationTask channelValidationTask; - - @GetMapping("/validated_dates/{month}") - public List listMonthValidatedDays(@PathVariable String month) { - try { - Date mon = DateUtils.parseDate(month, new String[]{"yyyyMM"}); - return cleanService.listValidatedDays(mon); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/order_validations/{date}") - public JSONObject getCheckReport(@PathVariable String date, @RequestParam(defaultValue = "false") boolean fix, - @RequestParam(name = "use_cache", defaultValue = "true") boolean useCache, - @RequestParam(name = "is_send_message", defaultValue = "false") boolean isSendMessage) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); - return cleanService.validTransactions(dt, fix, !useCache, false,isSendMessage); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/order_validation_new/{date}") - public Map> getCheckReportNew(@PathVariable String date) { - try { - Date dt = DateUtils.parseDate(date, "yyyyMMdd"); - List orderValidationChannelResults = logChannelValidationStorage.listDailyLogs(dt); - Map> collect = orderValidationChannelResults.stream().collect(Collectors.groupingBy(e -> e.getChannel().getChannelCode())); - return collect; - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @PostMapping("/mark/resolve/message") - public void markResolveMessage(@RequestBody JSONObject jsonObject) { - logChannelValidationStorage.markResolveMessage(jsonObject.getString("log_id"), jsonObject.getString("message")); - } - - @PostMapping("/redo_channel_validation/{date}") - public void redoChannelValidation(@PathVariable String date, @RequestBody JSONObject jsonObject) { - try { - Date dt = DateUtils.parseDate(date, "yyyyMMdd"); - channelValidationTask.redoChannelValidation(dt, jsonObject.getString("channel"), jsonObject.getBoolean("cache")); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/get/transaction/status/{transactionId}") - public TransactionStatus getTransactionStatus(@PathVariable String transactionId) { - if (transactionId.isEmpty()) { - throw new ParamInvalidException("date", "Transaction flow is empty"); - } - return cleanService.getTransactionStatus(transactionId); - } - - @GetMapping("/downloadChannelReconciliationFile") - public JSONObject downloadChannelReconciliationFile(@RequestParam(value = "pid") String pid, - @RequestParam(value = "billDate") String billDate, - @RequestParam(value = "noCache") boolean noCache, - @RequestParam(value = "billType", required = false) String billType, - @RequestParam(value = "channel") String channel, - HttpServletResponse response) { - ChannelReconciliationFileContent file = cleanService.downloadChannelReconciliationFile(pid, au.com.royalpay.payment.tools.utils.DateUtils.parseDate(billDate) - , noCache, channel, billType); - - - try (InputStream in = new ByteArrayInputStream(file.content())) { - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.name(), Charsets.UTF_8.name())); - response.setContentLength(file.length()); - response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); - OutputStream out = response.getOutputStream(); - byte[] buff = new byte[1024]; - int n; - while ((n = in.read(buff)) != -1) { - out.write(buff, 0, n); - } - } catch (IOException ex) { - throw new FileDownloadException(); - } - - return null; - } - - @GetMapping("/clean_logs") - public JSONObject getDailyTransactions(@RequestParam String date, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - try { - Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); - return cleanService.getClearDetails(dt, manager.getString("manager_id")); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/settlement/month_reports/{month}") - public List getMonthSettlementReport(@PathVariable String month) { - try { - Date dt = DateUtils.parseDate(month, new String[]{"yyyyMM"}); - DateTime monthDate = new DateTime(dt); - return cleanService.getSettlementMonthReport(monthDate.getYear(), monthDate.getMonthOfYear()); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/settlement/month_reports/{month}/xls") - public void getMonthSettlementReportExcel(@PathVariable String month, HttpServletResponse response) throws IOException { - try { - Date dt = DateUtils.parseDate(month, new String[]{"yyyyMM"}); - DateTime monthDate = new DateTime(dt); - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.addHeader("Content-Disposition", "attachment; filename=SettleReport_" + DateFormatUtils.format(dt, "yyyy_MM") + ".xlsx"); - OutputStream ous = response.getOutputStream(); - cleanService.writeSettlementMonthReportToExcel(monthDate.getYear(), monthDate.getMonthOfYear(), ous); - } catch (ParseException e) { - throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ManualSettleTask.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ManualSettleTask.java deleted file mode 100644 index ec65af537..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ManualSettleTask.java +++ /dev/null @@ -1,91 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import com.alibaba.fastjson.PropertyNamingStrategy; -import com.alibaba.fastjson.annotation.JSONType; -import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; - -import java.util.Date; -import java.util.List; - -@JSONType(naming = PropertyNamingStrategy.SnakeCase) -public class ManualSettleTask { - private String taskId; - private String settleDate; - private String planRefId; - private String remark; - private String lastSettleDate; - private int[] disabledCleanDays; - - private List whitelistClients; - private boolean followSubPartner; - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public Date getSettleDateValue() { - return StringUtils.isEmpty(settleDate) ? DateTime.now().withMillisOfDay(0).toDate() : DateTime.parse(settleDate).toDate(); - } - - public String getSettleDate() { - return settleDate; - } - - public void setSettleDate(String settleDate) { - this.settleDate = settleDate; - } - - public String getPlanRefId() { - return planRefId; - } - - public void setPlanRefId(String planRefId) { - this.planRefId = planRefId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getLastSettleDate() { - return lastSettleDate; - } - - public void setLastSettleDate(String lastSettleDate) { - this.lastSettleDate = lastSettleDate; - } - - public int[] getDisabledCleanDays() { - return disabledCleanDays; - } - - public void setDisabledCleanDays(int[] disabledCleanDays) { - this.disabledCleanDays = disabledCleanDays; - } - - public List getWhitelistClients() { - return whitelistClients; - } - - public void setWhitelistClients(List whitelistClients) { - this.whitelistClients = whitelistClients; - } - - public boolean isFollowSubPartner() { - return followSubPartner; - } - - public void setFollowSubPartner(boolean followSubPartner) { - this.followSubPartner = followSubPartner; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleDelayConfigController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleDelayConfigController.java deleted file mode 100644 index bfed97611..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleDelayConfigController.java +++ /dev/null @@ -1,80 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.analysis.beans.SettleDelayQuery; -import au.com.royalpay.payment.manage.cashback.core.CashbackService; -import au.com.royalpay.payment.manage.management.clearing.beans.SettleDelayConfig; -import au.com.royalpay.payment.manage.management.clearing.core.SettleDelayConfigurer; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -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 java.util.List; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Create by yixian at 2017-09-07 16:57 - */ -@RequestMapping(value = "/manage/settle_delay") -@RestController -public class SettleDelayConfigController { - @Resource - private SettleDelayConfigurer settleDelayConfigurer; - @Resource - private CashbackService cashbackService; - - @ManagerMapping(value = "/clients", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject listAttendingClients(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "15") int limit) { - // todo params - return settleDelayConfigurer.listAttendingClients(new JSONObject(), page, limit); - } - - @ManagerMapping(value = "/clients/{clientMoniker}", method = RequestMethod.PUT, role = { ManagerRole.ADMIN }) - public void configClient(@PathVariable String clientMoniker, @RequestBody @Valid SettleDelayConfig config, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - settleDelayConfigurer.configClient(clientMoniker, config, manager); - } - - @ManagerMapping(value = "/clients/{clientMoniker}", method = RequestMethod.DELETE, role = { ManagerRole.ADMIN }) - public void disableClient( @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker) { - settleDelayConfigurer.disableClient(manager,clientMoniker); - } - - @ManagerMapping(value = "/traAnalysis", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public List traAnalysis(SettleDelayQuery params) { - return settleDelayConfigurer.getWeekendAnalysis(params.params()); - } - - @ManagerMapping(value = "/ranking", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject getRanking(SettleDelayQuery params) { - PageList clientRank = settleDelayConfigurer.getClientRank(params.params()); - if(clientRank==null){ - return null; - } - return PageListUtils.buildPageListResult(clientRank); - } - - @ManagerMapping(value = "/total", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) - public JSONObject getTotal() { - JSONObject params = new JSONObject(); - params.put("cashback_type",2); - return cashbackService.analysisCashback(params); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java deleted file mode 100644 index 4bff06ba9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java +++ /dev/null @@ -1,76 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.management.clearing.beans.CustomizedSettleRequest; -import au.com.royalpay.payment.manage.management.clearing.beans.PriorityModifyLog; -import au.com.royalpay.payment.manage.management.clearing.core.PriorityListManager; -import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@ManagerMapping(value = "/sys/settle_tasks", role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.DEVELOPER}) -public class SettleTasksController { - private final SettleTasksService svc; - private final PriorityListManager priorityListManager; - - public SettleTasksController(SettleTasksService svc, PriorityListManager priorityListManager) { - this.svc = svc; - this.priorityListManager = priorityListManager; - } - - @GetMapping("/yesterday_trans_analysis") - public List getYesterdayTransAnalysis() { - return svc.analysisYesterdayTransaction(); - } - - @GetMapping("/plans") - public List listPlans() { - return svc.listPlans(); - } - - @GetMapping("/current_progress") - public JSONObject getProcessingStatus() { - return svc.currentProcessingStatus(); - } - - @PostMapping("/merchants") - public List listMerchants(@RequestBody JSONObject mch) { - return svc.listMerchantsInfo(mch.getString("monikers")); - } - - @PostMapping - public JSONObject submitTasks(@RequestBody List tasks) { - svc.submitTasks(tasks); - return getProcessingStatus(); - } - - @GetMapping("/priority_merchants") - public List listPriorityMerchants() { - return priorityListManager.listPriorityMerchants(); - } - - @PutMapping("/priority_merchants/{clientMoniker}") - public JSONObject setMerchantPriority(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return priorityListManager.setMerchantPriority(clientMoniker, manager); - } - - @DeleteMapping("/priority_merchants/{clientMoniker}") - public void removePriorityMerchant(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - priorityListManager.removePriorityMerchant(clientMoniker, manager); - } - - @GetMapping("/priority_merchants_modify_history") - public List getMerchantsModifyHistory() { - return priorityListManager.getMerchantsModifyHistory(); - } - - @ManagerMapping(value = "/customized_settle", method = RequestMethod.POST, role = ManagerRole.DEVELOPER) - public JSONObject sendCustomizedSettle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody CustomizedSettleRequest req) { - return svc.submitCustomizedSettle(req, manager); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java deleted file mode 100644 index 0ae007f8e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java +++ /dev/null @@ -1,213 +0,0 @@ -package au.com.royalpay.payment.manage.management.clearing.web; - -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.support.abafile.ABATemplate; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.joda.time.DateTime; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-01-11. - */ -@RestController -@ManagerMapping(value = "/sys/settlement", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.GET) -public class SettlementDevController { - private final DateFormat monthFormat = new SimpleDateFormat("yyyyMM"); - private final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - @Resource - private CleanService cleanService; - - - @RequestMapping(value = "/month/{month}/settled_dates") - public List settledDates(@PathVariable String month) { - try { - Date mon = monthFormat.parse(month); - return cleanService.listSettledDatesInMonth(mon); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @RequestMapping("/reports/{date}") - public JSONObject settleReport(@PathVariable String date, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - try { - Date dt = dateFormat.parse(date); - return cleanService.getClearDetails(dt, manager.getString("manager_id")); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/clearings/{clearingId}/available_banks") - public JSONObject getAvailableBanks(@PathVariable int clearingId) { - JSONObject clearing = cleanService.findSettleLog(clearingId); - BalanceGroup group = BalanceGroup.valueOf(clearing.getString("balance_group")); - List banks = ABATemplate.getConfig().availableBanks(group); - JSONObject res = new JSONObject(); - res.put("remains_to", ABATemplate.getConfig().getRemainsTo(group)); - res.put("banks", banks); - return res; - } - - @GetMapping("/clearing/{clearingId}/client_detail/{clientMoniker}") - public JSONObject getClientSettleDetail(@PathVariable int clearingId, @PathVariable String clientMoniker) { - return cleanService.findClearingDetail(clearingId, clientMoniker); - } - - @PutMapping("/reports/{date}/clearings/{clearingId}/bank_distribution") - public void modifyClearingBank(@PathVariable String date, @PathVariable int clearingId, @RequestBody JSONObject bankDistribution) { - try { - Date dt = dateFormat.parse(date); - cleanService.distributeBank(dt, clearingId, bankDistribution); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @PutMapping("/reports/{date}/clearings/{clearingId}/lock") - public void lockClearingLog(@PathVariable String date, @PathVariable int clearingId) { - try { - Date dt = dateFormat.parse(date); - cleanService.lockClearingLog(dt, clearingId); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @DeleteMapping("/reports/{date}/clearings/{clearingId}") - @RequireManager(role = ManagerRole.DEVELOPER) - public void undoSettle(@PathVariable String date, @PathVariable int clearingId) { - try { - Date dt = dateFormat.parse(date); - cleanService.undoSettle(dt, clearingId); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @RequestMapping("/reports/{date}/settlement_csv") - public void getSettlementCsv(@PathVariable String date, HttpServletResponse resp) throws IOException { - try { - Date dt = dateFormat.parse(date); - cleanService.settlementCsv(dt, resp); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @RequestMapping("/reports/{date}/transaction_csv") - public void getTransactionCsv(@PathVariable String date, HttpServletResponse resp) throws IOException { - try { - Date dt = dateFormat.parse(date); - cleanService.transactionCsv(dt, resp); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @RequestMapping("/reports/{date}/settlement_xlsx") - public void getSettlementXlsx(@PathVariable String date, HttpServletResponse resp) throws IOException { - try { - Date dt = dateFormat.parse(date); - cleanService.settlementXlsx(dt, resp); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @ManagerMapping(value = "/reports/{date}/send_settlement_xlsx", role = {ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.POST) - public JSONObject sendSettlementMail(@PathVariable("date") String date, @RequestBody JSONObject data) { - Date dt = null; - try { - dt = dateFormat.parse(date); - } catch (ParseException e) { - } - List clearIds = data.getJSONArray("clearing_ids").toJavaList(String.class); - boolean autoMarkSent = data.getBooleanValue("mark_sent"); - return cleanService.sendSettlementMail(dt, clearIds, autoMarkSent); - } - - @ManagerMapping(value = "/reports/send_checkcode", role = {ManagerRole.FINANCIAL_STAFF}) - public void sendCheckCode(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - cleanService.sendCheckCode(new Date(), manager); - } - - @RequestMapping(value = "/reports/{date}/send_status") - public List sendStatus(@PathVariable String date) { - Date dt = null; - try { - dt = dateFormat.parse(date); - } catch (ParseException e) { - } - return cleanService.findLogSettleByDate(dt); - } - - @GetMapping("/reports/{date}/settlement_aba") - public void getSettlementABA(@PathVariable String date, HttpServletResponse resp) throws IOException { - try { - Date dt = dateFormat.parse(date); - cleanService.settlementAba(dt, resp); - } catch (ParseException e) { - throw new BadRequestException("error.payment.valid.invalid_date_format"); - } - } - - @GetMapping("/customized_settle/dates/{date}") - public List customizedSettleInDay(@PathVariable String date){ - Date dt = DateTime.parse(date).withTimeAtStartOfDay().toDate(); - return cleanService.getCustomizedSettleDaily(dt); - } - - @GetMapping("/customized_settle/{logId}/aba_file") - public void getCustomizedSettleABAFile(@PathVariable int logId,HttpServletResponse response){ - cleanService.getCustomizedSettleABA(logId, response); - } - - @PostMapping("/customized_settle/sending_mail") - public JSONObject sendCustomizedSettleFile(@RequestBody JSONObject param){ - List ids = param.getJSONArray("ids").toJavaList(Integer.class); - return cleanService.sendCustomizedSettleMail(ids); - } - - @GetMapping("/settle_batches/{batchId}/settle_files") - public void getSettlementFilesForBatch(@PathVariable String batchId, HttpServletResponse resp) throws IOException { - cleanService.getSettlementFilesForBatch(batchId, resp); - } - - @GetMapping("/settle_batches/{batchId}/settle_report_xlsx") - public ResponseEntity getSettlementReportForBatch(@PathVariable int batchId) { - ByteArrayResource body = cleanService.downloadBatchSettleReportXlsx(batchId); - return ResponseEntity.ok().contentType(MediaType.APPLICATION_OCTET_STREAM) - .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + body.getFilename()) - .body(body); - } - - @GetMapping("/details/{detailId}") - public JSONObject settlementDetail(@PathVariable int detailId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return cleanService.getCleanLogTransactions(detailId, manager); - } - - @ManagerMapping(value = "/settlement_notice", method = RequestMethod.POST, role = ManagerRole.FINANCIAL_STAFF) - public void sendSettlementNotice() throws InterruptedException { - cleanService.getTodaySettlementLogs(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/FuncInfo.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/FuncInfo.java deleted file mode 100644 index 63d881c92..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/FuncInfo.java +++ /dev/null @@ -1,219 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.beans; - -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yixian on 2017-03-01. - */ -public class FuncInfo { - private String name; - private String remark; - private boolean admin; - private boolean operator; - private boolean bd; - private boolean finacial; - private boolean servant; - private boolean accountmanager; - private boolean director; - private boolean sitemanager; - private boolean developer; - private boolean bdleader; - private boolean riskmanager; - private boolean guest; - private boolean orgmanager; - private boolean salesmanager; - private boolean datacontent; - - public String getName() { - return StringUtils.isEmpty(name) ? null : name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public void setSalesmanager(boolean salesmanager) { - this.salesmanager = salesmanager; - } - - public boolean isAdmin() { - return admin; - } - - public boolean isBd() { - return bd; - } - - public boolean isFinacial() { - return finacial; - } - - public boolean isAccountmanager() { - return accountmanager; - } - - public boolean isOperator() { - return operator; - } - - public boolean isDeveloper() { - return developer; - } - - public boolean isDirector() { - return director; - } - - public boolean isServant() { - return servant; - } - - public void setAccountmanager(boolean accountmanager) { - this.accountmanager = accountmanager; - } - - public boolean isBdleader() { - return bdleader; - } - - public boolean isSitemanager() { - return sitemanager; - } - - public void setAdmin(boolean admin) { - this.admin = admin; - } - - public void setBd(boolean bd) { - this.bd = bd; - } - - public boolean isGuest() { - return guest; - } - - public void setDeveloper(boolean developer) { - this.developer = developer; - } - - public boolean isRiskmanager() { - return riskmanager; - } - - public void setDirector(boolean director) { - this.director = director; - } - - public void setBdleader(boolean bdleader) { - this.bdleader = bdleader; - } - - public void setFinacial(boolean finacial) { - this.finacial = finacial; - } - - public void setOperator(boolean operator) { - this.operator = operator; - } - - public void setServant(boolean servant) { - this.servant = servant; - } - - public void setGuest(boolean guest) { - this.guest = guest; - } - - public void setRiskmanager(boolean riskmanager) { - this.riskmanager = riskmanager; - } - - public void setSitemanager(boolean sitemanager) { - this.sitemanager = sitemanager; - } - - public void setDatacontent(boolean datacontent) { - this.datacontent = datacontent; - } - - public boolean isSalesmanager() { - return salesmanager; - } - - public boolean isOrgmanager() { - return orgmanager; - } - - public boolean isDatacontent() { - return datacontent; - } - - public void setOrgmanager(boolean orgmanager) { - this.orgmanager = orgmanager; - } - - - public JSONObject initObject(JSONObject mod) { - mod.put("name", getName()); - mod.put("remark", getRemark()); - int role = 0; - if (admin) { - role |= ManagerRole.ADMIN.getMask(); - } - if (operator) { - role |= ManagerRole.OPERATOR.getMask(); - } - if (sitemanager) { - role |= ManagerRole.SITE_MANAGER.getMask(); - } - if (bd) { - role |= ManagerRole.BD_USER.getMask(); - } - if (finacial) { - role |= ManagerRole.FINANCIAL_STAFF.getMask(); - } - if (servant) { - role |= ManagerRole.SERVANT.getMask(); - } - if (accountmanager) { - role |= ManagerRole.ACCOUNT_MANAGER.getMask(); - } - if (director) { - role |= ManagerRole.DIRECTOR.getMask(); - } - if (developer) { - role |= ManagerRole.DEVELOPER.getMask(); - } - if (bdleader){ - role |= ManagerRole.BD_LEADER.getMask(); - } - if (riskmanager){ - role |= ManagerRole.RISK_MANAGER.getMask(); - } - if (guest){ - role |= ManagerRole.GUEST.getMask(); - } - if (orgmanager){ - role |= ManagerRole.ORG_MANAGER.getMask(); - } - if (salesmanager) { - role |= ManagerRole.SALES_MANAGER.getMask(); - } - if (datacontent) { - role |= ManagerRole.DATA_CONTENT.getMask(); - } - mod.put("role", role); - return mod; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/HolidayConfig.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/HolidayConfig.java deleted file mode 100644 index c936615b4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/HolidayConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.beans; - -import au.com.royalpay.payment.tools.holiday.beans.SettlementRegion; - -import javax.validation.constraints.NotEmpty; - -public class HolidayConfig { - @NotEmpty - private String description; - @NotEmpty - private SettlementRegion[] regions; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public SettlementRegion[] getRegions() { - return regions; - } - - public void setRegions(SettlementRegion[] regions) { - this.regions = regions; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/ModuleInfo.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/ModuleInfo.java deleted file mode 100644 index 3b9ea6744..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/ModuleInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -/** - * Created by yixian on 2017-03-01. - */ -public class ModuleInfo { - - @JSONField(name = "js_module") - private String jsModule; - @JSONField(name = "js_path") - private String jsPath; - private String remark; - - public String getJsModule() { - return jsModule; - } - - public void setJsModule(String jsModule) { - this.jsModule = jsModule; - } - - public String getJsPath() { - return jsPath; - } - - public void setJsPath(String jsPath) { - this.jsPath = jsPath; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public void initObject(JSONObject mod) { - mod.put("js_module", getJsModule()); - mod.put("js_path", getJsPath()); - mod.put("remark", getRemark()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/PartnerModuleInfo.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/PartnerModuleInfo.java deleted file mode 100644 index 99dd8a24f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/PartnerModuleInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -/** - * Created by yangluo on 2018/07/05. - */ -public class PartnerModuleInfo { - - @JSONField(name = "js_module") - private String jsModule; - @JSONField(name = "js_path") - private String jsPath; - private String remark; - @JSONField(name = "initialize") - private Boolean initialize; - - public String getJsModule() { - return jsModule; - } - - public void setJsModule(String jsModule) { - this.jsModule = jsModule; - } - - public String getJsPath() { - return jsPath; - } - - public void setJsPath(String jsPath) { - this.jsPath = jsPath; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Boolean getInitialize() { - return initialize; - } - - public void setInitialize(Boolean initialize) { - this.initialize = initialize; - } - - public void initObject(JSONObject mod) { - mod.put("id", mod.getLong("id")); - mod.put("js_module", getJsModule()); - mod.put("js_path", getJsPath()); - mod.put("remark", getRemark()); - mod.put("initialize",getInitialize()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/PermissionClientVO.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/PermissionClientVO.java deleted file mode 100644 index fb2f0df69..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/beans/PermissionClientVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.beans; - -/** - * @author kira - * @date 2018/7/4 - */ -public class PermissionClientVO { - private Long id; - private String clientMoniker; - private int clientId; - private boolean isValid; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public int getClientId() { - return clientId; - } - - public void setClientId(int clientId) { - this.clientId = clientId; - } - - public boolean getIsValid() { - return isValid; - } - - public void setValid(boolean valid) { - isValid = valid; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/ClearDateManager.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/ClearDateManager.java deleted file mode 100644 index c9ca67aeb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/ClearDateManager.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.HolidayConfig; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-01-06. - */ -public interface ClearDateManager { - - List listClearingDays(String monthPattern); - - void configHoliday(String date, HolidayConfig config); - - void removeHolidayConfig(String date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/PermissionManager.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/PermissionManager.java deleted file mode 100644 index c0841ea52..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/PermissionManager.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo; -import au.com.royalpay.payment.manage.management.sysconfig.beans.ModuleInfo; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -public interface PermissionManager { - void synchronizeFunctions(); - - JSONObject listFunctions(); - - List listModules(); - - void saveOrUpdateModule(String moduleName, ModuleInfo module); - - void checkAndDeleteModule(String moduleName); - - void updateFuncInfo(String funcId, FuncInfo funcInfo); - - void setFunctionModule(String funcId, String moduleName); - - List listRoleFunctions(ManagerRole role); - - void authorizeRole(ManagerRole role, List functions); - - List listUserFunctions(int role); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/PermissionPartnerManager.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/PermissionPartnerManager.java deleted file mode 100644 index c91f8f756..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/PermissionPartnerManager.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo; -import au.com.royalpay.payment.manage.management.sysconfig.beans.PartnerModuleInfo; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yangluo on 2018/07/05. - */ -public interface PermissionPartnerManager { - void synchronizeFunctions(); - - JSONObject listFunctions(); - - List listModules(); - - void saveOrUpdateModule(String moduleName, PartnerModuleInfo module); - - void checkAndDeleteModule(String moduleName); - - void updateFuncInfo(String funcId, FuncInfo funcInfo); - - void setFunctionModule(String funcId, String moduleName); - - List listRoleFunctions(ManagerRole role); - - void authorizeRole(PartnerRole role, List functions); - - List listUserFunctions(int role); - - JSONObject getPartnerFuncById(String funcId); - - void permissionClientModuleSave(int clientId,String clientMoniker); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/SysPaymentConfig.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/SysPaymentConfig.java deleted file mode 100644 index 412a9a1f3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/SysPaymentConfig.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -public interface SysPaymentConfig { - List getPaymentChannel(); - - void updatePaymentChannel(JSONObject manager, String channel, int type); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/ClearDateManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/ClearDateManagerImpl.java deleted file mode 100644 index a2f15a033..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/ClearDateManagerImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core.impls; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.HolidayConfig; -import au.com.royalpay.payment.manage.management.sysconfig.core.ClearDateManager; -import au.com.royalpay.payment.manage.mappers.system.HolidayDAO; -import au.com.royalpay.payment.manage.mappers.system.HolidayMapper; -import au.com.royalpay.payment.tools.holiday.beans.HolidayDefinition; -import au.com.royalpay.payment.tools.holiday.beans.SettlementRegion; -import com.alibaba.fastjson.JSONObject; -import org.joda.time.DateTime; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Created by yixian on 2017-01-06. - */ -@Service -public class ClearDateManagerImpl implements ClearDateManager { - @Resource - private HolidayMapper holidayMapper; - - @Override - public List listClearingDays(String monthPattern) { - List dates = holidayMapper.listMonthly(monthPattern); - List definitions = dates.stream().map(HolidayDAO::toHolidayDefine).collect(Collectors.toList()); - return definitions.stream().map(this::serializeHolidayDef).collect(Collectors.toList()); - } - - private JSONObject serializeHolidayDef(HolidayDefinition def) { - JSONObject holiday = new JSONObject(); - holiday.put("holiday_id", def.getHolidayId()); - holiday.put("holiday", new DateTime(def.getHoliday()).toString("yyyy/MM/dd")); - holiday.put("description", def.getDescription()); - holiday.put("regions", def.getRegions()); - return holiday; - } - - @Override - public void configHoliday(String date, HolidayConfig config) { - HolidayDAO dao = holidayMapper.findDefine(date); - if (dao == null) { - HolidayDefinition define = new HolidayDefinition(0, new DateTime(date).toDate(), config.getDescription(), config.getRegions()); - holidayMapper.saveHoliday(new HolidayDAO(define)); - } else { - holidayMapper.updateHolidayDescription(config.getDescription(), - Arrays.stream(config.getRegions()).map(SettlementRegion::toString).collect(Collectors.joining(",")), dao.getHolidayId()); - } - } - - @Override - public void removeHolidayConfig(String date) { - holidayMapper.deleteHoliday(date); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java deleted file mode 100644 index 120715e69..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core.impls; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo; -import au.com.royalpay.payment.manage.management.sysconfig.beans.ModuleInfo; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager; -import au.com.royalpay.payment.manage.mappers.system.PermissionFunctionMapper; -import au.com.royalpay.payment.manage.mappers.system.PermissionModuleMapper; -import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionNode; -import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionReader; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.*; - -/** - * Created by yixian on 2017-02-28. - */ -@Service -public class PermissionManagerImpl implements PermissionManager { - @Resource - private PermissionFunctionMapper permissionFunctionMapper; - @Resource - private PermissionModuleMapper permissionModuleMapper; - @Resource - private PermissionReader permissionReader; - - @Override - @Transactional - public void synchronizeFunctions() { - List functions = permissionFunctionMapper.listAll(); - Map funcMapFromDB = new HashMap<>(); - for (JSONObject func : functions) { - funcMapFromDB.put(func.getString("func_id").toLowerCase(), func); - } - - List nodes = permissionReader.listFunctions(); - for (PermissionNode node : nodes) { - String funcId = node.getFuncId(); - if (funcMapFromDB.containsKey(funcId.toLowerCase())) { - funcMapFromDB.remove(funcId.toLowerCase()); - JSONObject func = node.initFuncObject(); - func.remove("role"); - permissionFunctionMapper.update(func); - } else { - JSONObject func = node.initFuncObject(); - permissionFunctionMapper.save(func); - } - } - - for (String funcId : funcMapFromDB.keySet()) { - permissionFunctionMapper.delete(funcId); - } - } - - @Override - public JSONObject listFunctions() { - List funcs = permissionFunctionMapper.listAll(); - Map> moduleMap = new TreeMap<>(); - List noModule = new ArrayList<>(); - for (JSONObject func : funcs) { - int role = func.getIntValue("role"); - func.put("admin", ManagerRole.ADMIN.hasRole(role)); - func.put("operator", ManagerRole.OPERATOR.hasRole(role)); - func.put("bd", ManagerRole.BD_USER.hasRole(role)); - func.put("finacial", ManagerRole.FINANCIAL_STAFF.hasRole(role)); - func.put("servant", ManagerRole.SERVANT.hasRole(role)); -// func.put("accountmanager", ManagerRole.ACCOUNT_MANAGER.hasRole(role)); - func.put("director", ManagerRole.DIRECTOR.hasRole(role)); - func.put("sitemanager", ManagerRole.SITE_MANAGER.hasRole(role)); - func.put("developer", ManagerRole.DEVELOPER.hasRole(role)); - func.put("bdleader", ManagerRole.BD_LEADER.hasRole(role)); - func.put("riskmanager", ManagerRole.RISK_MANAGER.hasRole(role)); - func.put("guest", ManagerRole.GUEST.hasRole(role)); - func.put("orgmanager", ManagerRole.ORG_MANAGER.hasRole(role)); - func.put("salesmanager", ManagerRole.SALES_MANAGER.hasRole(role)); -// manager.put("datacontent", ManagerRole.DATA_CONTENT.hasRole(role)); - - String module = func.getString("module"); - if (module == null) { - noModule.add(func); - continue; - } - List funcsInModule = moduleMap.get(module); - if (funcsInModule == null) { - funcsInModule = new ArrayList<>(); - moduleMap.put(module, funcsInModule); - } - funcsInModule.add(func); - } - JSONObject report = new JSONObject(); - report.put("no_module", noModule); - List modules = new ArrayList<>(); - for (String module : moduleMap.keySet()) { - JSONObject mod = new JSONObject(); - mod.put("module_name", module); - List funcList = moduleMap.get(module); - mod.put("remark", funcList.get(0).getString("mod_remark")); - mod.put("js_module", funcList.get(0).getString("js_module")); - mod.put("js_path", funcList.get(0).getString("js_path")); - mod.put("funcs", funcList); - modules.add(mod); - } - report.put("modules", modules); - return report; - } - - @Override - public List listModules() { - return permissionModuleMapper.list(); - } - - @Override - public void saveOrUpdateModule(String moduleName, ModuleInfo module) { - JSONObject mod = permissionModuleMapper.find(moduleName); - if (mod == null) { - mod = new JSONObject(); - mod.put("module_name", moduleName); - permissionModuleMapper.save(mod); - } - module.initObject(mod); - permissionModuleMapper.update(mod); - } - - @Override - public void checkAndDeleteModule(String moduleName) { - List funcs = permissionFunctionMapper.listByModule(moduleName); - if (funcs.isEmpty()) { - permissionModuleMapper.delete(moduleName); - } else { - throw new BadRequestException("Module have functions. Move them first."); - } - } - - @Override - public void updateFuncInfo(String funcId, FuncInfo funcInfo) { - JSONObject update = new JSONObject(); - update.put("func_id", funcId); - permissionFunctionMapper.update(funcInfo.initObject(update)); - } - - @Override - @CacheEvict(value = ":login:managers:", allEntries = true) - public void setFunctionModule(String funcId, String moduleName) { - if (moduleName == null) { - throw new BadRequestException("module name not provided"); - } - JSONObject mod = permissionModuleMapper.find(moduleName); - if (mod == null) { - throw new BadRequestException("Module:" + moduleName + " not exists!"); - } - JSONObject update = new JSONObject(); - update.put("func_id", funcId); - update.put("module", moduleName); - permissionFunctionMapper.update(update); - } - - @Override - public List listRoleFunctions(ManagerRole role) { - List funcs = permissionFunctionMapper.listByRoleMask(role.getMask()); - List funcIds = new ArrayList<>(); - for (JSONObject func : funcs) { - funcIds.add(func.getString("func_id")); - } - return funcIds; - } - - @Override - @Transactional - @CacheEvict(value = ":login:managers:", allEntries = true) - public void authorizeRole(ManagerRole role, List functions) { - permissionFunctionMapper.clearRolePermission(role.getInverseMask()); - permissionFunctionMapper.authorizeRole(role.getMask(), functions); - } - - @Override - public List listUserFunctions(int role) { - return permissionFunctionMapper.listByRoleMask(role); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionPartnerManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionPartnerManagerImpl.java deleted file mode 100644 index e063a67fe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionPartnerManagerImpl.java +++ /dev/null @@ -1,231 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core.impls; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo; -import au.com.royalpay.payment.manage.management.sysconfig.beans.PartnerModuleInfo; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.PermissionPartnerFunctionMapper; -import au.com.royalpay.payment.manage.mappers.system.PermissionPartnerModuleMapper; -import au.com.royalpay.payment.manage.mappers.system.SysPermissionClientModulesMapper; -import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionNode; -import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionPartnerReader; -import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService; -import au.com.royalpay.payment.manage.system.core.SystemPackageCacheSupport; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.utils.id.IdUtil; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import javax.annotation.Resource; - -/** - * Created by yangluo on 2018/07/05. - */ -@Service -public class PermissionPartnerManagerImpl implements PermissionPartnerManager { - @Resource - private PermissionPartnerFunctionMapper permissionPartnerFunctionMapper; - @Resource - private PermissionPartnerModuleMapper permissionPartnerModuleMapper; - @Resource - private PermissionPartnerReader permissionPartnerReader; - @Resource - private SysPermissionClientModulesMapper sysPermissionClientModulesMapper; - @Resource - private PermissionClientModulesService permissionClientModulesService; - @Resource - private SystemPackageCacheSupport systemPackageCacheSupport; - @Resource - private ClientMapper clientMapper; - - @Override - public void synchronizeFunctions() { - List functions = permissionPartnerFunctionMapper.listAll(); - Map funcMapFromDB = new HashMap<>(); - for (JSONObject func : functions) { - funcMapFromDB.put(func.getString("func_id"), func); - } - - List nodes = permissionPartnerReader.listFunctions(); - for (PermissionNode node : nodes) { - String funcId = node.getFuncId(); - if (funcMapFromDB.containsKey(funcId)) { - funcMapFromDB.remove(funcId); - JSONObject func = node.initFuncObject(); - func.remove("role"); - permissionPartnerFunctionMapper.update(func); - } else { - JSONObject func = node.initFuncObject(); - permissionPartnerFunctionMapper.save(func); - } - } - - for (String funcId : funcMapFromDB.keySet()) { - permissionPartnerFunctionMapper.delete(funcId); - } - } - - @Override - public JSONObject listFunctions() { - List funcs = permissionPartnerFunctionMapper.listAll(); - Map> moduleMap = new TreeMap<>(); - List noModule = new ArrayList<>(); - for (JSONObject func : funcs) { - String module = func.getString("module"); - if (module == null) { - noModule.add(func); - continue; - } - List funcsInModule = moduleMap.get(module); - if (funcsInModule == null) { - funcsInModule = new ArrayList<>(); - moduleMap.put(module, funcsInModule); - } - funcsInModule.add(func); - } - JSONObject report = new JSONObject(); - report.put("no_module", noModule); - List modules = new ArrayList<>(); - for (String module : moduleMap.keySet()) { - JSONObject mod = new JSONObject(); - mod.put("module_name", module); - List funcList = moduleMap.get(module); - mod.put("remark", funcList.get(0).getString("mod_remark")); - mod.put("module_id", funcList.get(0).getString("module_id")); - mod.put("js_module", funcList.get(0).getString("js_module")); - mod.put("js_path", funcList.get(0).getString("js_path")); - mod.put("funcs", funcList); - modules.add(mod); - } - report.put("modules", modules); - return report; - } - - @Override - @Transactional - public void permissionClientModuleSave(int clientId, String clientMoniker) { - permissionClientModulesService.removeByClientMoniker(clientMoniker); - List moduleId = permissionPartnerModuleMapper.list(); - for (JSONObject moduleClientAdd : moduleId) { - moduleClientAdd.put("client_id", clientId); - moduleClientAdd.put("client_moniker", clientMoniker); - moduleClientAdd.put("module_id", moduleClientAdd.getString("id")); - moduleClientAdd.put("is_valid", moduleClientAdd.getBoolean("initialize")); - permissionClientModulesService.save(moduleClientAdd); - } - systemPackageCacheSupport.clearClientPermission(clientMoniker); - systemPackageCacheSupport.clearClientPermission(clientId); - - } - - @Override - public List listModules() { - return permissionPartnerModuleMapper.list(); - } - - @Override - @Transactional - public void saveOrUpdateModule(String moduleName, PartnerModuleInfo module) { - JSONObject mod = permissionPartnerModuleMapper.find(moduleName); - if (mod == null) { - mod = new JSONObject(); - mod.put("module_name", moduleName); - module.initObject(mod); - permissionPartnerModuleMapper.save(mod); - List IdandMoniker = clientMapper.listClientsIdAndMoniker(); - JSONObject nModuleId = permissionPartnerModuleMapper.listModuleId(moduleName); - for (JSONObject clientMod : IdandMoniker) { - clientMod.put("client_id", clientMod.getString("client_id")); - clientMod.put("client_moniker", clientMod.getString("client_moniker")); - clientMod.put("module_id", nModuleId.getString("id")); - clientMod.put("is_valid", module.getInitialize()); - clientMod.put("id", IdUtil.getId()); - permissionClientModulesService.save(clientMod); - } - } - module.initObject(mod); - permissionPartnerModuleMapper.update(mod); -// sysPermissionClientModulesMapper.updateFunctionValid(mod.getString("id"), mod.getBooleanValue("initialize")); -// systemPackageCacheSupport.clearClientPermissionAll(); - } - - @Override - public void checkAndDeleteModule(String moduleName) { - List funcs = permissionPartnerFunctionMapper.listByModule(moduleName); - if (funcs.isEmpty()) { - sysPermissionClientModulesMapper.delete(moduleName); - permissionPartnerModuleMapper.delete(moduleName); - - } else { - throw new BadRequestException("Module have functions. Move them first."); - } - } - - @Override - public void updateFuncInfo(String funcId, FuncInfo funcInfo) { - JSONObject update = new JSONObject(); - update.put("func_id", funcId); - update.put("name", funcInfo.getName()); - update.put("remark", funcInfo.getRemark()); - permissionPartnerFunctionMapper.update(update); - } - - @Override - @CacheEvict(value = ":login:partners:", allEntries = true) - public void setFunctionModule(String funcId, String moduleName) { - if (moduleName == null) { - throw new BadRequestException("module name not provided"); - } - JSONObject mod = permissionPartnerModuleMapper.find(moduleName); - if (mod == null) { - throw new BadRequestException("Module:" + moduleName + " not exists!"); - } - JSONObject nModuleId = permissionPartnerModuleMapper.listModuleId(moduleName); - JSONObject update = new JSONObject(); - update.put("func_id", funcId); - update.put("module", moduleName); - update.put("module_id", nModuleId.getString("id")); - permissionPartnerFunctionMapper.update(update); - } - - @Override - public List listRoleFunctions(ManagerRole role) { - List funcs = permissionPartnerFunctionMapper.listByRoleMask(role.getMask()); - List funcIds = new ArrayList<>(); - for (JSONObject func : funcs) { - funcIds.add(func.getString("func_id")); - } - return funcIds; - } - - @Override - @Transactional - @CacheEvict(value = ":login:partners:", allEntries = true) - public void authorizeRole(PartnerRole role, List functions) { - permissionPartnerFunctionMapper.clearRolePermission(role.getCode()); - permissionPartnerFunctionMapper.authorizeRole(role.getCode(), functions); - } - - @Override - public List listUserFunctions(int role) { - return permissionPartnerFunctionMapper.listByRoleMask(role); - } - - @Override - public JSONObject getPartnerFuncById(String funcId) { - return permissionPartnerFunctionMapper.find(funcId); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/SysPaymentConfigImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/SysPaymentConfigImpl.java deleted file mode 100644 index 67d7af1ef..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/SysPaymentConfigImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.core.impls; - -import au.com.royalpay.payment.manage.management.sysconfig.core.SysPaymentConfig; -import au.com.royalpay.payment.manage.mappers.system.RateMapper; -import au.com.royalpay.payment.manage.mappers.system.SysChannelConfigMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -@Service -public class SysPaymentConfigImpl implements SysPaymentConfig { - @Resource - private SysChannelConfigMapper sysChannelConfigMapper; - - @Override - public List getPaymentChannel() { - return sysChannelConfigMapper.selectAll(); - } - - @Override - public void updatePaymentChannel(JSONObject manager, String channel, int type) { - JSONObject paymentConfig = sysChannelConfigMapper.find(channel, type); - if (paymentConfig == null) { - throw new BadRequestException("不存在该快捷通道"); - } - Date lastUpdateTime = new Date(); - sysChannelConfigMapper.updatePaymentConfig(channel, type, lastUpdateTime, manager.getString("display_name"), false); - sysChannelConfigMapper.updatePaymentConfig(channel, type, lastUpdateTime, manager.getString("display_name"), true); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/package-info.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/package-info.java deleted file mode 100644 index e235f6bd5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 系统配置 - * Created by yixian on 2017-01-06. - */ -package au.com.royalpay.payment.manage.management.sysconfig; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysConfigController.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysConfigController.java deleted file mode 100644 index 987f125f9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysConfigController.java +++ /dev/null @@ -1,79 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.web; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.HolidayConfig; -import au.com.royalpay.payment.manage.management.sysconfig.core.ClearDateManager; -import au.com.royalpay.payment.manage.management.sysconfig.core.SysPaymentConfig; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.EmailPasswordDecryptUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by yixian on 2017-01-06. - */ -@RestController -@RequestMapping("/sysconfig") -public class SysConfigController { - @Resource - private EmailPasswordDecryptUtils emailPasswordDecryptUtils; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClearDateManager clearDateManager; - @Resource - private SysPaymentConfig sysPaymentConfig; - - @ManagerMapping(value = "/base", method = RequestMethod.GET) - public Map getBaseConfig() { - JSONObject config = sysConfigManager.getSysConfig(); - return config.entrySet().stream() - .peek(entry -> { - if (emailPasswordDecryptUtils.checkPrefix(entry.getKey())) { - String decrypted = emailPasswordDecryptUtils.decoding(entry.getKey(), entry.getValue().toString()); - entry.setValue(decrypted); - } - }).collect(HashMap::new,(map,entry)->map.put(entry.getKey(),entry.getValue()), Map::putAll); - } - - @ManagerMapping(value = "/base", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER) - public void updateBaseConfig(@RequestBody JSONObject properties) { - sysConfigManager.updateProperties(properties); - } - - @ManagerMapping(value = "/clear_days/months/{monthPattern}", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR}) - public List listClearDays(@PathVariable String monthPattern) { - return clearDateManager.listClearingDays(monthPattern); - } - - @ManagerMapping(value = "/holidays/{date}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF}) - public void configHoliday(@PathVariable String date, @RequestBody @Valid HolidayConfig config, Errors errors) { - HttpUtils.handleValidErrors(errors); - clearDateManager.configHoliday(date, config); - } - - @ManagerMapping(value = "/holidays/{date}", method = RequestMethod.DELETE) - public void deleteHoliday(@PathVariable String date) { - clearDateManager.removeHolidayConfig(date); - } - - @ManagerMapping(value = "/payment/config", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR}) - public List selectPaymentChannel() { - return sysPaymentConfig.getPaymentChannel(); - } - - @ManagerMapping(value = "/payment/{channel}/config/{type}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR}) - public void updatePaymentChannel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String channel, @PathVariable int type) { - sysPaymentConfig.updatePaymentChannel(manager, channel, type); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionClientController.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionClientController.java deleted file mode 100644 index 63c4291d6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionClientController.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.web; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.PermissionClientVO; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -@RestController -@RequestMapping( value = "/sys/permission") -public class SysPermissionClientController { - @Resource - private PermissionClientModulesService permissionClientModulesService; - @Resource - private PermissionPartnerManager permissionPartnerManager; - @Resource - private ClientManager clientManager; - - - @GetMapping("/list") - public List list(@RequestParam String client_moniker) { - return permissionClientModulesService.listByClientMoniker(client_moniker); - } - - @PostMapping("/{id}") - public void modify(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager, @PathVariable Long id, @RequestBody PermissionClientVO permissionClientVO) { - permissionClientModulesService.switchValid(id,permissionClientVO.getIsValid(),loginManager); - } - - @PostMapping("/init") - public void init(@RequestBody JSONObject param) { - JSONObject client = clientManager.getClientInfoByMoniker(param.getString("client_moniker")); - permissionPartnerManager.permissionClientModuleSave(client.getIntValue("client_id"),client.getString("client_moniker")); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionConfigController.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionConfigController.java deleted file mode 100644 index 0da0b946b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionConfigController.java +++ /dev/null @@ -1,92 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.web; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo; -import au.com.royalpay.payment.manage.management.sysconfig.beans.ModuleInfo; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-02-28. - */ -@RestController -@ManagerMapping(role = ManagerRole.ADMIN, value = "/sys/permission") -public class SysPermissionConfigController { - @Resource - private PermissionManager permissionManager; - - @PostMapping("/synchronize") - public void synchronizeFunctions() { - permissionManager.synchronizeFunctions(); - } - - @GetMapping("/functions") - public JSONObject listFunctions() { - return permissionManager.listFunctions(); - } - - @PutMapping("/functions/{funcId}.end") - public void updateFunctionInfo(@PathVariable String funcId, @RequestBody FuncInfo funcInfo) { - permissionManager.updateFuncInfo(funcId, funcInfo); - } - - @PutMapping("/functions/{funcId}/modules") - public void setFuncModule(@PathVariable String funcId, @RequestBody JSONObject module) { - permissionManager.setFunctionModule(funcId, module.getString("module_name")); - } - - @GetMapping("/modules") - public List listModules() { - return permissionManager.listModules(); - } - - @PutMapping("/modules/{moduleName}.end") - public void updateModule(@PathVariable String moduleName, @RequestBody ModuleInfo module) { - permissionManager.saveOrUpdateModule(moduleName, module); - } - - @DeleteMapping("/modules/{moduleName}.end") - public void deleteModule(@PathVariable String moduleName) { - permissionManager.checkAndDeleteModule(moduleName); - } - - @GetMapping("/roles/{roleMask}/functions") - public List listRoleAuthorizedFunctions(@PathVariable String roleMask) { - try { - int mask = Integer.parseInt(roleMask, 2); - for (ManagerRole role : ManagerRole.values()) { - if (mask == role.getMask()) { - return permissionManager.listRoleFunctions(role); - } - } - - } catch (NumberFormatException ignored) { - } - throw new BadRequestException("Invalid role mask:" + roleMask); - } - - @PutMapping(value = "/roles/{roleMask}/functions") - public void authorizeRole(@PathVariable String roleMask, @RequestBody List functions){ - try { - int mask = Integer.parseInt(roleMask, 2); - for (ManagerRole role : ManagerRole.values()) { - if (mask == role.getMask()) { - permissionManager.authorizeRole(role,functions); - return; - } - } - - } catch (NumberFormatException ignored) { - } - throw new BadRequestException("Invalid role mask:" + roleMask); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionPartnerConfigController.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionPartnerConfigController.java deleted file mode 100644 index 8f6189393..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/web/SysPermissionPartnerConfigController.java +++ /dev/null @@ -1,93 +0,0 @@ -package au.com.royalpay.payment.manage.management.sysconfig.web; - -import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo; -import au.com.royalpay.payment.manage.management.sysconfig.beans.PartnerModuleInfo; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import javax.annotation.Resource; - -/** - * Created by yangluo on 2018/07/05. - */ -@RestController -@RequestMapping( value = "/sys/permissionPartner") -public class SysPermissionPartnerConfigController { - @Resource - private PermissionPartnerManager permissionPartnerManager; - - @PostMapping("/synchronize") - public void synchronizeFunctions() { - permissionPartnerManager.synchronizeFunctions(); - } - - @GetMapping("/functions") - public JSONObject listFunctions() { - return permissionPartnerManager.listFunctions(); - } - - @PutMapping("/functions/{funcId}.end") - public void updateFunctionInfo(@PathVariable String funcId, @RequestBody FuncInfo funcInfo) { - permissionPartnerManager.updateFuncInfo(funcId, funcInfo); - } - - @PutMapping("/functions/{funcId}/modules") - public void setFuncModule(@PathVariable String funcId, @RequestBody JSONObject module) { - permissionPartnerManager.setFunctionModule(funcId, module.getString("module_name")); - } - - @GetMapping("/modules") - public List listModuless() { - return permissionPartnerManager.listModules(); - } - - @PutMapping("/modules/{moduleName}.end") - public void updateModulee(@PathVariable String moduleName, @RequestBody PartnerModuleInfo module) { - permissionPartnerManager.saveOrUpdateModule(moduleName, module); - } - - @DeleteMapping("/modules/{moduleName}.end") - public void deleteModulee(@PathVariable String moduleName) { - permissionPartnerManager.checkAndDeleteModule(moduleName); - } - - @GetMapping("/roles/{roleMask}/functions") - public List listRoleAuthorizedFunctions(@PathVariable String roleMask) { - try { - int mask = Integer.parseInt(roleMask, 2); - for (ManagerRole role : ManagerRole.values()) { - if (mask == role.getMask()) { - return permissionPartnerManager.listRoleFunctions(role); - } - } - - } catch (NumberFormatException ignored) { - } - throw new BadRequestException("Invalid role mask:" + roleMask); - } - - @RequestMapping(value = "/roles/{roleMask}/functions",method = RequestMethod.PUT) - public void authorizeRole(@PathVariable String roleMask, @RequestBody List functions){ - try { - int mask = Integer.parseInt(roleMask, 2); - for (PartnerRole role : PartnerRole.values()) { - if (mask == role.getCode()) { - permissionPartnerManager.authorizeRole(role,functions); - return; - } - } - - } catch (NumberFormatException ignored) { - } - throw new BadRequestException("Invalid role mask:" + roleMask); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java deleted file mode 100644 index 1aef2f278..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -@AutoMapper(tablename = "act_app_list", pkName = "act_id") -public interface ActAppMapper { - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List listActs (); - - @AutoSql(SqlType.SELECT) - PageList listAppActs (JSONObject params,PageBounds pagination); - - @AutoSql(SqlType.SELECT) - JSONObject getActDetail(String act_id); - - @AutoSql(SqlType.UPDATE) - void updateAct(JSONObject params); - - @AutoSql(SqlType.INSERT) - void newAppAct(JSONObject params); - - JSONObject getLatestWindowNotice(@Param("now") Date now); - - JSONObject getAppActPopup(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java deleted file mode 100644 index 6327e0565..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yangluo on 2018/7/9. - */ -@AutoMapper(tablename = "act_charity", pkName = "client_moniker") -public interface ActChairtyMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findChairtyClient(@Param("client_moniker") String clientMoniker); - - @AutoSql(SqlType.INSERT) - void save(JSONObject chairtyClient); - - PageList chairtyClientNum(PageBounds pageBounds); - - List getChairtyWeekAnalysis(@Param("begin") Date begin, @Param("end") Date end); - - PageList getChairtyWeekRaking(@Param("begin") Date begin, @Param("end") Date end,PageBounds pageBounds); - - List chairtyClientNum(); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java deleted file mode 100644 index 202fccc69..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * Created by yixian on 2017-03-21. - */ -@AutoMapper(tablename = "act_diet_attend", pkName = "attend_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ActDietAttendMapper { - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "enabled=1") - JSONObject findClientAttend(@Param("client_id") String clientId); - - PageList listMerchants(@Param("city") String city, @Param("name") String name, PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void save(JSONObject attend); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject attend); - - PageList listMerchantsDetail(PageBounds pageBounds); - - List listMerchantsAnalysis(@Param("city") String city); - - List listTransactionAnalysis(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietOrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietOrderMapper.java deleted file mode 100644 index 17aed0757..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietOrderMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-03-22. - */ -@AutoMapper(tablename = "act_diet_orders", pkName = "order_id") -public interface ActDietOrderMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject dietOrderInfo); - - @AutoSql(SqlType.SELECT) - JSONObject findOrder(@Param("order_id") String orderId); - - @AutoSql(SqlType.UPDATE) - void setTransactionId(@Param("order_id") String orderId, @Param("transaction_id") String transactionId, @Param("pay_time") Date time); - - @AutoSql(SqlType.UPDATE) - void updateRefund(@Param("order_id") String orderId, @Param("refund_transaction") String transactionId, @Param("refund_time") Date transactionTime); - - List getAppendAmountInDays(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelayClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelayClientMapper.java deleted file mode 100644 index 7fa72cae9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelayClientMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - - -@AutoMapper(tablename = "act_mon_delay_read_logs", pkName = "id") -public interface ActMonDelayClientMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject clientlog); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject clientlog); - - @AutoSql(SqlType.SELECT) - JSONObject actClient(@Param("client_id") int client_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleMapper.java deleted file mode 100644 index c1d7d689f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "act_mon_delay_settle", pkName = "id") -public interface ActMonDelaySettleMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject clientlog); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject clientlog); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List clientLog (@Param("client_id") int client_id); - - PageList listAttendClients(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleRedPackMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleRedPackMapper.java deleted file mode 100644 index 06075c8ff..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleRedPackMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -@AutoMapper(tablename = "act_mon_delay_settle_redpack", pkName = "id") -public interface ActMonDelaySettleRedPackMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject dietOrderInfo); - - BigDecimal getTotalRedPack(int client_id); - - @AutoSql(SqlType.SELECT) - PageList listRedpacks(@Param("client_id") int client_id, PageBounds pagination); - - PageList getMonDelayRank(JSONObject params, PageBounds pageBounds); - - List getMondayAmount(JSONObject params); - - JSONObject analysisCashback(JSONObject params); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActSignEventsSignLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActSignEventsSignLogMapper.java deleted file mode 100644 index 381f32408..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActSignEventsSignLogMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.act; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-04-11. - */ -@AutoMapper(tablename = "act_sign_events_sign_log", pkName = "sign_id") -public interface ActSignEventsSignLogMapper { - - List checkUnsigned(@Param("client_id") int clientId); - - @AutoSql(SqlType.UPDATE) - void updateSignInfo(@Param("sign_id") String signId, @Param("sign_time") Date signTime, @Param("sign_user_id") String userId, @Param("sign_ip") String clientIp); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("sign_id") String signId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeClientMapper.java deleted file mode 100644 index 026ac85b6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeClientMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.apskyc; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -@AutoMapper(tablename = "sys_aps_notice_clients", pkName = "id") -public interface ApsNoticeClientMapper { - - @AutoSql(SqlType.INSERT) - void saveApsNoticeClient(ApsNoticeClient apsNoticeClient); - - @AutoSql(SqlType.UPDATE) - void updateApsNoticeClient(ApsNoticeClient apsNoticeClient); - - PageList getApsNoticeClients(String id,String clientStatus, PageBounds pageBounds); - - void updateApsNoticeClientByPartnerCode(@Param("modify_time") Date modifyTime, @Param("modifier") String modifier, @Param("partner_code") String partnerCode); - - @AutoSql(SqlType.SELECT) - ApsNoticeClient getApsNoticeClientById(String id); - - JSONObject getApsKycClient(@Param("client_moniker")String clientMoniker); - - @AutoSql(SqlType.UPDATE) - void toUpdateApsKycClient(JSONObject updateReadTime); - - List apsNoticeClients(String id, String clientStatus); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeMapper.java deleted file mode 100644 index 28788e3bc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.apskyc; - -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -import java.util.List; - -@AutoMapper(tablename = "sys_aps_notice", pkName = "id") -public interface ApsNoticeMapper { - PageList getApsNotices(PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void saveApsNotice(ApsNotice apsNotice); - - @AutoSql(SqlType.SELECT) - ApsNotice getApsNoticesById(String id); - - @AutoSql(SqlType.UPDATE) - void updateApsNotice(JSONObject apsNotice); - - List getApsNotice(String id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/bill/BillMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/bill/BillMapper.java deleted file mode 100644 index e7929ec70..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/bill/BillMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.bill; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-19 19:09 - */ -@AutoMapper(tablename = "pmt_bill", pkName = "bill_id") -public interface BillMapper { - @AutoSql(SqlType.INSERT) - int save(JSONObject record); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("bill_id") String bill_id); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject record); - - @AutoSql(SqlType.SELECT) - List findByClientId(@Param("client_id") int client_id); - - @AutoSql(SqlType.DELETE) - void delete(@Param("bill_id") String billId); - - PageList listWithOrderAnalysis(@Param("param") JSONObject jsonObject, PageBounds pageBounds); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/bill/BillOrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/bill/BillOrderMapper.java deleted file mode 100644 index 7d65229db..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/bill/BillOrderMapper.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.bill; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Create by yixian at 2017-12-19 19:09 - */ -@AutoMapper(tablename = "pmt_bill_order_relation", pkName = "bill_id") -public interface BillOrderMapper { - @AutoSql(SqlType.INSERT) - JSONObject save(JSONObject record); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject record); - - List findByBillIdWithWechatInfo(@Param("bill_id") String bill_id); - - List findByBillIdWithAlipayInfo(@Param("bill_id") String bill_id); - - @AutoSql(SqlType.SELECT) - JSONObject findByClientId(@Param("client_id") int client_id); - - @AutoSql(SqlType.SELECT) - List findByBillId(@Param("bill_id") String bill_id); - - List findOrderIdByStatus(@Param("order_status")String order_status); - - PageList query(@Param("bill_id") String bill_id, @Param("param") JSONObject jsonObject, PageBounds pageBounds); - - JSONObject analysis(@Param("bill_id")String bill_id,@Param("param")JSONObject jsonObject); - - int updateStatusByOrderId(@Param("order_id")String order_id, @Param("order_status")String order_status); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/billqrcode/DirectedBillCodeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/billqrcode/DirectedBillCodeMapper.java deleted file mode 100644 index 794e23604..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/billqrcode/DirectedBillCodeMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.billqrcode; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "pmt_directed_bill_code", pkName = "bill_code_id") -public interface DirectedBillCodeMapper { - @AutoSql(SqlType.INSERT) - int save(JSONObject record); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("client_order_id") String client_order_id); - - @AutoSql(SqlType.SELECT) - JSONObject findOneByBillCodeId(@Param("bill_code_id") String bill_code_id); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject record); - - @AutoSql(SqlType.SELECT) - List findByClientId(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status=1") - List listAllBills(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/cashback/CashbackDrawDepositsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/cashback/CashbackDrawDepositsMapper.java deleted file mode 100644 index 900b18ebb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/cashback/CashbackDrawDepositsMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.cashback; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.math.BigDecimal; - -/** - * Created by yishuqian on 26/05/2017. - */ -@AutoMapper(tablename = "cashback_draw_deposits", pkName = "draw_id") -public interface CashbackDrawDepositsMapper { - - - @AutoSql(SqlType.INSERT) - void save(JSONObject object); - - @AutoSql(SqlType.SELECT) - PageList getDrawLogs(JSONObject params, PageBounds pageBounds); - - BigDecimal getDrawTotal(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/cashback/CashbackRecordsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/cashback/CashbackRecordsMapper.java deleted file mode 100644 index 7c9bb8ff7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/cashback/CashbackRecordsMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.cashback; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 26/05/2017. - */ -@AutoMapper(tablename = "cashback_records", pkName = "cashback_id") -public interface CashbackRecordsMapper { - - BigDecimal getCashTotal(JSONObject params); - - @AutoSql(SqlType.INSERT) - void save(JSONObject object); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject object); - - PageList getCashbackRecores(JSONObject params, PageBounds pageBounds); - - JSONObject analysisCashback(JSONObject date_params); - - List getCashbackDaily(JSONObject params); - - List getSettleDelayDaily(@Param("begin") Date begin, @Param("end") Date end); - - PageList getSettleDelayRank(JSONObject params, PageBounds pageBounds); - - PageList getPartnerTotalCashback(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - List findByOrderId(@Param("order_id") String orderId); - - List findBySurchargeDiscountLog(@Param("client_id") int clientId, @Param("settle_date") Date settleDate); - - BigDecimal getSettleDelayDebit(@Param("analysis_date") Date analysis_date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java deleted file mode 100644 index b52161bc7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.cashiers; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 31/10/2016. - */ - -@AutoMapper(tablename = "cashier", pkName = "cashier_id") -public interface CashierMapper { - - @AutoSql(SqlType.SELECT) - List listCashiers(JSONObject params); - - @AutoSql(SqlType.SELECT) - PageList listCashiers(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("cashier_id") String cashier_id); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findIsValidById(@Param("cashier_id") String cashier_id); - - @AutoSql(SqlType.INSERT) - void save(JSONObject cashier); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject cashier); - - @AutoSql(SqlType.SELECT) - JSONObject findCashierByCode(@Param("client_id") int client_id, @Param("code") String code); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierOrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierOrderMapper.java deleted file mode 100644 index b00da97be..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierOrderMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.cashiers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - - -/** - * Created by yishuqian on 02/11/2016. - */ -@AutoMapper(tablename = "cashier_orders", pkName = "cashier_order_id") -public interface CashierOrderMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject jsonObject); - @AutoSql(SqlType.UPDATE) - void update(JSONObject updateaObj); - @AutoSql(SqlType.SELECT) - JSONObject findOrder(@Param("cashier_order_id") String cashier_order_id); - - PageList listOrders(JSONObject params, PageBounds pageBounds); - @AutoSql(SqlType.SELECT) - JSONObject findOrderByOrderId(@Param("order_id") String cashier_order_id); - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/client/AuthAppMessageMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/client/AuthAppMessageMapper.java deleted file mode 100644 index 2ef5936e9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/client/AuthAppMessageMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.client; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by davep at 2019-10-23 17:28 - */ -@AutoMapper(tablename = "log_client_app_messages",pkName = "message_id") -public interface AuthAppMessageMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject msg); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/client/AuthHistoryMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/client/AuthHistoryMapper.java deleted file mode 100644 index ccd162527..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/client/AuthHistoryMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.client; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Create by davep at 2019-08-16 15:05 - */ -@AutoMapper(tablename = "log_client_app_authentication", pkName = "auth_id") -public interface AuthHistoryMapper { - - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("auth_id") String authId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.java deleted file mode 100644 index 6212c8e49..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.client; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yuan on 2017/9/12. - */ -@AutoMapper(tablename = "sys_clients_customers", pkName = {"client_id","customer_id"}) -public interface ClientCustomersMapper { - @AutoSql(SqlType.SELECT) - public JSONObject getClientCustomer(@Param("client_id") int client_id, @Param("customer_id") String customer_id); - - public JSONObject getClientCustomerWithNull(@Param("client_id") int client_id, @Param("customer_id") String customer_id); - - @AutoSql(SqlType.INSERT) - public void insert(JSONObject obj); - - @AutoSql(SqlType.UPDATE) - public void update(JSONObject obj); - - public void updateAfterPaymentFinish(JSONObject obj); - - PageList listCustomerInfo(JSONObject params, PageBounds pageBounds); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/client/ClientSubMerchantIdMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/client/ClientSubMerchantIdMapper.java deleted file mode 100644 index cb62cc2f3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/client/ClientSubMerchantIdMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.client; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -@AutoMapper(tablename = "cli_sub_merchant_id", pkName = "sub_merchant_id") -public interface ClientSubMerchantIdMapper { - @AutoSql(SqlType.SELECT) - List listSubMerchantId(PageBounds pageBounds); - - List listSubMerchantIdByDiffDays(@Param("begin") int begin,@Param("end") int end); - - @AutoSql(SqlType.INSERT) - void save(JSONObject subMerchantId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject subMerchantId); - - @AutoSql(SqlType.DELETE) - void delete(@Param("sub_merchant_id") String sub_merchant_id); - - @AutoSql(SqlType.DELETE) - void deleteAll(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/client/GoodMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/client/GoodMapper.java deleted file mode 100644 index bb137225d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/client/GoodMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.client; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yishuqian on 8/30/16. - */ -@AutoMapper(tablename = "pat_goods", pkName = "id") -public interface GoodMapper { - @AutoSql(SqlType.SELECT) - JSONObject findGood(@Param("id") String goodId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_using=1") - PageList listGoods(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.INSERT) - void save(JSONObject good); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject good); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/client/GoodOrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/client/GoodOrderMapper.java deleted file mode 100644 index 22fb124d8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/client/GoodOrderMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.client; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 9/1/16. - */ -@AutoMapper(tablename = "pat_goods_sale", pkName = "id") -public interface GoodOrderMapper { - @AutoSql(SqlType.SELECT) - JSONObject findGoodOrder(@Param("id") String goodOrderId); - - @AutoSql(SqlType.SELECT) - PageList listGoodOrder(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.SELECT) - List getGoodOrderList(JSONObject params); - - @AutoSql(SqlType.INSERT) - void save(JSONObject goodOrder); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject goodOrder); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java deleted file mode 100644 index b26de402d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.custom; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yishuqian on 9/1/16. - */ -@AutoMapper(tablename = "pmt_custom_report_detail", pkName = "sub_order_no") -public interface CustomReportDetailsMapper { - @AutoSql(SqlType.SELECT) - List findByReportId(@Param("report_id") String report_id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java deleted file mode 100644 index 2e9833522..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.custom; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yishuqian on 9/1/16. - */ -@AutoMapper(tablename = "pmt_custom_report", pkName = "report_id") -public interface CustomReportsMapper { - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("report_id") String report_id); - - @AutoSql(SqlType.SELECT) - JSONObject findByOrderId(@Param("order_id")String order_id); - - PageList queryWithTrans(JSONObject param,PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardConfigMapper.java deleted file mode 100644 index edf2d8747..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardConfigMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - - -/** - * @Author: james7whm - * @Date: 2019/1/17 17:34 - */ -@AutoMapper(tablename = "cus_reward_config",pkName = "key") -public interface CusRewardConfigMapper { - @AutoSql(SqlType.SELECT) - JSONObject getValue(@Param("key") String key); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardCouponMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardCouponMapper.java deleted file mode 100644 index fe0d43c59..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardCouponMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -@AutoMapper(tablename = "cus_reward_coupon",pkName = "coupon_id") -public interface CusRewardCouponMapper { - - @Select("SELECT * FROM cus_reward_coupon WHERE type =2 or type =3 order by rand() limit 1") - JSONObject randomType(); - - @AutoSql(SqlType.SELECT) - JSONObject getCoupon(@Param("type") int type); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardLogsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardLogsMapper.java deleted file mode 100644 index 82f78555c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CusRewardLogsMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.Date; -import java.util.List; - - -@AutoMapper(tablename = "cus_reward_log",pkName = "reward_id") -public interface CusRewardLogsMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject params); - - @AutoSql(SqlType.SELECT) - JSONObject findRewardByFakeOpenId(@Param("openid")String fakeOpenId); - - @AutoSql(SqlType.SELECT) - JSONObject findRewardByRewardId(@Param("reward_id")String reward_id); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject params); - - int openIdReceivedCount(@Param("openid") String openid, @Param("send_time") Date send_time); - - int takeReward(@Param("send_time")Date sendTime, @Param("openid")String openid, @Param("date")String date); - - int takeRewardNotWechat(@Param("send_time")Date sendTime, @Param("openid")String openid, @Param("date")String date); - - @Select("SELECT * FROM cus_reward_log WHERE type=1 AND (`status`=0 OR `status`=1) AND openid IS NOT NULL ORDER BY send_time ASC") - List listUnconfirmRewards(); - - @Select("select * from cus_reward_log where openid is not null and type=1 and send_listid is null") - List resendRewards(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageConfigMapper.java deleted file mode 100644 index 39d19b107..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageConfigMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-04-25. - */ -@AutoMapper(tablename = "cus_encourage_events",pkName = "event_id") -public interface CustomerEncourageConfigMapper { - - JSONObject currentConfig(); - - @AutoSql(SqlType.SELECT) - List listConfigs(PageBounds pagination); - - - @AutoSql(SqlType.SELECT) - JSONObject findConfig(@Param("event_id") String eventId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject config); - - @AutoSql(SqlType.INSERT) - void newEvent(JSONObject event); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyAccessLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyAccessLogMapper.java deleted file mode 100644 index cfd872d3e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyAccessLogMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-04-27. - */ -@AutoMapper(tablename = "cus_encourage_money_access_log",pkName = "encourage_id") -public interface CustomerEncourageMoneyAccessLogMapper { - - int countOrders(@Param("member_id") String memberId, @Param("date") Date queryDate); - - @AutoSql(SqlType.SELECT) - JSONObject findByOrderId(@Param("order_id") String orderId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject log); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject log); - - PageList list(JSONObject params, PageBounds pageBounds); - - List analysisByDate(@Param("event_id") String eventId); - - JSONObject sumMoney(@Param("memberId") String memberId,@Param("eventId")String eventId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyUseLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyUseLogMapper.java deleted file mode 100644 index 7e7265cd1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyUseLogMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-04-26. - */ -@AutoMapper(tablename = "cus_encourage_money_use_log", pkName = "use_id") -public interface CustomerEncourageMoneyUseLogMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findByOrderId(@Param("order_id") String orderId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject useLog); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject useLogUpdate); - - BigDecimal sumUsed(@Param("member_id") String memberId, @Param("from_date") Date fromDate, @Param("to_date") Date toDate); - - PageList list(JSONObject params, PageBounds pageBounds); - - List analysisByDate(@Param("event_id") String eventId); - - List listUnsettled(); - - JSONObject sumMoney(@Param("memberId") String memberId,@Param("eventId")String eventId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java deleted file mode 100644 index 06ce4f028..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-04-24. - */ -@AutoMapper(tablename = "cus_membership",pkName = "member_id") -public interface CustomerMembershipMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findByPaymentOpenId(@Param("payment_openid") String openid); - - @AutoSql(SqlType.SELECT) - JSONObject findByMemberId(@Param("member_id") String memberId); - - @AutoSql(SqlType.INSERT) - void saveMember(JSONObject member); - - @AutoSql(SqlType.UPDATE) - int updateCustomerPoints(@Param("member_id") String memberId, @Param("member_point") int memberPoints); - - void useEncourage(@Param("memberId") String memberId, @Param("amount") BigDecimal amount); - - void addEncourage(@Param("memberId") String memberId, @Param("amount") BigDecimal amount); - - List listEncourageBalanceHistory(@Param("fromDate") Date fromDate, @Param("toDate") Date toDate, @Param("memberId") String memberId); - - BigDecimal sumEncourageBalance(); - - List listPaymentManagerByCus(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerPointsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerPointsMapper.java deleted file mode 100644 index ab7fe6ceb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerPointsMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.customers; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; - -/** - * Created by yishuqian on 25/04/2017. - */ -@AutoMapper(tablename = "cus_points_access_log",pkName = "point_id") -public interface CustomerPointsMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findPointLog(@Param("point_id") String pointId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject pointLog); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "refund_id is null") - JSONObject getPointLog(@Param("order_id") String order_id, @Param("member_id") String member_id); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject pointLog); - - int getOuttimePoints(@Param("member_id") String memberId, @Param("expire_date") Date date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionDetailMapper.java deleted file mode 100644 index f3ea05881..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionDetailMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_agent_commission_detail", pkName = "detail_id") -public interface FinancialAgentCommissionDetailMapper { - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month); - - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - List listDetails(@Param("record_id") String recordId); - - List listDetailsByRecordIds(List recordId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionMapper.java deleted file mode 100644 index bdd86c121..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_agent_commission", pkName = "record_id") -public interface FinancialAgentCommissionMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject commissionAnalysis); - - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month); - - List listAvailableMonths(@Param("year") int year); - - List find(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); - - List list(@Param("year") int year, @Param("month") int month); - - String getRecordId(@Param("org_id") int orgId, @Param("year") int year, @Param("month") int month, @Param("channel") String channel); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDCommissionConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDCommissionConfigMapper.java deleted file mode 100644 index 652fb0162..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDCommissionConfigMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * BD leader manager提成配置 - * Created by Tayl0r on 2017/6/1. - */ -@AutoMapper(tablename = "financial_bd_commission_config",pkName = "bc_config_id") -public interface FinancialBDCommissionConfigMapper { - - //获取当月的Leader 、Manager信息 - List listCurrentBDLeMaInfo(); - - //获取历史月份 Leader 、Manager信息 - List listBDLeMaInfoHistory(String month); - - @AutoSql(SqlType.UPDATE) - void updateCommissionConfig(JSONObject configInfo); - - @AutoSql(SqlType.INSERT) - void insertCommissionConfig(JSONObject configInfo); - - @AutoSql(SqlType.DELETE) - void deleteConfig(@Param("bc_config_id") String configInfo); - - JSONObject findCurrentCommissionRate(@Param("month") String month, @Param("amount") String amount, @Param("bd_type") int bd_type); - - BigDecimal findCurrentCommissionMaxAmount(@Param("month") String month, @Param("bd_type") int bd_type); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java deleted file mode 100644 index ca32fe856..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * BD信息配置 - * Created by yixian on 2017-02-07. - */ -@AutoMapper(tablename = "financial_bd_config",pkName = "manager_id") -public interface FinancialBDConfigMapper { - @AutoSql(SqlType.SELECT) - JSONObject getBdConfig(@Param("manager_id") String userId); - - @AutoSql(SqlType.INSERT) - void saveBDConfig(JSONObject config); - - @AutoSql(SqlType.UPDATE) - void updateBDConfig(JSONObject config); - - List listBDConfig(); - - JSONObject getBDConfigById(@Param("manager_id") String manager_id); - - List listGroupBds(@Param("bd_group") String bd_group); - - BigDecimal getGroupAmount(@Param("bd_group") String bd_group, @Param("record_id") String record_id, @Param("channel") String channel); - - BigDecimal getTotalAmount(@Param("bd_group") String bd_group, @Param("record_id") String record_id); - - List listBDCity(); - - JSONObject listCityCommission(@Param("city") String city, @Param("record_id") String record_id); - - List findManagerByTeamType(@Param("bd_type") String bdType, @Param("record_id") String record_id); - - List findManagerByTeamTypeRealTime(@Param("bd_type") String bdType, @Param("start_date") Date start_date, @Param("end_date") Date end_date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeDetailMapper.java deleted file mode 100644 index 067df7116..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeDetailMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-02-07. - */ -@AutoMapper(tablename = "financial_bd_prize_detail", pkName = "detail_id") -public interface FinancialBDPrizeDetailMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - List listDetails(@Param("prize_log_id") String prizeLogId, PageBounds order); - - void clearDetailsOfReport(@Param("record_id") String recordId); - - List findCommissionDetailById(@Param("record_id")String record_id, @Param("manager_id")String managerId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java deleted file mode 100644 index a30339cbc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java +++ /dev/null @@ -1,160 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-02-07. - */ -@AutoMapper(tablename = "financial_bd_prize_log", pkName = "prize_log_id") -public interface FinancialBDPrizeLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject log); - - @Select("SELECT fbpl.prize_log_id,fbpl.record_id,fbpl.manager_id,fbpl.bd_name,fbpl.kpi_amount,fbpl.bd_level,SUM(fbpl.total_amount) total_amount, " + - "SUM(fbpl.total_prize) total_prize,SUM(fbpl.total_donation) total_donation, SUM(fbpl.send_prize) send_prize, " + - "SUM(fbpl.hold_prize) hold_prize,fbpl.last_punish,fbpl.prize_type,sysm.is_valid FROM financial_bd_prize_log fbpl, " + - "sys_managers sysm " + - "where fbpl.prize_type = #{prize_type} and fbpl.record_id = #{record_id} " + - " AND fbpl.manager_id = sysm.manager_id "+ - "GROUP BY fbpl.manager_id order by total_amount desc") - List listPrizeLogsForReport(@Param("prize_type") int prize_type, @Param("record_id") String recordId, PageBounds order); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "prize_type=0") - List findByReportAndBD(@Param("record_id") String recordId, @Param("manager_id") String managerId); - - @Select("SELECT prize_log_id,record_id,kpi_amount,manager_id,bd_name,bd_level,SUM(total_amount) total_amount, " + - "SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize, " + - "SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " + - "where fbpl.prize_type = 0 and fbpl.record_id = #{record_id} and fbpl.manager_id = #{manager_id} " + - "GROUP BY fbpl.manager_id") - JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") String managerId); - - - @Select("SELECT\n" + - "\tc.bd_name,\n" + - "\tc.manager_id,\n" + - "\tc.kpi_amount,\n" + - "\tsum( o.total * d.proportion ) AS total_amount \n" + - "FROM\n" + - "\tstatistics_customer_order o\n" + - "\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" + - "\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" + - "\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id \n" + - "WHERE\n" + - "\tsc.org_id = 1 \n" + - "\tAND o.date >= #{start_date} \n" + - "\tAND o.date < #{end_date} \n" + - "\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" + - "\t) \n" + - "\tAND c.get_prize = 1 \n" + - "\tAND c.manager_id = #{manager_id}") - JSONObject findByReportAndBDTotalRealTime(@Param("manager_id") String manage_id, @Param("start_date") Date start_date, @Param("end_date") Date end_date); - - @Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount," + - "SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize," + - "SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " + - "where fbpl.prize_type = 1 and fbpl.manager_id = #{manager_id} " + - "GROUP BY fbpl.manager_id ") - JSONObject findByReportAndGroup(@Param("record_id") String recordId, @Param("manager_id") String managerId); - - @AutoSql(SqlType.DELETE) - void clearLogsOfReport(@Param("record_id") String recordId); - - @Select("select bpl.record_id,bpl.manager_id,bpl.bd_name,sum(bpl.total_amount) total_amount,sum(bpl.total_prize) total_prize,sum(bpl.total_donation) total_donation,sum(bpl.send_prize) send_prize,sum(bpl.hold_prize) hold_prize," + - "bpl.kpi_amount,bpr.`month` " + - "from financial_bd_prize_log bpl INNER JOIN financial_bd_prize_records bpr on bpl.record_id = bpr.record_id " + - "where bpl.manager_id= #{manager_id} " + - "and bpl.channel!='ALL' " + - "group by bpr.month " + - "ORDER BY bpr.month desc") - List listBdPrizeLogByOne(@Param("manager_id") String manager_id); - - @AutoSql(SqlType.SELECT) - List findReportByOne(@Param("record_id") String recordId, @Param("manager_id") String managerId); - - @Select("SELECT c.manager_id, SUM(total_amount) total_amount, c.bd_type\n" + - "FROM financial_bd_prize_log l\n" + - "INNER JOIN financial_bd_config c ON l.manager_id = c.manager_id\n" + - "WHERE prize_type = 1 AND record_id = #{record_id}\n" + - "GROUP BY l.manager_id") - List findBdPrizeAmountAndBdType(@Param("record_id") String recordId); - - @Select("SELECT\n" + - "\tfbc.*,\n" + - "\tsum( ( o.total ) * d.proportion ) AS total_amount \n" + - "FROM\n" + - "\tstatistics_customer_order o\n" + - "\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" + - "\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" + - "\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id\n" + - "\tINNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group \n" + - "WHERE\n" + - "\tsc.org_id = 1 \n" + - "\tAND o.date >= #{start_date} \n" + - "\tAND o.date < #{end_date} \n" + - "\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" + - "\t) \n" + - "\tAND c.bd_group IS NOT NULL \n" + - "GROUP BY\n" + - "\tfbc.bd_type") - List findBdPrizeAmountRealTime(@Param("start_date") Date start_date, @Param("end_date") Date end_date); - - @Select("SELECT\n" + - "\tt1.*,\n" + - "\tt2.total_amount AS month_amount \n" + - "FROM\n" + - "\t(\n" + - "SELECT\n" + - "\tfbc.*,\n" + - "\tsum( ( o.total ) * d.proportion ) AS total_amount \n" + - "FROM\n" + - "\tstatistics_customer_order o\n" + - "\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" + - "\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" + - "\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id\n" + - "\tINNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group \n" + - "WHERE\n" + - "\tsc.org_id = 1 \n" + - "\tAND o.date >= #{start_date} \n" + - "\tAND o.date < #{end_date} \n" + - "\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" + - "\t) \n" + - "\tAND c.bd_group IS NOT NULL \n" + - "\tAND fbc.bd_type in (1, 2, 6, 7) \n" + - "GROUP BY\n" + - "\tfbc.bd_type \n" + - "\t) t1\n" + - "\tLEFT JOIN (\n" + - "SELECT\n" + - "\tfbc.*,\n" + - "\tsum( ( o.total ) * d.proportion ) AS total_amount \n" + - "FROM\n" + - "\tstatistics_customer_order o\n" + - "\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" + - "\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" + - "\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id\n" + - "\tINNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group \n" + - "WHERE\n" + - "\tsc.org_id = 1 \n" + - "\tAND o.date >= #{month_start_date} \n" + - "\tAND o.date < #{end_date} \n" + - "\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" + - "\t) \n" + - "\tAND c.bd_group IS NOT NULL \n" + - "\tAND fbc.bd_type in (1, 2, 6, 7) \n" + - "GROUP BY\n" + - "\tfbc.bd_type \n" + - "\t) t2 ON t1.bd_group = t2.bd_group") - List findBdPrizeAmountMonth(@Param("start_date") Date start_date, @Param("end_date") Date end_date,@Param("month_start_date") Date month_start_date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeRecordMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeRecordMapper.java deleted file mode 100644 index cedf3df70..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeRecordMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-02-07. - */ -@AutoMapper(tablename = "financial_bd_prize_records", pkName = "record_id") -public interface FinancialBDPrizeRecordMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.SELECT) - JSONObject findByMonth(@Param("month") String month); - - List listRecordsInYear(@Param("year") String year); - - JSONObject getTotalBDCharge(@Param("month") String month); - - JSONObject getReport(@Param("month") String month); - - JSONObject getChannelReport(@Param("record_id") String recordId, @Param("channel") String channel); - - @AutoSql(SqlType.DELETE) - void delete(@Param("record_id") String recordId); - - List getReportByManagerId(@Param("manager_id") String managerId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java deleted file mode 100644 index daad69cba..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * Created by yixian on 2017-02-07. - */ -@AutoMapper(tablename = "financial_bd_prize_rate_config", pkName = "config_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface FinancialBDRateConfigMapper { - @AutoSql(SqlType.SELECT) - List listAllConfig(); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject update); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialLeaderPrizeLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialLeaderPrizeLogMapper.java deleted file mode 100644 index 575db43f7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialLeaderPrizeLogMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "financial_leader_prize_log", pkName = "leader_prize_log") -public interface FinancialLeaderPrizeLogMapper { - - @AutoSql(SqlType.SELECT) - List listLeaderPrizeLog(@Param(value = "record_id") String record_id); - - @AutoSql(SqlType.INSERT) - void save(JSONObject prizeLog); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionDetailMapper.java deleted file mode 100644 index 2d45c59ae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionDetailMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_partner_commission_detail", pkName = "detail_id") -public interface FinancialPartnerCommissionDetailMapper { - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month,@Param("commission_type") int commission_type); - - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - List listDetails(@Param("record_id") String recordId); - - List listDetailsByRecordIds(List recordId); - - @AutoSql(SqlType.SELECT) - List listDetailByMonth(@Param("year") int year, @Param("month") int month); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java deleted file mode 100644 index 2b50513ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_partner_commission", pkName = "record_id") -public interface FinancialPartnerCommissionMapper { - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month,@Param("commission_type") int commission_type); - - @AutoSql(SqlType.INSERT) - void save(JSONObject commissionAnalysis); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject commission); - - List getOrgPrizeList(@Param("org_id") String orgId); - - List getOrgPrizeDetail(@Param("org_id") String orgId,@Param("month") Date month); - - List listAvailableMonths(@Param("year") int year); - - List listWithOrgInfo(@Param("year") int year, @Param("month") int month); - - List list(@Param("year") int year, @Param("month") int month); - - JSONObject getTotalPartnerCharge(@Param("year") int year, @Param("month") int month); - - List find(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); - - List analysisSenior(@Param("year") int year, @Param("month")int month,@Param("orgIds") List orgIds); - - JSONObject analysisSeniorForGenerate(@Param("year") int year, @Param("month")int month,@Param("orgIds") List orgIds); - - String getRecordId(@Param("org_id") int orgId, @Param("year") int year, @Param("month") int month, @Param("channel") String channel); - - JSONObject findByChanel(@Param("year") int year, @Param("month") int month, @Param("org_id") int orgId,@Param("channel") String channel); - - PageList getClientExtractRecord(@Param("org_id") int orgId, PageBounds pageBounds); - - JSONObject findTotalByOrg(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionDetailMapper.java deleted file mode 100644 index ecda7b446..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionDetailMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_referrer_commission_detail", pkName = "detail_id") -public interface FinancialReferrerCommissionDetailMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject commissionAnalysis); - - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month); - - List listDetailsByRecordIds(List recordId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionMapper.java deleted file mode 100644 index 502db0b8f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_referrer_commission", pkName = "record_id") -public interface FinancialReferrerCommissionMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject commissionAnalysis); - - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month); - - List listAvailableMonths(@Param("year") int year); - - List find(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); - - List list(@Param("year") int year, @Param("month") int month); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialSeniorPartnerCommissionDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialSeniorPartnerCommissionDetailMapper.java deleted file mode 100644 index 408aea59a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialSeniorPartnerCommissionDetailMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_senior_partner_commission_detail", pkName = "id") -public interface FinancialSeniorPartnerCommissionDetailMapper { - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month,@Param("commission_type") int commission_type); - - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - List listDetails(@Param("record_id") String recordId); - - List listDetailsByRecordIds(List recordId); - - @AutoSql(SqlType.SELECT) - List listDetailByMonth(@Param("year") int year, @Param("month") int month); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialSeniorPartnerCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialSeniorPartnerCommissionMapper.java deleted file mode 100644 index f6dbbaf82..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialSeniorPartnerCommissionMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.financial; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-03-08. - */ -@AutoMapper(tablename = "financial_senior_partner_commission", pkName = "id") -public interface FinancialSeniorPartnerCommissionMapper { - @AutoSql(SqlType.DELETE) - void clearData(@Param("year") int year, @Param("month") int month); - - @AutoSql(SqlType.INSERT) - void save(JSONObject commissionAnalysis); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/FundsConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/funds/FundsConfigMapper.java deleted file mode 100644 index 97942b399..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/FundsConfigMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.funds; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * Create by yixian at 2017-09-14 17:31 - */ -@AutoMapper(tablename = "fund_basic_config", pkName = "type_id") -public interface FundsConfigMapper { - @AutoSql(SqlType.SELECT) - List listAll(); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("type_id") String typeId); - - @AutoSql(SqlType.UPDATE) - void updateRate(@Param("type_id") String typeId, @Param("rate") BigDecimal rate); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestClientLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestClientLogMapper.java deleted file mode 100644 index b9be76959..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestClientLogMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.funds; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Create by yixian at 2017-09-21 8:08 - */ -@AutoMapper(tablename = "fund_xplan_interest_client_history", pkName = "detail_id") -public interface XPlanInterestClientLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - List listMerchantLogs(@Param("history_id") String historyId, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestLogMapper.java deleted file mode 100644 index 21b4e01ea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestLogMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.funds; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; - -/** - * Create by yixian at 2017-09-15 14:42 - */ -@AutoMapper(tablename = "fund_xplan_interest_history", pkName = "history_id") -public interface XPlanInterestLogMapper { - - @AutoSql(SqlType.SELECT) - PageList interestLog(PageBounds pagination); - - @AutoSql(SqlType.INSERT) - void save(JSONObject interest); - - @AutoSql(SqlType.SELECT) - JSONObject getTransLogByDate(@Param("date") Date date); - - PageList list(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanMerchantMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanMerchantMapper.java deleted file mode 100644 index 50b6e956e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanMerchantMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.funds; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; - -/** - * Create by yixian at 2017-09-14 20:55 - */ -@AutoMapper(tablename = "fund_xplan_merchants", pkName = "client_id") -public interface XPlanMerchantMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findMerchantConfig(@Param("client_id") int clientId); - - - @AutoSql(SqlType.INSERT) - void save(JSONObject config); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject update); - - void deposit(@Param("client_id") int clientId, @Param("amount") BigDecimal amount); - - void withdraw(@Param("client_id") int clientId, @Param("amount") BigDecimal amount); - - PageList listClients(JSONObject params, PageBounds pageBounds); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanOperationLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanOperationLogMapper.java deleted file mode 100644 index 0936abdf6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanOperationLogMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.funds; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2017-09-15 14:36 - */ -@AutoMapper(tablename = "fund_xplan_log_operation",pkName = "operation_id") -public interface XPlanOperationLogMapper { - - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject log); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanTransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanTransactionMapper.java deleted file mode 100644 index bf8af2555..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/funds/XPlanTransactionMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.funds; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Create by yixian at 2017-09-14 21:20 - */ -@AutoMapper(tablename = "fund_xplan_transactions", pkName = "transaction_id") -public interface XPlanTransactionMapper { - @AutoSql(SqlType.INSERT) - void saveTransaction(JSONObject transaction); - - @AutoSql(SqlType.SELECT) - PageList listMerchantTransactions(JSONObject params, PageBounds pagination); - - List listDailyTransactions(@Param("client_id") int clientId, @Param("date") Date date); - - @AutoSql(SqlType.SELECT) - JSONObject findTransaction(@Param("transaction_id") String transactionId); - - BigDecimal analysisMerchantTotalAchieve(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - List findByRequestId(@Param("client_id") int clientId, @Param("request_id") String requestId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/loanapplication/LoanApplicationMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/loanapplication/LoanApplicationMapper.java deleted file mode 100644 index 3e171fb34..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/loanapplication/LoanApplicationMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.loanapplication; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.LoanApplication; -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.request.ModifyLoanApplicationRequest; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -import java.util.Map; - -@AutoMapper(tablename = "sys_clients_loans_apply", pkName = "id") -public interface LoanApplicationMapper { - - PageList listPagedLoanApplication(Map params, PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void save(JSONObject request); - - LoanApplication findById(@Param("id") String id); - - @AutoSql(SqlType.UPDATE) - void updateLoanApplication(ModifyLoanApplicationRequest request); - - @AutoSql(SqlType.DELETE) - void deleteLoanApplication(@Param("id") String id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/AppMessageLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/AppMessageLogMapper.java deleted file mode 100644 index 517b96ae8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/AppMessageLogMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yishuqian on 13/04/2017. - */ -@AutoMapper(tablename = "log_app_msg", pkName = "send_id") -public interface AppMessageLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject log); - @AutoSql(SqlType.UPDATE) - void updateStatus(@Param("send_id") String id, @Param("status") int status, @Param("remark") String remark); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject object); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.java deleted file mode 100644 index 91fbc4899..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - - -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileDTO; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileQueryParameter; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileTunnel; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.PageSize; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.TimeRange; -import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.TimeRangeAndPageSizeQueryParameter; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; - - -/** - * @Description - * @title: - * @Date 2020/11/4 14:25 - * @author: zhangTao - */ -@AutoMapper(tablename = "log_validation_attachment_batches", pkName = "batch_id") -public interface ChannelReconciliationFileTunnelMapper extends ChannelReconciliationFileTunnel { - - - PageList queryChannelReconciliationFile(String billType, String channel, String startTime, String endTime, PageBounds pagination); - - @Override - default PageList list(ChannelReconciliationFileQueryParameter channelReconciliationFileQueryParameter){ - TimeRangeAndPageSizeQueryParameter timeRangeAndPageSizeQueryParameter = channelReconciliationFileQueryParameter.getTimeRangeAndPageSizeQueryParameter(); - TimeRange timeRange = timeRangeAndPageSizeQueryParameter.getTimeRange(); - PageSize pageSize = timeRangeAndPageSizeQueryParameter.getPageSize(); - - String channel = channelReconciliationFileQueryParameter.getChannel(); - String billType = channelReconciliationFileQueryParameter.getBillType(); - return this.queryChannelReconciliationFile(billType,channel, timeRange.getStartTime(), timeRange.getEndTime() , new PageBounds(pageSize.getPage(), pageSize.getRows())); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java deleted file mode 100644 index f5ab7190d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-03-21. - */ -@AutoMapper(tablename = "log_clearing_detail_analysis", pkName = "detail_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ClearingDetailAnalysisMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject channel); - - List analysisChannelReport(@Param("clearing_id") int clearingId); - - List analysisChannelReportDaily(@Param("settle_date") Date settleDate); - - @AutoSql(SqlType.SELECT) - List listReportChannels(@Param("clearing_detail_id") String clearDetailId); - - List listReportChannelsOfMergeSettle(@Param("report_date") String reportDate, @Param("client_id") int clientId); - - BigDecimal getSysCleaingAmount(@Param("settle_date") String settle_date, @Param("channel") String channel); - - void clearAnalysis(@Param("clearing_id") int clearingId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java deleted file mode 100644 index 1bcd222dc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-09-05. - */ -@AutoMapper(tablename = "log_clearing_detail", keyGenerator = Jdbc3KeyGenerator.class, pkName = "clear_detail_id") -public interface ClearingDetailMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("client_id") int clientId, @Param("clearing_id") int clearId); - - @AutoSql(SqlType.SELECT) - JSONObject findByDetailId(@Param("clear_detail_id") int clearDetailId); - - List listReports(@Param("client_id") int clientId, @Param("month") Date month); - - List listReportsOfSettlement(@Param("clearing_id") int clearingId); - - JSONObject listReportsOfSettleCleanDay(@Param("clearing_id") int clearingId, @Param("client_ids") List client_ids); - - PageList listReportsOfSettlementLogs(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.SELECT) - JSONObject listReport(@Param("clear_detail_id") String clearDetailId, @Param("client_id") int client_id); - - JSONObject listReportOfMergeSettle(@Param("report_date") String reportDate, @Param("client_id") int client_id); - - @AutoSql(SqlType.SELECT) - JSONObject listReportByDate(@Param("report_date") Date date, @Param("client_id") int clientId); - - PageList listClientSettlementLog(JSONObject params, PageBounds pagination); - - void updateAllBanks(@Param("settle_bank") String bank, @Param("clearing_id") int clearingId); - - @AutoSql(SqlType.UPDATE) - void updateBanks(@Param("settle_bank") String bank,@Param("clear_detail_id") List clearingDetailIds); - - @AutoSql(SqlType.DELETE) - void deleteSettleLogs(@Param("clearing_id") int clearingId); - - List batchReport(@Param("clearing_id") int clearingId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java deleted file mode 100644 index 32e9bf29e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-09-04. - */ -@AutoMapper(tablename = "log_clearing", pkName = "clearing_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ClearingLogMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject clearingLog); - - List findByDate(Date date); - - List listSettlementDatesInMonth(@Param("month") Date month); - - List listLatestSettleDates(@Param("limit") int limit); - - List getSettlementMonthReport(@Param("year") int year, @Param("month") int month); - - JSONObject getTotalPlatformCharge(@Param("year") int year, @Param("month") int month); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject update); - - List getSettlementChannelsMonthReport(@Param("year") int year, @Param("month") int month); - - List getMondayClearing(@Param("begin") Date begin, @Param("end") Date end); - - List getSettlementChannelsDailyReport(@Param("date") Date date); - - JSONObject getSettleDataDailyReport(@Param("date") Date date); - - void lockSettlements(@Param("date") Date date); - - void lockSettlementsById(@Param("clearing_ids") List clearingIds); - - @AutoSql(SqlType.SELECT) - JSONObject findById(@Param("clearing_id") int clearingId); - - @AutoSql(SqlType.UPDATE) - void setLogEditable(@Param("editable") boolean editable, @Param("clearing_id") int clearingId); - - @AutoSql(SqlType.DELETE) - void deleteSettleLogs(@Param("clearing_id") int clearingId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientConfigLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientConfigLogMapper.java deleted file mode 100644 index 9d9de007c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientConfigLogMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2016-10-14. - */ -@AutoMapper(tablename = "log_client_config", pkName = "id") -public interface ClientConfigLogMapper { - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject log); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientLoginLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientLoginLogMapper.java deleted file mode 100644 index 893251020..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientLoginLogMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2016-10-14. - */ -@AutoMapper(tablename = "log_client_login", pkName = "id") -public interface ClientLoginLogMapper { - - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject log); - - @AutoSql(SqlType.SELECT) - PageList listAccountLog(@Param("account_id") String accountId, PageBounds pagination); - - PageList listClientLog(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientReviewLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientReviewLogMapper.java deleted file mode 100644 index ea2d79219..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientReviewLogMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-04-18. - */ -@AutoMapper(tablename = "log_client_review",pkName = "review_id") -public interface ClientReviewLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject review); - - @AutoSql(SqlType.SELECT) - JSONObject findReviewLog(@Param("client_id") int clientId, @Param("review_date") Date date); - - List listReviewLogs(@Param("clientId") int clientId, @Param("from") Date from, @Param("to") Date to); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientsOperationLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientsOperationLogMapper.java deleted file mode 100644 index 0ad9378ab..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClientsOperationLogMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-04-18. - */ -@AutoMapper(tablename = "log_clients_operation",pkName = "id") -public interface ClientsOperationLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject review); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java deleted file mode 100644 index 406f9a436..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import java.util.List; - -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -@AutoMapper(tablename = "cus_coupon_accuess_log", pkName = "accuess_id") -public interface CouponAccuessLogMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject params); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject params); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") - JSONObject findUsedCouponByOrderId(@Param("order_id") String order_id); - - @AutoSql(SqlType.SELECT) - List findCouponByOrderId(@Param("order_id") String order_id); - - PageList getCouponAccuessLog(@Param("client_id")int client_id, @Param("keyword")String keyword, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 0") - List findAccuessLogByOrderId(@Param("order_id") String order_id, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") - List findUsedCouponByOrderIdList(@Param("order_id") String order_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/CustomizedSettleLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/CustomizedSettleLogMapper.java deleted file mode 100644 index 46c7587c6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/CustomizedSettleLogMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.Date; -import java.util.List; - -@AutoMapper(tablename = "log_settle_customized", pkName = "log_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface CustomizedSettleLogMapper { - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("log_id") int logId); - - @Select("select * from log_settle_customized where create_time between #{date_from} and #{date_to}") - List listByDate(@Param("date_from") Date dateFrom,@Param("date_to") Date dateTo); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/DailyReportMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/DailyReportMapper.java deleted file mode 100644 index 5d3f4bcae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/DailyReportMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yishuqian on 16/11/2017. - */ -@AutoMapper(tablename = "log_daily_report", pkName = "report_id") -public interface DailyReportMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject report); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("report_id") String reportId); - - @AutoSql(SqlType.DELETE) - void delete(@Param("report_id") String reportId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/GatewayClientApplyNotifyLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/GatewayClientApplyNotifyLogMapper.java deleted file mode 100644 index bfffbf22a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/GatewayClientApplyNotifyLogMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -/** - * Created by davep on 2016-07-22. - */ -@AutoMapper(tablename = "gateway_clientApply_notify_log", pkName = "id") -public interface GatewayClientApplyNotifyLogMapper { - - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject log); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject notice); - - @AutoSql(SqlType.SELECT) - JSONObject findHistoryByClientId(@Param("client_id") int clientId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogClientSubMerchantIdMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogClientSubMerchantIdMapper.java deleted file mode 100644 index d3a91775a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogClientSubMerchantIdMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "log_client_sub_merchant_id", pkName = "id") -public interface LogClientSubMerchantIdMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject log); - - @AutoSql(SqlType.SELECT) - List listLogsByClientId(@Param("client_id") int client_id, PageBounds pageBounds); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogRiskMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogRiskMapper.java deleted file mode 100644 index a6e5ce44b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogRiskMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -/** - * Created by wangning on 2017/9/5. - */ -@AutoMapper(tablename = "log_risk", pkName = "id") -public interface LogRiskMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject cashier); - - PageList listWithClientInfo(JSONObject params, PageBounds pagination); - - List statisticsRiskLog(JSONObject params); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogSettleMailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogSettleMailMapper.java deleted file mode 100644 index 0f4f6a6ae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/LogSettleMailMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-09-04. - */ -@AutoMapper(tablename = "log_settle_send", pkName = "id") -public interface LogSettleMailMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject clearingLog); - - List findByDate(Date date); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject update); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ManagerLoginLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ManagerLoginLogMapper.java deleted file mode 100644 index fce799530..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ManagerLoginLogMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2016-10-14. - */ -@AutoMapper(tablename = "log_manager_login", pkName = "id") -public interface ManagerLoginLogMapper { - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject log); - - @AutoSql(SqlType.SELECT) - PageList listAccountLoginLog(@Param("manager_id") String managerId, PageBounds pagination); - - PageList listManagerLoginLog(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.java deleted file mode 100644 index 771f3fb05..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-07-22. - */ -@AutoMapper(tablename = "log_notify_error", pkName = "id") -public interface NotifyErrorLogMapper { - - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject log); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "success=0 and `addtime`>addtime(now(),'-24:00:00')") - List listErrorLogsInOneHour(); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject notice); - - PageList listErrorLogs(JSONObject params, PageBounds pageBounds); - - List listUnsentOrders(@Param("date") Date date); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java deleted file mode 100644 index bc3b6ae69..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -@AutoMapper(tablename = "log_clearing_platform_analysis", pkName = "log_id") -public interface PlatformSettlementMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject params); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject params); - - @AutoSql(SqlType.SELECT) - List findBySettleDate(@Param("settle_date") Date settle_date, @Param("channel") String channel); - - @AutoSql(SqlType.SELECT) - JSONObject findByDateMerchant(@Param("settle_date") String settle_date, @Param("channel") String channel, @Param("merchants") String merchants); - - @AutoSql(SqlType.SELECT) - List findByDate(@Param("settle_date") String settle_date); - - PageList findSettleLogsAllMerchant(@Param("channel") String channel, PageBounds pageBounds); - - JSONObject calculateSysSettleLog(@Param("start_date") Date startDate, @Param("end_date") Date endDate, @Param("channel") String channel, - @Param("pid") String pid, @Param("transaction_type") String type); - - BigDecimal calculateRmbCharge(@Param("start_date") Date start_date, @Param("end_date") Date end_date, @Param("channel") String channel); - - @AutoSql(SqlType.DELETE) - void delete(JSONObject params); - - JSONObject calculateChannelSysSettleLog(@Param("start_date") Date startDate, @Param("end_date") Date endDate, @Param("channel") String channel, - @Param("transaction_type") String type); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/PreSettleTaskMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/PreSettleTaskMapper.java deleted file mode 100644 index 1a74e031d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/PreSettleTaskMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import org.apache.ibatis.annotations.Param; - -/** - * Create by davep at 2020-02-04 11:40 - */ -@AutoMapper(tablename = "log_presettle_task",pkName = "task_id") -public interface PreSettleTaskMapper { - - void resetClearStatus(@Param("clearing_id") int clearingId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/StatisticsBDSalesReportMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/StatisticsBDSalesReportMapper.java deleted file mode 100644 index 5bbae6d65..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/StatisticsBDSalesReportMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by dulingling on 2019-08-14 - */ -@AutoMapper(tablename = "statistics_bd_sales", pkName = "log_id") -public interface StatisticsBDSalesReportMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject report); - - List getBDSaleList(JSONObject params); - - List getPartnerAmountList(JSONObject params); - - JSONObject findByBDIdAndLogDate(@Param("org_id") String org_id,@Param("bd_id") String bd_id, @Param("log_date")String beginTime,@Param("isOrg") int isOrg); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject existBDSalesReport); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java deleted file mode 100644 index ad98d8d2a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2016-09-19. - */ -@AutoMapper(tablename = "log_order_validation", pkName = "valid_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ValidationLogMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject valid); - - void removeByDate(@Param("valid_date") Date validDate); - - JSONObject findByDate(@Param("valid_date") Date validDate); - - List listValidatedReports(@Param("month") Date month); - - List listValidatedDates(Date month); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/WechatTemplateMsgSendLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/WechatTemplateMsgSendLogMapper.java deleted file mode 100644 index f82f2940a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/WechatTemplateMsgSendLogMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by davep on 2016-08-18. - */ -@AutoMapper(tablename = "log_wechat_template_msg", pkName = "send_id") -public interface WechatTemplateMsgSendLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject log); - - @AutoSql(SqlType.UPDATE) - void updateStatus(@Param("send_id") String id, @Param("status") int status); - - @AutoSql(SqlType.UPDATE) - void updateLog(@Param("send_id") String id, @Param("status") int status, @Param("remark") String remark); - - List listWechatMsg(JSONObject params, PageBounds pageBounds); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/WeekReportMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/WeekReportMapper.java deleted file mode 100644 index c4aa5bf38..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/WeekReportMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.log; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2017-03-03. - */ -@AutoMapper(tablename = "log_week_report", pkName = "report_id") -public interface WeekReportMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject report); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("report_id") String reportId); - - @AutoSql(SqlType.DELETE) - void delete(@Param("report_id") String reportId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/notice/ActPartnerReadMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/notice/ActPartnerReadMapper.java deleted file mode 100644 index d9b98c6e1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/notice/ActPartnerReadMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.notice; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - - -/** - * Created by yishuqian on 29/09/2016. - */ -@AutoMapper(tablename = "sys_act_client_display", pkName = "display_client_id") -public interface ActPartnerReadMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject displayInfo); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject displayInfo); - - @AutoSql(SqlType.SELECT) - JSONObject displayInfo(@Param("act_id") String actId, @Param("client_id") int clientId, @Param("account_id") String accountId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/notice/NoticeManageMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/notice/NoticeManageMapper.java deleted file mode 100644 index 0816861ae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/notice/NoticeManageMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.notice; - -import java.util.Date; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yishuqian on 10/10/2016. - */ -@AutoMapper(tablename = "sys_notice", pkName = "notice_id") -public interface NoticeManageMapper { - @AutoSql(SqlType.SELECT) - PageList listPageNotices(JSONObject params, PageBounds pagination); - @AutoSql(SqlType.SELECT) - @AdvanceSelect(excludeColumns = {"desc"}) - JSONObject getNoticeDetailById(String noticeId); - @AutoSql(SqlType.INSERT) - void createNotice(JSONObject notice); - @AutoSql(SqlType.UPDATE) - void updateNotice(JSONObject notice); - - JSONObject getLatestWindowNotice(@Param("client_id") int client_id,@Param("end_time")Date end_time); - - JSONObject getLatestWindowConfirmNotice(@Param("client_id") int client_id,@Param("end_time")Date end_time); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/notice/NoticePartnerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/notice/NoticePartnerMapper.java deleted file mode 100644 index cc2086c86..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/notice/NoticePartnerMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.notice; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - - -/** - * Created by yishuqian on 29/09/2016. - */ -@AutoMapper(tablename = "sys_notice_client", pkName = "notice_client_id") -public interface NoticePartnerMapper{ - @AutoSql(SqlType.INSERT) - void save(JSONObject noticePartner); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject noticePartner); - - @AutoSql(SqlType.SELECT) - List listNoticePartner(JSONObject noticePartner); - - PageList listNoticesByClientId(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.COUNT) - int countNoticePartner(JSONObject params); - - @AutoSql(SqlType.COUNT) - int countClientsByNoticeId(JSONObject params); - - PageList listClientsByNoticeId(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/ofei/TopUpOrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/ofei/TopUpOrderMapper.java deleted file mode 100644 index 6f843c8f6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/ofei/TopUpOrderMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.ofei; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2016-06-25. - */ -@AutoMapper(tablename = "top_up_order", pkName = "id") -public interface TopUpOrderMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject order); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject order); - - @AutoSql(SqlType.SELECT) - JSONObject findById(@Param("id") String id); - - List findOrderIdByStatus(@Param("status") String status); - - PageList listPageable(JSONObject jsonObject, PageBounds pageBounds); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/package-info.java b/src/main/java/au/com/royalpay/payment/manage/mappers/package-info.java deleted file mode 100644 index b2d9b67d4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * mybatis mappers - * Created by yixian on 2016-06-24. - */ -package au.com.royalpay.payment.manage.mappers; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/AustracDataMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/AustracDataMapper.java deleted file mode 100644 index 22119c490..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/AustracDataMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 01/12/2016. - */ -@AutoMapper(tablename = "austrac_data", pkName = "id") -public interface AustracDataMapper { - @AutoSql(SqlType.SELECT) - List getTransactionTotal(JSONObject params); - - @AutoSql(SqlType.DELETE) - void delete(@Param("client_id") int client_id, @Param("clearing_time") Date clearing_time); - - BigDecimal getClientLastTransactionTotal(@Param("client_id") int client_id, @Param("clearing_time") Date clearing_time); - - @AutoSql(SqlType.INSERT) - void save(JSONObject data); - - List getAustracData(JSONObject params); - - List getAustracDataNew(JSONObject params); - - List getAustracReport(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java deleted file mode 100644 index 3d541898b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-05 23:13 - */ -@AutoMapper(tablename = "pmt_sub_merchant_id", pkName = "sub_merchant_id") -public interface CommonSubMerchantIdMapper { - @AutoSql(SqlType.SELECT) - PageList list(@Param("is_valid") boolean is_valid, @Param("sub_merchant_id") String sub_merchant_id,PageBounds pageBounds); - - - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject record); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") - JSONObject find(@Param("sub_merchant_id") String subMerchantId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java deleted file mode 100644 index de3a5fee2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java +++ /dev/null @@ -1,82 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2016-06-24. - */ -@AutoMapper(tablename = "pmt_orders", pkName = "order_id") -public interface OrderMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject order); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject order); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("order_id") String orderId); - - @AutoSql(SqlType.SELECT) - List listOrdersByMerchantOrderId(@Param("client_id") int clientId, @Param("client_order_id") String clientOrderId, PageBounds pagination); - - PageList listOrders(JSONObject params, PageBounds pagination); - - PageList listIncrementalOrders(JSONObject params, PageBounds pagination); - - PageList listIncrementalOrdersNew(JSONObject params, PageBounds pagination); - - List listOrdersNoPage(JSONObject params); - - PageList listOrdersByClients(JSONObject params, PageBounds pagination); - - PageList listIncrementalOrdersByClients(JSONObject params, PageBounds pagination); - - JSONObject analysisOrders(JSONObject params); - - JSONObject getOrderDetail(@Param("order_id") String orderId); - - @AutoSql(SqlType.SELECT) - PageList list(JSONObject params, PageBounds pagination); - - void updateRefundAmount(@Param("order_id") String orderId); - - List listOrdersWithNoTransactions(); - - @AutoSql(SqlType.UPDATE) - void setOrderErrorInfo(@Param("order_id") String orderId, @Param("error_code") String errCode, @Param("error_message") String errMsg); - - void updateOrderCreationError(@Param("order_id") String orderId, @Param("status") int status, @Param("error_code") String errorCode, @Param("error_message") String errorMessage); - - int getOldOrdersPoints(@Param("customer_id") String openId); - - PageList listOrderByCustomer(JSONObject params, PageBounds pagination); - - List listPaid(JSONObject params, PageBounds pageBounds); - - List listOrdersByClientsNoPages(JSONObject params); - - List listAnalysisClientCustomer(JSONObject params); - - List listTransactionsForApp(JSONObject params); - - JSONObject findOrderById(@Param("order_id") String orderId,@Param("client_id") int clientId); - - List listHalloweenActOrder(JSONObject param); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status in (5,6,7) AND channel in('Wechat','Alipay')") - List listNewYearOrdersByOpenId(@Param("customer_id") String open_id,@Param("transaction_date") String date); - - List listGatewayByClientId(@Param("client_id") int clientId); - - List getClientAndCustomerLoc(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/PaySuccessCountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/PaySuccessCountMapper.java deleted file mode 100644 index 3cb89c838..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/PaySuccessCountMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by todking on 2019-06-15. - */ - -@AutoMapper(tablename = "paysuccess_count", pkName = "id") -public interface PaySuccessCountMapper { - - @AutoSql(SqlType.SELECT) - List findCount(@Param("in_time") String time); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundAuditionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundAuditionMapper.java deleted file mode 100644 index 8eb16a101..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundAuditionMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by davep on 2016-07-23. - */ -@AutoMapper(tablename = "pmt_refund_applies", pkName = "id") -public interface RefundAuditionMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject apply); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject apply); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "audit_result is null") - List listAuditingRefundsOfOrder(@Param("order_id") String orderId); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("id") String refundAuditId); - - List listAuditingRefundsOfClient(@Param("client_id") int clientId); - - List listAllAuditingRefundsOfClient(@Param("client_id") int clientId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java deleted file mode 100644 index dd4926da6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2016-06-25. - */ -@AutoMapper(tablename = "pmt_refunds", pkName = "refund_id") -public interface RefundMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject refundOrder); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject refundOrder); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("refund_id") String refundOrderId); - - @AutoSql(SqlType.SELECT) - JSONObject findByClientRefundId(@Param("client_refund_id") String clientRefundId); - - List listOrderRefunds(@Param("order_id") String orderId, PageBounds pagination); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status=2") - List listUnConfirmedRefunds(); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status=4 and confirm_time is not null") - List listConfirmedRefunds(); - - @AutoSql(SqlType.SELECT) - JSONObject findByOutRefundId(@Param("out_refund_id") String outRefundNo); - - List listConfirmedRefundsWithNoTransactions(); - - JSONObject findRefundInfoByDay(@Param("begin") Date begin, @Param("end") Date end); - - List findClientMoniker(@Param("begin") Date begin, @Param("end") Date end, @Param("amount") BigDecimal amount); - - List listRefundCount(@Param("begin") Date begin, @Param("end") Date end); - - List listRefundDate(@Param("begin") Date begin, @Param("end") Date end); - - List listClientRefund(JSONObject param); - - PageList listUnionAllApply(JSONObject params, PageBounds pagination); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundReviewMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundReviewMapper.java deleted file mode 100644 index fef322cab..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundReviewMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by Tayl0r on 2017/6/20. - */ -@AutoMapper(tablename = "pmt_refunds_review", pkName = "review_id") -public interface RefundReviewMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject review); - - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status=0 and is_valid=1") - JSONObject findUnResolveByOrderId(@Param("order_id") String orderId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status=0 and is_valid=1") - JSONObject findUnResolveByReviewId(@Param("review_id") String reviewId); - - @AutoSql(SqlType.SELECT) - JSONObject findByReviewId(@Param("review_id") String reviewId); - - PageList listNeedReviewOrders(JSONObject reviewBean, PageBounds page); - - JSONObject analysisReviewRefundOrders(JSONObject reviewBean); - - void updateReviewOrders(JSONObject review); - - int notifyRefundReview(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java deleted file mode 100644 index 6b6052f90..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Create by yixian at 2018-03-20 18:05 - */ -@AutoMapper(tablename = "task_client_manual_settle", pkName = "task_id") -public interface TaskManualSettleMapper { - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "request_time>curdate()") - JSONObject findTodayTask(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "clearing_order is null or disable_flag=1") - List listActiveTasks(@Param("client_id") int clientId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject task); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject task); - - PageList getEveryLatestRecord(PageBounds pagination); - - JSONObject getManualSettleAnalysis(); - - void rollbackExecutedTask(@Param("clearing_id") int clearingId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java deleted file mode 100644 index a3e393e9a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ /dev/null @@ -1,180 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.payment; - -import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.yixsoft.support.mybatis.paginator.annotations.CountRef; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2016-07-01. - */ -@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface TransactionMapper { - - PageList listTransFlowPage(JSONObject params, PageBounds pagination); - - int countTransFlowPage(JSONObject params); - - List listTransFlow(JSONObject params); - - JSONObject analysisTransFlow(JSONObject params); - - Double analysisBalance(JSONObject params); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "transaction_type = 'Credit'") - JSONObject findByOrderId(@Param("order_id") String orderId); - - JSONObject findLastIncome(); - - double getClientUnClearedAmount(@Param("client_id") int clientId); - - List getClientsUnClearedAmount(@Param("client_ids") List clientIds); - - JSONObject getClientAmountAnalysis(JSONObject params); - - PageList listPreRefundClients(PageBounds pagination); - - PageList listPreGeekCostClients(PageBounds pagination); - - JSONObject validAnalysis(@Param("from") Date from, @Param("to") Date to, @Param("channel") String channel, @Param("merchant_id") String merchantId); - - List listUnclearedTransactionsOfClient(@Param("client_id") int clientId, @Param("end") Date finish, @Param("settleDate") Date settleDate); - - List listTransactionsOfClearingOrder(@Param("clearing_order") int detailId, PageBounds pagination); - - List listTransactionsOfMergeSettleClearingOrder(@Param("report_date") String reportDate, @Param("client_id") int clientId, PageBounds pagination); - - List listSettlementTransactions(@Param("clearing_order") int detailId); - - PageList listSettlementLog(JSONObject params, PageBounds pagination); - - PageList listSettlementLogOrigin(JSONObject params, PageBounds pagination); - - PageList listSettlementLogForDashbord(JSONObject params, PageBounds pagination); - - @CountRef(".countSettlementLogInClients") - PageList listSettlementLogInClients(JSONObject params, PageBounds pagination); - - int countSettlementLogInClients(JSONObject params); - - JSONObject analysisSettlementLog(JSONObject params); - - List listSettlementLogTotal(JSONObject params); - - List getAusTracData(JSONObject params); - - JSONObject getAusTracData2(JSONObject params); - - List getAusTrackReportData(JSONObject params); - - List getMerchantAmount(JSONObject params); - - JSONObject getSumMerchantAmount(JSONObject params); - - double analysisTotalTransactions(@Param("client_id") int clientId, @Param("begin") Date begin, @Param("end") Date end); - - List listTransactionsOfClearingTask(@Param("clear_id") int clearId); - - List listTransactionsForBDPrize(@Param("year") int year, @Param("month") int month, @Param("channel") String channel); - - BigDecimal totalAmountForBDPrize(@Param("year") int year, @Param("month") int month, @Param("bd_id") String bd_id); - - BigDecimal totalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group); - - BigDecimal totalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month); - - List listTransactionForCityPartnerCommissionByDate(@Param("begin") Date begin, @Param("end") Date end); - - List listTransactionForCityPartnerAgentCommissionByDate(@Param("begin") Date begin, @Param("end") Date end); - - List listTransactionsForCityPartnerCommission(@Param("begin") Date begin, @Param("end") Date end); - - List listTransactionsForReferrerCommission(@Param("begin") Date begin, @Param("end") Date end); - - List listTransactionsForAgentCommission(@Param("year") int year, @Param("month") int month, @Param("parent_org_id") int parent_org_id); - - BigDecimal checkBalance(@Param("end") Date endDate); - - @AutoSql(SqlType.COUNT) - @AdvanceSelect(addonWhereClause = "transaction_type='Credit'") - int countOrders(@Param("client_id") int clientId); - - List listDailyTransactions(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId, @Param("client_ids") String[] client_ids); - - JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId, @Param("client_ids") String[] client_ids); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "system_generate=1") - List findTransactionsBySysGen(@Param("order_id") String orderId); - - BigDecimal analysisCustomerPaid(@Param("customer_id") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); - - List getSettleDelayAnalysis(@Param("begin") Date begin, @Param("end") Date end); - - List getSettleDelayTotalTransaction(@Param("begin") Date begin, @Param("end") Date end); - - List getClientRank(@Param("begin") Date begin, @Param("end") Date end); - - List listClientUnsettleDataByDate(@Param("client_id") int clientId, @Param("max_settle_to") Date maxSettleTo); - - void deleteSettlementTransaction(@Param("clearing_id") int clearingId); - - void removeSettleRemark(@Param("clearing_id") int clearingId); - -// void removePreSettleRemark(@Param("clearing_id") int clearingId); - - List getHfClearAmount(JSONObject params); - - List analysisForATOReport(@Param("clientId") int clientId, @Param("channels") List channels, @Param("from") Date startOfMon, @Param("to") Date endOfMon); - - /** - * 付款退款都是同一个退款单号 - * - * @param clientId - * @param systemTransactionId - * @return - */ - @AutoSql(SqlType.SELECT) - PageList findByClientIdAndSystemTransactionId(@Param("client_id") int clientId, - @Param("system_transaction_id") String systemTransactionId, - PageBounds pageBounds); - - List listCreditTransactionsForSecure(@Param("from") Date from, @Param("to") Date to); - - List listDebitTransactionsForSecure(@Param("from") Date from, @Param("to") Date to); - - JSONObject getClearDetailTotal(JSONObject params); - - List getSettlementLogDetailList(@Param("clientOrders") List clientOrders); - - List getClientOrderByTransactionTime(JSONObject params); - - List getLastDaytransAmount(JSONObject params); - - List useAlipayOnlineClients(); - - /** - * 日清算 - * - * @param beginTime - * @param endTime - * @return - */ - List getSettleDataDailyReport(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime); - - List analysisByChannels(@Param("from") Date from, @Param("to") Date to, @Param("channels") List channels); - - TransactionStatus getTransactionStatusById(String transactionId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/PreApplyHandleLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/PreApplyHandleLogMapper.java deleted file mode 100644 index b202aa03e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/PreApplyHandleLogMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.preapply; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "pre_apply_handle_log", pkName = "id") -public interface PreApplyHandleLogMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject data); - - @AutoSql(SqlType.INSERT) - void save(JSONObject data); - - @AutoSql(SqlType.SELECT) - PageList listHandleLogs(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java deleted file mode 100644 index b915db7a3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.preapply; - -import com.alibaba.fastjson.JSONObject; - -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -@AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id",keyGenerator = Jdbc3KeyGenerator.class) -public interface SysClientPreMapperMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject data); - - @AutoSql(SqlType.INSERT) - void save(JSONObject data); - - @AutoSql(SqlType.SELECT) - JSONObject findByUserName(@Param("username") String username); - - List query(JSONObject param); - - @AutoSql(SqlType.SELECT) - PageList listApplies(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.SELECT) - JSONObject findOneByClientPreApplyId(@Param("client_pre_apply_id")String client_pre_apply_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java deleted file mode 100644 index 145b67830..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 04/01/2017. - */ -@AutoMapper(tablename = "act_black_list", pkName = {"act_id", "client_id"}) -public interface ActBlackListMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject blackObj); - - @AutoSql(SqlType.SELECT) - List list(JSONObject params); - - @AutoSql(SqlType.SELECT) - List listByActId(@Param("act_id") String act_id); - - - @AutoSql(SqlType.DELETE) - void delete(@Param("act_id") String act_id, @Param("client_id") int client_id); - - @AutoSql(SqlType.DELETE) - void delete(@Param("act_id") String act_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActClientApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActClientApplyMapper.java deleted file mode 100644 index 3e8799d01..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActClientApplyMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -@AutoMapper(tablename = "act_client_apply", pkName = "id") -public interface ActClientApplyMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject apply); - - @AutoSql(SqlType.SELECT) - JSONObject findActivity(@Param("act_id") String actId, @Param("client_id") int clientId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject apply); - - List listAttendClients(@Param("act_id") String actId); - - List search(@Param("clientMoniker") String clientMoniker); - - @AutoSql(SqlType.DELETE) - void remove(@Param("act_id") String actId, @Param("client_id") int clientId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActClientInvitationCodeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActClientInvitationCodeMapper.java deleted file mode 100644 index 7e120e6ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActClientInvitationCodeMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 09/01/2017. - */ -@AutoMapper(tablename = "act_client_invitation_code", pkName = {"act_id", "client_moniker"}) -public interface ActClientInvitationCodeMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject jsonObject); - - @AutoSql(SqlType.SELECT) - JSONObject getInvitationCode(@Param("act_id") String act_id, @Param("client_moniker") String client_moniker); - - @AutoSql(SqlType.DELETE) - void deleteInvitaionCode(@Param("act_id") String act_id); - - @AutoSql(SqlType.UPDATE) - void changeClientInvitationCode(JSONObject data); - - @AutoSql(SqlType.SELECT) - List getInvitationCodes(@Param("act_id") String act_id); - - @AutoSql(SqlType.SELECT) - JSONObject getInvitationClient(@Param("act_id") String act_id, @Param("client_id") int client_id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.java deleted file mode 100644 index 0876a0027..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.java +++ /dev/null @@ -1,71 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 09/12/2016. - */ -@AutoMapper(tablename = "act_red_packets_orders", pkName = "red_packet_order_id") -public interface ActPartnerLMLogMapper { - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject sendLog); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject lucky_money); - - @AutoSql(SqlType.SELECT) - PageList listSendLogs(JSONObject params, PageBounds pageBounds); - - List sendList(JSONObject params); - - int sendCount(JSONObject params); - - int count(JSONObject params); - - BigDecimal getTotalLuckyMoney(@Param("act_id") String act_id); - - List listUnsendRedpacks(); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("red_packet_id") String red_packet_id); - - JSONObject analysisLuckyMoney(JSONObject params); - - int lockPrize(@Param("act_id") String act_id, @Param("lock_key") String lock, @Param("red_pack_type_id") String prizeType, @Param("open_id") String open_id, - @Param("client_id") int client_id, @Param("order_id") String order_id, @Param("order_amount") Double order_amount, @Param("event_time") Date date); - - @AutoSql(SqlType.SELECT) - JSONObject findLockedPrize(@Param("lock_key") String lock, @Param("open_id") String openid); - - void clearUnsendRedpacks(@Param("act_id") String actId, @Param("red_pack_type_id") String typeId); - - List getUnSendOrders(@Param("transaction_time") String transaction_time, @Param("channel") String channel); - - List getSendLogsAnalysis(JSONObject params); - - - BigDecimal getRedpackAmount(@Param("analysis_date") Date analysis_date); - - List getTopSendCounts(JSONObject params); - - PageList getTopSendCounts(JSONObject params, PageBounds pageBounds); - - int getRedPacketsByOpenid(@Param("open_id") String openid, @Param("event_date") Date date); - - List getUnSendRedPackLog(@Param("act_id") String actId, @Param("client_id") int client_id); - - BigDecimal getUnSendRedPackAmount(@Param("act_id") String actId, @Param("client_id") int client_id); - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMMapper.java deleted file mode 100644 index 13feeb55e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -@AutoMapper(tablename = "act_red_packets", pkName = "act_id") -public interface ActPartnerLMMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject act); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("act_id") String act_id); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject act); - - void closePartnerActivities(); - - PageList listActivities(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - List actList(JSONObject params); - - List listActivitiesNoPage(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerWechatRelationMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerWechatRelationMapper.java deleted file mode 100644 index f29ce77be..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerWechatRelationMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yishuqian on 08/12/2016. - */ -@AutoMapper(tablename = "act_red_packets_wechat",pkName = "relation_id") -public interface ActPartnerWechatRelationMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject relation); -//@Param("act_id") String act_id,@Param("client_id") int client_id,@Param("wechat_openid") String wechat_openid - void deleteBindWehcat(JSONObject update); - -// @AutoSql(SqlType.SELECT) -// List relationList(@Param("act_id") String act_id,@Param("client_id") int client_id,@Param("channel") String channel); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List relationList(JSONObject rel); - - PageList getPartnersWechatBinds(JSONObject params, PageBounds pageBounds); - - PageList listActPartners(JSONObject params, PageBounds pageBounds); - - List listBindErrorClients(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.java deleted file mode 100644 index b522434b5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -@AutoMapper(tablename = "act_prize_type_customer", pkName = "type_id") -public interface ActPrizeTypeCustomerMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject prize_type); - - List listAvailableTypes(@Param("act_id") String act_id); - - List listPrizeTypes(@Param("act_id") String act_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeMapper.java deleted file mode 100644 index cbae57fbd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * Created by yishuqian on 20/12/2016. - */ -@AutoMapper(tablename = "act_prize_type", pkName = "type_id") -public interface ActPrizeTypeMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject prize_type); - - List listAvailableTypes(@Param("rate") BigDecimal rate, @Param("act_id") String act_id); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List listPrizeTypes(@Param("act_id") String act_id, PageBounds pageBounds); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerMapper.java deleted file mode 100644 index d0e1ceb1f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -@AutoMapper(tablename = "act_red_packets_customer", pkName = "act_id") -public interface ActRedPacketsCustomerMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject act); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("act_id") String act_id); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject act); - - PageList listActivities(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - List actList(JSONObject params); - - void closePartnerActivities(); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "start_time<=curdate() and end_time>=curdate() and status=1") - List findCurrentActivity(); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.java deleted file mode 100644 index 81361a2e6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.java +++ /dev/null @@ -1,51 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -@AutoMapper(tablename = "act_red_packets_customer_orders", pkName = "red_packet_customer_order_id") -public interface ActRedPacketsCustomerOrdersMapper { - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject sendLog); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject lucky_money); - - int count(JSONObject params); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("red_packet_id") String red_packet_id); - - int lockPrize(@Param("act_id") String act_id, @Param("lock_key") String lock, @Param("red_pack_type_id") String prizeType, @Param("open_id") String open_id, - @Param("client_id") int client_id, @Param("order_id") String order_id, @Param("order_amount") BigDecimal order_amount, @Param("event_time") Date date); - - @AutoSql(SqlType.SELECT) - JSONObject findLockedPrize(@Param("lock_key") String lock, @Param("open_id") String openid); - - int getRedPacketsByOpenid(@Param("open_id") String openid, @Param("event_date") Date date, @Param("act_id") String actId); - - void clearUnsendRedpacks(@Param("act_id") String actId, @Param("red_pack_type_id") String typeId); - - @AutoSql(SqlType.SELECT) - JSONObject findByRedpackOrderId(@Param("red_packet_customer_order_id") String redpackOrderId); - - PageList listOrders(JSONObject jsonObject, PageBounds pageBounds); - - List listUnsend(@Param("act_id") String actId, @Param("before") Date before); - - List getCustomerRedpackAnalysis(JSONObject params); - - JSONObject analysisCustomerLuckyMoney(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/RedPackConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/RedPackConfigMapper.java deleted file mode 100644 index a5593a6c8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/RedPackConfigMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by davep on 2016-08-03. - */ -@AutoMapper(tablename = "cli_config_redpack", pkName = "client_id") -public interface RedPackConfigMapper { - @AutoSql(SqlType.INSERT) - void saveConfig(JSONObject redpackConfig); - - @AutoSql(SqlType.UPDATE) - void updateConfig(JSONObject config); - - @AutoSql(SqlType.SELECT) - JSONObject findRedpackConfig(@Param("client_id") int clientId); - - @AutoSql(SqlType.DELETE) - void removeConfig(@Param("client_id") int clientId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/RedPackLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/RedPackLogMapper.java deleted file mode 100644 index 8c3c543ff..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/RedPackLogMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.redpack; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by davep on 2016-08-03. - */ -@AutoMapper(tablename = "log_redpack_send", pkName = "redpack_id") -public interface RedPackLogMapper { - @AutoSql(SqlType.INSERT) - void saveLog(JSONObject redpackLog); - - @AutoSql(SqlType.UPDATE) - void updateLog(JSONObject redpackLog); - - int countSendedToUser(@Param("client_id") int clientId, @Param("open_id") String openId); - - PageList sendLogs(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("redpack_id") String redpackId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java deleted file mode 100644 index 6fd522160..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.risk; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * Create by yixian at 2017-12-21 11:45 - */ -@AutoMapper(tablename = "risk_attention_merchants", pkName = "client_id") -public interface RiskAttentionMerchantsMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject client); - - @AutoSql(SqlType.INSERT) - void save(JSONObject client); - - @AutoSql(SqlType.SELECT) - JSONObject findById(@Param("id") String id); - - @AutoSql(SqlType.SELECT) - JSONObject findByClientMoniker(@Param("client_moniker") String clientMoniker); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - PageList query(JSONObject params, PageBounds pagination); - - @Select("SELECT client_moniker FROM risk_attention_merchants " + - "WHERE ((abn = #{abn} ) OR (acn = #{acn} ) " + - " OR (contact_phone = #{contact_phone} ) " + - " OR (contact_person = #{contact_person} ) " + - " OR (client_moniker = #{client_moniker} ) " + - " OR (bank_account_no = #{bank_account_no} )) AND is_valid=1") - List listRiskySimilarMerchants(JSONObject params); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskCustomerBlackListMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskCustomerBlackListMapper.java deleted file mode 100644 index fe229d161..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskCustomerBlackListMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.risk; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Create by yixian at 2017-12-21 11:45 - */ -@AutoMapper(tablename = "risk_customer_black_list", pkName = "openid") -public interface RiskCustomerBlackListMapper { - @AutoSql(SqlType.SELECT) - JSONObject findByOpenid(@Param("openid") String openid); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - PageList query(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject customerBlackList); - - @AutoSql(SqlType.INSERT) - void save(JSONObject customerBlackList); -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantDetailLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantDetailLogMapper.java deleted file mode 100644 index ad1b5a808..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantDetailLogMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.risk; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-21 11:45 - */ -@AutoMapper(tablename = "risk_merchant_detail_log", pkName = "id") -public interface RiskMerchantDetailLogMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject record); - - PageList query(JSONObject params, PageBounds pagination); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantRecordMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantRecordMapper.java deleted file mode 100644 index b8b856055..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantRecordMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.risk; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-21 11:45 - */ -@AutoMapper(tablename = "risk_merchant_record", pkName = "id") -public interface RiskMerchantRecordMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject record); - - @AutoSql(SqlType.SELECT) - JSONObject findById(@Param("id") String id); - - PageList query(JSONObject params, PageBounds pagination); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskTransactionLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskTransactionLogMapper.java deleted file mode 100644 index a4b924623..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskTransactionLogMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.risk; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-21 11:45 - */ -@AutoMapper(tablename = "risk_transaction_log", pkName = "id") -public interface RiskTransactionLogMapper { - @AutoSql(SqlType.SELECT) - JSONObject findByOrderId(@Param("order_id") String order_id); - - @AutoSql(SqlType.SELECT) - List findByRecordId(@Param("record_id") String record_id); - - PageList query(JSONObject params, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskWhiteListMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskWhiteListMapper.java deleted file mode 100644 index 31491e358..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskWhiteListMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.risk; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.ibatis.annotations.Param; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-21 11:45 - */ -@AutoMapper(tablename = "risk_white_list", pkName = "client_id") -public interface RiskWhiteListMapper { - @AutoSql(SqlType.SELECT) - JSONObject findByClientMoniker(@Param("client_moniker") String client_moniker); - - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject record); - - -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.java deleted file mode 100644 index bbbb37213..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.riskbusiness; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @Author lvjian - * @Date 2018/10/10 10:25 - */ -@AutoMapper(tablename = "risk_event", pkName = "risk_id") -public interface RiskEventMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject riskEvent); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject riskEvent); - - @AutoSql(SqlType.SELECT) - List findAll(JSONObject params); - - PageList listRisksByPage(JSONObject params, PageBounds pageBounds); - - List analysisByIndustry(JSONObject params); - - List analysisByAmount(JSONObject params); - - @AutoSql(SqlType.SELECT) - JSONObject findById(@Param("risk_id") String riskId); - - @AutoSql(SqlType.DELETE) - void deleteRiskEvent(@Param("risk_id") String risk_id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskFileMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskFileMapper.java deleted file mode 100644 index cce888a21..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskFileMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.riskbusiness; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "risk_file", pkName = "file_id") -public interface RiskFileMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject file); - - @AutoSql(SqlType.SELECT) - List findAllFiles(@Param("material_id") String material_id); - - @AutoSql(SqlType.SELECT) - List findEmailScreenshot(@Param("material_id") String material_id,@Param("file_type") String file_type); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java deleted file mode 100644 index 1a09a7162..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.riskbusiness; - - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - - -import java.util.List; - -@AutoMapper(tablename = "risk_material", pkName = "material_id") -public interface RiskMaterialMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject material); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject material); - - List findAllMaterials(@Param("risk_id") String risk_id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskOrdersMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskOrdersMapper.java deleted file mode 100644 index a2df10652..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskOrdersMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.riskbusiness; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "risk_orders", pkName = "risk_order_id") -public interface RiskOrdersMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject params); - - @AutoSql(SqlType.DELETE) - void clearOrders(@Param("risk_id") String riskId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskProcessLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskProcessLogMapper.java deleted file mode 100644 index adb195df6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskProcessLogMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.riskbusiness; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * @Description: - * @Author: lujian - * @Date: 2018/11/22 15:32 - */ -@AutoMapper(tablename = "risk_process_log", pkName = "risk_process_id") -public interface RiskProcessLogMapper { - - @AutoSql(SqlType.SELECT) - PageList getRiskProcessLogs(@Param("risk_id") String riskId, PageBounds pagination); - - @AutoSql(SqlType.INSERT) - void addRiskProcessLog(JSONObject log); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/MerchantAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/MerchantAccountMapper.java deleted file mode 100644 index 414778280..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/MerchantAccountMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.shopify; - -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantAccountRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchantAccount; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -@AutoMapper(tablename = "sys_accounts", pkName = "account_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface MerchantAccountMapper { - - @AutoSql(SqlType.INSERT) - void insert(MerchantAccountRequest accountRequest); - - @AutoSql(SqlType.SELECT) - SimpleMerchantAccount selectByUsername(@Param("username") String username); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/MerchantMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/MerchantMapper.java deleted file mode 100644 index 071d6b16f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/MerchantMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.shopify; - -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchant; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface MerchantMapper { - - @AutoSql(SqlType.SELECT) - SimpleMerchant selectByClientId(@Param("client_id") Integer clientId); - - @AutoSql(SqlType.SELECT) - SimpleMerchant selectByMoniker(@Param("client_moniker") String clientMoniker); - - @AutoSql(SqlType.INSERT) - void insert(MerchantRequest merchantRequest); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/ShopifyStoreMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/ShopifyStoreMapper.java deleted file mode 100644 index c511fd10d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/shopify/ShopifyStoreMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.shopify; - -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -@AutoMapper(tablename = "shopify_store", pkName = "id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ShopifyStoreMapper { - - @AutoSql(SqlType.INSERT) - void insert(ShopifyStore shopifyStore); - - @AutoSql(SqlType.SELECT) - ShopifyStore selectByShop(@Param("shopify_shop") String shop); - - @AutoSql(SqlType.UPDATE) - void update(ShopifyStore shopifyStore); - - @AdvanceSelect(addonWhereClause = "status=1") - List listAvailableStores(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/BusinessMemberMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/BusinessMemberMapper.java deleted file mode 100644 index 9c99f62a4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/BusinessMemberMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2016-10-27. - */ -@AutoMapper(tablename = "sys_membership_business", pkName = "member_id") -public interface BusinessMemberMapper { - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("member_id") String memberId); - @AutoSql(SqlType.SELECT) - JSONObject findByRelationId(@Param("relation_id") int relationId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject member); - - @AutoSql(SqlType.INSERT) - void save(JSONObject member); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CalendarMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CalendarMapper.java deleted file mode 100644 index c1911468b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CalendarMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-01-03. - */ -public interface CalendarMapper { - Date findNextClearingDate(@Param("date") Date date); - - Date findPreviousClearingDate(@Param("date") Date date); - - List listClearingDates(@Param("month") Date month); - - void resetClearDaysInMonth(@Param("month") Date month); - - void setClearingDays(@Param("days") List dates); - - List findClearingDateRange(@Param("date") Date settleDate, @Param("offset") int cleanDays); - - Date getLastSettleDate(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CityPartnerRegisterMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CityPartnerRegisterMapper.java deleted file mode 100644 index 682235e2e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CityPartnerRegisterMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2017-01-23. - */ -@AutoMapper(tablename = "sys_city_partner_register", pkName = "partner_id") -public interface CityPartnerRegisterMapper { - @AutoSql(SqlType.INSERT) - void savePartner(JSONObject partner); - - @AutoSql(SqlType.SELECT) - PageList listRequests(PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("partner_id") String requestId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject request); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java deleted file mode 100644 index 900b9cd7c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.joda.time.DateTime; - -import java.util.Date; -import java.util.List; - - -@AutoMapper(tablename = "log_clearing_distributed_surcharge", pkName = "log_id") -public interface ClearingDistributedSurchargeMapper { - - List findTransactions(@Param("client_id") int clientId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject transaction); - - @AutoSql(SqlType.INSERT) - void save(JSONObject transactions); - - @AutoSql(SqlType.SELECT) - List findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); - - List getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); - - List findSurchargeTransactionsByDetailId(@Param("client_id") int clientId, @Param("detailId") String detailId); - - List listUnClearedByMonth(@Param("dateto") DateTime dateTo); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java deleted file mode 100644 index fc868bd32..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java +++ /dev/null @@ -1,111 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2016-06-29. - */ -@AutoMapper(tablename = "sys_accounts", pkName = "account_id") -public interface ClientAccountMapper { - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash", "password_aes"}) - JSONObject findById(@Param("account_id") String accountId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByUsername(@Param("username") String username); - - @AutoSql(SqlType.SELECT) - JSONObject findByUsernameForDuplicate(@Param("username") String username); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List findByPhone(@Param("contact_phone") String contact_phone, @Param("nation_code") String nation_code); - - @AutoSql(SqlType.SELECT) - JSONObject findDetail(@Param("account_id") String accountId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject account); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - List listPartnerAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject account); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - JSONObject findByOpenId(@Param("wechat_openid") String openid); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - JSONObject findByAppOpenId(@Param("wxapp_openid") String openId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - JSONObject findByAppleUserId(@Param("apple_userid") String appleUserId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - JSONObject findByWxUnioinId(@Param("wx_unionid") String wx_unionid); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and payment_notice=1 and wechat_openid is not null", excludeColumns = {"salt", "password_hash"}) - List listPaymentNoticeAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and (refund_authorised = 1 OR role = 1) and wechat_openid is not null", excludeColumns = {"salt", "password_hash"}) - List listRefundAuditAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and role=1", excludeColumns = {"salt", "password_hash"}) - List listAdminAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and role=1 and (client_id is null or client_id=0)", excludeColumns = {"salt", "password_hash"}) - List listUnRegisterClientAccounts(PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and role=1 and wechat_openid is not null and wx_unionid is null", excludeColumns = {"salt", "password_hash"}) - List listNullUnionIdAccounts(); - - List query(JSONObject params); - - List partnerAndSubPartnerAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and (role=1 or role=2) and wechat_openid is not null", excludeColumns = {"salt", "password_hash"}) - List listRiskNoticeAccounts(@Param("client_id") int clientId); - - /** - * 获取绑定微信的最新账号 - * - * @param unionId - * @return - */ - JSONObject findOneByUnionIdAndCreateTimeDesc(@Param("wx_unionid") String unionId); - - JSONObject findOneByPhoneAndCreateTimeDesc(@Param("contact_phone") String contactPhone, @Param("nation_code") String nationCode); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - List findByWechatOpenId(@Param("wechat_openid") String openid); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - List findByWechatUnionId(@Param("wx_unionid") String unionId); - - @AutoSql(SqlType.SELECT) - JSONObject findRSvcClientInfo(@Param("account_id") String accountId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAndCustomerLocation.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAndCustomerLocation.java deleted file mode 100644 index 692a732da..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAndCustomerLocation.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "sys_clients_customer_locations", pkName = {"id"}) -public interface ClientAndCustomerLocation { - - @AutoSql(SqlType.SELECT) - JSONObject findByIp(@Param(value = "ip") String ip); - - @AutoSql(SqlType.INSERT) - void save(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java deleted file mode 100644 index 055e64434..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - - -/** - * Created by yishuqian on 18/10/2016. - */ -@AutoMapper(tablename = "sys_clients_apply", pkName = "client_apply_id") -public interface ClientApplyMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject clientApply); - - @AutoSql(SqlType.SELECT) - JSONObject findClientApplicationById(@Param("client_apply_id") String client_apply_id); - - @AutoSql(SqlType.SELECT) - JSONObject findClientApplicationByClientMoniker(@Param("client_moniker") String client_moniker); - - PageList listPartnerApplications(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.COUNT) - int countNewApplications(JSONObject params); - - @AutoSql(SqlType.UPDATE) - void updatePartnerApplication(JSONObject obj); - - List analysisByDate(@Param("begin") Date begin, @Param("end") Date end); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAuditProcessMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAuditProcessMapper.java deleted file mode 100644 index c277cfa4b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAuditProcessMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yishuqian on 27/11/2017. - */ -@AutoMapper(tablename = "sys_clients_audit_process", pkName = "merchant_audit_id") -public interface ClientAuditProcessMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - PageList getAuditLog(@Param("client_id") int client_id, @Param("type") int type, PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBDMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBDMapper.java deleted file mode 100644 index b7eb25b88..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBDMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 26/09/2016. - */ -@AutoMapper(tablename = "sys_client_bd", pkName = "client_bd_id") -public interface ClientBDMapper { - @AutoSql(SqlType.INSERT) - void saveBD(JSONObject jsonObject); - - @AutoSql(SqlType.SELECT) - List listClientDB(JSONObject params, PageBounds pageBounds); - - List listClientBDAvailable(@Param("client_id") int clientId, @Param("date") Date date); - - List listClientBDInfoAvailable(@Param("client_id") int clientId, @Param("date") Date date); - - List listBDClientInfo(JSONObject param); - - void updateClientDB(JSONObject jsonObject); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject json); - - int checkBDPermission(@Param("client_id") int clientId, @Param("bd_id") String bdId); - - List clientsWithBDAway(); - - Date findTheMaxBDCommissionEndDate(@Param("client_id") int clientId); - - List listBDByOrgId(@Param("org_id") int org_id); - - List findTotalClientByBdId(@Param("bd_id")String manager_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java deleted file mode 100644 index 07c43f172..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * Created by davep on 2016-08-16. - */ -@AutoMapper(tablename = "sys_bank_accounts", keyGenerator = Jdbc3KeyGenerator.class, pkName = "bank_account_id") -public interface ClientBankAccountMapper { - - @AutoSql(SqlType.SELECT) - List clientBankAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject bankAccount); - - @AutoSql(SqlType.DELETE) - void deleteClientAccounts(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - List listClientAccounts(JSONObject params); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject bankAccount); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java deleted file mode 100644 index 2529b20bc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 06/03/2017. - */ -@AutoMapper(tablename = "client_authfile_compliance", pkName = "compliance_id") -public interface ClientComplianceCompanyMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "type = 1") - JSONObject findFileByClientId(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "type = 2") - JSONObject findKycFileByClientId(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "type = 2 and status in (0,1,9)") - JSONObject findKycFileComplete(@Param("client_id") int clientId); - - PageList listClientCompliances(JSONObject params, PageBounds pageBounds); - - List listNeedHelpClients(JSONObject params); - - PageList listKycProgressClients(JSONObject params, PageBounds pageBounds); - - int countKycProgressClients(JSONObject params); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientConfigMapper.java deleted file mode 100644 index d365a6442..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientConfigMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -/** - * Created by wangning on 2018-04-08. - */ -@AutoMapper(tablename = "sys_client_config", pkName = "client_id") -public interface ClientConfigMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("client_id") int client_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java deleted file mode 100644 index 8844c2c59..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2016-09-12. - */ -@AutoMapper(tablename = "sys_clients_devices", pkName = "dev_id") -public interface ClientDeviceMapper { - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findValid(@Param("dev_id") String devId); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("dev_id") String devId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByClientDevIdAndClient(@Param("client_id") int clientId, @Param("client_dev_id") String clientDevId, @Param("client_type") String clientType); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByClientDevIdAndClientType(@Param("client_dev_id") String clientDevId, @Param("client_type") String clientType); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findDeviceInfoByDeviceNo(@Param("client_dev_id") String clientDevId,@Param("dev_type") String devType); - - PageList listClientDevices(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject devInfo); - - @AutoSql(SqlType.INSERT) - void save(JSONObject devInfo); - - PageList listDevices(JSONObject params, PageBounds pagination); - - void deviceOffline(@Param("account_id") String accountId); - - List listClientDeviceIds(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java deleted file mode 100644 index b4b2d8b95..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2016-09-12. - */ -@AutoMapper(tablename = "sys_clients_devices_token", pkName = "dev_token_id") -public interface ClientDeviceTokenMapper { - - JSONObject findByDevId(@Param("dev_id") String devDevId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject devInfo); - - @AutoSql(SqlType.INSERT) - void save(JSONObject devTokenInfo); - - List listTokensByClient_id(@Param("client_id") int client_id); - - List listTokensByAccountId(@Param("account_id") String accountId); - - List listAllTokens(JSONObject devToken); - - JSONObject getTestTokens(); - - @AutoSql(SqlType.SELECT) - List listAllTokensByClient_id(@Param("client_id") int client_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java deleted file mode 100644 index d7169064e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 06/03/2017. - */ -@AutoMapper(tablename = "sys_files", pkName = "file_id") -public interface ClientFilesMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1") - List findClientFile(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - JSONObject findFileByIdAndvalue(@Param("client_id") int clientId,@Param("file_name") String fileType); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'") - List findClientPassAggreeFile(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'") - List findClientAggreeFileCommit(@Param("client_id") int clientId); - - List findAllClientFile(@Param("client_id") int clientId); - - List findKycClientFileByClient(@Param("client_id") int clientId); - - List findKycClientFileByAudit(@Param("client_id") int clientId); - - List findRepetitiveFiles(@Param("client_id") int clientId,@Param("file_name") String fileType); - - List findRepetitiveFilesForDelete(@Param("client_id") int clientId,@Param("file_name") String fileType); - - @AutoSql(SqlType.SELECT) - JSONObject findFileById(@Param("file_id") String file_id); - - List findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name); - - JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId); - - JSONObject getSourceCardAgreeFilesByClientId(@Param("client_id") int clientId,@Param("file_name")String file_name); - - void deleteByClientAndFileId(@Param("file_id") String file_id); - - void deleteAggreeByClientId(@Param("client_id") int file_id); - - void confirmAgreeFile(@Param("client_id") int client_id); - - void updateFilesAuthStatus(@Param("client_id") int client_id,@Param("status") int status,@Param("original_status_type") int[] original_status_type,@Param("file_names") String[] file_names); - - void updateRepeatFilesAfterCommit(@Param("client_id") int client_id, @Param("file_name") String fileName); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientIncrementalMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientIncrementalMapper.java deleted file mode 100644 index f16e458a8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientIncrementalMapper.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * @Author DuLingLing - * @create 2019/11/13 0013 14:49 - */ -@AutoMapper(tablename = "sys_client_incremental", pkName = "incremental_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ClientIncrementalMapper { - - /** - * 获取商户所有增值渠道信息 - * @param clientId - * @return - */ - @AutoSql(SqlType.SELECT) - List findAllByclientMoniker(@Param("client_id") int clientId); - - @Select("select ci.*, " + - " si.source_code " + - " from sys_client_incremental ci inner join sys_incremental_channels si " + - " on ci.channel = si.channel" + - " where ci.client_id = #{client_id} " + - " and ci.channel = #{channel} ") - JSONObject findByClinetIdAndChannel(@Param("client_id")int clientId, @Param("channel")String channel); - - @Select("select ci.*, " + - " si.source_code " + - " from sys_client_incremental ci inner join sys_incremental_channels si " + - " on ci.channel = si.channel" + - " where ci.client_id = #{client_id} " + - " and ci.channel = #{channel} " + - " and ci.is_valid = 1") - JSONObject findByClinetIdAndChannelIsValid(@Param("client_id")int clientId, @Param("channel")String channel); - - @AutoSql(SqlType.INSERT) - void save(JSONObject saveIncrementalService); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject saveIncrementalService); - - @AutoSql(SqlType.SELECT) - String findByChannelAndClientId(@Param("client_id") int clientId,@Param("channel") String channel); - - @AutoSql(SqlType.SELECT) - List find(@Param("client_id") int clientId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientLocationsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientLocationsMapper.java deleted file mode 100644 index ead84a118..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientLocationsMapper.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -@AutoMapper(tablename = "sys_clients_locations", pkName = {"location_id"}) -public interface ClientLocationsMapper { - - List getAllMerchantsLocations(JSONObject params); - - @Select("select sysc.client_moniker, " + - " sysc.short_name, " + - " sysc.industry, " + - " syscl.address, " + - " sysc.bd_user_name, " + - " syscl.latitude, " + - " syscl.longitude, " + - " syscl.location_id " + - " from sys_clients sysc, " + - " sys_clients_locations syscl " + - " where sysc.client_moniker = #{client_moniker} " + - " and sysc.client_id = syscl.client_id ") - JSONObject findTheLocationByMerchantCode(@Param("client_moniker") String client_moniker); - - @Select("select sysc.client_moniker, " + - " sysc.short_name, " + - " sysc.industry, " + - " syscl.address, " + - " sysc.bd_user_name, " + - " syscl.latitude, " + - " syscl.longitude " + - " from sys_clients sysc," + - " sys_clients_locations syscl " + - " where sysc.client_id = syscl.client_id " + - " and sysc.client_id in (${merchant_list})") - List getMerchantLocationsByList(@Param("merchant_list") String merchant_list); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject params); - - @AutoSql(SqlType.INSERT) - void save(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMWFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMWFilesMapper.java deleted file mode 100644 index 24d7e73d7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMWFilesMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 06/03/2017. - */ -@AutoMapper(tablename = "sys_merchant_warrior_files", pkName = "file_id") -public interface ClientMWFilesMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") - List findClientFile(@Param("client_id") int clientId, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - JSONObject findFileById(@Param("file_id") String file_id); - - void deleteByClientAndFileId(@Param("file_id") String file_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java deleted file mode 100644 index 17be3b380..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ /dev/null @@ -1,165 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2016-06-25. - */ -@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ClientMapper { - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findClient(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5 and sub_merchant_id='321888408'") - List findApClient(); - - List listValidClient(); - - List listValidClientFor90Days(JSONObject params); - - List listGreenChannel(JSONObject params); - - JSONObject findSamePhone(@Param("contact_phone") String contactPhone); - - JSONObject findSameCompanyName(@Param("company_name") String contactPhone); - - JSONObject findSameEmail(@Param("contact_email") String contactEmail); - - JSONObject findSameAddress(@Param("address") String address); - - @AutoSql(SqlType.SELECT) - JSONObject findClientIgnoreInvalid(int clientId); - - JSONObject findClientAprrovingStatus(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findClientByMoniker(@Param("client_moniker") String clientMoniker); - - @AutoSql(SqlType.SELECT) - JSONObject findClientByMonikerAll(@Param("client_moniker") String clientMoniker); - - List listNeedOpenCbpayMerchant(); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List getClientBySubMerchantId(@Param("sub_merchant_id") String subMerchantId); - - PageList listPartners(JSONObject params, PageBounds pagination); - - PageList listLessInfoPartners(JSONObject params, PageBounds pagination); - - PageList comListPartners(JSONObject params, PageBounds pagination); - - List listClientsIdAndMoniker(); - - - List passPartners(JSONObject params); - - List listClients(); - - List listPartnerSelection(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - int update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List listChildClients(@Param("parent_client_id") int parentClientId); - - PageList listChildClientsByPage(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List listChildClients(@Param("parent_client_id") int parentClientId, PageBounds pagination); - - @AutoSql(SqlType.UPDATE) - void updateCleanDays(@Param("client_id") int clientId, @Param("clean_days") int cleanDays); - - @AutoSql(SqlType.UPDATE) - void updateClientEmail(@Param("client_id") int clientId, @Param("contact_email") String contact_email); - - List listClientsForSettlement(); - - List listClientsForSettlementWithDetail(); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and approve_email_id is not null and approve_email_send=3") - List listClientsWithEmailNotVerify(); - - List listUnAuthPartners(@Param("auth_days") int auth_days); - - JSONObject analysisClients(JSONObject params); - - List listCityClientIds(@Param("city") String city, @Param("date") Date date); - - List listClientByCleanDays(@Param("clean_days") int clean_days); - - List listSubMerchantId(); - - List listBySubMerchantId(@Param("sub_merchant_id") String sub_merchant_id); - - List listClientsWithTransactionsSettled(@Param("channels") List channels, @Param("from") Date fromDate, @Param("to") Date toDate); - - @AutoSql(SqlType.SELECT) - List AllClients(); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - List listClientsByBD(@Param("bd_user") String bd_user); - - PageList simpleQuery(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.SELECT) - JSONObject findByWechatInstitutionMerchantId(@Param("wechat_institution_merchant_id") String wechat_institution_merchant_id); - - List findByhfPayUrlNotNull(); - - @AutoSql(SqlType.UPDATE) - void updateRpayEnterpriseId(@Param("client_id") int clientId, @Param("rpay_enterprise_id") String rpayEnterpriseId); - - List findByrpayNotNull(); - - JSONObject countBdApproveClients(@Param("manager_id") String manager_id); - - @Select("select client_id from sys_clients where parent_client_id=#{parent_client_id}") - List childClientId(@Param("parent_client_id") int parent_client_id); - - List createClientsByGroup(@Param("start_date") Date start_date, @Param("end_date") Date end_date, @Param("start_date_month") Date start_date_month); - - List clientPayTypeInfoByClientIdRange(@Param("begin") int begin, @Param("end") int end); - - int getPartnercode(@Param("codes") String codes); - - JSONObject findCountByBd(@Param("bd_group") String bd_group, @Param("today") Date today, @Param("yesterday") Date yesterday, @Param("month") Date month); - - List listUseAlipayMerchant(@Param("start") int start, @Param("end") int end); - - PageList listCompletedContractKycClients(JSONObject params, PageBounds pageBounds); - - int countKycClients(JSONObject params); - - - /** - * 半年内有交易的有效商户 - * @return - */ - List halfYearHaveTransactionClients(@Param("from") Date fromDate, @Param("to") Date toDate); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java deleted file mode 100644 index 59ebd36c4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-08-16. - */ -@AutoMapper(tablename = "sys_client_rates", pkName = "client_rate_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface ClientRateMapper { - List listCurrentClientRates(@Param("client_id") int clientId, @Param("date") Date date, @Param("rate_name") String rateName); - - - List listClientRates(@Param("client_id") int clientId, @Param("rate_name") String rateName); - - @AutoSql(SqlType.SELECT) - JSONObject findRateByRateId(@Param("client_rate_id") String rateId); - - @AutoSql(SqlType.INSERT) - void saveRate(JSONObject rateConfig); - - @AutoSql(SqlType.UPDATE) - void updateConfig(JSONObject rateConfig); - - List listClientRatesOfTime(@Param("client_id") int clientId, @Param("rate_name") String rateName, - @Param("date") Date time, @Param("client_rate_id") Integer excludeId); - - List listClientsWithNoRateConfig(); - - List listClientsWithRateExpiring(@Param("warning_days") int warningDays); - - @AutoSql(SqlType.SELECT) - List listClientRatesForSaving(@Param("client_id") int clientId, @Param("active_time") Date activeTime, - @Param("expiry_time") Date expiryTime, @Param("rate_value") BigDecimal rateValue, - @Param("clean_days") Integer cleanDays, @Param("rate_name") String rateName); - - - List latestConfig(@Param("client_id") int client_id, @Param("rate_name") String rate_name); - - //Task - List maxChannelExpiryTime(@Param("client_id") int client_id, @Param("rate_name") String rate_name); - - List getAllExpiry(@Param("expiry_date") Date expiry_date); - - List getAllClientRateExpiryMerchants(); - - void postponeMerchantRateByClientId(@Param("client_id") int clientId, @Param("channel") String channel); - - JSONObject latestChannelCleanDays(@Param("rate_name") String rate_name, @Param("client_id") int client_id); - - JSONObject latestCardChannelCleanDays(@Param("rate_name") String rate_name, @Param("client_id") int client_id); - - JSONObject latestExpiryConfig(@Param("client_id") int client_id, @Param("rate_name") String rate_name); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientServicesApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientServicesApplyMapper.java deleted file mode 100644 index 16d36b810..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientServicesApplyMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yishuqian on 06/03/2017. - */ -@AutoMapper(tablename = "sys_client_services_apply", pkName = "apply_id") -public interface ClientServicesApplyMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject partner); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") - JSONObject findApplyByApplyId(@Param("apply_id") String applyId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 0") - JSONObject findApplyByClientIdAndChannel(@Param("client_id") int clientId,@Param("channel") String channel); - - PageList listServicesApply(JSONObject params, PageBounds pageBounds); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientSettleDelayConfMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientSettleDelayConfMapper.java deleted file mode 100644 index eb8448be4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientSettleDelayConfMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -/** - * Create by yixian at 2017-09-06 20:50 - */ -@AutoMapper(tablename = "sys_clients_settle_delay_conf", pkName = "config_id") -public interface ClientSettleDelayConfMapper { - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "enabled=1") - JSONObject findClientConf(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - JSONObject findClientConfIncludingDisabled(@Param("client_id") int clientId); - - PageList listClients(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void save(JSONObject conf); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject conf); - - - void disableClient(@Param("client_id") int clientId); -} 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 deleted file mode 100644 index 1f19363f5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yishuqian on 06/03/2017. - */ -@AutoMapper(tablename = "sys_clients_contract", pkName = "id") -public interface ClientsContractMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject partner); - - JSONObject findByClientId(@Param("client_id") int clientId); - - @AutoSql(SqlType.SELECT) - List list(); - - PageList listWithClientInfo(JSONObject param,PageBounds pagination); - - List analysisSingstatus(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsSurchargeAccountsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsSurchargeAccountsMapper.java deleted file mode 100644 index 4ea9ba5e9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsSurchargeAccountsMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; - - -@AutoMapper(tablename = "sys_clients_surcharge_accounts", pkName = "client_id") -public interface ClientsSurchargeAccountsMapper { - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject find(@Param("client_id") int clientId); - - @AutoSql(SqlType.INSERT) - void save(JSONObject surchargeAccount); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject surchargeAccount); - - @AutoSql(SqlType.UPDATE) - void updateBalance(@Param("client_id") int clientId, @Param("balance") BigDecimal balance); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CommoditiesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CommoditiesMapper.java deleted file mode 100644 index 48a2741bb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CommoditiesMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yuan on 2017/11/24. - */ -@AutoMapper(tablename = "commodities", pkName = "commodity_id") -public interface CommoditiesMapper { - - PageList listProduct(JSONObject params, PageBounds pagination); - - @AutoSql(SqlType.INSERT) - void saveProduct(JSONObject params); - - @AutoSql(SqlType.UPDATE) - void updateProduct(JSONObject params); - - int checkProduct(@Param("client_id") int client_id); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findOne(@Param("name") String name); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java deleted file mode 100644 index 458563f66..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -/** - * Created by davep on 2016-08-03. - */ -@AutoMapper(tablename = "sys_customer_relation", pkName = "relation_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface CustomerMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject customer); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject customer); - - @AutoSql(SqlType.SELECT) - JSONObject findCustomerByOpenId(@Param("wechat_openid") String openId); - - @AutoSql(SqlType.SELECT) - JSONObject findCustomerGlobalpayByOpenId(@Param("globalpay_openid") String openId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "wechat_openid like 'o32%'") - JSONObject findCustomerBykangaOpenid(@Param("kanga_openid") String openId); - - @AutoSql(SqlType.SELECT) - JSONObject findCustomerBykangaId(@Param("kanga_openid") String openId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMemberMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMemberMapper.java deleted file mode 100644 index 437a71d3b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMemberMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2016-10-27. - */ -@AutoMapper(tablename = "sys_membership_customer", pkName = "member_id") -public interface CustomerMemberMapper { - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("member_id") String memberId); - - @AutoSql(SqlType.SELECT) - JSONObject findByRelationId(@Param("relation_id") int relationId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject member); - - @AutoSql(SqlType.INSERT) - void save(JSONObject member); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ExchangeRateMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ExchangeRateMapper.java deleted file mode 100644 index 3fc270a4b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ExchangeRateMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import java.util.Date; -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-19 19:09 - */ -@AutoMapper(tablename = "sys_exchange_rate", pkName = "id") -public interface ExchangeRateMapper { - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "type = 1") - JSONObject findMaxRate(@Param("create_date") Date create_time); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "type = 2") - JSONObject findMinRate(@Param("create_date") Date create_time); - - List listExchangeRates(@Param("begin") Date begin, @Param("end") Date end, @Param("channel") String channel); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/FinancialSurchargeAccountDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/FinancialSurchargeAccountDetailMapper.java deleted file mode 100644 index effbdad27..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/FinancialSurchargeAccountDetailMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - - -@AutoMapper(tablename = "financial_surcharge_account_detail", pkName = "detail_id") -public interface FinancialSurchargeAccountDetailMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findByDetailId(@Param("detail_id") String detail_id); - - List findDetailsByMonth(@Param("settle_month") String settle_month); - - List findDetailsByClientId(@Param("client_id") int client_id); - - @AutoSql(SqlType.INSERT) - void save(JSONObject detail); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject detail); - - List listSettlementDatesInMonth(@Param("month") String month); - - List listSettlementDatesByClientId(@Param("client_id") int client_id); -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/HolidayDAO.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/HolidayDAO.java deleted file mode 100644 index 55df020f2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/HolidayDAO.java +++ /dev/null @@ -1,61 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import au.com.royalpay.payment.tools.holiday.beans.HolidayDefinition; -import au.com.royalpay.payment.tools.holiday.beans.SettlementRegion; -import org.joda.time.DateTime; - -import java.util.Arrays; -import java.util.stream.Collectors; - -public class HolidayDAO { - private int holidayId; - private String holiday; - private String description; - private String regions; - - public HolidayDAO() { - } - - public HolidayDAO(HolidayDefinition define) { - holiday = new DateTime(define.getHoliday()).toString("yyyy-MM-dd"); - description = define.getDescription(); - regions = Arrays.stream(define.getRegions()).map(SettlementRegion::toString).collect(Collectors.joining(",")); - } - - public HolidayDefinition toHolidayDefine() { - return new HolidayDefinition(holidayId, DateTime.parse(holiday).toDate(), description, - Arrays.stream(regions.split(",")).map(SettlementRegion::valueOf).toArray(SettlementRegion[]::new)); - } - - public int getHolidayId() { - return holidayId; - } - - public void setHolidayId(int holidayId) { - this.holidayId = holidayId; - } - - public String getHoliday() { - return holiday; - } - - public void setHoliday(String holiday) { - this.holiday = holiday; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getRegions() { - return regions; - } - - public void setRegions(String regions) { - this.regions = regions; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/HolidayMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/HolidayMapper.java deleted file mode 100644 index b386850f0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/HolidayMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -@AutoMapper(tablename = "sys_holidays", pkName = "holiday_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface HolidayMapper { - @AutoSql(SqlType.INSERT) - void saveHoliday(HolidayDAO dao); - - List listMonthly(@Param("month") String monthPattern); - - @AutoSql(SqlType.DELETE) - void deleteHoliday(@Param("holiday") String holiday); - - @AutoSql(SqlType.SELECT) - HolidayDAO findDefine(@Param("holiday") String holiday); - - @AutoSql(SqlType.UPDATE) - void updateHolidayDescription(@Param("description") String description, @Param("regions") String regions, @Param("holiday_id") int holidayId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/IndustryLookupMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/IndustryLookupMapper.java deleted file mode 100644 index dffe61351..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/IndustryLookupMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -/** - * @Author DuLingLing - * @create 2019/11/27 0027 16:20 - */ -@AutoMapper(tablename = "industry_lookup", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface IndustryLookupMapper { - @AutoSql(SqlType.SELECT) - JSONObject findByLookupCode(@Param("lookup_code") String code); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MailSendMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MailSendMapper.java deleted file mode 100644 index 1f8085272..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MailSendMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Create by yixian at 2017-12-13 19:10 - */ -@AutoMapper(tablename = "sys_mail_send", pkName = {"id", "mail_address"}) -public interface MailSendMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject record); - - @AutoSql(SqlType.UPDATE) - void updateStatus(JSONObject record); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("id") String id, @Param("mail_address")String mail_address); -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MailUnsubMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MailUnsubMapper.java deleted file mode 100644 index 3196cac13..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MailUnsubMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by davep on 2016-08-03. - */ -@AutoMapper(tablename = "sys_mail_unsub", pkName = "id") -public interface MailUnsubMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.DELETE) - void delete(@Param("id") Long id); - - @AutoSql(SqlType.SELECT) - JSONObject getOne(@Param("id") Long id,@Param("address") String address); - - @AutoSql(SqlType.SELECT) - JSONObject findOneByClientMoniker(@Param("client_moniker") String client_moniker); - - PageList queryPageable(JSONObject params, PageBounds pagination); - - List query(JSONObject params); - - List getAllAddress(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java deleted file mode 100644 index 77802773a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2016-09-12. - */ -@AutoMapper(tablename = "sys_manage_devices_token", pkName = "dev_token_id") -public interface ManageDeviceTokenMapper { - - JSONObject findByDevId(@Param("dev_id") String devDevId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject devInfo); - - @AutoSql(SqlType.INSERT) - void save(JSONObject devTokenInfo); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerCustomerRelationAlipayMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerCustomerRelationAlipayMapper.java deleted file mode 100644 index a4d5032f2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerCustomerRelationAlipayMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by wangning on 2017/9/19. - */ -@AutoMapper(tablename = "sys_customer_relation_alipay", pkName = "relation_id") -public interface ManagerCustomerRelationAlipayMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject customer); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject customer); - - @AutoSql(SqlType.SELECT) - JSONObject findCustomerByUserId(@Param("alipay_uid") String userId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java deleted file mode 100644 index bbe15519f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java +++ /dev/null @@ -1,81 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * Created by yixian on 2016-06-29. - */ -@AutoMapper(tablename = "sys_managers", pkName = "manager_id") -public interface ManagerMapper { - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "username", "password_hash"}) - JSONObject findById(@Param("manager_id") String managerId); - - @AutoSql(SqlType.SELECT) - JSONObject findDetail(@Param("manager_id") String managerId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findAvailableByLoginId(@Param("username") String loginId); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findAvailableByLoginIdAndOrgId(@Param("username") String loginId, @Param("org_id") String orgId); - - @AutoSql(SqlType.SELECT) - JSONObject findByLoginId(@Param("username") String loginId); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject account); - - PageList listAvailable(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void save(JSONObject manager); - - List listByRole(@Param("org_id") Integer orgId, @Param("mask") int mask); - - List listDetailsByRole(@Param("org_id") Integer orgId, @Param("mask") int mask); - - List listByRole(JSONObject params); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByWxOpenId(@Param("wx_openid") String openid); - - List listOpenIdsOfCompliances(); - - List listRoyalPayUsers(); - - List getOnlyCompliance(); - - List getDirectors(); - - List listRiskManagers(); - - List findByIds(List ids); - - List listOpenIdByRole(@Param("mask") int mask); - - List listServants(@Param("mask") int mask); - - @Select("select email from sys_managers where is_valid=1 AND (role & 256 > 0 OR role & 4 > 0) AND (org_id = 1 or org_id is null) AND email IS NOT NULL") - List listDevAndBdManager(); - - @Select("select wx_openid from sys_managers where is_valid=1 AND (role & 256 > 0 OR role & 4 > 0) AND (org_id = 1 or org_id is null) AND wx_openid IS NOT NULL") - List listDevAndBdOpenId(); - - List findBdById(@Param("org_id")String org_id); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java deleted file mode 100644 index 7005b3a06..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -@AutoMapper(tablename = "merchant_sign_info", pkName = "client_moniker", keyGenerator = Jdbc3KeyGenerator.class) -public interface MerchantSignInfoMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findClientSign(@Param("client_moniker") String clientMoniker); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject signInfo); - - @AutoSql(SqlType.INSERT) - void insert(JSONObject signInfo); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java deleted file mode 100644 index 3f7964685..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import au.com.royalpay.payment.manage.organizations.core.OrgClientProfileUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * Created by yixian on 2016-10-18. - */ -@AutoMapper(tablename = "sys_org", pkName = "org_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface OrgMapper { - @AdvanceSelect(addonWhereClause = "type != 1") - List listOrgsWithDetail(PageBounds order); - - @AutoSql(SqlType.SELECT) - List listsOrgWithDetail(PageBounds order); - - List listOrgs(@Param("type") int type, PageBounds order); - - List listOrgsWithParent(JSONObject params); - - List listOrgsWithChid(JSONObject params); - - @AutoSql(SqlType.INSERT) - void saveOrg(JSONObject org); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("org_id") int orgId); - - @AutoSql(SqlType.UPDATE) - void updateOrg(JSONObject org); - - @AdvanceSelect(addonWhereClause = "is_valid=1 AND parent_org_id is null") - List listAllOrgs(); - - @AdvanceSelect(addonWhereClause = "is_valid=1 AND senior_parent_org_id=0") - List listSeniorOrgs(); - - JSONObject findOrgByBDId(@Param("bd_id") String bd_id); - - PageList listOrgWithPages(JSONObject paraams, PageBounds order); - - List listOrgAndChild(@Param("org_id") int org_id); - - List listSeniorOrgId(@Param("senior_parent_org_id") int senior_parent_org_id); - - @AutoSql(SqlType.UPDATE) - void updateOrgClientProfile(@Param("org_id") int orgId, @Param(OrgClientProfileUtils.PROFILE_KEY) String clientDefaultProfile); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgSignInfoMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgSignInfoMapper.java deleted file mode 100644 index dba29c321..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgSignInfoMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -@AutoMapper(tablename = "org_sign_info", pkName = "org_id", keyGenerator = Jdbc3KeyGenerator.class) -public interface OrgSignInfoMapper { - - @AutoSql(SqlType.SELECT) - JSONObject findByOrgId(@Param("org_id") int orgId); - - @AutoSql(SqlType.SELECT) - JSONObject findOrgSignInfo(@Param("gateway_short_id") String orgId); - - int getPartnercode(@Param("codes") String codes); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject signInfo); - - @AutoSql(SqlType.INSERT) - void insert(JSONObject signInfo); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionFunctionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionFunctionMapper.java deleted file mode 100644 index 2492f1081..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionFunctionMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -@AutoMapper(tablename = "sys_permission_functions", pkName = "func_id") -public interface PermissionFunctionMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject func); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject func); - - List listByRoleMask(@Param("mask") int mask); - - List listAll(); - - @AutoSql(SqlType.SELECT) - List listByModule(@Param("module") String moduleName); - - @AutoSql(SqlType.DELETE) - void delete(@Param("func_id") String funcId); - - void clearRolePermission(@Param("mask") int mask); - - void authorizeRole(@Param("mask") int mask, @Param("func_ids") List functions); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("func_id") String funcId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionModuleMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionModuleMapper.java deleted file mode 100644 index 1f55fcff7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionModuleMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -@AutoMapper(tablename = "sys_permission_modules", pkName = "module_name") -public interface PermissionModuleMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject module); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject module); - - @AutoSql(SqlType.DELETE) - void delete(@Param("module_name") String moduleName); - - @AutoSql(SqlType.SELECT) - List list(); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("module_name") String moduleName); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerFunctionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerFunctionMapper.java deleted file mode 100644 index 3e261915b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerFunctionMapper.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-02-28. - */ -@AutoMapper(tablename = "sys_permission_partner_functions", pkName = "func_id") -public interface PermissionPartnerFunctionMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject func); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject func); - - List listByRoleMask(@Param("mask") int mask); - - List listAll(); - - @AutoSql(SqlType.SELECT) - List listByModule(@Param("module") String moduleName); - - @AutoSql(SqlType.DELETE) - void delete(@Param("func_id") String funcId); - - void clearRolePermission(@Param("mask") int mask); - - void authorizeRole(@Param("mask") int mask, @Param("func_ids") List functions); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("func_id") String funcId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java deleted file mode 100644 index e0044cea2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -@AutoMapper(tablename = "sys_permission_partner_modules", pkName = "id",keyGenerator = Jdbc3KeyGenerator.class) -public interface PermissionPartnerModuleMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject module); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject module); - - @AutoSql(SqlType.DELETE) - void delete(@Param("module_name") String moduleName); - - @AutoSql(SqlType.SELECT) - List list(); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("module_name") String moduleName); - - @AutoSql(SqlType.SELECT) - JSONObject listModuleId(@Param("module_name") String moduleName); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/RateMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/RateMapper.java deleted file mode 100644 index 9ef093d1b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/RateMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2017-01-09. - */ -public interface RateMapper { - - JSONObject getRateConfig(@Param("rate_name") String rateName, @Param("amount") double tradeAmount); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java deleted file mode 100644 index 3c7ad9c3f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; - -import java.util.List; - -/** - * Created by yishuqian on 11/11/2016. - */ -@AutoMapper(tablename = "austrac_report_config", pkName = "pkid", keyGenerator = Jdbc3KeyGenerator.class) -public interface ReportConfigMapper { - @AutoSql(SqlType.UPDATE) - void update(JSONObject jsonObject); - @AutoSql(SqlType.SELECT) - List listReportConfig(); - - @AutoSql(SqlType.SELECT) - JSONObject findOne(@Param("pkid") int pkid); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysAppsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysAppsMapper.java deleted file mode 100644 index e48a54e17..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysAppsMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -/** - * Created by yixian on 2017-03-14. - */ -@AutoMapper(tablename = "sys_apps",pkName = "appid") -public interface SysAppsMapper { - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findApp(@Param("appid") String appid); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysChannelConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysChannelConfigMapper.java deleted file mode 100644 index ea04c9d90..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysChannelConfigMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -@AutoMapper(tablename = "cb_channel_config",pkName = "channel_id") -public interface SysChannelConfigMapper { - @AutoSql(SqlType.SELECT) - List selectAll(); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param(value = "channel_id") String channel, @Param(value = "type") int type); - - void updatePaymentConfig(@Param(value = "channel_id") String channel, @Param(value = "type") int type, @Param(value = "last_update_date")Date lastUpdateDate, - @Param(value = "last_update_by")String lastUpdateBy, @Param(value = "is_valid") boolean is_valid); - - JSONObject findOne(@Param(value = "type") int type); - - @AutoSql(SqlType.SELECT) - JSONObject selectByChannelId (@Param(value = "channel_id") String channel_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientLegalPersonMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientLegalPersonMapper.java deleted file mode 100644 index 235cdc202..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientLegalPersonMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "sys_client_legal_person", pkName = "client_id") -public interface SysClientLegalPersonMapper{ - @AutoSql(SqlType.INSERT) - void save(JSONObject representativeInfo); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject representativeInfo); - - @AutoSql(SqlType.SELECT) - JSONObject findRepresentativeInfo(@Param("client_id") int clientId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientUpayProfileMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientUpayProfileMapper.java deleted file mode 100644 index 2e9842a40..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientUpayProfileMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "sys_client_upay_profile", pkName = "client_id") -public interface SysClientUpayProfileMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject info); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject info); - - @AutoSql(SqlType.SELECT) - JSONObject findInfo(@Param("client_id") int clientId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerCommentMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerCommentMapper.java deleted file mode 100644 index 2055c4b5a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerCommentMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; - -@AutoMapper(tablename = "sys_customer_comment", pkName = "id") -public interface SysCustomerCommentMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject info); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerPaymentInfoMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerPaymentInfoMapper.java deleted file mode 100644 index 6eefd4003..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerPaymentInfoMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "sys_customer_payment_info", pkName = "id") -public interface SysCustomerPaymentInfoMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject paymentInfo); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject paymentInfo); - - @AutoSql(SqlType.SELECT) - JSONObject selectPaymentInfo(@Param(value = "wechat_openid") String open_id); - - @AutoSql(SqlType.SELECT) - JSONObject selectById(@Param(value = "id") String id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerServiceMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerServiceMapper.java deleted file mode 100644 index 0ba9b1e15..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerServiceMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2016-06-29. - */ -@AutoMapper(tablename = "sys_customer_service", pkName = "manager_id") -public interface SysCustomerServiceMapper { - List findOnline(); - - @AutoSql(SqlType.SELECT) - JSONObject findByManagerId(@Param("manager_id")String manager_id); - - @AutoSql(SqlType.INSERT) - void save(JSONObject record); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject record); - - void onoff(@Param("managerId") String managerId, @Param("status") int status); - - @AutoSql(SqlType.SELECT) - List findAllWithDetail(); - - @AutoSql(SqlType.COUNT) - int countAll(); -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerSubscribeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerSubscribeMapper.java deleted file mode 100644 index 74363c6f0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysCustomerSubscribeMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "sys_customer_subscribe", pkName = "id") -public interface SysCustomerSubscribeMapper { - - @AutoSql(SqlType.INSERT) - void save(JSONObject info); - - @AutoSql(SqlType.SELECT) - JSONObject findByEmail(@Param("subscribe_email") String email); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject subscribeInfo); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysPermissionClientModulesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysPermissionClientModulesMapper.java deleted file mode 100644 index 6a8de7e69..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysPermissionClientModulesMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; - -/** - * Created by yixian on 2017-02-28. - */ -@AutoMapper(tablename = "sys_permission_partner_modules_clients", pkName = "id") -public interface SysPermissionClientModulesMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject module); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject module); - - void delete(@Param("module_name") String moduleName); - - void deleteByClientMoniker(@Param("client_moniker") String client_moniker); - - @AutoSql(SqlType.SELECT) - List listByClientId(@Param("client_id") int client_id); - - @AutoSql(SqlType.SELECT) - JSONObject find(@Param("id") Long id); - - @AutoSql(SqlType.SELECT) - List listByClientMoniker(@Param("client_moniker")String client_moniker); - - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") - List listValidByClientId(@Param("client_id") int client_id); - - void updateFunctionValid(@Param("module_id") String module_id, @Param("is_valid") boolean is_valid); -} - - diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java deleted file mode 100644 index adfb90f8a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yangluo on 2018-09-18. - */ -@AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id") -public interface SysRpayMerchantApplyMapper { - @AutoSql(SqlType.SELECT) - List listRpayMerchantApplices(@Param("client_id") int client_id, PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void insertRpayMerchantApply(JSONObject params); - - @AutoSql(SqlType.SELECT) - List listByShortName(@Param("merchant_shortname") String shortName); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysSettlePlanMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysSettlePlanMapper.java deleted file mode 100644 index 89e011bd1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysSettlePlanMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@AutoMapper(tablename = "sys_settlement_plan", pkName = "plan_id") -public interface SysSettlePlanMapper { - @AdvanceSelect(excludeColumns = "whitelist_clients") - List listPlans(); - - @AutoSql(SqlType.SELECT) - JSONObject findPlanDetail(@Param("plan_id") String planId); - - @AutoSql(SqlType.UPDATE) - void setWhitelistClients(@Param("plan_id") String planId, @Param("whitelist_clients") String clientMonikers); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java deleted file mode 100644 index e3f3e93da..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.annotations.Update; -import java.util.List; - -/** - * Created by yixian on 2017-03-14. - */ -@AutoMapper(tablename = "sys_wx_merchant_apply",pkName = "merchant_app_id") -public interface SysWxMerchantApplyMapper { - - @Select("SELECT * FROM sys_wx_merchant_apply WHERE client_id = #{client_id} and is_valid = 1") - List listWxMerchantApplices(@Param("client_id") int client_id, PageBounds pageBounds); - - @AutoSql(SqlType.INSERT) - void insertWxMerchantApply(JSONObject params); - - @AutoSql(SqlType.SELECT) - JSONObject findByClientIdAndSubMerchantAppId(@Param("client_id") int clientId, @Param("merchant_app_id")String merchantAppId); - - @AutoSql(SqlType.SELECT) - List findByClientIdAndSubMerchantId(@Param("client_id") int client_id,@Param("sub_merchant_id") String subMerchantId); - - /** - * 失效相同微信子商户号老数据 - * @param client_id - * @param sub_merchant_id - */ - @Update("UPDATE sys_wx_merchant_apply SET is_valid=0 WHERE client_id = #{client_id} and sub_merchant_id = #{sub_merchant_id}") - void failureSubMerchantByClientIdAndSubMerchantId(@Param("client_id")int client_id, @Param("sub_merchant_id")String sub_merchant_id); - - @AutoSql(SqlType.UPDATE) - void updateSubMerchantInfoByMerchantAppId(JSONObject updateSubMerchantInfo); - - @Select("SELECT * FROM sys_wx_merchant_apply where is_valid = 1 and ( business_type is null or business_type ='')") - List findSubMerchantIdHistorys(); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/aps/ApsConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/aps/ApsConfigMapper.java deleted file mode 100644 index e819edb63..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/aps/ApsConfigMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system.aps; - -import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData; -import com.alibaba.fastjson.JSONObject; -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import org.apache.ibatis.annotations.Param; - -@AutoMapper(tablename = "sys_client_aps_config", pkName = "id") -public interface ApsConfigMapper { - - @AutoSql(SqlType.SELECT) - ApsConfigData findByClientId(@Param("client_id") String clientId); - - @AutoSql(SqlType.INSERT) - void saveApsConfigClientId(ApsConfigData apsConfigData); - - void updateApsConfigClientId(JSONObject apsConfigData); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerMapper.java deleted file mode 100644 index 103d7c3e9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.vipcustomer; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 31/10/2016. - */ - -@AutoMapper(tablename = "vip_customers", pkName = "vip_customer_id") -public interface VipCustomerMapper { - - @AutoSql(SqlType.SELECT) - List listVipCustomers(JSONObject params); - - @AutoSql(SqlType.SELECT) - PageList listVipCustomers(JSONObject params, PageBounds pageBounds); - - @AutoSql(SqlType.SELECT) - JSONObject findNewVipCustomer(@Param("client_id") int client_id); - - @AutoSql(SqlType.INSERT) - void save(JSONObject vipCustomer); - - @AutoSql(SqlType.SELECT) - JSONObject findVipCustomer(@Param("vip_customer_id") String vip_customer_id); - - @AutoSql(SqlType.UPDATE) - void update(JSONObject vipCustomer); - - @AutoSql(SqlType.SELECT) - JSONObject findVipCustomerByCode(@Param("vip_code") String vipCode); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerOrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerOrderMapper.java deleted file mode 100644 index 68d727ed3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerOrderMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.vipcustomer; - -import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; -import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; -import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.ibatis.annotations.Param; - - -/** - * Created by yishuqian on 02/11/2016. - */ -@AutoMapper(tablename = "vip_customer_orders", pkName = "vip_customer_order_id") -public interface VipCustomerOrderMapper { - @AutoSql(SqlType.INSERT) - void save(JSONObject jsonObject); - @AutoSql(SqlType.UPDATE) - void update(JSONObject updateaObj); - @AutoSql(SqlType.SELECT) - JSONObject findVipOrder(@Param("vip_customer_order_id") String vip_order_id); - - PageList listVipOrders(JSONObject params, PageBounds pageBounds); - - void updateClearingStatus(@Param("client_id") int clientId, @Param("vip_customer_id") String vip_customer_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchantid/core/MerchantIdManageService.java b/src/main/java/au/com/royalpay/payment/manage/merchantid/core/MerchantIdManageService.java deleted file mode 100644 index 508da2491..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchantid/core/MerchantIdManageService.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.merchantid.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; -import java.util.Map; - -/** - * Created by yuan on 2018/4/24. - */ -public interface MerchantIdManageService { - Map> listSubMerchantId(JSONObject manager); - - void generateClientsSunMerchantId(); - - JSONObject listNotTradeSubMerchantId(int type, JSONObject manager); - - List showClientMoniker(JSONObject manager,String sub_merchant_id); - - void save(JSONObject record); - - void disable(String sub_merchant_id); - - JSONObject getClientQrCodeImg(JSONObject manager,String sub_merchant_id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchantid/core/impl/MerchantIdManageServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchantid/core/impl/MerchantIdManageServiceImpl.java deleted file mode 100644 index 21acde64b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchantid/core/impl/MerchantIdManageServiceImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -package au.com.royalpay.payment.manage.merchantid.core.impl; - -import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.client.ClientSubMerchantIdMapper; -import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Created by yuan on 2018/4/24. - */ -@Service -public class MerchantIdManageServiceImpl implements MerchantIdManageService { - @Autowired - private ClientMapper clientMapper; - - @Autowired - private SysConfigManager sysConfigManager; - - @Autowired - private ClientAnalysisMapper clientAnalysisMapper; - - @Autowired - private ClientSubMerchantIdMapper clientSubMerchantIdMapper; - - @Resource - private CommonSubMerchantIdMapper commonSubMerchantIdMapper; - - @Resource - private MpPaymentApi mpPaymentApi; - - private Logger logger = LoggerFactory.getLogger(getClass()); - - - @Override - public Map> listSubMerchantId(JSONObject manager) { - List clients = clientMapper.listSubMerchantId(); - return getClientMap(clients); - } - @Override - public JSONObject listNotTradeSubMerchantId(int type, JSONObject manager) { - List clients = new ArrayList<>(); - switch (type) { - case 0: //all - clients = clientSubMerchantIdMapper.listSubMerchantId(new PageBounds(Order.formString("diff_days.desc"))); - break; - case 1://0~15天 - clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(0,15); - break; - case 2://15~30天 - clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(15,30); - break; - case 3://30~45天 - clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(30,45); - break; - case 4://45~60天 - clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(45,60); - break; - default: - break; - } - Map> merchantIdMap = clients.stream().filter(t->t.containsKey("merchant_id")).filter(t->t.containsKey("sub_merchant_id")).collect(Collectors.groupingBy(t->t.getString("merchant_id"))); - JSONObject returnJason = new JSONObject(); - returnJason.put("merchant_id_map", merchantIdMap); - returnJason.put("refresh_time", !clients.isEmpty() ? clients.get(0).getDate("create_time") : ""); - return returnJason; - } - - @Override - public void generateClientsSunMerchantId() { - //重构未交易商户号逻辑 - List clients = clientAnalysisMapper.tradeSubMerchantIdBy60Days(DateUtils.addDays(new Date(), -60)); - if (!clients.isEmpty()) { - clientSubMerchantIdMapper.deleteAll(); - } - for (JSONObject client: clients) { - String subMerchantId = client.getString("sub_merchant_id"); - if (subMerchantId != null) { - client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); - } - String id = client.getString("sub_merchant_id"); - client.put("create_time",new Date()); - clientSubMerchantIdMapper.save(client); - } - } - - @Override - public List showClientMoniker(JSONObject manager,String sub_merchant_id) { - return clientMapper.listBySubMerchantId(sub_merchant_id); - } - - @Override - public void save(JSONObject record) { - JSONObject sub_merchant_id = commonSubMerchantIdMapper.find(record.getString("sub_merchant_id")); - if(sub_merchant_id!=null){ - throw new BadRequestException("当前商户号已经添加,请重新输入"); - } - WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(record.getString("sub_merchant_id")); - if(availableMerchant == null){ - throw new BadRequestException("未检索到对应的商户号,请验证子商户号是否正确"); - } - record.put("merchant_id",availableMerchant.getMerchantId()); - commonSubMerchantIdMapper.save(record); - - } - - @Override - public void disable(String sub_merchant_id) { - JSONObject record = new JSONObject(); - record.put("sub_merchant_id",sub_merchant_id); - record.put("is_valid",false); - record.put("update_time",new Date()); - commonSubMerchantIdMapper.update(record); - } - - private Map> getClientMap(List clients){ - for (JSONObject client: clients) { - String subMerchantId = client.getString("sub_merchant_id"); - if (subMerchantId != null) { - client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); - } - } - Map> clientsMap = clients.stream() - .filter(t->t.containsKey("merchant_id")) - .filter(t->t.containsKey("sub_merchant_id")) - .collect(Collectors.groupingBy(t->t.getString("merchant_id"))); - return clientsMap; - } - - @Override - public JSONObject getClientQrCodeImg(JSONObject manager,String sub_merchant_id) { - String partner_code = "PINE"; - String orderId = "Merchant" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + "_" + RandomStringUtils.random(5, true, true).toUpperCase(); - JSONObject param = new JSONObject(); - param.put("price", 1); - param.put("description", "order"); - param.put("operator", "web"); - param.put("sub_merchant_id",sub_merchant_id); - String createUrl= PlatformEnvironment.getEnv().concatUrl("api/v1.0/gateway/partners/" + partner_code + "/orders/" + orderId +"/manager/test"+"?" + queryParams(partner_code)); - HttpRequestResult result = null; - result = new HttpRequestGenerator(createUrl, RequestMethod.PUT).setJSONEntity(param).execute(); - if (result.isSuccess()) { - try { - return result.getResponseContentJSONObj(); - } catch (IOException e) { - throw new ServerErrorException(e.getMessage(), e); - } - } - return null; - } - - private String queryParams(String client_moniker) { - JSONObject client = clientMapper.findClientByMoniker(client_moniker); - long time = System.currentTimeMillis(); - String nonceStr = RandomStringUtils.random(15, true, true); - String validStr = client_moniker + "&" + time + "&" + nonceStr + "&" + client.getString("credential_code"); - String sign = DigestUtils.sha256Hex(validStr).toLowerCase(); - return "time=" + time + "&nonce_str=" + nonceStr + "&sign=" + sign; - } - - @Cacheable("common_sub_mch_id:") - public boolean checkSubMerchantIdInCommonPool(String subMerchantId) { - JSONObject json = commonSubMerchantIdMapper.find(subMerchantId); - return json != null; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java deleted file mode 100644 index 462a203a4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java +++ /dev/null @@ -1,87 +0,0 @@ -package au.com.royalpay.payment.manage.merchantid.web; - -import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper; -import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService; - -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/sys/merchant_id") -public class MerchantIdManageController { - - @Resource - private MerchantIdManageService merchantIdManageService; - - @Resource - private CommonSubMerchantIdMapper commonSubMerchantIdMapper; - - @RequestMapping(method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.OPERATOR}) - public Map> listSubMerchantId(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return merchantIdManageService.listSubMerchantId(manager); - } - - - @RequestMapping(method = RequestMethod.GET,value = "/trade") - @RequireManager(role = {ManagerRole.OPERATOR}) - public JSONObject listNotTradeSubMerchantId(int type,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return merchantIdManageService.listNotTradeSubMerchantId(type, manager); - } - - @RequestMapping(method = RequestMethod.POST,value = "/refresh") - @RequireManager(role = {ManagerRole.OPERATOR}) - public void refreshClientsByTraded(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - merchantIdManageService.generateClientsSunMerchantId(); - } - - @RequestMapping(method = RequestMethod.GET,value = "/{sub_merchant_id}") - @RequireManager(role = {ManagerRole.OPERATOR}) - public List showClientMoniker(@PathVariable() String sub_merchant_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return merchantIdManageService.showClientMoniker(manager,sub_merchant_id); - } - - - @GetMapping("/common_sub_merchant_id") - @RequireManager(role = {ManagerRole.OPERATOR}) - public JSONObject listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id, - @RequestParam int page, @RequestParam(defaultValue = "true") boolean is_valid) { - PageList list = commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(page, 20, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @PostMapping("/common_sub_merchant_id/{sub_merchant_id}") - @RequireManager(role = {ManagerRole.OPERATOR}) - public void addCommonSubMerchantId(@PathVariable String sub_merchant_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject record = new JSONObject(); - record.put("sub_merchant_id",sub_merchant_id); - record.put("operator",manager.getString("display_name")); - record.put("create_time",new Date()); - merchantIdManageService.save(record); - } - - @PutMapping("/common_sub_merchant_id/{sub_merchant_id}") - @RequireManager(role = {ManagerRole.OPERATOR}) - public void disableCommonSubMerchantId(@PathVariable String sub_merchant_id) { - merchantIdManageService.disable(sub_merchant_id); - } - - @PutMapping("/qrcode/{sub_merchant_id}") - @RequireManager(role = {ManagerRole.OPERATOR}) - public JSONObject getClientQrCodeImg(@PathVariable String sub_merchant_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return merchantIdManageService.getClientQrCodeImg(manager,sub_merchant_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ActivityPosterBuilder.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ActivityPosterBuilder.java deleted file mode 100644 index 3d9ae6ecb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ActivityPosterBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import au.com.royalpay.payment.manage.merchants.beans.activityPosterBuilders.AlipayLuckyMoneyPosterBuilder; -import au.com.royalpay.payment.manage.merchants.beans.activityPosterBuilders.LuckyMoneyPosterBuilder; -import com.alibaba.fastjson.JSONObject; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * Created by yixian on 2017-01-04. - */ -public interface ActivityPosterBuilder { - - void writePoster(JSONObject client, JSONObject invitation, OutputStream ous) throws IOException; - - String actId(); - - class Porvider { - public static ActivityPosterBuilder getBuilder(String activityName) { - switch (activityName) { - case "luckymoney": - return new LuckyMoneyPosterBuilder(); - case "alipayluckmoney": - return new AlipayLuckyMoneyPosterBuilder(); - default: - return null; - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/BankAccountInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/BankAccountInfo.java deleted file mode 100644 index 22188436d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/BankAccountInfo.java +++ /dev/null @@ -1,135 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import org.hibernate.validator.constraints.Length; -import javax.validation.constraints.NotEmpty; - -import javax.validation.constraints.Pattern; - -/** - * Created by davep on 2016-08-16. - */ -public class BankAccountInfo { - @JSONField(name = "swift_code") - @Length(max = 12,message = "Switft code must be less than 12 characters") - @NotEmpty(message = "error.payment.valid.param_missing") - private String swiftCode; - - @JSONField(name = "bsb_no") - @Length(max = 6,message = "BSB No must be less than 6 characters") - @NotEmpty(message = "error.payment.valid.param_missing") - private String bsbNo; - @NotEmpty(message = "error.payment.valid.param_missing") - private String bank; - @NotEmpty(message = "error.payment.valid.param_missing") - private String city; - private String address; - private String system; - private String postcode; - private String state; - private String branch; - - @JSONField(name = "account_no") - @Length(max = 20,message = "Account No must be less than 20 characters") - @NotEmpty(message = "error.payment.valid.param_missing") - private String accountNo; - - @JSONField(name = "account_name") - @Length(max = 50,message = "Account Name must be less than 50 characters") - @Pattern(regexp = "^[a-zA-Z0-9 &]+$",message = "Invalid Account Name format") - @NotEmpty(message = "error.payment.valid.param_missing") - private String accountName; - - public JSONObject toJSON(){ - return (JSONObject)JSONObject.toJSON(this); - } - - public String getSwiftCode() { - return swiftCode; - } - - public void setSwiftCode(String swiftCode) { - this.swiftCode = swiftCode; - } - - public String getBsbNo() { - return bsbNo; - } - - public void setBsbNo(String bsbNo) { - this.bsbNo = bsbNo; - } - - public String getAccountNo() { - return accountNo; - } - - public void setAccountNo(String accountNo) { - this.accountNo = accountNo; - } - - public String getAccountName() { - return accountName; - } - - public void setAccountName(String accountName) { - this.accountName = accountName; - } - - public String getBank() { - return bank; - } - - public void setBank(String bank) { - this.bank = bank; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSystem() { - return system; - } - - public void setSystem(String system) { - this.system = system; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getBranch() { - return branch; - } - - public void setBranch(String branch) { - this.branch = branch; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientApplyInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientApplyInfo.java deleted file mode 100644 index a442b4826..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientApplyInfo.java +++ /dev/null @@ -1,292 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-06-29. - */ -public class ClientApplyInfo { - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "company_name") - private String companyName; - @JSONField(name = "client_moniker") - private String clientMoniker; - - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "short_name") - private String shortName; - @JSONField(name = "business_name") - private String businessName; -// @NotEmpty(message = "error.payment.valid.param_missing") - private String abn; - private String acn; - @JSONField(name = "company_website") - private String companyWebsite; - @JSONField(name = "company_phone") - private String companyPhone; - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - private String address; - private String suburb; - private String postcode; - private String state; - private int apply_approve_result=0; - private String country; - private String bd_id; - private String bd_name; - private String captcha; - private String industry; - private int source = 0; - private String remark; - @JSONField(name = "aus_mch_category") - private String ausMchCategory; - - - public JSONObject insertObject() { - return (JSONObject) JSON.toJSON(this); - } - - public JSONObject updateObject() { - JSONObject res = new JSONObject(); - if (apply_approve_result != 0){ - res.put("apply_approve_result",apply_approve_result); - } - if (apply_approve_result ==1 && bd_id != null){ - res.put("bd_user",bd_id); - res.put("bd_user_name",bd_name); - } - if (remark !=null){ - res.put("remark",remark); - } - return res; - } - - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getBusinessName() { - return businessName; - } - - public void setBusinessName(String businessName) { - this.businessName = businessName; - } - - public String getAbn() { - return abn; - } - - public void setAbn(String abn) { - this.abn = abn; - } - - public String getAcn() { - return acn; - } - - public void setAcn(String acn) { - this.acn = acn; - } - - public String getCompanyWebsite() { - return companyWebsite; - } - - public void setCompanyWebsite(String companyWebsite) { - this.companyWebsite = companyWebsite; - } - - public String getCompanyPhone() { - return companyPhone; - } - - public void setCompanyPhone(String companyPhone) { - this.companyPhone = companyPhone; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public int getApply_approve_result() { - return apply_approve_result; - } - - public void setApply_approve_result(int apply_approve_result) { - this.apply_approve_result = apply_approve_result; - } - - public void setBd_id(String bd_id) { - this.bd_id = bd_id; - } - - public String getBd_name() { - return bd_name; - } - - public void setBd_name(String bd_name) { - this.bd_name = bd_name; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCaptcha() { - return captcha; - } - - public void setCaptcha(String captcha) { - this.captcha = captcha; - } - - public int getSource() { - return source; - } - - public void setSource(int source) { - this.source = source; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getClientMoniker() { - if (clientMoniker != null){ - return clientMoniker.toUpperCase(); - }else { - return null; - } - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getAusMchCategory() { - return ausMchCategory; - } - - public void setAusMchCategory(String ausMchCategory) { - this.ausMchCategory = ausMchCategory; - } - - @Override - public String toString() { - return "ClientApplyInfo{" + - "companyName='" + companyName + '\'' + - ", clientMoniker='" + clientMoniker + '\'' + - ", shortName='" + shortName + '\'' + - ", businessName='" + businessName + '\'' + - ", abn='" + abn + '\'' + - ", acn='" + acn + '\'' + - ", companyWebsite='" + companyWebsite + '\'' + - ", companyPhone='" + companyPhone + '\'' + - ", contactPerson='" + contactPerson + '\'' + - ", contactPhone='" + contactPhone + '\'' + - ", contactEmail='" + contactEmail + '\'' + - ", address='" + address + '\'' + - ", suburb='" + suburb + '\'' + - ", postcode='" + postcode + '\'' + - ", state='" + state + '\'' + - ", apply_approve_result=" + apply_approve_result + - ", country='" + country + '\'' + - ", bd_id='" + bd_id + '\'' + - ", bd_name='" + bd_name + '\'' + - ", captcha='" + captcha + '\'' + - ", industry='" + industry + '\'' + - ", source=" + source + - ", remark='" + remark + '\'' + - '}'; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientAuthFilesInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientAuthFilesInfo.java deleted file mode 100644 index 764c3b40a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientAuthFilesInfo.java +++ /dev/null @@ -1,141 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yishuqian on 07/03/2017. - */ -public class ClientAuthFilesInfo { -// @NotEmpty(message = "error.payment.valid.param_missing") - private String file_bank_info; - -// @NotEmpty(message = "error.payment.valid.param_missing") - private String file_company_info; - - private String file_id_info; - -// @NotEmpty(message = "error.payment.valid.param_missing") - private String file_agreement_info; - - private String file_apply_info; - - private String utility_bill_info; - - private String id_type; - private String beneficiary_id_title; - private String other_id_title_desc; - - private int authStatus=0; - - public JSONObject toJson(){ - return (JSONObject)JSONObject.toJSON(this); - } - - public String getFile_bank_info() { - return file_bank_info; - } - - public void setFile_bank_info(String file_bank_info) { - this.file_bank_info = file_bank_info; - } - - public String getFile_company_info() { - return file_company_info; - } - - public void setFile_company_info(String file_company_info) { - this.file_company_info = file_company_info; - } - - public int getAuthStatus() { - return authStatus; - } - - public void setAuthStatus(int authStatus) { - this.authStatus = authStatus; - } - - public String getFile_agreement_info() { - return file_agreement_info; - } - - public void setFile_agreement_info(String file_aggreement_info) { - this.file_agreement_info = file_aggreement_info; - } - - public String getFile_apply_info() { - return file_apply_info; - } - - public void setFile_apply_info(String file_apply_info) { - this.file_apply_info = file_apply_info; - } - - public String getFile_id_info() { - return file_id_info; - } - - public void setFile_id_info(String file_id_info) { - this.file_id_info = file_id_info; - } - - public String getUtility_bill_info() { - return utility_bill_info; - } - - public void setUtility_bill_info(String utility_bill_info) { - this.utility_bill_info = utility_bill_info; - } - - public String getBeneficiary_id_title() { - return beneficiary_id_title; - } - - public String getId_type() { - return id_type; - } - - public String getOther_id_title_desc() { - return other_id_title_desc; - } - - public void setBeneficiary_id_title(String beneficiary_id_title) { - this.beneficiary_id_title = beneficiary_id_title; - } - - public void setId_type(String id_type) { - this.id_type = id_type; - } - - public void setOther_id_title_desc(String other_id_title_desc) { - this.other_id_title_desc = other_id_title_desc; - } - - public JSONObject toIdInfoJson() { - JSONObject params = new JSONObject(); - if (StringUtils.isNotBlank(id_type)) { - params.put("id_type", id_type); - } - if (StringUtils.isNotBlank(id_type)) { - params.put("beneficiary_id_title", beneficiary_id_title); - } - if (StringUtils.isNotBlank(id_type)) { - params.put("other_id_title_desc", other_id_title_desc); - } - return params; - } - - @Override - public String toString() { - return "ClientAuthFilesInfo{" + - "file_bank_info='" + file_bank_info + '\'' + - ", file_company_info='" + file_company_info + '\'' + - ", file_id_info='" + file_id_info + '\'' + - ", file_agreement_info='" + file_agreement_info + '\'' + - ", file_apply_info='" + file_apply_info + '\'' + - ", utility_bill_info='" + utility_bill_info + '\'' + - ", authStatus=" + authStatus + - '}'; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java deleted file mode 100644 index c699f42dd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by liuxinxin on 09/12/2019. - */ -public class ClientKycFilesInfo { - - private String file_company_info; - - private String file_id_info; - - private String utility_bill_info; - - private int authStatus=0; - - public JSONObject toJson(){ - return (JSONObject)JSONObject.toJSON(this); - } - - public String getFile_company_info() { - return file_company_info; - } - - public void setFile_company_info(String file_company_info) { - this.file_company_info = file_company_info; - } - - public String getFile_id_info() { - return file_id_info; - } - - public void setFile_id_info(String file_id_info) { - this.file_id_info = file_id_info; - } - - public String getUtility_bill_info() { - return utility_bill_info; - } - - public void setUtility_bill_info(String utility_bill_info) { - this.utility_bill_info = utility_bill_info; - } - - public int getAuthStatus() { - return authStatus; - } - - public void setAuthStatus(int authStatus) { - this.authStatus = authStatus; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientMWAuthFilesInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientMWAuthFilesInfo.java deleted file mode 100644 index fde67b19e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientMWAuthFilesInfo.java +++ /dev/null @@ -1,151 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yishuqian on 07/03/2017. - */ -public class ClientMWAuthFilesInfo { - private String client_bank_file; - private String client_company_file; - private String refund_exchange_policy; - private String upay_privacy_policy; - private String card_security_policy; - private String upay_promotional_offer; - private String upay_terms_conditions; - private String upay_offer_letter; - private String upay_driver_license; - private String kyc_utility_bill_file; - private String upay_risk_level; - private String upay_risk_remark; - private String upay_application_form; - private String upay_desc_file; - - public JSONObject toJson(){ - return (JSONObject)JSONObject.toJSON(this); - } - - public JSONObject toRiskInfoJson() { - JSONObject params = new JSONObject(); - if (StringUtils.isNotBlank(upay_risk_level)) { - params.put("upay_risk_level", upay_risk_level); - } - if (StringUtils.isNotBlank(upay_risk_remark)) { - params.put("upay_risk_remark", upay_risk_remark); - } - return params; - } - - public String getUpay_driver_license() { - return upay_driver_license; - } - - public String getUpay_offer_letter() { - return upay_offer_letter; - } - - public String getUpay_risk_level() { - return upay_risk_level; - } - - public void setUpay_driver_license(String upay_driver_license) { - this.upay_driver_license = upay_driver_license; - } - - public void setUpay_offer_letter(String upay_offer_letter) { - this.upay_offer_letter = upay_offer_letter; - } - - public String getUpay_risk_remark() { - return upay_risk_remark; - } - - public void setUpay_risk_level(String upay_risk_level) { - this.upay_risk_level = upay_risk_level; - } - - public void setUpay_risk_remark(String upay_risk_remark) { - this.upay_risk_remark = upay_risk_remark; - } - - public String getCard_security_policy() { - return card_security_policy; - } - - public String getClient_bank_file() { - return client_bank_file; - } - - public String getClient_company_file() { - return client_company_file; - } - - public String getUpay_privacy_policy() { - return upay_privacy_policy; - } - - public String getUpay_promotional_offer() { - return upay_promotional_offer; - } - - public void setCard_security_policy(String card_security_policy) { - this.card_security_policy = card_security_policy; - } - - public String getUpay_terms_conditions() { - return upay_terms_conditions; - } - - public void setClient_bank_file(String client_bank_file) { - this.client_bank_file = client_bank_file; - } - - public void setClient_company_file(String client_company_file) { - this.client_company_file = client_company_file; - } - - public void setUpay_privacy_policy(String upay_privacy_policy) { - this.upay_privacy_policy = upay_privacy_policy; - } - - public void setUpay_promotional_offer(String upay_promotional_offer) { - this.upay_promotional_offer = upay_promotional_offer; - } - - public void setUpay_terms_conditions(String upay_terms_conditions) { - this.upay_terms_conditions = upay_terms_conditions; - } - - public String getRefund_exchange_policy() { - return refund_exchange_policy; - } - - public void setRefund_exchange_policy(String refund_exchange_policy) { - this.refund_exchange_policy = refund_exchange_policy; - } - - public String getKyc_utility_bill_file() { - return kyc_utility_bill_file; - } - - public void setKyc_utility_bill_file(String kyc_utility_bill_file) { - this.kyc_utility_bill_file = kyc_utility_bill_file; - } - - public void setUpay_application_form(String upay_application_form) { - this.upay_application_form = upay_application_form; - } - - public String getUpay_application_form() { - return upay_application_form; - } - - public String getUpay_desc_file() { - return upay_desc_file; - } - - public void setUpay_desc_file(String upay_desc_file) { - this.upay_desc_file = upay_desc_file; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRateConfig.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRateConfig.java deleted file mode 100644 index b927fbb89..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRateConfig.java +++ /dev/null @@ -1,124 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.time.DateUtils; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.util.Calendar; -import java.util.Date; - -/** - * Created by davep on 2016-08-16. - */ -public class ClientRateConfig { - - @JSONField(name = "rate_name") - @NotEmpty(message = "error.payment.valid.param_missing") - private String rateName; - - @JSONField(name = "rate_value") - @NotNull(message = "error.payment.valid.param_missing") - private BigDecimal rateValue; - - @JSONField(name = "transaction_fee") - @NotNull(message = "error.payment.valid.param_missing") - private BigDecimal transactionFee = BigDecimal.ZERO; - - @JSONField(name = "active_time") - @NotNull(message = "error.payment.valid.param_missing") - private Date activeTime; - - @JSONField(name = "expiry_time") - @NotNull(message = "error.payment.valid.param_missing") - private Date expiryTime; - - @JSONField(name = "clean_days") - @NotNull(message = "error.payment.valid.param_missing") - private Integer cleanDays = 3; - private String remark; - @JSONField(name = "ext_rates") - private String extRates; - - public JSONObject toJSON() { - if (expiryTime.before(activeTime)) { - throw new BadRequestException("Expire Time is before active time"); - } - return (JSONObject) JSONObject.toJSON(this); - } - - public void setRateName(String rateName) { - this.rateName = rateName; - } - - public void setRateValue(BigDecimal rateValue) { - this.rateValue = rateValue; - } - - public void setRateValue(double rateValue) { - this.rateValue = BigDecimal.valueOf(rateValue); - } - - public void setActiveTime(Date activeTime) { - this.activeTime = activeTime; - } - - public void setExpiryTime(Date expiryTime) { - this.expiryTime = expiryTime; - } - - public String getRateName() { - return rateName; - } - - public BigDecimal getRateValue() { - return rateValue; - } - - public Date getActiveTime() { - return DateUtils.truncate(activeTime, Calendar.DATE); - } - - public Date getExpiryTime() { - return DateUtils.truncate(expiryTime, Calendar.DATE); - } - - public Integer getCleanDays() { - return cleanDays; - } - - public void setCleanDays(Integer cleanDays) { - this.cleanDays = cleanDays; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public BigDecimal getTransactionFee() { - return transactionFee; - } - - public void setTransactionFee(BigDecimal transactionFee) { - this.transactionFee = transactionFee; - } - - public void setTransactionFee(double transactionFee) { - this.transactionFee = BigDecimal.valueOf(transactionFee); - } - - public String getExtRates() { - return extRates; - } - - public void setExtRates(String extRates) { - this.extRates = extRates; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java deleted file mode 100644 index 0835b7e4b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java +++ /dev/null @@ -1,713 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Pattern; -import java.util.Date; - -/** - * Created by yixian on 2016-06-29. - */ -public class ClientRegisterInfo { - @JSONField(name = "client_moniker") - @NotEmpty(message = "error.payment.valid.param_missing") - @Pattern(regexp = "^[a-zA-Z0-9]{4}$", message = "Parameter error(partner code):Only letters or numbers are allowed") - private String clientMoniker; - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "company_name") - private String companyName; - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "short_name") - private String shortName; - @JSONField(name = "business_name") - private String businessName; - @JSONField(name = "business_structure") - private String businessStructure; - // @NotEmpty(message = "error.payment.valid.param_missing") - private String abn; - private String acn; - // @NotEmpty(message = "error.payment.valid.param_missing") - private String industry; - @JSONField(name = "alipayindustry") - /* @NotEmpty(message = "error.payment.valid.param_missing")*/ - private String alipayIndustry; - @JSONField(name = "company_photo") - private String companyPhoto; - @JSONField(name = "store_photo") - private String storePhoto; - @JSONField(name = "company_website") - private String companyWebsite; - @JSONField(name = "company_phone") - @NotEmpty(message = "error.payment.valid.param_missing") - private String companyPhone; - private String description; - private String remark; - private String sector; - @JSONField(name = "logo_id") - private String logoId; - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - @JSONField(name = "contact_job") - private String contactJob; - private String address; - private String suburb; - private String postcode; - private String state; - @JSONField(name = "legal_representative_person") - private String representativePerson; - @JSONField(name = "legal_representative_phone") - private String representativePhone; - @JSONField(name = "legal_representative_email") - private String representativeEmail; - @JSONField(name = "legal_representative_job") - private String representativeJobTitle; - @JSONField(name = "legal_representative_id") - private String representativeId; - @JSONField(name = "marketing_person") - private String marketingPerson; - @JSONField(name = "marketing_phone") - private String marketingPhone; - @JSONField(name = "marketing_email") - private String marketingEmail; - @JSONField(name = "marketing_job") - private String marketingJobTitle; - @JSONField(name = "registered_address") - private String registeredAddress; - @JSONField(name = "registered_suburb") - private String registeredSuburb; - @JSONField(name = "registered_postcode") - private String registeredPostcode; - @JSONField(name = "registered_state") - private String registeredState; - - @JSONField(name = "contact_wechatid") - private String contactWechatId; - @JSONField(name = "legal_representative_wechatid") - private String representativeWechatId; - @JSONField(name = "marketing_wechatid") - private String marketingWechatId; - - @NotEmpty(message = "error.payment.valid.param_missing") - private String country; - @Pattern(regexp = "^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$", message = "error.payment.valid.invalid_timezone") - private String timezone; - private String royalpayindustry; - - private String referrer_id; - private String referrer_name; - - private String client_apply_id; - - private String business_hours; - private String merchant_introduction; - private String merchant_tag; - private String merchant_video_url; - @JSONField(name = "store_name") - private String storeName; - @NotEmpty(message = "error.payment.valid.param_missing") - private String client_pay_type; - @NotEmpty(message = "error.payment.valid.param_missing") - private String client_pay_desc; - @JSONField(name = "it_contact_person_email") - private String itContactPersonEmail; - @JSONField(name = "acceptor_name") - private String acceptorName; - @JSONField(name = "expected_card_revenue") - private String expectCardRevenue; - @JSONField(name = "average_card_transaction") - private String averageCardTransaction; - @JSONField(name = "mw_industry") - private String mwIndustry; - @JSONField(name = "mc_industry") - private String mcIndustry; - @JSONField(name = "enable_international_card") - private boolean enableInternaltionCard; - @JSONField(name = "enable_cross_payment") - private boolean enableCrossPayment = true; - @JSONField(name = "enable_card_payment") - private boolean enableCardPayment = false; - - private String director_name; - private String director_id_number; - private String principal_name; - private String principal_id_number; - private String certificat_expire_date;//注册证书过期时间 - - private String mc_code;//微信mccode - - public JSONObject insertObject() { - if (industry == null) { - setIndustry("331"); - } - JSONObject res = (JSONObject) JSON.toJSON(this); - if (client_apply_id == null) { - res.remove("client_apply_id"); - } - return res; - } - - public JSONObject updateObject() { - JSONObject obj = insertObject(); - obj.remove("client_moniker"); - return obj; - } - - public String getClientMoniker() { - return clientMoniker.toUpperCase(); - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getBusinessName() { - return businessName; - } - - public void setBusinessName(String businessName) { - this.businessName = businessName; - } - - public String getAbn() { - return abn; - } - - public void setAbn(String abn) { - this.abn = abn; - } - - public String getAcn() { - return acn; - } - - public void setAcn(String acn) { - this.acn = acn; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getCompanyPhoto() { - return companyPhoto; - } - - public void setCompanyPhoto(String companyPhoto) { - this.companyPhoto = companyPhoto; - } - - public String getStorePhoto() { - return storePhoto; - } - - public void setStorePhoto(String storePhoto) { - this.storePhoto = storePhoto; - } - - public String getCompanyWebsite() { - return companyWebsite; - } - - public void setCompanyWebsite(String companyWebsite) { - this.companyWebsite = companyWebsite; - } - - public String getCompanyPhone() { - return companyPhone; - } - - public void setCompanyPhone(String companyPhone) { - this.companyPhone = companyPhone; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getSector() { - return sector; - } - - public void setSector(String sector) { - this.sector = sector; - } - - public String getLogoId() { - return logoId; - } - - public void setLogoId(String logoId) { - this.logoId = logoId; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public String getClient_apply_id() { - return client_apply_id; - } - - public void setClient_apply_id(String client_apply_id) { - this.client_apply_id = client_apply_id; - } - - public String getBusinessStructure() { - return businessStructure; - } - - public void setBusinessStructure(String businessStructure) { - this.businessStructure = businessStructure; - } - - public String getReferrer_id() { - return referrer_id; - } - - public void setReferrer_id(String referrer_id) { - this.referrer_id = referrer_id; - } - - public String getReferrer_name() { - return referrer_name; - } - - public void setReferrer_name(String referrer_name) { - this.referrer_name = referrer_name; - } - - public String getAlipayIndustry() { - return alipayIndustry; - } - - public void setAlipayIndustry(String alipayIndustry) { - this.alipayIndustry = alipayIndustry; - } - - public String getRoyalpayindustry() { - return royalpayindustry; - } - - public void setRoyalpayindustry(String royalpayindustry) { - this.royalpayindustry = royalpayindustry; - } - - public String getBusiness_hours() { - return business_hours; - } - - public void setBusiness_hours(String business_hours) { - this.business_hours = business_hours; - } - - public String getMerchant_introduction() { - return merchant_introduction; - } - - public void setMerchant_introduction(String merchant_introduction) { - this.merchant_introduction = merchant_introduction; - } - - public String getMerchant_tag() { - return merchant_tag; - } - - public void setMerchant_tag(String merchant_tag) { - this.merchant_tag = merchant_tag; - } - - public String getMerchant_video_url() { - return merchant_video_url; - } - - public void setMerchant_video_url(String merchant_video_url) { - this.merchant_video_url = merchant_video_url; - } - - public void setStoreName(String storeName) { - this.storeName = storeName; - } - - public String getStoreName() { - return storeName; - } - - public void setClient_pay_type(String client_pay_type) { - this.client_pay_type = client_pay_type; - } - - public void setClient_pay_desc(String client_pay_desc) { - this.client_pay_desc = client_pay_desc; - } - - public String getClient_pay_type() { - return client_pay_type; - } - - public String getClient_pay_desc() { - return client_pay_desc; - } - - public String getRepresentativePerson() { - return representativePerson; - } - - public void setRepresentativePerson(String representativePerson) { - this.representativePerson = representativePerson; - } - - public String getRepresentativePhone() { - return representativePhone; - } - - public void setRepresentativePhone(String representativePhone) { - this.representativePhone = representativePhone; - } - - public String getRepresentativeEmail() { - return representativeEmail; - } - - public void setRepresentativeEmail(String representativeEmail) { - this.representativeEmail = representativeEmail; - } - - public String getRegisteredAddress() { - return registeredAddress; - } - - public void setRegisteredAddress(String registeredAddress) { - this.registeredAddress = registeredAddress; - } - - public String getRegisteredSuburb() { - return registeredSuburb; - } - - public void setRegisteredSuburb(String registeredSuburb) { - this.registeredSuburb = registeredSuburb; - } - - public String getRegisteredPostcode() { - return registeredPostcode; - } - - public void setRegisteredPostcode(String registeredPostcode) { - this.registeredPostcode = registeredPostcode; - } - - public String getRegisteredState() { - return registeredState; - } - - public void setRegisteredState(String registeredState) { - this.registeredState = registeredState; - } - - public String getRepresentativeJobTitle() { - return representativeJobTitle; - } - - public void setRepresentativeJobTitle(String representativeJobTitle) { - this.representativeJobTitle = representativeJobTitle; - } - - public String getContactJob() { - return contactJob; - } - - public void setContactJob(String contactJob) { - this.contactJob = contactJob; - } - - public String getMarketingPerson() { - return marketingPerson; - } - - public void setMarketingPerson(String marketingPerson) { - this.marketingPerson = marketingPerson; - } - - public String getMarketingPhone() { - return marketingPhone; - } - - public void setMarketingPhone(String marketingPhone) { - this.marketingPhone = marketingPhone; - } - - public String getMarketingEmail() { - return marketingEmail; - } - - public void setMarketingEmail(String marketingEmail) { - this.marketingEmail = marketingEmail; - } - - public String getMarketingJobTitle() { - return marketingJobTitle; - } - - public void setMarketingJobTitle(String marketingJobTitle) { - this.marketingJobTitle = marketingJobTitle; - } - - public String getContactWechatId() { - return contactWechatId; - } - - public void setContactWechatId(String contactWechatId) { - this.contactWechatId = contactWechatId; - } - - public String getRepresentativeWechatId() { - return representativeWechatId; - } - - public void setRepresentativeWechatId(String representativeWechatId) { - this.representativeWechatId = representativeWechatId; - } - - public String getMarketingWechatId() { - return marketingWechatId; - } - - public void setMarketingWechatId(String marketingWechatId) { - this.marketingWechatId = marketingWechatId; - } - - public String getItContactPersonEmail() { - return itContactPersonEmail; - } - - public void setItContactPersonEmail(String itContactPersonEmail) { - this.itContactPersonEmail = itContactPersonEmail; - } - - public void setAcceptorName(String acceptorName) { - this.acceptorName = acceptorName; - } - - public String getAcceptorName() { - return acceptorName; - } - - public boolean isEnableInternaltionCard() { - return enableInternaltionCard; - } - - public String getAverageCardTransaction() { - return averageCardTransaction; - } - - public String getExpectCardRevenue() { - return expectCardRevenue; - } - - public String getMwIndustry() { - return mwIndustry; - } - - public String getMcIndustry() { - return mcIndustry; - } - - public void setAverageCardTransaction(String averageCardTransaction) { - this.averageCardTransaction = averageCardTransaction; - } - - public void setEnableInternaltionCard(boolean enableInternaltionCard) { - this.enableInternaltionCard = enableInternaltionCard; - } - - public void setExpectCardRevenue(String expectCardRevenue) { - this.expectCardRevenue = expectCardRevenue; - } - - public void setMwIndustry(String mwIndustry) { - this.mwIndustry = mwIndustry; - } - - public void setMcIndustry(String mcIndustry) { - this.mcIndustry = mcIndustry; - } - - public boolean isEnableCardPayment() { - return enableCardPayment; - } - - public boolean isEnableCrossPayment() { - return enableCrossPayment; - } - - public void setEnableCardPayment(boolean enableCardPayment) { - this.enableCardPayment = enableCardPayment; - } - - public void setEnableCrossPayment(boolean enableCrossPayment) { - this.enableCrossPayment = enableCrossPayment; - } - - public String getDirector_name() { - return director_name; - } - - public void setDirector_name(String director_name) { - this.director_name = director_name; - } - - public String getDirector_id_number() { - return director_id_number; - } - - public void setDirector_id_number(String director_id_number) { - this.director_id_number = director_id_number; - } - - public String getPrincipal_name() { - return principal_name; - } - - public void setPrincipal_name(String principal_name) { - this.principal_name = principal_name; - } - - public String getPrincipal_id_number() { - return principal_id_number; - } - - public void setPrincipal_id_number(String principal_id_number) { - this.principal_id_number = principal_id_number; - } - - public String getCertificat_expire_date() { - return certificat_expire_date; - } - - public void setCertificat_expire_date(String certificat_expire_date) { - this.certificat_expire_date = certificat_expire_date; - } - - public String getMc_code() { - return mc_code; - } - - public void setMccode(String mc_code) { - this.mc_code = mc_code; - } - - public String getRepresentativeId() { - return representativeId; - } - - public void setRepresentativeId(String representativeId) { - this.representativeId = representativeId; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientUpdateInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientUpdateInfo.java deleted file mode 100644 index b0851cae3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientUpdateInfo.java +++ /dev/null @@ -1,512 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -import org.apache.commons.lang3.StringUtils; - -import java.util.ArrayList; -import java.util.List; - -import javax.validation.constraints.Pattern; - -/** - * Created by yixian on 2016-06-29. - */ -public class ClientUpdateInfo { - @JSONField(name = "client_moniker") - @Pattern(regexp = "^[a-zA-Z0-9]{4}$", message = "Parameter error(partner code):Only letters or numbers are allowed") - private String clientMoniker; - @JSONField(name = "company_name") - private String companyName; - @JSONField(name = "short_name") - private String shortName; - @JSONField(name = "business_name") - private String businessName; - @JSONField(name = "business_structure") - private String businessStructure; - private String abn; - private String acn; - private String industry; -// @JSONField(name = "alipayindustry") -// private String alipayIndustry; - @JSONField(name = "company_photo") - private String companyPhoto; - @JSONField(name = "store_photo") - private String storePhoto; - @JSONField(name = "company_website") - private String companyWebsite; - @JSONField(name = "company_phone") - private String companyPhone; - private String description; - private String remark; - private String sector; - @JSONField(name = "logo_id") - private String logoId; - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - private String address; - private String suburb; - private String postcode; - private String state; - private String country; - @Pattern(regexp = "^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$", message = "error.payment.valid.invalid_timezone") - private String timezone; - private String client_apply_id; - private String contact_job; - private String representative_person; - private String representative_phone; - private String representative_email; - private String representative_job_title; - private String registered_address; - private String registered_suburb; - private String registered_state; - private String registered_postcode; - private String logo_url; - - - public JSONObject insertObject() { - JSONObject res = (JSONObject) JSON.toJSON(this); - if (client_apply_id == null) { - res.remove("client_apply_id"); - } - return res; - } - - public JSONObject updateObject() { - JSONObject obj = insertObject(); - obj.remove("client_moniker"); - return obj; - } - - public JSONObject appClientInfo() { - JSONObject obj = insertObject(); - List keys = new ArrayList<>(); - obj.keySet().forEach(p -> { - if (StringUtils.isEmpty(obj.getString(p))) { - keys.add(p); - } - }); - keys.forEach(p->{ - obj.remove(p); - }); - obj.remove("client_moniker"); - obj.remove("client_id"); - obj.remove("merchant_video_url"); - obj.remove("merchant_tag"); - obj.remove("merchant_introduction"); - obj.remove("business_hours"); - obj.remove("client_apply_id"); - obj.remove("referrer_id"); - obj.remove("referrer_name"); - obj.remove("jdindustry"); - obj.remove("royalpayindustry"); - obj.remove("industry"); - obj.remove("alipayIndustry"); - obj.remove("country"); - obj.remove("company_phone"); - return obj; - } - - public String getClientMoniker() { - if (StringUtils.isEmpty(this.clientMoniker)) { - return null; - } else { - return clientMoniker.toUpperCase(); - } - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getBusinessName() { - return businessName; - } - - public void setBusinessName(String businessName) { - this.businessName = businessName; - } - - public String getAbn() { - return abn; - } - - public void setAbn(String abn) { - this.abn = abn; - } - - public String getAcn() { - return acn; - } - - public void setAcn(String acn) { - this.acn = acn; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getCompanyPhoto() { - return companyPhoto; - } - - public void setCompanyPhoto(String companyPhoto) { - this.companyPhoto = companyPhoto; - } - - public String getStorePhoto() { - return storePhoto; - } - - public void setStorePhoto(String storePhoto) { - this.storePhoto = storePhoto; - } - - public String getCompanyWebsite() { - return companyWebsite; - } - - public void setCompanyWebsite(String companyWebsite) { - this.companyWebsite = companyWebsite; - } - - public String getCompanyPhone() { - return companyPhone; - } - - public void setCompanyPhone(String companyPhone) { - this.companyPhone = companyPhone; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getSector() { - return sector; - } - - public void setSector(String sector) { - this.sector = sector; - } - - public String getLogoId() { - return logoId; - } - - public void setLogoId(String logoId) { - this.logoId = logoId; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public String getClient_apply_id() { - return client_apply_id; - } - - public void setClient_apply_id(String client_apply_id) { - this.client_apply_id = client_apply_id; - } - - public String getBusinessStructure() { - return businessStructure; - } - - public void setBusinessStructure(String businessStructure) { - this.businessStructure = businessStructure; - } - - public String getContact_job() { - return contact_job; - } - - public String getLogo_url() { - return logo_url; - } - - public String getRegistered_address() { - return registered_address; - } - - public String getRegistered_postcode() { - return registered_postcode; - } - - public String getRegistered_state() { - return registered_state; - } - - public String getRegistered_suburb() { - return registered_suburb; - } - - public String getRepresentative_email() { - return representative_email; - } - - public String getRepresentative_job_title() { - return representative_job_title; - } - - public String getRepresentative_person() { - return representative_person; - } - - public String getRepresentative_phone() { - return representative_phone; - } - - public void setContact_job(String contact_job) { - this.contact_job = contact_job; - } - - public void setLogo_url(String logo_url) { - this.logo_url = logo_url; - } - - public void setRegistered_address(String registered_address) { - this.registered_address = registered_address; - } - - public void setRegistered_postcode(String registered_postcode) { - this.registered_postcode = registered_postcode; - } - - public void setRegistered_state(String registered_state) { - this.registered_state = registered_state; - } - - public void setRegistered_suburb(String registered_suburb) { - this.registered_suburb = registered_suburb; - } - - public void setRepresentative_email(String representative_email) { - this.representative_email = representative_email; - } - - public void setRepresentative_job_title(String representative_job_title) { - this.representative_job_title = representative_job_title; - } - - public void setRepresentative_person(String representative_person) { - this.representative_person = representative_person; - } - - public void setRepresentative_phone(String representative_phone) { - this.representative_phone = representative_phone; - } - - // public String getReferrer_id() { -// return referrer_id; -// } -// -// public void setReferrer_id(String referrer_id) { -// this.referrer_id = referrer_id; -// } -// -// public String getReferrer_name() { -// return referrer_name; -// } -// -// public void setReferrer_name(String referrer_name) { -// this.referrer_name = referrer_name; -// } -// -// public String getAlipayIndustry() { -// return alipayIndustry; -// } -// -// public void setAlipayIndustry(String alipayIndustry) { -// this.alipayIndustry = alipayIndustry; -// } -// -// public String getJdindustry() { -// return jdindustry; -// } -// -// public void setJdindustry(String jdindustry) { -// this.jdindustry = jdindustry; -// } -// -// public String getRoyalpayindustry() { -// return royalpayindustry; -// } -// -// public void setRoyalpayindustry(String royalpayindustry) { -// this.royalpayindustry = royalpayindustry; -// } -// -// public String getBusiness_hours() { -// return business_hours; -// } -// -// public void setBusiness_hours(String business_hours) { -// this.business_hours = business_hours; -// } -// -// public String getMerchant_introduction() { -// return merchant_introduction; -// } -// -// public void setMerchant_introduction(String merchant_introduction) { -// this.merchant_introduction = merchant_introduction; -// } -// -// public String getMerchant_tag() { -// return merchant_tag; -// } -// -// public void setMerchant_tag(String merchant_tag) { -// this.merchant_tag = merchant_tag; -// } -// -// public String getMerchant_video_url() { -// return merchant_video_url; -// } -// -// public void setMerchant_video_url(String merchant_video_url) { -// this.merchant_video_url = merchant_video_url; -// } - - - @Override - public String toString() { - return "ClientUpdateInfo{" + - "clientMoniker='" + clientMoniker + '\'' + - ", companyName='" + companyName + '\'' + - ", shortName='" + shortName + '\'' + - ", businessName='" + businessName + '\'' + - ", businessStructure='" + businessStructure + '\'' + - ", abn='" + abn + '\'' + - ", acn='" + acn + '\'' + - ", industry='" + industry + '\'' + - ", companyPhoto='" + companyPhoto + '\'' + - ", storePhoto='" + storePhoto + '\'' + - ", companyWebsite='" + companyWebsite + '\'' + - ", companyPhone='" + companyPhone + '\'' + - ", description='" + description + '\'' + - ", remark='" + remark + '\'' + - ", sector='" + sector + '\'' + - ", logoId='" + logoId + '\'' + - ", contactPerson='" + contactPerson + '\'' + - ", contactPhone='" + contactPhone + '\'' + - ", contactEmail='" + contactEmail + '\'' + - ", address='" + address + '\'' + - ", suburb='" + suburb + '\'' + - ", postcode='" + postcode + '\'' + - ", state='" + state + '\'' + - ", country='" + country + '\'' + - ", timezone='" + timezone + '\'' + - ", client_apply_id='" + client_apply_id + '\'' + - '}'; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java deleted file mode 100644 index d611dc943..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java +++ /dev/null @@ -1,107 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-07-02. - */ -public class NewAccountBean { - @NotEmpty(message = "error.payment.valid.param_missing") - private String username; - @NotEmpty(message = "error.payment.valid.param_missing") - private String pwd; - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "display_name") - private String displayName; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - @JSONField(name = "nation_code") - private String nation_code = "+61"; - private int role = PartnerRole.CASHIER.getCode(); - @JSONField(name = "client_id") - private int clientId; - - public JSONObject toJson() { - JSONObject account = new JSONObject(); - account.put("display_name", displayName); - account.put("username", getUsername()); - account.put("role", role); - account.put("nation_code", nation_code.startsWith("+")?nation_code:"+"+nation_code); - if (contactEmail != null){ - account.put("contact_email", contactEmail); - } - if (contactPhone != null){ - account.put("contact_phone", contactPhone); - } - return account; - } - - public String getUsername() { - return username.toLowerCase(); - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPwd() { - return pwd; - } - - public void setPwd(String pwd) { - this.pwd = pwd; - } - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public int getRole() { - return role; - } - - public void setRole(int role) { - this.role = role; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getNation_code() { - return nation_code; - } - - public void setNation_code(String nation_code) { - this.nation_code = nation_code; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public int getClientId() { - return clientId; - } - - public void setClientId(int clientId) { - this.clientId = clientId; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewSubMerchantIdApply.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewSubMerchantIdApply.java deleted file mode 100644 index d39440dfd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewSubMerchantIdApply.java +++ /dev/null @@ -1,352 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import au.com.royalpay.payment.channels.wechat.runtime.beans.WechatMerchantInfo; -import au.com.royalpay.payment.tools.utils.JsonUtils; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.StringUtils; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotBlank; - -/** - * Created by yuan on 2018/1/19. - */ -public class NewSubMerchantIdApply { - - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 50) - @JSONField(name = "company_name") - private String merchant_name; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 10) - @JSONField(name = "merchant_id") - private String merchant_id; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 20) - @JSONField(name = "short_name") - private String merchant_shortname; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 20) - @JSONField(name = "company_phone") - private String office_phone; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 32) - @JSONField(name = "contact_person") - private String contact_name; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 16) - private String contact_phone; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 128) - private String contact_email; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 10) - @JSONField(name = "industry") - private String business_category; - - @Length(max = 128) - @JSONField(name = "company_website") - private String website; - - //2020-11-16 - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 20) - @JSONField(name = "merchant_type") - private String merchant_type; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 7) - @JSONField(name = "mcc_code")//数据库中用的是mc_code - private String mcc_code; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(min = 4, max = 128) - @JSONField(name = "address") - private String address; - @Length(min=1 ,max = 128) - @JSONField(name = "director_name") - private String legal_director_name; - @Length(min=1 ,max = 128) - @JSONField(name = "director_id_number") - private String director_id_number; - @Length(min=1 ,max = 128) - @JSONField(name = "principal_name") - @Length(min=1 ,max = 128) - private String principal_name; - @JSONField(name = "principal_id_number") - private String principal_id_number; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(min=1 ,max = 50) - @JSONField(name = "company_register_no") - private String company_register_no; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(min=1 ,max = 10) - @JSONField(name = "certificat_expire_date") - private String certificat_expire_date; - - @NotBlank(message = "error.payment.valid.param_missing") - @JSONField(name = "business_type") - private String business_type; - - private String sub_mch_id; - - @JSONField(name = "merchant_remark") - private String merchantRemark; - - public JSONObject insertObject(JSONObject client) { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(merchant_name)){ - params.put("merchant_name",merchant_name); - } - if(StringUtils.isNotEmpty(merchant_shortname)){ - params.put("merchant_shortname",merchant_shortname); - } - if(StringUtils.isNotEmpty(office_phone)){ - params.put("office_phone",office_phone); - } - if(StringUtils.isNotEmpty(contact_name)){ - params.put("contact_name",contact_name); - } - if(StringUtils.isNotEmpty(contact_phone)){ - params.put("contact_phone",contact_phone); - } - if(StringUtils.isNotEmpty(contact_email)){ - params.put("contact_email",contact_email); - } - if(StringUtils.isNotEmpty(business_category)){ - params.put("business_category",business_category); - } - if(StringUtils.isNotEmpty(website)){ - params.put("website",website); - } - if(StringUtils.isNotEmpty(address)){ - params.put("stores_address", address); - } - if(StringUtils.isNotEmpty(company_register_no)){ - params.put("extra_reg_cer_number", company_register_no); - } - if(StringUtils.isNotEmpty(certificat_expire_date)){ - params.put("extra_reg_cer_exp_date", certificat_expire_date); - } - if(StringUtils.isNotEmpty(merchant_type)){ - params.put("extra_merchant_type",merchant_type); - if(StringUtils.equals("ENTERPRISE",merchant_type)){ - params.put("director_name",legal_director_name);//董事、项目主持人 - params.put("director_id_number", director_id_number); - }else{ - params.put("principal_name",principal_name);//[企业]主要负责人 - params.put("principal_id_number",principal_id_number); - } - } - if(StringUtils.isNotEmpty(mcc_code)){ - params.put("mcc_code", mcc_code); - } - if(StringUtils.isNotEmpty(business_type)){ - params.put("business_type", business_type); - } - - params.put("merchant_country_code","036");//固定值,036-澳大利亚国家编码 - params.put("merchant_remark",merchantRemark); - if(StringUtils.isNotEmpty(sub_mch_id)) { - params.put("sub_mch_id", sub_mch_id); - } - - return params; - } - - public static JSONObject resultParams(WechatMerchantInfo subMerchantApplyInfo){ - return JsonUtils.newJson(json->{ - json.put("company_name",subMerchantApplyInfo.getMerchantName()); - json.put("merchant_id",subMerchantApplyInfo.getMerchantId()); - json.put("short_name",subMerchantApplyInfo.getMerchantShortname()); - json.put("company_phone",subMerchantApplyInfo.getOfficePhone()); - json.put("contact_person",subMerchantApplyInfo.getContactName()); - json.put("contact_phone",subMerchantApplyInfo.getContactPhone()); - json.put("contact_email",subMerchantApplyInfo.getContactEmail()); - json.put("industry",subMerchantApplyInfo.getBusinessCategory()); - json.put("company_website",subMerchantApplyInfo.getWebsite()); - json.put("mcc_code",subMerchantApplyInfo.getMccCode()); - json.put("address",subMerchantApplyInfo.getStoresAddress()); - json.put("company_register_no",subMerchantApplyInfo.getExtraRegCerNumber()); - json.put("certificat_expire_date",subMerchantApplyInfo.getExtraRegCerExpDate()); - json.put("merchant_type",subMerchantApplyInfo.getExtraMerchantType()); - json.put("director_name",subMerchantApplyInfo.getDirectorName()); - json.put("director_id_number",subMerchantApplyInfo.getDirectorIdNumber()); - json.put("principal_name",subMerchantApplyInfo.getPrincipalName()); - json.put("principal_id_number",subMerchantApplyInfo.getPrincipalIdNumber()); - json.put("business_type",subMerchantApplyInfo.getBusinessType()); - json.put("sub_merchant_id",subMerchantApplyInfo.getSubMerchantId()); - json.put("merchant_remark",subMerchantApplyInfo.getMerchantRemark()); - }); - } - - public NewSubMerchantIdApply() { - } - - public String getMerchantRemark() { - return merchantRemark; - } - - public void setMerchantRemark(String merchantRemark) { - this.merchantRemark = merchantRemark; - } - - public String getMerchant_name() { - return this.merchant_name; - } - - public String getMerchant_id() { - return merchant_id; - } - - public void setMerchant_id(String merchant_id) { - this.merchant_id = merchant_id; - } - - public void setMerchant_name(String merchant_name) { - this.merchant_name = merchant_name; - } - - public String getMerchant_shortname() { - return this.merchant_shortname; - } - - public void setMerchant_shortname(String merchant_shortname) { - this.merchant_shortname = merchant_shortname; - } - - public String getOffice_phone() { - return this.office_phone; - } - - public void setOffice_phone(String office_phone) { - this.office_phone = office_phone; - } - - public String getContact_name() { - return this.contact_name; - } - - public void setContact_name(String contact_name) { - this.contact_name = contact_name; - } - - public String getContact_phone() { - return this.contact_phone; - } - - public void setContact_phone(String contact_phone) { - this.contact_phone = contact_phone; - } - - public String getContact_email() { - return this.contact_email; - } - - public void setContact_email(String contact_email) { - this.contact_email = contact_email; - } - - public String getBusiness_category() { - return this.business_category; - } - - public void setBusiness_category(String business_category) { - this.business_category = business_category; - } - - public String getWebsite() { - return this.website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getAddress() { - return this.address; - } - - public String getMerchant_type() { - return merchant_type; - } - - public void setMerchant_type(String merchant_type) { - this.merchant_type = merchant_type; - } - - public String getLegal_director_name() { - return legal_director_name; - } - - public void setLegal_director_name(String legal_director_name) { - this.legal_director_name = legal_director_name; - } - - public String getDirector_id_number() { - return director_id_number; - } - - public void setDirector_id_number(String director_id_number) { - this.director_id_number = director_id_number; - } - - public String getPrincipal_name() { - return principal_name; - } - - public void setPrincipal_name(String principal_name) { - this.principal_name = principal_name; - } - - public String getPrincipal_id_number() { - return principal_id_number; - } - - public void setPrincipal_id_number(String principal_id_number) { - this.principal_id_number = principal_id_number; - } - - public String getMcc_code() { - return mcc_code; - } - - public void setMcc_code(String mcc_code) { - this.mcc_code = mcc_code; - } - - public String getCompany_register_no() { - return company_register_no; - } - - public void setCompany_register_no(String company_register_no) { - this.company_register_no = company_register_no; - } - - public String getCertificat_expire_date() { - return certificat_expire_date; - } - - public void setCertificat_expire_date(String certificat_expire_date) { - this.certificat_expire_date = certificat_expire_date; - } - - public String getBusiness_type() { - return business_type; - } - - public void setBusiness_type(String business_type) { - this.business_type = business_type; - } - - public String getSub_mch_id() { - return sub_mch_id; - } - - public void setSub_mch_id(String sub_mch_id) { - this.sub_mch_id = sub_mch_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerApplyQuery.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerApplyQuery.java deleted file mode 100644 index 352752706..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerApplyQuery.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yixian on 2016-07-01. - */ -public class PartnerApplyQuery { - private String short_name; - private int page = 1; - private int limit = 10; - private int apply_approve_result=9;//0:待审核 1:已提交bd 2:bd已通过 3:初审不通过 4:bd不通过 8:不通过 9:all - - public String getShort_name() { - return short_name; - } - - public void setShort_name(String short_name) { - this.short_name = short_name; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if(StringUtils.isNotBlank(short_name)){ - param.put("short_name",short_name); - } - if (apply_approve_result != 9){ - param.put("apply_approve_result",apply_approve_result); - } - return param; - } - - public int getApply_approve_result() { - return apply_approve_result; - } - - public void setApply_approve_result(int apply_approve_result) { - this.apply_approve_result = apply_approve_result; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java deleted file mode 100644 index 323861852..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java +++ /dev/null @@ -1,514 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - - -/** - * Created by yixian on 2016-07-01. - */ -public class PartnerQuery { - private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - private String textType; - private String searchText; - private String client_moniker; - private String state; - private String suburb; - private String short_name; - private String sub_merchant_id; - private String org_id; - private String org_ids; - private String bd; - private String business_structure; - private String industry; - private Integer clean_day; - private String bd_city; - private String surcharge_start_rate; - private String surcharge_end_rate; - private String create_start_time; - private String approve_start_time; - private String create_end_time; - private String approve_end_time; - private String transaction_start_time; - private String transaction_end_time; - private boolean approving = false; - private int page = 1; - private int limit = 10; - private boolean onlyMe = false; - private boolean tempMchId = false; - private boolean quickPass = false; - private boolean greenChannel = false; - private boolean greenChannelBdTodo = false; - private boolean pass = false; - private boolean completed_contract = false; - private boolean apply_to_back = false; - private boolean bd_upload_material = false; - private boolean is_valid = false; - private String merchant_id; - private boolean card_approving = false; - - //审核商户查询进件分类(跨境/卡支付) - private boolean cross_approving_flag= false; - private boolean card_approving_flag = false; - - public String getClient_moniker() { - return StringUtils.isEmpty(client_moniker) ? null : client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getShort_name() { - return short_name; - } - - public void setShort_name(String short_name) { - this.short_name = short_name; - } - - public String getSub_merchant_id() { - return sub_merchant_id; - } - - public void setSub_merchant_id(String sub_merchant_id) { - this.sub_merchant_id = sub_merchant_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(client_moniker)) { - param.put("client_moniker", getClient_moniker()); - } - if (StringUtils.isNotBlank(short_name)) { - param.put("short_name", short_name); - } - if (StringUtils.isNotBlank(sub_merchant_id)) { - param.put("sub_merchant_id", sub_merchant_id); - } - if (StringUtils.isNotBlank(state)) { - param.put("state", state); - } - if (StringUtils.isNotBlank(suburb)) { - param.put("suburb", suburb); - } - if (StringUtils.isNotBlank(searchText)) { - param.put("search_text", searchText); - if (StringUtils.isNotBlank(textType)) { - param.put("text_type", textType); - } else { - param.put("text_type", "all"); - } - } - if (approving) { - param.put("approving", true); - } - if(card_approving){ - param.put("card_approving",true); - } - if(cross_approving_flag){ - param.put("cross_approving_flag", true); - } - if(card_approving_flag){ - param.put("card_approving_flag", true); - } - if (org_id != null) { - param.put("org_id", org_id); - } - if (org_ids != null) { - param.put("org_ids", org_ids); - } - if (StringUtils.isNotBlank(bd)) { - param.put("bd_user", bd); - } - if (quickPass){ - param.put("quickPass",true); - } - if (greenChannel){ - param.put("greenChannel",true); - } - if (business_structure!=null && !business_structure.equals("")){ - param.put("business_structure",business_structure); - } - if (industry!=null && !industry.equals("")){ - param.put("industry",industry); - } - if (bd_city!=null && !bd_city.equals("")){ - param.put("bd_city",bd_city); - } - if (clean_day!=null){ - param.put("clean_day",clean_day); - } - if (surcharge_start_rate!=null) { - param.put("surcharge_start_rate",surcharge_start_rate); - } - if (surcharge_end_rate!=null){ - param.put("surcharge_end_rate",surcharge_end_rate); - } - if (transaction_start_time != null) { - try { - param.put("transaction_start_time", format.parse(transaction_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("transaction_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (transaction_end_time != null) { - try { - param.put("transaction_end_time", DateUtils.addDays(format.parse(transaction_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("transaction_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (create_start_time != null) { - try { - param.put("create_start_time", format.parse(create_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("create_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (create_end_time != null) { - try { - param.put("create_end_time", DateUtils.addDays(format.parse(create_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("create_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (approve_start_time != null) { - try { - param.put("approve_start_time", format.parse(approve_start_time)); - } catch (ParseException e) { - throw new ParamInvalidException("approve_start_time", "error.payment.valid.invalid_date_format"); - } - } - if (approve_end_time != null) { - try { - param.put("approve_end_time", DateUtils.addDays(format.parse(approve_end_time), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("approve_end_time", "error.payment.valid.invalid_date_format"); - } - } - if (greenChannelBdTodo){ - param.put("greenChannelBdTodo",true); - } - if (is_valid){ - param.put("is_valid",true); - } - if (pass){ - param.put("pass",true); - } - if (completed_contract){ - param.put("completed_contract",true); - } - if (apply_to_back){ - param.put("apply_to_back",true); - } - if (bd_upload_material){ - param.put("bd_upload_material",true); - } - if (merchant_id != null){ - param.put("merchant_id",merchant_id); - } - return param; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getTextType() { - return textType; - } - - public void setTextType(String textType) { - this.textType = textType; - } - - public String getSearchText() { - return searchText; - } - - public void setSearchText(String searchText) { - this.searchText = searchText; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public void setOnlyMe(boolean onlyMe) { - this.onlyMe = onlyMe; - } - - public boolean getOnlyMe() { - return onlyMe; - } - - public boolean isTempMchId() { - return tempMchId; - } - - public void setTempMchId(boolean tempMchId) { - this.tempMchId = tempMchId; - } - - public String getBusiness_structure() { - return business_structure; - } - - public void setBusiness_structure(String business_structure) { - this.business_structure = business_structure; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public Integer getClean_day() { - return clean_day; - } - - public void setClean_day(Integer clean_day) { - this.clean_day = clean_day; - } - - public String getBd_city() { - return bd_city; - } - - public void setBd_city(String bd_city) { - this.bd_city = bd_city; - } - - public String getCreate_start_time() { - return create_start_time; - } - - public void setCreate_start_time(String create_start_time) { - this.create_start_time = create_start_time; - } - - public String getApprove_start_time() { - return approve_start_time; - } - - public void setApprove_start_time(String approve_start_time) { - this.approve_start_time = approve_start_time; - } - - public String getCreate_end_time() { - return create_end_time; - } - - public void setCreate_end_time(String create_end_time) { - this.create_end_time = create_end_time; - } - - public String getApprove_end_time() { - return approve_end_time; - } - - public void setApprove_end_time(String approve_end_time) { - this.approve_end_time = approve_end_time; - } - - public String getSurcharge_start_rate() { - return surcharge_start_rate; - } - - public void setSurcharge_start_rate(String surcharge_start_rate) { - this.surcharge_start_rate = surcharge_start_rate; - } - - public String getTransaction_start_time() { - return transaction_start_time; - } - - public void setTransaction_start_time(String transaction_start_time) { - this.transaction_start_time = transaction_start_time; - } - - public String getTransaction_end_time() { - return transaction_end_time; - } - - public void setTransaction_end_time(String transaction_end_time) { - this.transaction_end_time = transaction_end_time; - } - - public String getSurcharge_end_rate() { - return surcharge_end_rate; - } - - public void setSurcharge_end_rate(String surcharge_end_rate) { - this.surcharge_end_rate = surcharge_end_rate; - } - - public boolean isOnlyMe() { - return onlyMe; - } - - public boolean isApproving() { - return approving; - } - - public void setApproving(boolean approving) { - this.approving = approving; - } - - public boolean isQuickPass() { - return quickPass; - } - - public void setQuickPass(boolean quickPass) { - this.quickPass = quickPass; - } - - public boolean isGreenChannel() { - return greenChannel; - } - - public void setGreenChannel(boolean greenChannel) { - this.greenChannel = greenChannel; - } - public void setGreenChannelAndBDtodo(boolean bDTodo){ - this.greenChannelBdTodo = bDTodo; - } - public void setIs_valid(boolean is_valid){ - this.is_valid=is_valid; - } - - public DateFormat getFormat() { - return format; - } - - public boolean isGreenChannelBdTodo() { - return greenChannelBdTodo; - } - - public void setGreenChannelBdTodo(boolean greenChannelBdTodo) { - this.greenChannelBdTodo = greenChannelBdTodo; - } - - public boolean isPass() { - return pass; - } - - public void setPass(boolean pass) { - this.pass = pass; - } - - public boolean isCompleted_contract() { - return completed_contract; - } - - public void setCompleted_contract(boolean completed_contract) { - this.completed_contract = completed_contract; - } - - public boolean isApply_to_back() { - return apply_to_back; - } - - public void setApply_to_back(boolean apply_to_back) { - this.apply_to_back = apply_to_back; - } - - public boolean isBd_upload_material() { - return bd_upload_material; - } - - public void setBd_upload_material(boolean bd_upload_material) { - this.bd_upload_material = bd_upload_material; - } - - public boolean isIs_valid() { - return is_valid; - } - - public String getOrg_ids() { - return org_ids; - } - - public void setOrg_ids(String org_ids) { - this.org_ids = org_ids; - } - - public void setBd(String bd) { - this.bd = bd; - } - - public String getMerchant_id() { - return merchant_id; - } - - public void setMerchant_id(String merchant_id) { - this.merchant_id = merchant_id; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public boolean isCard_approving() { - return card_approving; - } - - public void setCard_approving(boolean card_approving) { - this.card_approving = card_approving; - } - - public boolean isCross_approving_flag() { - return cross_approving_flag; - } - - public void setCross_approving_flag(boolean cross_approving_flag) { - this.cross_approving_flag = cross_approving_flag; - } - - public boolean isCard_approving_flag() { - return card_approving_flag; - } - - public void setCard_approving_flag(boolean card_approving_flag) { - this.card_approving_flag = card_approving_flag; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SettleDetail.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SettleDetail.java deleted file mode 100644 index 76a4e562a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SettleDetail.java +++ /dev/null @@ -1,118 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import com.alibaba.fastjson.annotation.JSONField; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import java.math.BigDecimal; - -/** - * Create by yixian at 2018-01-07 22:25 - */ -public class SettleDetail { - private Integer hour; - @JSONField(name = "rule_type") - @Pattern(regexp = "^(DAY_OF_MONTH)|(DAY_OF_WEEK)$", message = "Invalid Rule Type") - @NotNull(message = "error.payment.valid.param_missing") - private String rule_type; - - private String rule; - private boolean manual; - private boolean everyday; - private BigDecimal min = BigDecimal.ZERO; - private int max_settle_days; - - private String group= BalanceGroup.RPAY_SVC_CARD.toString(); - - public String ruleToCron() { - if (everyday) { - return "* * ?"; - } - if (!manual && rule_type == null) { - throw new ParamInvalidException("rule_type", "error.payment.valid.param_missing"); - } - if (rule_type != null) { - switch (rule_type) { - case "DAY_OF_MONTH": - return rule + " * ?"; - case "DAY_OF_WEEK": - return "? * " + rule; - default: - throw new ParamInvalidException("rule_type", "Invalid Rule Type"); - } - } - return null; - } - - public Integer getHour() { - return hour; - } - - public SettleDetail setHour(Integer hour) { - this.hour = hour; - return this; - } - - public String getRule_type() { - return rule_type; - } - - public SettleDetail setRule_type(String rule_type) { - this.rule_type = rule_type; - return this; - } - - public String getRule() { - return rule; - } - - public SettleDetail setRule(String rule) { - this.rule = rule; - return this; - } - - public BigDecimal getMin() { - return min; - } - - public SettleDetail setMin(BigDecimal min) { - this.min = min; - return this; - } - - public boolean isManual() { - return manual; - } - - public SettleDetail setManual(boolean manual) { - this.manual = manual; - return this; - } - - public boolean isEveryday() { - return everyday; - } - - public SettleDetail setEveryday(boolean everyday) { - this.everyday = everyday; - return this; - } - - public int getMax_settle_days() { - return max_settle_days; - } - - public void setMax_settle_days(int max_settle_days) { - this.max_settle_days = max_settle_days; - } - - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubClientRegistry.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubClientRegistry.java deleted file mode 100644 index 4dca9d9b6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubClientRegistry.java +++ /dev/null @@ -1,146 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import javax.validation.constraints.NotEmpty; - -import javax.validation.constraints.Pattern; - -/** - * Created by yixian on 2016-06-29. - */ -public class SubClientRegistry { - @JSONField(name = "client_moniker") - @NotEmpty(message = "error.payment.valid.param_missing") - @Pattern(regexp = "^[a-zA-Z0-9]+$",message = "Parameter error(partner code):Only letters or numbers are allowed") - private String clientMoniker; - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "short_name") - private String shortName; - @JSONField(name = "company_phone") - @NotEmpty(message = "error.payment.valid.param_missing") - private String companyPhone; - private String description; - private String remark; - @JSONField(name = "contact_person") - private String contactPerson; - @JSONField(name = "contact_phone") - private String contactPhone; - @JSONField(name = "contact_email") - private String contactEmail; - private String address; - private String suburb; - private String postcode; - private String state; - @NotEmpty(message = "error.payment.valid.param_missing") - private String country; - - public JSONObject insertObject() { - return (JSONObject) JSON.toJSON(this); - } - - public String getClientMoniker() { - return clientMoniker.toUpperCase(); - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getCompanyPhone() { - return companyPhone; - } - - public void setCompanyPhone(String companyPhone) { - this.companyPhone = companyPhone; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getContactPerson() { - return contactPerson; - } - - public void setContactPerson(String contactPerson) { - this.contactPerson = contactPerson; - } - - public String getContactPhone() { - return contactPhone; - } - - public void setContactPhone(String contactPhone) { - this.contactPhone = contactPhone; - } - - public String getContactEmail() { - return contactEmail; - } - - public void setContactEmail(String contactEmail) { - this.contactEmail = contactEmail; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getSuburb() { - return suburb; - } - - public void setSuburb(String suburb) { - this.suburb = suburb; - } - - public String getPostcode() { - return postcode; - } - - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java deleted file mode 100644 index 69c0e05fb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java +++ /dev/null @@ -1,174 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.StringUtils; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotBlank; - -/** - * Created by yuan on 2018/1/19. - */ -public class SubMerchantIdApply { - - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 50) - @JSONField(name = "company_name") - private String merchant_name; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 10) - @JSONField(name = "merchant_id") - private String merchant_id; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 20) - @JSONField(name = "store_name") - private String merchant_storename; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 20) - @JSONField(name = "company_phone") - private String office_phone; - @JSONField(name = "contact_person") - private String contact_name; - private String contact_phone; - private String contact_email; - @NotBlank(message = "error.payment.valid.param_missing") - @JSONField(name = "industry") - private String business_category; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(max = 20) - @JSONField(name = "remark") - private String merchant_remark; - @JSONField(name = "company_website") - private String website; - @NotBlank(message = "error.payment.valid.param_missing") - @Length(min = 10, max = 256) - @JSONField(name = "description") - private String merchant_introduction; - - public JSONObject insertObject() { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(merchant_name)){ - params.put("merchant_name",merchant_name); - } - if(StringUtils.isNotEmpty(merchant_storename)){ - params.put("merchant_shortname",merchant_storename); - } - if(StringUtils.isNotEmpty(office_phone)){ - params.put("office_phone",office_phone); - } - if(StringUtils.isNotEmpty(contact_name)){ - params.put("contact_name",contact_name); - } - if(StringUtils.isNotEmpty(contact_phone)){ - params.put("contact_phone",contact_phone); - } - if(StringUtils.isNotEmpty(contact_email)){ - params.put("contact_email",contact_email); - } - if(StringUtils.isNotEmpty(business_category)){ - params.put("business_category",business_category); - } - if(StringUtils.isNotEmpty(merchant_remark)){ - params.put("merchant_remark",merchant_remark); - } - if(StringUtils.isNotEmpty(website)){ - params.put("website",website); - } - if(StringUtils.isNotEmpty(merchant_introduction)){ - params.put("merchant_introduction",merchant_introduction); - } - return params; - } - - public SubMerchantIdApply() { - } - - public String getMerchant_name() { - return this.merchant_name; - } - - public String getMerchant_id() { - return merchant_id; - } - - public void setMerchant_id(String merchant_id) { - this.merchant_id = merchant_id; - } - - public void setMerchant_name(String merchant_name) { - this.merchant_name = merchant_name; - } - - public String getMerchant_storename() { - return this.merchant_storename; - } - - public void setMerchant_storename(String merchant_storename) { - this.merchant_storename = merchant_storename; - } - - public String getOffice_phone() { - return this.office_phone; - } - - public void setOffice_phone(String office_phone) { - this.office_phone = office_phone; - } - - public String getContact_name() { - return this.contact_name; - } - - public void setContact_name(String contact_name) { - this.contact_name = contact_name; - } - - public String getContact_phone() { - return this.contact_phone; - } - - public void setContact_phone(String contact_phone) { - this.contact_phone = contact_phone; - } - - public String getContact_email() { - return this.contact_email; - } - - public void setContact_email(String contact_email) { - this.contact_email = contact_email; - } - - public String getBusiness_category() { - return this.business_category; - } - - public void setBusiness_category(String business_category) { - this.business_category = business_category; - } - - public String getMerchant_remark() { - return this.merchant_remark; - } - - public void setMerchant_remark(String merchant_remark) { - this.merchant_remark = merchant_remark; - } - - public String getMerchant_introduction() { - return this.merchant_introduction; - } - - public void setMerchant_introduction(String merchant_introduction) { - this.merchant_introduction = merchant_introduction; - } - - public String getWebsite() { - return this.website; - } - - public void setWebsite(String website) { - this.website = website; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/activityPosterBuilders/AlipayLuckyMoneyPosterBuilder.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/activityPosterBuilders/AlipayLuckyMoneyPosterBuilder.java deleted file mode 100644 index 1b9b1d0c0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/activityPosterBuilders/AlipayLuckyMoneyPosterBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans.activityPosterBuilders; - -import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.utils.ImageUtils; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSONObject; -import com.google.zxing.WriterException; -import org.apache.commons.io.IOUtils; - -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -/** - * Created by yixian on 2017-01-04. - */ -public class AlipayLuckyMoneyPosterBuilder implements ActivityPosterBuilder { - - @Override - public void writePoster(JSONObject client, JSONObject invitation, OutputStream ous) throws IOException { - - BufferedImage img = new BufferedImage(750, 2430, BufferedImage.TYPE_3BYTE_BGR); - Graphics2D g = (Graphics2D) img.getGraphics(); - g.setColor(Color.WHITE); - g.fillRect(0, 0, 750, 2430); - String headUrl = PlatformEnvironment.getEnv().concatUrl("/static/images/alipayPromotion/alipay_poster.png"); - ImageUtils.drawImage(g, headUrl, 0, 0, 750, 2430); - ImageUtils.drawText(g, "邀请码:" + invitation.getString("invitation_code"), 32, 400, 1190, Font.PLAIN, new Color(1, 114, 207)); - ImageUtils.drawText(g, "详见下方“参与方式”", 24, 400, 1240, Font.PLAIN, new Color(1, 170, 226)); - ImageUtils.drawText(g, "活动时间:2017.10.20-2017.12.31", 27, 374, 883, Font.PLAIN, new Color(255, 255, 255)); - - try { - ByteArrayOutputStream bos = QRCodeUtils.getQRImageBytes(PlatformEnvironment.getEnv().concatUrl("/promotions/clients/" + client.getString("client_moniker")+"/aggregate"), 270,true); - BufferedImage qr = ImageIO.read(new ByteArrayInputStream(bos.toByteArray())); - ImageUtils.drawImage(g, qr, 130, 1140, 110, 110); - } catch (WriterException ignored) { - } - g.dispose(); - ImageIO.write(img, "jpeg", ous); - ous.flush(); - IOUtils.closeQuietly(ous); - } - - @Override - public String actId() { - return "3"; - } - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/activityPosterBuilders/LuckyMoneyPosterBuilder.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/activityPosterBuilders/LuckyMoneyPosterBuilder.java deleted file mode 100644 index 7dd7d52a8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/activityPosterBuilders/LuckyMoneyPosterBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans.activityPosterBuilders; - -import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.utils.ImageUtils; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSONObject; -import com.google.zxing.WriterException; -import org.apache.commons.io.IOUtils; - -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -/** - * Created by yixian on 2017-01-04. - */ -public class LuckyMoneyPosterBuilder implements ActivityPosterBuilder { - - @Override - public void writePoster(JSONObject client, JSONObject invitation, OutputStream ous) throws IOException { - - BufferedImage img = new BufferedImage(640, 1050, BufferedImage.TYPE_3BYTE_BGR); - Graphics2D g = (Graphics2D) img.getGraphics(); - g.setColor(Color.WHITE); - g.fillRect(0, 0, 640, 1050); - String headUrl = PlatformEnvironment.getEnv().concatUrl("/static/images/promotion_head.png"); - ImageUtils.drawImage(g, headUrl, 0, 0, 640, 395); - String logoUrl = PlatformEnvironment.getEnv().concatUrl("/static/images/promotion_logo.png"); - ImageUtils.drawImage(g, logoUrl, 0, 400, 640, 77); - ImageUtils.drawText(g, "推荐微信支付成功 微信福利红包返现", 24, 320, 500, Font.PLAIN, Color.BLACK); - Color green = new Color(0x28, 0xb2, 0x4b); - ImageUtils.drawText(g, "1RMB-188RMB不等", 28, 320, 535, Font.BOLD, green); - - try { - ByteArrayOutputStream bos = QRCodeUtils.getQRImageBytes(PlatformEnvironment.getEnv().concatUrl("/promotions/clients/" + client.getString("client_moniker")), 320,false); - BufferedImage qr = ImageIO.read(new ByteArrayInputStream(bos.toByteArray())); - ImageUtils.drawImage(g, qr, 160, 670, 320, 320); - } catch (WriterException ignored) { - } - ImageUtils.drawText(g, "敬请参与", 28, 320, 570, Font.BOLD, green); -// ImageUtils.drawText(g, "活动时间:1月23日-2月20日", 24, 320, 610, Font.PLAIN, Color.BLACK); - ImageUtils.drawText(g, "(每单消费需要满50澳币)", 24, 320, 640, Font.PLAIN, Color.BLACK); - ImageUtils.drawText(g, client.getString("short_name"), 16, 320, 670, Font.PLAIN, Color.BLACK); - ImageUtils.drawText(g, "邀请码:" + invitation.getString("invitation_code"), 24, 320, 990, Font.PLAIN, Color.BLACK); - g.setColor(green); - g.setStroke(new BasicStroke(4)); - g.drawRect(197,965,246,32); - g.dispose(); - ImageIO.write(img, "jpeg", ous); - ous.flush(); - IOUtils.closeQuietly(ous); - } - - @Override - public String actId() { - return "2"; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/mongo/ClientConfigLog.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/mongo/ClientConfigLog.java deleted file mode 100644 index a27be4e76..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/mongo/ClientConfigLog.java +++ /dev/null @@ -1,94 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.beans.mongo; - -import com.fasterxml.jackson.annotation.JsonFormat; - -import org.springframework.data.mongodb.core.mapping.Document; - -import java.util.Date; - -@Document(collection = "client_config_log") -public class ClientConfigLog { - - private long id; - private int clientId; - private String business; - private String userType; - private String userId; - private String userName; - private String originData; - private String newData; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+10") - private Date createTime; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public int getClientId() { - return clientId; - } - - public void setClientId(int clientId) { - this.clientId = clientId; - } - - public String getBusiness() { - return business; - } - - public void setBusiness(String business) { - this.business = business; - } - - public String getUserType() { - return userType; - } - - public void setUserType(String userType) { - this.userType = userType; - } - - 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; - } - - public String getOriginData() { - return originData; - } - - public void setOriginData(String originData) { - this.originData = originData; - } - - public String getNewData() { - return newData; - } - - public void setNewData(String newData) { - this.newData = newData; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ApsConfigService.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ApsConfigService.java deleted file mode 100644 index 3441146e0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ApsConfigService.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import au.com.royalpay.payment.manage.merchants.deacriptor.ApsConfigDescriptor; -import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData; -import com.alibaba.fastjson.JSONObject; - -public interface ApsConfigService { - ApsConfigData getApsConfigByClientId(String clientId); - - ApsConfigData saveApsConfigClientId(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor); - - ApsConfigData updateApsConfigClientId(String managerId,String clientId, JSONObject apsConfig); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java deleted file mode 100644 index 76be422f8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - - -/** - * Created by yishuqian on 18/10/2016. - */ -public interface ClientApply { - void applyPartner(ClientApplyInfo apply); - - JSONObject listPartnerApply(JSONObject manager, PartnerQuery apply); - - JSONObject getPartnerApplicationDetail(String client_apply_id); - - JSONObject getNewPartnerApplications(JSONObject manager, PartnerQuery apply); - - void handlePartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager); - - String addVerifyCode(String capText); - - String getVerifyCode(String codeKey); - - void deleteVerifyCodeKey(String codeKey); - - JSONObject passPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager); - - void linkPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager); - - void remarkAccount(JSONObject manager, String accountId, String remark); - - List listAlllOrgs(); - - List listBDByOrg(int org_id); - - JSONObject findOrgByBDId(String bd_id); - - void notifyBD(String client_apply_id); - - void exportApplyPartnerList(JSONObject manager, HttpServletResponse response) throws Exception; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientComplyValidator.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientComplyValidator.java deleted file mode 100644 index 8727b45e3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientComplyValidator.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2017-02-15. - */ -public interface ClientComplyValidator { - void validClient(JSONObject client); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientConfigService.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientConfigService.java deleted file mode 100644 index e64f35412..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientConfigService.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-06-25. - */ -public interface ClientConfigService { - - void update(JSONObject record); - - JSONObject find(int client_id); - - JSONObject save(JSONObject record); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientInfoCacheSupport.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientInfoCacheSupport.java deleted file mode 100644 index 653a7b10f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientInfoCacheSupport.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -public interface ClientInfoCacheSupport { - - - void clearClientCache(int clientId); - - void clearClientMonikerCache(String clientMoniker); - - void clearClientConfigCache(int clientId); - - void clearClientMonikerConfigCache(String clientMoniker); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java deleted file mode 100644 index 4a36c272b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ /dev/null @@ -1,627 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import au.com.royalpay.payment.channels.alipay.beans.plus.ApsMerchantApplication; -import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.request.entities.RPayMerchantEntity; -import au.com.royalpay.payment.core.beans.ChannelMerchantInfo; -import au.com.royalpay.payment.core.beans.MerchantApplicationResult; -import au.com.royalpay.payment.core.exceptions.EmailException; -import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; -import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; -import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean; -import au.com.royalpay.payment.manage.merchants.beans.*; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.util.List; - -/** - * Created by yixian on 2016-06-25. - */ -public interface ClientManager { - - JSONObject getSysRateConfig(); - - JSONObject getSysCardRateConfig(); - - JSONObject getClientInfo(int clientId); - - JSONObject getClientInfoIgnoreInvalid(int clientId); - - JSONObject getClientInfoByMoniker(String clientMoniker); - - JSONObject clientDetail(JSONObject manager, String clientMoniker); - - JSONObject getClientDetailById(int clientId); - - JSONObject listClients(JSONObject manager, PartnerQuery query); - - void exportClients(JSONObject manager, PartnerQuery query, HttpServletResponse resp); - - JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query); - - List listPartners(JSONObject manager, PartnerQuery query); - - String initMerchantCode(); - - boolean getMerchantIsValid(String clientMoniker); - - @Transactional - JSONObject registerClient(String clientMoniker, ClientRegisterInfo registery, JSONObject manager); - - @Transactional - void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info); - - @Transactional - void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info); - - @Transactional - void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo); - - @Transactional - void updateClientRpayPaymentConfig(JSONObject manager, String clientMoniker, JSONObject rpaySubMerchantInfo); - - @Transactional - void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo); - - @Transactional - void refreshWechatInstitutionMerchantId(JSONObject manager, String clientMoniker, JSONObject refreshWechatInstitutionMerchantId); - - @Transactional(noRollbackFor = EmailException.class) - void auditClient(JSONObject manager, String clientMoniker, int pass); - - @Transactional(noRollbackFor = EmailException.class) - void auditCardClient(JSONObject manager, String clientMoniker, int pass); - - @Transactional(noRollbackFor = EmailException.class) - void auditClientGreenChannel(JSONObject manager, String clientMoniker); - - void checkAndSendInitEmail(JSONObject manager, String clientMoniker, String type); - - - void markApproveEmailSendStatus(String clientMoniker, JSONObject manager); - - void checkEmailStatus(); - - @Transactional - void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow); - - @Transactional - void modifyUPayProfile(JSONObject manager, String clientMoniker, String profileKey, boolean allow); - - @Transactional - void switchChannelPermission(JSONObject manager, String clientMoniker, String channel, boolean allow); - - List listAccounts(JSONObject manager, String clientMoniker); - - /** - * new partner account - * - * @param clientMoniker partner code - * @param account new account info - * @param manager creator, could be a system manager or partner manager - * @param managerType 1 for system manager, 2 for partner manager - * @return new account object - */ - @Transactional - JSONObject newAccount(String clientMoniker, NewAccountBean account, JSONObject manager, int managerType); - - @Transactional - void resetAccountPwd(JSONObject manager, String clientMoniker, String accountId, String pwd); - - @Transactional - void disableAccount(JSONObject manager, String clientMoniker, String accountId); - - JSONObject createBindWechatUserQrCode(String clientMoniker, String accountId); - - @Transactional - void bindWechatUser(String randomKey, JSONObject user, Model model); - - @Transactional - void unbindAccountWechat(String clientMoniker, String accountId); - - @Transactional - void toggleAccountReceiveNotice(String shortId, String accountId, boolean enable); - - @Transactional - void toggleAccountRefundAuthorize(String clientMoniker, String accountId, boolean enable); - - @Transactional - void toggleAccountReceiveNoticeByOpenId(String openid, boolean enable); - - @Transactional - void togglePayNotice(JSONObject account, String clientMoniker, boolean enable); - - @Transactional - void changeRole(JSONObject manager, String clientMoniker, String accountId, int role); - - @Transactional - void toggleAuditRefund(String clientMoniker, boolean enable, JSONObject account); - - List listPaymentNoticeAccounts(int clientId); - - List listRefundAuditAccounts(int clientId); - - JSONObject getAccountByOpenId(String openid); - - void updateClientBDUser(JSONObject account, String clientMoniker, int managerId); - - void refreshClientCredentialCode(JSONObject manager, String clientMoniker); - - JSONObject listClientBankAccounts(JSONObject manager, String clientMoniker); - - JSONObject getBankAccountByClientId(int clientId); - - void saveBankAccount(JSONObject manager, String clientMoniker, BankAccountInfo bankAccount); - - List clientRates(String clientMoniker, boolean includingInactive); - - void configSettleHour(JSONObject manager, String clientMoniker, Integer hour); - - void configRate(JSONObject manager, String clientMoniker, ClientRateConfig config); - - void newConfigRate(JSONObject manager, String clientMoniker, JSONObject config); - - void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config); - - List listSubClients(JSONObject manager, String clientMoniker); - - JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker, String searchText, int page); - - List listSubClients(int clientId); - - void validateClients(int clientId, JSONObject params) throws Exception; - - void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception; - - List listClientDBUsers(JSONObject manager, String clientMoniker); - - JSONObject getQRCode(JSONObject manager, String clientMoniker, QRCodeConfig config); - - String getQrCodeBoard(JSONObject client, QRCodeConfig config, JSONObject account, String plantform); - - void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous, String plantform); - - void writeCBBankAggregateQrCodeBoard(JSONObject manager, String clientMoniker, OutputStream ous, String plantform); - - void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous, String plantform); - - void writePoster(JSONObject manager, String clientMoniker, OutputStream ous); - - void writeAggregatePoster(JSONObject manager, String clientMoniker, OutputStream ous); - - void writeActivityPoster(JSONObject manager, String clientMoniker, String activityName, OutputStream ous) throws IOException; - - @Transactional - void updateTimeZone(JSONObject account, String clientMoniker, String timezone); - - JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String clientType, String[] clientIds); - - /** - * 获取所有设备Id分类 - * - * @param clientMoniker - * @param clientType - * @param clientIds - * @return - */ - JSONObject listClientDeviceIds(String clientMoniker, String clientType, String[] clientIds); - - void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark); - - void toggleDeviceAvailable(JSONObject manager, String clientMoniker, String devId, boolean enable); - - List listClientCurrentBDUsers(JSONObject manager, String clientMoniker); - - JSONObject getBankInfo(JSONObject manager, String clientMoniker, String bsbNo); - - void setMaxOrderAmount(JSONObject account, String clientMoniker, BigDecimal limit); - - void setClientQRCodePaySurCharge(JSONObject account, String clientMoniker, boolean paySurcharge); - - void setClientApiPaySurCharge(JSONObject account, String clientMoniker, boolean enableApiSurcharge); - - void setClientRetailPaySurCharge(JSONObject account, String clientMoniker, boolean paySurcharge); - - void setClientCBBankPaySurCharge(JSONObject account, String clientMoniker, boolean paySurcharge); - - void setClientTaxInSurcharge(JSONObject account, String clientMoniker, boolean taxInSurcharge); - - void setClientPreSettle(JSONObject manager, String clientMoniker, boolean presettle); - - void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree); - - List listClientsForSettlement(); - - List listClientsDetailsForSettlement(); - - void updateClientCleanDays(int clientId, int cleanDays); - - void updateClientEmail(int clientId, String contactEmail); - - void disableClient(String clientMoniker, JSONObject manager); - - void revertClient(String clientMoniker, JSONObject manager); - - void updateClientIdInfo(String clientMoniker, JSONObject params, JSONObject manager); - - void updateMWRiskInfoByClient(String clientMoniker, JSONObject params, JSONObject manager); - - JSONObject getAuthFiles(JSONObject manager, String clientMoniker); - - JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker); - - JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker); - - JSONObject getMWAuthFiles(JSONObject manager, String clientMoniker); - - JSONObject getAllKycFiles(JSONObject manager, String clientMoniker); - - JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker); - - JSONObject getSourceCardAgreeFiles(String clientMoniker, JSONObject manager, String fileName); - - void deleteAuthFiles(String fileId); - - void deleteAuthFilesByAdmin(String fileId); - - void deleteMWAuthFilesByAdmin(String fileId); - - void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); - - void uploadAuthFilesManager(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); - - void uploadMWAuthFilesManager(JSONObject manager, String clientMoniker, ClientMWAuthFilesInfo filesInfo); - - void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); - - List uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); - - List uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo, String fileType); - - List uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); - - void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source); - - JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException; - - JSONObject getClientsAnalysis(JSONObject manager); - - List getUnRegister(JSONObject manager); - - void commitToCompliance(String clientMoniker, JSONObject manager); - - void commitToCardCompliance(String clientMoniker, JSONObject manager); - - void commitToDoAgreeFile(String clientMoniker, JSONObject manager); - - /** - * 提交资料,申请卡支付 - * - * @param clientMoniker - * @param manager - */ - void commitToDoCardAgreeFile(String clientMoniker, JSONObject manager); - - void commitToGreenChannel(String clientMoniker, JSONObject manager); - - void changePaymentPage(JSONObject manager, String clientMoniker, String paypadVersion); - - void changeCBBankPaymentPage(JSONObject manager, String clientMoniker, String paypadVersion); - - void changePaymentSuccessPage(JSONObject manager, String clientMoniker, String paysuccessVersion); - - void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund); - - void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet); - - void changeGatewayVersion(JSONObject account, boolean enableV2); - - void changeVerifyIp(JSONObject account, boolean enableV2); - - void changePaymentPage(JSONObject account, String paypadVersion); - - void changeCBBankPaymentPage(JSONObject account, String paypadVersion); - - void changeManualSettle(JSONObject account, int clientId, boolean manualSettle, String operatorId, int type, String operation); - - void changeQRCodePaySurcharge(JSONObject account, boolean paySurcharge); - - void changeApiPaySurcharge(JSONObject account, boolean enableApiSurcharge); - - void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge); - - void changeCBBankPaySurcharge(JSONObject account, boolean paySurcharge); - - void changeRequireCustinfo(JSONObject account, boolean requireCustinfo); - - void changeRequireRemark(JSONObject account, boolean requireRemark); - - void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO); - - void refusePartner(String clientMoniker, JSONObject manager, String refuseRemark); - - void cardRefusePartner(String clientMoniker, JSONObject manager, String refuseRemark); - - JSONArray getAllClientIds(int clientId); - - void updateAppClient(JSONObject account, int clientId, AppClientBean appClientBean); - - void setSkipClearing(JSONObject account, String clientMoniker, Boolean skipClearing, String remark); - - void modifyMinSettle(JSONObject manager, String clientMoniker, BigDecimal minSettle); - - void setSurchargeMode(JSONObject account, String clientMoniker, String surchargeMode); - - JSONObject surchargeAccount(JSONObject account, String clientMoniker); - - void setAllowSurchargeCredit(JSONObject account, String clientMoniker, Boolean allowSurchargeCredit); - - List getAccountTransactions(JSONObject account, String clientMoniker); - - List getAccountDetailByMonths(JSONObject account, String clientMoniker); - - List getAccountTransactionsByDetailId(JSONObject account, String clientMoniker, String detailId); - - List getAccountMonthDetails(JSONObject account, String clientMoniker); - - void saveAccountTransaction(JSONObject account, String clientMoniker, JSONObject transaction); - - void enableGatewayUpgrade(JSONObject account, String clientMoniker, boolean gatewayUpgrade); - - void enableGatewayAlipayOnline(JSONObject account, String clientMoniker, boolean gatewayAlipayOnline); - - void setCustomerSurchargeRate(JSONObject account, String clientMoniker, BigDecimal customerSurchargeRate); - - void setPartnerPublicKeyConfig(JSONObject account, String ipWhitelistConfig); - - void refreshPlatformPublicKeyConfig(JSONObject account); - - void setIpWhitelistConfig(JSONObject account, String ipWhitelistConfig); - - void setOrderExpiryConfig(JSONObject account, String clientMoniker, String orderExpiryConfig); - - void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception; - - void getAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; - - void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; - - //重新制作卡支付合同 - void getAggregateCardAgreeFileAgain(String clientMoniker, JSONObject manager) throws Exception; - - void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String rateid, HttpServletResponse httpResponse); - - void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; - - void temporaryExportPdf(String clientMoniker, JSONObject manager, HttpServletResponse httpResponse) throws Exception; - - void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile, boolean renewal); - - void completeAgree(String clientMoniker, JSONObject manager); - - void cardCompleteAgree(String clientMoniker, JSONObject manager); - - void downloadComplianceZip(String clientMoniker, HttpServletResponse response) throws Exception; - - void downloadMWComplianceZip(String clientMoniker, HttpServletResponse response) throws Exception; - - void configMasterMerchant(JSONObject manager, String clientMoniker, String masterMerchant); - - JSONObject getSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query); - - /** - * 导出清算日志 - * - * @param manager - * @param clientMoniker - * @param query - */ - void excelSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query, HttpServletResponse response); - - void updateRefundPwd(JSONObject account, String pwd); - - void validRefundPwd(JSONObject account, String pwd); - - void setWeekendDelay(JSONObject account, String clientMoniker, int clientId, boolean delay); - - List listSubMerchantIdApplys(JSONObject manager, String clientMoniker); - - List listRpaySubMerchantIdApplys(JSONObject manager, String clientMoniker); - - @Deprecated - String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply, JSONObject manager); - - String newSubMerchantApplication(String clientMoniker, NewSubMerchantIdApply subMerchantIdApply, JSONObject manager); - - JSONObject queryApplicationSubMerchantById(String clientMoniker, String merchantAppId); - - void changeApplicationSubMerchantById(String clientMoniker, String merchantAppId, NewSubMerchantIdApply subMerchantIdApply, JSONObject manager); - - JSONObject querySubMerchantStatus(String clientMoniker, String subMerchantId); - - void registerAlipayGms(String clientMoniker, JSONObject manager); - - void registerAlipayOnlineGms(String clientMoniker, JSONObject manager); - - void registerClientApplyGMS(String clientMoniker, String account_id); - - String queryAlipayGmsStatus(String clientMoniker, JSONObject manager); - - JSONObject queryAlipayGmsJson(String clientMoniker, JSONObject manager); - - JSONObject queryAlipayOnlineGmsJson(String clientMoniker, JSONObject manager); - - String queryAlipayOnlineGmsStatus(String clientMoniker, JSONObject manager); - - List listMerchantIds(String clientMoniker, JSONObject manager); - - JSONObject getCheckClientInfo(int client_id, String account_id, String channel); - - List getClientSubMerchantIdLogs(String clientMoniker, JSONObject manager); - - void applyToCompliance(String client_moniker, JSONObject account, JSONObject params); - - void sendVerifyEmail(JSONObject client, String accountId); - - JSONObject getWithConfig(int client_id); - - List getClientsByBD(String bd_user); - - JSONObject simpleQuery(JSONObject param, int page, int limit); - - JSONObject getByEmail(String email, int page, int limit, List ExceptClientIds); - - void addSub(String client_moniker, JSONObject manager); - - void removeSub(String client_moniker, JSONObject manager); - - String getShortLink(String client_moniker); - - String getGatewayShortLink(String client_moniker, String channel); - - @Transactional - void switchHfLink(JSONObject manager, String clientMoniker, boolean allow); - - @Transactional - void switchGatewayLink(JSONObject manager, String clientMoniker, String channel, boolean allow); - - void sendHfEmailNotice(JSONObject order); - - void sendGatewayEmailNotice(JSONObject order); - - void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo, JSONObject manager); - - void updateAllPartnerPassword(String clientMoniker); - - /** - * 根据商户之前的费率自动延期一年 - * - * @param clientId - */ - boolean postponeClientRate(int clientId, String clientMoniker, String nextYearExipryDate, List channels); - - JSONObject comListPartnerSelection(JSONObject manager, PartnerQuery query); - - List getClientBySimpleQuery(JSONObject param); - - void switchPaymentConfig(String clientMoniker, HttpServletResponse response) throws IOException; - - @Transactional - void switchCBBankLink(JSONObject manager, String clientMoniker, boolean allow); - - String cbBankPayLink(String clientMoniker); - - void switchPaymentConfigPC(String clientMoniker, HttpServletResponse response) throws IOException; - - void partnerCBChannelConfig(String clientMoniker, String channelKey, String channel_id); - - void addDevice(JSONObject manager, String clientMoniker, JSONObject device); - - /** - * 退款密码 - */ - void verifyRefundPassword(JSONObject account, JSONObject json); - - /** - * 退款密码 - */ - void resetRefundPassword(JSONObject account, JSONObject json); - - void resetRefundPasswordByManage(String clientMoniker, JSONObject manage, JSONObject json); - - List listLevel3Client(int client_id); - - void updateRefundCreditLine(JSONObject manager, String clientMoniker, JSONObject refundLineInfo); - - JSONObject getComplianceFiles(JSONObject account); - - JSONObject getKycFiles(JSONObject account); - - JSONObject getClientInfoByAggree(JSONObject account); - - JSONObject getComplianceFilesForClient(JSONObject account); - - JSONObject getKycFilesForBD(JSONObject client, JSONObject manager, String sourceType); - - /** - * 获取商户所有增值服务 - * - * @param clientMoniker - * @return - */ - JSONObject partnerIncrementalService(String clientMoniker); - - boolean isPartnerKycfilesComplete(String clientMoniker); - - JSONObject isLessFiles(JSONObject partner); - - /** - * 保存/修改增值服务配置 - * - * @param clientMoniker - * @param incrementalService - */ - void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager); - - /** - * 禁用/启用增值服务 - * - * @param clientMoniker - * @param incrementalService - */ - void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager); - - /** - * 获取商户增值服务详情 - * - * @param clientMoniker - * @return - */ - JSONObject partnerIncrementalServiceInfo(String clientMoniker, String incrementalId); - - JSONObject getClientIncrementalServiceLoginToken(JSONObject account, String incrementalId); - - JSONObject findByLookupCode(String code); - - RSvcMchBean findSvcMchByAccountId(String accountId); - - void queryModifyClientIds(int clientId, JSONObject params); - - boolean getMergeSettleStatus(JSONObject client); - - void changeExtParams(String clientMoniker, JSONObject manager, JSONObject params); - - RPayMerchantEntity applyMWMerchantId(String clientMoniker, JSONObject manager); - - RPayMerchantEntity queryMWMerchantIdStatus(String clientMoniker, JSONObject manager); - - RPayMerchantEntity queryMWMerchantInfo(String clientMoniker, JSONObject manager); - - void selectBillCodeVersion(JSONObject manager, String clientMoniker, String version); - - - MerchantApplicationResult alipayPlusRegisterMerchant(String clientMoniker, ApsMerchantApplication apsMerchantApplication, JSONObject manager);//alipayplus 注册商户 - - String queryAlipayPlusOnlineStatus(boolean isOffline, String clientMoniker, JSONObject manager); - - String queryAlipayPlusOfflineStatus(String clientMoniker, JSONObject manager); - - JSONObject getApsKycClient(JSONObject account, String clientMoniker); - - void updateApsKycClient(JSONObject account, JSONObject item); - - JSONObject getSettleConfig(String clientMoniker, JSONObject manager); - - void configSettleDetail(JSONObject manager, String clientMoniker, SettleDetail settleDetail); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java deleted file mode 100644 index 34b6a6fc1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation; - -/** - * Create by yixian at 2018-04-12 16:24 - */ -public interface ClientModifySupport { - - void processModify(ClientModifyOperation modify); - - void processClientModify(ClientModify clientModify); - - void processClientConfigModify(ClientModify clientConfigModify); - - void processClientConfigModify(ClientModify clientConfigModify, boolean onlyModifyConfig); - - void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientSignEventSupport.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientSignEventSupport.java deleted file mode 100644 index 0cc08e41d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientSignEventSupport.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-04-11. - */ -public interface ClientSignEventSupport { - List listUnhandledSignEvents(int clientId); - - void sign(JSONObject account, String signId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/MerchantChannelPermissionService.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/MerchantChannelPermissionService.java deleted file mode 100644 index e4538e039..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/MerchantChannelPermissionService.java +++ /dev/null @@ -1,8 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core; - -import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.request.entities.RPayMerchantEntity; -import com.alibaba.fastjson.JSONObject; - -public interface MerchantChannelPermissionService { - RPayMerchantEntity copyMerchantWarriorConfig(JSONObject manager, String targetClientMoniker, String sourceClientMoniker); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBank.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBank.java deleted file mode 100644 index 5f823c9e2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBank.java +++ /dev/null @@ -1,73 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.bank; - -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.io.IOException; - - -/** - * @Description - * @title: 澳大利亚银行 - * @Date 2020/11/12 14:24 - * @author: zhangTao - */ -public class AustraliaBank { - - private static Logger logger = LoggerFactory.getLogger(AustraliaBank.class); - private static final String AUSTRALIA_BSB_NUMBERS_API = "https://bankcodesapi.com/au-bsb/json"; - private static final String API_KEY = "ab9379cfdab559509bbdcdd11923489f"; - - - public static AustraliaBankInfo getBankInfo(String bsbNo) { - logger.info("<------------------>Start submitting branch bsb Numbers<--------------------->"); - - try { - HttpRequestResult result = - new HttpRequestGenerator(new URL(AUSTRALIA_BSB_NUMBERS_API, API_KEY, bsbNo).toString(), RequestMethod.GET) - .execute(); - - if (result.isSuccess()) { - JSONObject res = result.getResponseContentJSONObj(); - - logger.info("Success submitted branch bsb Numbers message ------> {}", res); - - return AustraliaBankInfo.instance(res); - } - } catch (IOException e) { - logger.error("fail to submitting branch bsb Numbers, error ---> {}", e.getMessage()); - } - - return AustraliaBankInfo.noneInstance(); - } - - - private static class URL { - private static String URL_TEMPLATE = "{url}/{apiKey}/{bsbNo}/"; - - private String url; - private String apiKey; - private String bsbNo; - - public URL(String url, String apiKey, String bsbNo) { - this.url = url; - this.apiKey = apiKey; - this.bsbNo = bsbNo; - } - - public String toString() { - return URL_TEMPLATE.replace("{url}", this.url) - .replace("{apiKey}", apiKey) - .replace("{bsbNo}", bsbNo); - } - - - } - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBankClientNullException.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBankClientNullException.java deleted file mode 100644 index f81271bea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBankClientNullException.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.bank; - -/** - * @Description - * @title: - * @Date 2020/11/12 16:07 - * @author: zhangTao - */ -public class AustraliaBankClientNullException extends RuntimeException{ - - public AustraliaBankClientNullException() { - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBankInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBankInfo.java deleted file mode 100644 index 2574899e0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/bank/AustraliaBankInfo.java +++ /dev/null @@ -1,50 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.bank; - -import com.alibaba.fastjson.JSONObject; -import lombok.Getter; -import org.apache.commons.lang3.StringUtils; - -import java.awt.*; - -/** - * @Description - * @title: - * @Date 2020/11/12 15:56 - * @author: zhangTao - */ -@Getter -public class AustraliaBankInfo { - private String bsb; - private String valid; - private String bank; - private String address; - private String system; - private String city; - private String postcode; - private String state; - private String branch; - - public boolean isNone() { - return StringUtils.isBlank(this.bsb); - } - - static AustraliaBankInfo instance(JSONObject australiaBankInfo){ - AustraliaBankInfo bankInfo = new AustraliaBankInfo(); - bankInfo.bsb = australiaBankInfo.getString("bsb"); - bankInfo.valid = australiaBankInfo.getString("valid"); - bankInfo.bank = australiaBankInfo.getString("bank"); - bankInfo.address = australiaBankInfo.getString("address"); - bankInfo.system = australiaBankInfo.getString("system"); - bankInfo.city = australiaBankInfo.getString("city"); - bankInfo.postcode = australiaBankInfo.getString("postcode"); - bankInfo.state = australiaBankInfo.getString("state"); - bankInfo.branch = australiaBankInfo.getString("branch"); - return bankInfo; - } - - static AustraliaBankInfo noneInstance() { - return new AustraliaBankInfo(); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/AlipayChannelsConfig.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/AlipayChannelsConfig.java deleted file mode 100644 index 5081dd21e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/AlipayChannelsConfig.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.Optional; - -/** - * @Description - * @title: - * @Date 2021/1/28 11:15 - * @author: zhangTao - */ -@Component -public class AlipayChannelsConfig { - - @Resource - private ClientConfigMapper clientConfigMapper; - - - public boolean isMandatoryAlipayOnline(int clientId) { - Optional optionalClientConfigInfo = getClientConfig(clientId); - if (optionalClientConfigInfo.isPresent()){ - JSONObject clientConfigInfo = optionalClientConfigInfo.get(); - if (clientConfigInfo.getBooleanValue("mandatory_alipay_online")){ - return true; - } - } - return false; - } - - - - public void modifyMandatoryAlipayOnline(int clientId ,boolean mandatoryAlipayOnlineStatus){ - JSONObject mandatoryAlipayOnlineConfig = new JSONObject(); - mandatoryAlipayOnlineConfig.put("client_id",clientId); - mandatoryAlipayOnlineConfig.put("mandatory_alipay_online",mandatoryAlipayOnlineStatus); - clientConfigMapper.update(mandatoryAlipayOnlineConfig); - } - - - public boolean isAlipayPlus(int clientId) { - Optional optionalClientConfigInfo = getClientConfig(clientId); - if (optionalClientConfigInfo.isPresent()){ - JSONObject clientConfigInfo = optionalClientConfigInfo.get(); - if (clientConfigInfo.getBooleanValue("alipay_payment_channels")){ - return true; - } - } - return false; - } - - public void modifyAlipayPaymentChannels(int clientId ,boolean alipayPaymentChannelsStatus){ - JSONObject mandatoryAlipayOnlineConfig = new JSONObject(); - mandatoryAlipayOnlineConfig.put("client_id",clientId); - mandatoryAlipayOnlineConfig.put("alipay_payment_channels",alipayPaymentChannelsStatus); - clientConfigMapper.update(mandatoryAlipayOnlineConfig); - } - - - private Optional getClientConfig(int clientId) { - Optional optionalClientConfigInfo = Optional.of(clientConfigMapper.find(clientId)); - return optionalClientConfigInfo; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ApsConfigServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ApsConfigServiceImpl.java deleted file mode 100644 index d06b65bb6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ApsConfigServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.aps.ApsConfigMapper; -import au.com.royalpay.payment.manage.merchants.core.ApsConfigService; -import au.com.royalpay.payment.manage.merchants.deacriptor.ApsConfigDescriptor; -import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - - -@Service -public class ApsConfigServiceImpl implements ApsConfigService { - - @Resource - private ApsConfigMapper apsConfigMapper; - - @Override - public ApsConfigData getApsConfigByClientId(String clientId) { - return apsConfigMapper.findByClientId(clientId); - } - - @Override - public ApsConfigData saveApsConfigClientId(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor) { - ApsConfigData apsConfigData = ApsConfigData.saveData(managerId, clientId, apsConfigDescriptor); - apsConfigMapper.saveApsConfigClientId(apsConfigData); - return apsConfigMapper.findByClientId(clientId); - } - - @Override - public ApsConfigData updateApsConfigClientId(String managerId, String clientId, JSONObject apsConfig) { - apsConfig.put("clientId", clientId); - apsConfig.put("modifier", managerId); - apsConfigMapper.updateApsConfigClientId(apsConfig); - return apsConfigMapper.findByClientId(clientId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java deleted file mode 100644 index d2e549f7a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java +++ /dev/null @@ -1,445 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - - -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.core.ClientApply; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; -import au.com.royalpay.payment.manage.merchants.entity.impls.SourceModify; -import au.com.royalpay.payment.manage.merchants.events.ClientApplyEvent; -import au.com.royalpay.payment.manage.merchants.events.ClientApplyNotifyBDEvent; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.data.redis.core.BoundValueOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import java.io.OutputStream; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yishuqian on 18/10/2016. - */ -@Service -public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAware { - @Resource - private ClientApplyMapper clientApplyMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private OrgMapper orgMapper; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private ClientModifySupport clientModifySupport; - @Value("${app.redis.prefix}") - private String redisPrefix; - private ApplicationEventPublisher publisher; - @Resource - private ClientConfigService clientConfigService; - - @Override - @Transactional - public void applyPartner(ClientApplyInfo apply) { - JSONObject clientApply = apply.insertObject(); - clientApplyMapper.save(clientApply); - publisher.publishEvent(new ClientApplyEvent(this, clientApply)); - } - - @Override - public JSONObject listPartnerApply(JSONObject manager, PartnerQuery applyQuery) { - JSONObject params = applyQuery.toJsonParam(); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - PageList partners = clientApplyMapper.listPartnerApplications(params, new PageBounds(applyQuery.getPage(), applyQuery.getLimit(), Order.formString("apply_approve_result.asc,create_time.desc"))); - return PageListUtils.buildPageListResult(partners); - } - - @Override - public JSONObject getPartnerApplicationDetail(String client_apply_id) { - return clientApplyMapper.findClientApplicationById(client_apply_id); - } - - @Override - public JSONObject getNewPartnerApplications(JSONObject manager, PartnerQuery applyQuery) { - JSONObject params = applyQuery.toJsonParam(); - params.put("apply_approve_result", 0); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - params.put("apply_approve_result", 1); - } - int newApplications = clientApplyMapper.countNewApplications(params); - JSONObject res = new JSONObject(); - res.put("counts", newApplications); - return res; - } - - @Override - @Transactional - public void handlePartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager) { - JSONObject partnerApplication = clientApplyMapper.findClientApplicationById(client_apply_id); - Assert.notNull(partnerApplication); - JSONObject obj = info.updateObject(); - obj.put("client_apply_id", client_apply_id); - clientApplyMapper.updatePartnerApplication(obj); - if (!ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - JSONObject client = clientApplyMapper.findClientApplicationById(client_apply_id); - if ((partnerApplication.getIntValue("apply_approve_result") == 0) || (partnerApplication.getString("bd_user") != client.getString("bd_user"))) { - if (client.getString("bd_user") != null) { - publisher.publishEvent(new ClientApplyNotifyBDEvent(this, client)); - } - } - } - } - - private String newStatusKey() { - return Long.toHexString(System.currentTimeMillis()) + "_" + RandomStringUtils.random(20, true, true); - } - - private String verifyCodeRedisKey(String statusKey) { - return redisPrefix + ":verify_code:login:" + statusKey; - } - - @Override - public String addVerifyCode(String code) { - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(verifyCodeRedisKey(statusKey)).set(code, 3, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public String getVerifyCode(String codeKey) { - BoundValueOperations op = stringRedisTemplate.boundValueOps(verifyCodeRedisKey(codeKey)); - String codeValue = op.get(); - return codeValue; - } - - @Override - public void deleteVerifyCodeKey(String codeKey) { - stringRedisTemplate.delete(verifyCodeRedisKey(codeKey)); - } - - @Override - @Transactional - public JSONObject passPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager) { - JSONObject apply = clientApplyMapper.findClientApplicationById(client_apply_id); - - Assert.notNull(apply); - - JSONObject partner = info.insertObject(); - - if (info.getClientMoniker() == null || info.getClientMoniker().isEmpty()) { - throw new NotFoundException("clientMoniker can not be null"); - } - if (info.getShortName() == null || info.getShortName().isEmpty()) { - partner.put("short_name", "0"); - } - if (!partner.containsKey("sector")) { - partner.put("sector", "0"); - } - if (!partner.containsKey("industry")) { - partner.put("industry", "0"); - } - if (info.getAddress() == null || info.getAddress().isEmpty()) { - partner.put("address", "0"); - } - if (info.getSuburb() == null || info.getSuburb().isEmpty()) { - partner.put("suburb", "0"); - } - if (info.getPostcode() == null || info.getPostcode().isEmpty()) { - partner.put("postcode", "0"); - } - if (info.getState() == null || info.getState().isEmpty()) { - partner.put("state", "0"); - } - if (info.getCountry() == null || info.getCountry().isEmpty()) { - partner.put("county", "AUS"); - } - if (info.getCompanyPhone() == null || info.getCompanyPhone().isEmpty()) { - partner.put("company_phone", "0"); - } - if (info.getContactPerson() == null || info.getContactPerson().isEmpty()) { - partner.put("contact_person", "0"); - } - if (info.getContactEmail() == null || info.getContactEmail().isEmpty()) { - partner.put("contact_email", "0"); - } - - if (partner.containsKey("remark")) { - partner.remove("remark"); - } - - partner.put("create_time", new Date()); - partner.put("credential_code", RandomStringUtils.random(32, true, true)); - partner.put("creator", manager.getString("manager_id")); - if (manager.getIntValue("org_id") == 0) { - throw new ForbiddenException("You were not belong to any organizations so that you cannot create new client"); - } - partner.put("org_id", manager.getIntValue("org_id")); - - partner.put("bd_user", manager.getString("manager_id")); - partner.put("bd_user_name", manager.getString("display_name")); - JSONObject client; - - if ((client = clientMapper.findClientByMoniker(info.getClientMoniker())) != null) { - if( manager.getString("manager_id").equals(client.getString("creator")) ) - { - if(clientApplyMapper.findClientApplicationByClientMoniker(info.getClientMoniker()) != null) - { - throw new BadRequestException("无效,已关联商户"); - } - JSONObject client_bd = new JSONObject(); - client_bd.put("client_id", partner.getIntValue("client_id")); - client_bd.put("bd_id", manager.getString("manager_id")); - client_bd.put("bd_name", manager.getString("display_name")); - client_bd.put("create_time", new Date()); - client_bd.put("create_id", manager.getString("manager_id")); - client_bd.put("start_date", new Date()); - client_bd.put("proportion", 1); - clientBDMapper.saveBD(client_bd); - - apply.put("client_apply_id", client_apply_id); - apply.put("client_id", partner.getIntValue("client_id")); - apply.put("client_moniker", info.getClientMoniker()); - apply.put("apply_approve_result", 2); - apply.put("apply_approve_time", new Date()); - clientApplyMapper.updatePartnerApplication(apply); - - return partner; - } - throw new BadRequestException("您只能关联自己创建的商户"); - //throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); - } - partner.put("source", 2);//自主申请 - partner.put("country", "AUS");//自主申请 - partner.put("ali_sub_merchant_id", info.getClientMoniker()); - clientMapper.save(partner); - - JSONObject clientConfig = new JSONObject(); - if (StringUtils.isNotBlank(apply.getString("client_pay_type")) && StringUtils.isNotBlank(apply.getString("client_pay_desc"))) { - clientConfig.put("client_pay_type", apply.getString("client_pay_type")); - clientConfig.put("client_pay_desc", apply.getString("client_pay_desc")); - } - clientConfig.put("client_id", partner.getIntValue("client_id")); - clientConfig.put("client_moniker", info.getClientMoniker()); - clientConfigService.save(clientConfig); - - JSONObject client_bd = new JSONObject(); - client_bd.put("client_id", partner.getIntValue("client_id")); - client_bd.put("bd_id", manager.getString("manager_id")); - client_bd.put("bd_name", manager.getString("display_name")); - client_bd.put("create_time", new Date()); - client_bd.put("create_id", manager.getString("manager_id")); - client_bd.put("start_date", new Date()); - client_bd.put("proportion", 1); - clientBDMapper.saveBD(client_bd); - - apply.put("client_apply_id", client_apply_id); - apply.put("client_id", partner.getIntValue("client_id")); - apply.put("client_moniker", info.getClientMoniker()); - apply.put("apply_approve_result", 2); - apply.put("apply_approve_time", new Date()); - clientApplyMapper.updatePartnerApplication(apply); - return partner; - } - - @Override - public void linkPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager) { - JSONObject apply = clientApplyMapper.findClientApplicationById(client_apply_id); - - Assert.notNull(apply); - - if (info.getClientMoniker() == null || info.getClientMoniker().isEmpty()) { - throw new NotFoundException("clientMoniker can not be null"); - } - JSONObject client = clientMapper.findClientByMoniker(info.getClientMoniker()); - Assert.notNull(client); - clientModifySupport.processClientModify(new SourceModify(manager, client.getString("client_moniker"), 2)); - apply.put("client_id", client.getIntValue("client_id")); - apply.put("client_moniker", info.getClientMoniker()); - apply.put("apply_approve_result", 2); - apply.put("apply_approve_time", new Date()); - clientApplyMapper.updatePartnerApplication(apply); - } - - @Override - public void remarkAccount(JSONObject manager, String accountId, String remark) { - JSONObject account = clientAccountMapper.findById(accountId); - Assert.notNull(account); - JSONObject updateObj = new JSONObject(); - updateObj.put("account_id", accountId); - updateObj.put("remark", remark); - clientAccountMapper.update(updateObj); - } - - @Override - public List listAlllOrgs() { - return orgMapper.listAllOrgs(); - } - - @Override - public List listBDByOrg(int org_id) { - return clientBDMapper.listBDByOrgId(org_id); - } - - @Override - public JSONObject findOrgByBDId(String bd_id) { - return orgMapper.findOrgByBDId(bd_id); - } - - @Override - public void notifyBD(String client_apply_id) { - JSONObject client = clientApplyMapper.findClientApplicationById(client_apply_id); - publisher.publishEvent(new ClientApplyNotifyBDEvent(this, client)); - } - - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @Override - public void exportApplyPartnerList(JSONObject manager, HttpServletResponse resp) throws Exception{ - PartnerQuery partnerQuery = new PartnerQuery(); - JSONObject params = partnerQuery.toJsonParam(); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - OutputStream ous = null; - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", "attachment; filename=" + "apply_partner_list.xls"); - ous = resp.getOutputStream(); - HSSFWorkbook wb = new HSSFWorkbook(); - Cell cell = null; - HSSFFont font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle titleStyle = wb.createCellStyle(); - titleStyle.setFont(font); - HSSFCellStyle style = wb.createCellStyle(); - style.setFillForegroundColor(HSSFColor.RED.index); - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - PageList partners = clientApplyMapper.listPartnerApplications(params, new PageBounds(Order.formString("apply_approve_result.asc,create_time.desc"))); - Sheet sheet = wb.createSheet("apply_partner_list"); - sheet.setDefaultColumnWidth(20); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] CommissionTitle = {"Application Time", "Client Moniker", "Company Name", "Short Name", "Contact Person" , "Contact Phone", "Contact Email", "Country","State", "Suburb", "Address", "Company Phone", "Company Website", "Progress", "BD", "Apply Approve Result", "Source"}; - for (int i = 0; i < CommissionTitle.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(CommissionTitle[i]); - } - for (JSONObject partner : partners) { - row = sheet.createRow(++rowNum); - String type = ""; - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(partner.getDate("create_time"),"yyyy-MM-dd HH:mm:ss")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("client_moniker")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_name")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("short_name")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("contact_person")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("contact_phone")); - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("contact_email")); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("country")); - row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("state")); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("suburb")); - row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("address")); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_phone")); - row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_website")); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("remark")); - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("bd_user_name")); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(getApplyResultStatus(partner.getIntValue("apply_approve_result"))); - row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(getSource(partner.getIntValue("apply_approve_result"))); - } - wb.write(ous); - ous.flush(); - } - - public String getApplyResultStatus(int result) { - String status = ""; - switch (result) { - case 0: - status = "待审核"; - break; - case 1: - status = "已提交BD"; - break; - case 2: - status = "BD已通过"; - break; - case 3: - status = "初审拒绝"; - break; - case 4: - status = "BD提交后不通过"; - break; - default: - status = "待审核"; - break; - } - return status; - } - - public String getSource(int result) { - String status = ""; - switch (result) { - case 0: - status = "PC"; - break; - case 1: - status = "公众号菜单"; - break; - case 2: - status = "公众号推送"; - break; - case 3: - status = "小程序申请"; - break; - default: - status = "PC"; - break; - } - return status; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientChannelSettlement.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientChannelSettlement.java deleted file mode 100644 index 5cf6c8085..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientChannelSettlement.java +++ /dev/null @@ -1,134 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.beans.SettleDetail; -import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.cronutils.model.Cron; -import com.cronutils.model.CronType; -import com.cronutils.model.definition.CronDefinition; -import com.cronutils.model.definition.CronDefinitionBuilder; -import com.cronutils.model.field.CronFieldName; -import com.cronutils.parser.CronParser; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -/** - * 分渠道清算服务 - */ -@Component -public class ClientChannelSettlement { - - private final Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - private ClientManager clientManager; - - @Resource - private ClientMapper clientMapper; - -// @Autowired -// private ClientManagerApplication application; - - @Resource - private ClientInfoCacheSupport clientInfoCacheSupport; - - - public JSONObject getClientChannelSettleConfig(String clientMoniker, JSONObject manager, String group) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - JSONObject card = this.getGroup(client, group); - if (card == null) { - return null; - } - String settleRule = card.getString("date_rule"); - String minSettle = card.getString("min_settle"); - JSONObject config = new JSONObject(); - config.put("max_settle_days", card.getInteger("max_settle_days")); - config.put("min", new BigDecimal(minSettle).toPlainString()); - if ("* * ?".equals(settleRule)) { - config.put("everyday", true); - } else { - config.put("everyday", false); - CronDefinition cronDefinition = - CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ); - CronParser parser = new CronParser(cronDefinition); - Cron cron = parser.parse("0 0 0 " + settleRule); - if (settleRule.startsWith("? * ")) { - String dayOfWeek = cron.retrieve(CronFieldName.DAY_OF_WEEK).getExpression().asString(); - logger.info("DAY_OF_WEEK CRON => " + dayOfWeek); - config.put("rule_type", "DAY_OF_WEEK"); - config.put("days", dayOfWeek.split(",")); - } - if (settleRule.endsWith(" * ?")) { - String dayOfMon = cron.retrieve(CronFieldName.DAY_OF_MONTH).getExpression().asString(); - logger.info("DAY_OF_WEEK CRON => " + dayOfMon); - config.put("rule_type", "DAY_OF_MONTH"); - config.put("days", dayOfMon.split(",")); - } - } - logger.info("=====>getClientChannelSettleConfig:{}",config.toJSONString()); - return config; - } - - public void configClientChannelSettleDetails(JSONObject manager, String clientMoniker, SettleDetail detail) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - JSONArray ruleExt = client.getJSONArray("settle_rule_ext"); - if (ruleExt == null) { - ruleExt = new JSONArray(); - JSONObject object = new JSONObject(); - this.setSettleRuleExt(detail, object); - ruleExt.add(object); - } else { - JSONObject card = this.getGroup(client, detail.getGroup()); - if (card == null) { - JSONObject object = new JSONObject(); - this.setSettleRuleExt(detail, object); - ruleExt.add(object); - } else { - ruleExt.remove(card); - this.setSettleRuleExt(detail, card); - ruleExt.add(card); - } - } - - JSONObject update = new JSONObject(); - update.put("client_id", client.getIntValue("client_id")); - logger.info("SETTLE RULE EXT => " + ruleExt.toString()); - update.put("settle_rule_ext", ruleExt.toString()); - clientMapper.update(update); - - clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); - } - - private void setSettleRuleExt(SettleDetail detail, JSONObject object) { - object.put("date_rule", detail.ruleToCron()); - object.put("min_settle", CurrencyAmountUtils.scale(detail.getMin(), PlatformEnvironment.getEnv().getForeignCurrency())); - object.put("group", detail.getGroup()); -// object.put("max_settle_days", detail.getMax_settle_days()); //max_settle_days 在rp中去掉 - } - - private JSONObject getGroup(JSONObject client, String group) { - JSONArray ruleExt = client.getJSONArray("settle_rule_ext"); - if (ruleExt == null) { - return null; - } - for (Object o : ruleExt) { - JSONObject item = (JSONObject) o; - if (group.equalsIgnoreCase(item.getString("group"))) { - return item; - } - } - return null; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientConfigServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientConfigServiceImpl.java deleted file mode 100644 index 52c7f6251..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientConfigServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -@Service -public class ClientConfigServiceImpl implements ClientConfigService { - @Resource - private ClientConfigMapper clientConfigMapper; - @Override - public void update(JSONObject record) { - - } - @Override - public JSONObject find(int client_id) { - return clientConfigMapper.find(client_id); - } - - @Override - public JSONObject save(JSONObject record) { - JSONObject clientConfig= clientConfigMapper.find(record.getIntValue("Client_id")); - if(clientConfig!=null){ - throw new ServerErrorException("client config is repeated"); - } - clientConfigMapper.save(record); - return record; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientInfoCacheSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientInfoCacheSupportImpl.java deleted file mode 100644 index 3b9ce12ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientInfoCacheSupportImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class ClientInfoCacheSupportImpl implements ClientInfoCacheSupport{ - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private SignInAccountService signInAccountService; - @Resource - private ClientManager clientManager; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private ClientInfoCacheSupport clientInfoCacheSupport; - - @Override - @CacheEvict(value = ":app_client_info:", key = "''+#clientId") - public void clearClientCache(int clientId) { - List accounts = clientAccountMapper.listPartnerAccounts(clientId); - for (JSONObject acc : accounts) { - signInAccountService.clearAccountCache(acc.getString("account_id")); - } - JSONObject client = clientManager.getClientInfo(clientId); - if(client!=null){ - clientInfoCacheSupport.clearClientMonikerCache(client.getString("client_moniker")); - } - } - - @Override - @CacheEvict(value = ":app_client_info_moniker:", key = "#clientMoniker") - public void clearClientMonikerCache(String clientMoniker) { - } - - @Override - @CacheEvict(value = ":app_client_config_info:", key = "''+#clientId") - public void clearClientConfigCache(int clientId) { - JSONObject client = clientConfigMapper.find(clientId); - if(client!=null){ - clientInfoCacheSupport.clearClientMonikerConfigCache(client.getString("client_moniker")); - } - } - - @Override - @CacheEvict(value = ":app_client_config_info_moniker:", key = "#clientMoniker") - public void clearClientMonikerConfigCache(String clientMoniker) { - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java deleted file mode 100644 index 25fde2f81..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ /dev/null @@ -1,7624 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.channels.alipay.beans.plus.AlipayPlusRegisterResult; -import au.com.royalpay.payment.channels.alipay.beans.plus.ApsMerchantApplication; -import au.com.royalpay.payment.channels.alipay.config.AlipayConfig; -import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment; -import au.com.royalpay.payment.channels.alipay.runtime.AlipayOnlineApi; -import au.com.royalpay.payment.channels.alipay.runtime.AlipayRetailApi; -import au.com.royalpay.payment.channels.alipay.runtime.alipayplus.AlipayApsMerchantRegister; -import au.com.royalpay.payment.channels.alipay.runtime.entity.AlipayMerchantEntity; -import au.com.royalpay.payment.channels.rpay.runtime.beans.SubRpayMerchantInfo; -import au.com.royalpay.payment.channels.rpay.runtime.impls.RPayMerchantRegister; -import au.com.royalpay.payment.channels.rpaypaymentsvc.mappers.RPayMerchantMapper; -import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.RPayPaymentCardSvcApi; -import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.request.entities.RPayMerchantEntity; -import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; -import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; -import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo; -import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfoInheritance; -import au.com.royalpay.payment.channels.wechat.runtime.beans.WechatMerchantInfo; -import au.com.royalpay.payment.channels.wechat.runtime.impls.WxPayMerchantRegister; -import au.com.royalpay.payment.channels.wechat.runtime.impls.WxPayMerchantRegisterLegacy; -import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper; -import au.com.royalpay.payment.channels.wechat.runtime.mappers.WxMerchantApplyMapper; -import au.com.royalpay.payment.core.ChannelContractSource; -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.PaymentChannelApi; -import au.com.royalpay.payment.core.beans.ChannelMerchantInfo; -import au.com.royalpay.payment.core.beans.EmptyMerchantApplication; -import au.com.royalpay.payment.core.beans.MchChannelContract; -import au.com.royalpay.payment.core.beans.MerchantApplicationResult; -import au.com.royalpay.payment.core.exceptions.EmailException; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; -import au.com.royalpay.payment.core.mappers.*; -import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; -import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; -import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; -import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean; -import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient; -import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply; -import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo; -import au.com.royalpay.payment.manage.device.core.DeviceManager; -import au.com.royalpay.payment.manage.gateway.core.GatewayMerchantApply; -import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum; -import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; -import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeClientMapper; -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; -import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper; -import au.com.royalpay.payment.manage.mappers.log.LogClientSubMerchantIdMapper; -import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; -import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.beans.*; -import au.com.royalpay.payment.manage.merchants.core.*; -import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBank; -import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankClientNullException; -import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankInfo; -import au.com.royalpay.payment.manage.merchants.deacriptor.ApsConfigDescriptor; -import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData; -import au.com.royalpay.payment.manage.merchants.entity.impls.*; -import au.com.royalpay.payment.manage.merchants.enums.UPayAuthFileEnum; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.organizations.beans.DefaultClientProfile; -import au.com.royalpay.payment.manage.organizations.core.OrgClientProfileUtils; -import au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils; -import au.com.royalpay.payment.manage.rservices.core.RServicesApplyService; -import au.com.royalpay.payment.manage.signin.beans.TodoNotice; -import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.support.serverless.ServerlessFunctionTrigger; -import au.com.royalpay.payment.manage.support.sms.SmsSender; -import au.com.royalpay.payment.manage.support.sms.msg.RefuseMessage; -import au.com.royalpay.payment.manage.system.core.ClientContractService; -import au.com.royalpay.payment.manage.system.core.MailGunService; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.tools.codec.RSACrypt; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException; -import au.com.royalpay.payment.tools.defines.IncrementalChannel; -import au.com.royalpay.payment.tools.defines.PayChannel; -import au.com.royalpay.payment.tools.defines.TradeType; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.exceptions.event.WechatExceptionEvent; -import au.com.royalpay.payment.tools.inspiry.core.InspiryPOSFinder; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.mail.SendMail; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.merchants.beans.TransactionFee; -import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO; -import au.com.royalpay.payment.tools.merchants.core.MerchantChannelPermissionResolver; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.merchants.qrboard.QRBoard; -import au.com.royalpay.payment.tools.merchants.qrboard.QRBoardProvider; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.utils.*; -import au.com.royalpay.payment.tools.websocket.notify.PartnerPageEvent; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import com.alipay.global.api.model.aps.ProductCodeType; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.http.util.TextUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.dom4j.Element; -import org.joda.time.DateTime; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.multipart.MultipartFile; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.*; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URL; -import java.net.URLDecoder; -import java.security.InvalidParameterException; -import java.security.KeyPair; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.text.SimpleDateFormat; -import java.util.List; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; -import com.cronutils.model.Cron; -import com.cronutils.model.CronType; -import com.cronutils.model.definition.CronDefinition; -import com.cronutils.model.definition.CronDefinitionBuilder; -import com.cronutils.model.field.CronFieldName; -import com.cronutils.parser.CronParser; -import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; - -/** - * partner manage Created by yixian on 2016-06-28. - */ -@Service -public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvider, ApplicationEventPublisherAware { - private final Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientMapper clientMapper; - @Resource - private ClientConfigService clientConfigService; - @Resource - private SysClientLegalPersonMapper sysClientLegalPersonMapper; - @Resource - private ClientDeviceMapper clientDeviceMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private ClientRateMapper clientRateMapper; - @Resource - private MailUnsubMapper mailUnsubMapper; - @Resource - private AttachmentClient attachmentClient; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private ClientComplianceApply clientComplianceApply; - @Resource - private ClientIncrementalMapper clientIncrementalMapper; - @Value("${client_card.annual_rate}") - private String cardAnnualRate; - - @Value("${app.redis.prefix}") - private String redisPrefix; - private ApplicationEventPublisher publisher; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private ClientApplyMapper clientApplyMapper; - @Resource - private OrgMapper orgMapper; - @Resource - private ActClientInvitationCodeMapper actClientInvitationCodeMapper; - @Resource - private MailService mailService; - @Resource - private ClientModifySupport clientModifySupport; - - @Resource - private MerchantChannelApplicationManager merchantChannelApplicationManager; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private SignInAccountService signInAccountService; - - @Resource - private ManagerMapper managerMapper; - @Resource - private SysConfigManager sysConfigManager; - - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private ClientMWFilesMapper clientMWAuthFilesInfo; - - @Resource - private TransactionMapper transactionMapper; - - @Resource - private TransactionAnalysisMapper transactionAnalysisMapper; - - @Resource - private ClientAuditProcessMapper clientAuditProcessMapper; - - @Resource - private WxMerchantApplyMapper wxMerchantApplyMapper; - @Resource - private SysRpayMerchantApplyMapper sysRpayMerchantApplyMapper; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private DeviceManager deviceManager; - - @Resource - private FinancialBDConfigMapper financialBDConfigMapper; - - @Resource - private ClientsContractMapper clientsContractMapper; - @Resource - private ClientContractService clientContractService; - @Resource - private ClientsOperationLogMapper clientsOperationLogMapper; - @Resource - private LogClientSubMerchantIdMapper logClientSubMerchantIdMapper; - - @Resource - private ClientInfoCacheSupport clientInfoCacheSupport; - - @Resource - private SimpleClientApplyService simpleClientApplyService; - @Resource - private MailGunService mailGunService; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private PermissionPartnerManagerImpl permissionPartnerManagerImpl; - @Resource - private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper; - @Resource - private SysChannelConfigMapper sysChannelConfigMapper; - @Resource - private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper; - @Resource - private ClearingDistributedSurchargeMapper clearingDistributedSurchargeMapper; - @Resource - private FinancialSurchargeAccountDetailMapper financialSurchargeAccountDetailMapper; - @Resource - private SysClientMapper sysClientMapper; - @Resource - private MerchantSignInfoMapper merchantSignInfoMapper; - @Resource - private CommonSubMerchantIdMapper commonSubMerchantIdMapper; - @Resource - private ServerlessFunctionTrigger serverlessFunctionTrigger; - @Resource - private Locker locker; - @Resource - private MongoTemplate mongoTemplate; - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource - private IndustryLookupMapper industryLookupMapper; - @Resource - private GatewayMerchantApply gatewayMerchantApply; - @Resource - private RetailRSvcService retailRSvcService; - @Resource - private RServicesApplyService rServicesApplyService; - @Resource - private RPayPaymentCardSvcApi rPayPaymentCardSvcApi; - @Resource - private RPayMerchantMapper rPayMerchantMapper; - @Resource - private SysClientUpayProfileMapper sysClientUpayProfileMapper; - @Resource - private PaymentApi paymentApi; - @Resource - private ApsConfigService apsConfigService; - @Resource - private ApsNoticeClientMapper apsNoticeClientMapper; - - DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy"); - @Resource - private MchChannelContractMapper mchChannelContractMapper; - - @Resource - public AlipayApsOverseasConfigMapper overseaSwitchConfigMapper; - - @Resource - private SmsSender smsSender; - private static final String SOURCE_AGREE_FILE = "source_agree_file"; - private static final String CLIENT_BANK_FILE = "client_bank_file"; - private static final String CLIENT_ID_FILE = "client_id_file"; - private static final String CLIENT_AGREE_FILE = "client_agree_file"; - private static final String CLIENT_COMPANY_FILE = "client_company_file"; - private static final String CLIENT_APPLY_FILE = "client_apply_file"; - - //卡支付合同文件 - private static final String LETTER_OF_OFFER_FILE = "letter_of_offer_file"; - private static final String PROMOTIONAL_OFFER_FILE = "promotional_offer_file"; -// private static final String TERMS_AND_CONDITIONS_FILE = "terms_and_conditions_file"; - - - private static final List tags = new ArrayList<>(); - - private static final String KYC_UTILITY_BILL_FILE = "kyc_utility_bill_file"; - - @Value("${app.agreetemplate.classic.path}") - private String agreetemplatePdfPath; - @Value("${app.agreetemplate.aggregate.path}") - private String aggregateAgreetemplatePdfPath; - // private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2020/04/08/1586313342533_41vI3w9R8OHrhAVYWvdv7S2IyQra4z.pdf"; - private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2021/09/07/1630997571126_fqWcLQ5Rx0wFm8pVwpKuI1gjf6FmwX.pdf"; - - - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - - @Resource - private PaymentChannelMccGoodMapper paymentChannelMccGoodMapper; - - @PostConstruct - public void init() { - tags.add("account"); - } - - @Override - public JSONObject getSysRateConfig() { - String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); - return JSON.parseObject(rateConfig); - } - - @Override - public JSONObject getSysCardRateConfig() { - String rateConfig = sysConfigManager.getSysConfig().getString("sys_card_rates"); - return JSON.parseObject(rateConfig); - } - - @Override - @Cacheable(value = ":app_client_info:", key = "''+#clientId", unless = "#result == null") - public JSONObject getClientInfo(int clientId) { - return clientMapper.findClient(clientId); - } - - @Override - public JSONObject getClientInfoIgnoreInvalid(int clientId) { - return clientMapper.findClientIgnoreInvalid(clientId); - } - - @Override - @Cacheable(value = ":app_client_info_moniker:", key = "#clientMoniker", unless = "#result == null") - public JSONObject getClientInfoByMoniker(String clientMoniker) { - return clientMapper.findClientByMonikerAll(clientMoniker); - } - - @Override - public JSONObject clientDetail(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (manager != null) { - checkClientOrg(manager, client); - } - // 雷同信息检查 - try { - String same_phone = clientMapper.findSamePhone(client.getString("contact_phone")).getString("a"); - if (same_phone != null && client.getString("contact_phone") != null && same_phone.contains(" ")) { - same_phone = same_phone.replace(client.getString("client_moniker"), ""); - client.put("same_phone", "(雷同商户:" + same_phone + ")"); - } - - String same_company_name = clientMapper.findSameCompanyName(client.getString("company_name")).getString("a"); - if (same_company_name != null && client.getString("company_name") != null && same_company_name.contains(" ")) { - same_company_name = same_company_name.replace(client.getString("client_moniker"), ""); - client.put("same_company_name", "(雷同商户:" + same_company_name + ")"); - } - - String same_email = clientMapper.findSameEmail(client.getString("contact_email")).getString("a"); - if (same_email != null && client.getString("contact_email") != null && same_email.contains(" ")) { - same_email = same_email.replace(client.getString("client_moniker"), ""); - client.put("same_email", "(雷同商户:" + same_email + ")"); - } - - String same_address = clientMapper.findSameAddress(client.getString("address")).getString("a"); - if (same_address != null && client.getString("address") != null && same_address.contains(" ")) { - same_address = same_address.replace(client.getString("client_moniker"), ""); - client.put("same_address", "(雷同商户:" + same_address + ")"); - } - } catch (Exception e) { - // donothing - } - - JSONObject clientConfig = clientConfigService.find(client.getIntValue("client_id")); - if (client.containsKey("enable_presettle")) { - clientConfig.put("enable_presettle", client.getBoolean("enable_presettle")); - } - if (client.containsKey("ext_params")) { - clientConfig.put("ext_params", client.getString("ext_params")); - } - client.putAll(clientConfig); - JSONObject upayInfo = sysClientUpayProfileMapper.findInfo(client.getIntValue("client_id")); - if (upayInfo != null) { - client.putAll(upayInfo); - } - client.put("unsubscribe", mailUnsubMapper.findOneByClientMoniker(clientMoniker) != null); - client.put("show_all_permission", true); - int role = manager != null ? manager.getIntValue("role") : 0; - if (manager != null) { - if (ManagerRole.OPERATOR.hasRole(role)) { - List log = logClientSubMerchantIdMapper.listLogsByClientId(client.getInteger("client_id"), - new PageBounds(Order.formString("create_time.desc"))); - client.put("sub_merchant_id_log", !log.isEmpty()); - } - if (ManagerRole.BD_USER.hasRole(role)) { - int checkBDPermission = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); - client.put("show_all_permission", checkBDPermission > 0); - if (checkBDPermission > 0) { - JSONObject org = orgMapper.findOne(manager.getIntValue("org_id")); - boolean bdRateEditable = client.getIntValue("approve_result") != 1 || org.getBooleanValue("rate_editable"); - client.put("rate_editable", bdRateEditable); - boolean bdCardRateEditable = (clientConfig.getBoolean("enable_card_payment") && !client.containsKey("upay_approve_result")); - client.put("card_rate_editable", bdCardRateEditable); - } else { - client.put("company_phone", "******"); - client.put("contact_person", "******"); - client.put("contact_phone", "******"); - client.put("contact_email", "******"); - } - } else { - client.put("rate_editable", ManagerRole.OPERATOR.hasRole(role)); - } - } - List children = clientMapper.listChildClients(client.getIntValue("client_id")); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - client.putAll(mchConfig); - client.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - client.put("has_children", !children.isEmpty()); - if (client.getInteger("parent_client_id") != null) { - client.put("parent_client", clientMapper.findClient(client.getInteger("parent_client_id"))); - } - if (!StringUtils.equalsIgnoreCase(clientMoniker, PlatformEnvironment.getEnv().getTestMoniker())) { - String subMerchantId = client.getString("sub_merchant_id"); - if (subMerchantId != null) { - client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); - } - } - try { - JSONObject activeRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (activeRate != null) { - client.put("rate_value", activeRate.getDouble("rate_value")); - } - } catch (Exception ignore) { - - } - client.put("max_customer_surcharge_rate", PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()); - if (client.getBigDecimal("rate_value") != null) { - client.put("min_customer_surcharge_rate", client.getBigDecimal("rate_value").add(new BigDecimal("0.1"))); - } - - // 商户跨境支付审核过程日志 - PageList audit_logs = clientAuditProcessMapper.getAuditLog(client.getIntValue("client_id"), 1, - new PageBounds(Order.formString("create_time"))); - if (audit_logs != null && !audit_logs.isEmpty()) { - client.put("audit_logs", audit_logs); - } - //商户卡支付审核过程日志 - PageList audit_card_logs = clientAuditProcessMapper.getAuditLog(client.getIntValue("client_id"), 2, - new PageBounds(Order.formString("create_time"))); - if (audit_card_logs != null && !audit_card_logs.isEmpty()) { - client.put("audit_card_logs", audit_card_logs); - } - - if (client.getString("cb_bankpay_url") != null) { - String cbBankPayQrcodeUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link"); - client.put("cbBankPayQrcodeUrl", QRCodeUtils.qrcodeImageCode(cbBankPayQrcodeUrl, 250, true)); - } - //商户支付场景 - if (StringUtils.isNotBlank(client.getString("client_pay_type"))) { - client.put("client_pay_type", client.getString("client_pay_type").split(",")); - client.put("client_pay_desc", client.getString("client_pay_desc").split(",")); - } - if (StringUtils.isNotBlank(client.getString("parent_client_id")) - && sysClientMapper.childClientId(client.getIntValue("client_id")).size() > 0) { - client.put("level2_client", 1); - } - //gateway V2 - JSONObject partnerGatewaySign = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); - if (partnerGatewaySign == null) { - client.put("enable_gateway_version2", false); - } else { - client.put("enable_gateway_version2", partnerGatewaySign.getBooleanValue("is_valid")); - client.put("gateway_sign", partnerGatewaySign); - } - JSONObject representativeInfo = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (representativeInfo != null) { - client.put("representativeInfo", representativeInfo); - } - JSONObject wechatMcc = paymentChannelMccGoodMapper.findWechatPayMccByClientId(client.getIntValue("client_id")); - if (wechatMcc != null) { - client.put("mc_code", wechatMcc.getString("mc_code")); - } - client.put("enable_alipayplus", false); - MerchantChannelPermissionResolver resolver = this.paymentApi.channelApi(PayChannel.ALIPAY_PLUS.getChannelCode()).getChannelPermissionResolver(); - if (!Objects.isNull(resolver) && - resolver.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency())) { - client.put("enable_alipayplus", true); - } - client.put("enable_alipayaps", false); - Map channelPermissions = new HashMap<>(); - for (PaymentChannelApi channelApi : paymentApi.channels()) { - try { - MchChannelContract contract = channelApi.initContractSource(). - findMchContract(client.getIntValue("client_id"), TradeType.CLIENT_CODE, PlatformEnvironment.getEnv().getForeignCurrencyEnum().toCurrencyInfo()); - JSONObject config = new JSONObject(); - config.put("channel", channelApi.channel()); - if (contract != null) { - config.put("enable", contract.isValid()); - config.put("pid", contract.getPid()); - config.put("mid", contract.getMid()); - config.put("mcc", contract.getMccCode()); - } else { - config.put("enable", false); - //aps渠道的默认值展示 - config.put("mid", client.getString("client_moniker")); - } - channelPermissions.put(channelApi.channel().toLowerCase(), config); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - client.put("available_channels", channelPermissions); - MerchantChannelPermissionResolver resolverApsInStore = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()).getChannelPermissionResolver(); - MerchantChannelPermissionResolver resolverApsCashier = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_CASHIER.getChannelCode()).getChannelPermissionResolver(); - if (!Objects.isNull(resolverApsInStore) && !Objects.isNull(resolverApsCashier) && - (resolverApsInStore.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency()) || - resolverApsCashier.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency()))) { - client.put("enable_alipayaps", true); - } - ApsConfigData apsConfig = apsConfigService.getApsConfigByClientId(client.getString("client_id")); - if (apsConfig == null) { - if (client.getBoolean("enable_alipay")) { - apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor().setAlipayCnSwitch(false)); - } else if (client.getBoolean("enable_alipayaps")) { - apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor().setAlipayCnSwitch(true)); - } - } - if (apsConfig != null) { - client.put("aps_config_id", apsConfig.getId()); - client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch()); - } - Boolean overseaSwitch = overseaSwitchConfigMapper.getOverseaSwitch(client.getInteger("client_id")); - if (overseaSwitch == null || overseaSwitch) { - client.put("oversea_wallet_switch", true); - } else { - client.put("oversea_wallet_switch", false); - } - return client; - } - - private void checkClientOrg(JSONObject manager, JSONObject client) { - if (manager.getInteger("org_id") != null) { - List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org -> org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(client.getIntValue("org_id"))) { - throw new ForbiddenException("The org of client is not belong to you"); - } - } - } - - @Override - public JSONObject getClientDetailById(int clientId) { - JSONObject client = getClientInfo(clientId); - if (client != null) { - List children = clientMapper.listChildClients(client.getIntValue("client_id")); - client.put("has_children", !children.isEmpty()); - } - assert client != null; - - JSONObject clientConfig = clientConfigService.find(clientId); - if (clientConfig != null) { - client.putAll(clientConfig); - } - return client; - } - - @Override - public JSONObject listClients(JSONObject manager, PartnerQuery query) { - JSONObject params = prepareListClientsParameter(manager, query); - PageList partners = clientMapper.listPartners(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc"))); - int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期 - for (JSONObject partner : partners) { - String subMerchantId = partner.getString("sub_merchant_id"); - if (subMerchantId != null) { - partner.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); - } - if (partner.getIntValue("approve_result") == 2) { - partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays)); - partner.put("pass_timeout", DateUtils.addDays(partner.getDate("approve_time"), authDays).compareTo(new Date()) < 0); - } - } - return PageListUtils.buildPageListResult(partners); - } - - @Override - public void exportClients(JSONObject manager, PartnerQuery query, HttpServletResponse resp) { - JSONObject params = prepareListClientsParameter(manager, query); - logger.info("exporting_clients:--->{}", params); - JSONObject retResp = serverlessFunctionTrigger.triggerFunction("export_merchants", params); - String contentB64 = retResp.getString("content"); - resp.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - resp.setHeader("Content-Disposition", "attachment; filename=merchants.xlsx"); - try (OutputStream out = resp.getOutputStream()) { - IOUtils.write(Base64.decodeBase64(contentB64), out); - out.flush(); - } catch (IOException e) { - throw new ServerErrorException(e); - } - } - - private JSONObject prepareListClientsParameter(JSONObject manager, PartnerQuery query) { - JSONObject params = query.toJsonParam(); - if (params.getString("org_id") != null) { - if (params.getString("org_ids") == null) { - orgIds(params, Integer.parseInt(params.getString("org_id"))); - } else { - params.put("org_id", params.getString("org_ids")); - params.remove("org_ids"); - } - } - JSONObject org = null; - if (params.getString("org_id") != null) { - org = orgMapper.findOne(params.getIntValue("org_id")); - if (org.getIntValue("type") == 1) { - params.put("referrer_id", org.getString("org_id")); - params.remove("org_id"); - } - } - int orgId = manager.getIntValue("org_id"); - if (orgId > 0) { - if (params.getString("org_ids") == null) { - JSONObject org2 = orgMapper.findOne(orgId); - if (org2.getString("parent_org_id") != null) { - params.put("org_id", orgId); - } else { - params.put("org_id", orgId); - orgIds(params, orgId); - } - } else { - params.put("org_id", params.getIntValue("org_ids")); - params.remove("org_ids"); - } - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); - if (bdConfig != null) { - params.put("bd_group", bdConfig.getString("bd_group")); - List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); - List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList()); - if (params.containsKey("bd_user")) { - if (!bdUserId.contains(params.getString("bd_user"))) { - params.remove("bd_user"); - } - } - if (params.containsKey("org_ids")) { - params.remove("org_ids"); - } - if (params.containsKey("org_id")) { - params.remove("org_id"); - } - } - - if (query.getOnlyMe()) { - params.put("bd_user", manager.getString("manager_id")); - } - } - String tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id"); - String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source"); - tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource; - if (query.isTempMchId()) { - params.put("temp_mch_id", tempSubMchId); - params.put("temp_mch_id_source", tempSubMchSource); - } - return params; - } - - @Override - public JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query) { - JSONObject params = query.toJsonParam(); - if (params.getString("org_id") != null) { - if (params.getString("org_ids") == null) { - orgIds(params, Integer.parseInt(params.getString("org_id"))); - } else { - params.put("org_id", params.getString("org_ids")); - params.remove("org_ids"); - } - } - JSONObject org = null; - if (params.getString("org_id") != null) { - org = orgMapper.findOne(params.getIntValue("org_id")); - if (org.getIntValue("type") == 1) { - params.put("referrer_id", org.getString("org_id")); - params.remove("org_id"); - } - } - int orgId = manager.getIntValue("org_id"); - if (orgId > 0) { - if (params.getString("org_ids") == null) { - JSONObject org2 = orgMapper.findOne(orgId); - if (org2.getString("parent_org_id") != null) { - params.put("org_id", orgId); - } else { - params.put("org_id", orgId); - orgIds(params, orgId); - } - } else { - params.put("org_id", params.getIntValue("org_ids")); - params.remove("org_ids"); - } - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); - if (bdConfig != null) { - params.put("bd_group", bdConfig.getString("bd_group")); - List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); - List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList()); - if (params.containsKey("bd_user")) { - if (!bdUserId.contains(params.getString("bd_user"))) { - params.remove("bd_user"); - } - } - if (params.containsKey("org_ids")) { - params.remove("org_ids"); - } - if (params.containsKey("org_id")) { - params.remove("org_id"); - } - } - - if (query.getOnlyMe()) { - params.put("bd_user", manager.getString("manager_id")); - } - } - PageList partners = clientMapper.listLessInfoPartners(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc"))); - int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期 - return PageListUtils.buildPageListResult(partners); - } - - private void orgIds(JSONObject params, int orgId) { - JSONObject param = new JSONObject(); - param.put("parent_org_id", params.getString("org_id")); - param.put("type", 0); - List orgIds = new ArrayList<>(); - List childOrgs = orgMapper.listOrgsWithChid(param); - if (!childOrgs.isEmpty()) { - for (JSONObject object : childOrgs) { - orgIds.add(object.getIntValue("org_id")); - } - orgIds.add(orgId); - params.put("org_ids", orgIds); - params.remove("org_id"); - } - } - - @Override - public List listPartners(JSONObject manager, PartnerQuery query) { - JSONObject params = query.toJsonParam(); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - if (query.getOnlyMe()) { - params.put("bd_user", manager.getString("manager_id")); - } - } - int orgId = manager.getIntValue("org_id"); - if (orgId > 0) { - params.put("org_id", orgId); - } - return clientMapper.listPartnerSelection(params, new PageBounds(Order.formString("create_time.desc"))); - } - - @Override - public String initMerchantCode() { - String code = RandomStringUtils.randomAlphanumeric(4).toUpperCase(); - if (!getMerchantIsValid(code)) { - return initMerchantCode(); - } - return code; - } - - @Override - public boolean getMerchantIsValid(String clientMoniker) { - if (clientMapper.getPartnercode(clientMoniker) > 0) { - return false; - } - return true; - } - - @Override - @Transactional - public JSONObject registerClient(String clientMoniker, ClientRegisterInfo registery, JSONObject manager) { - JSONObject partner = registery.insertObject(); - if (clientMoniker != null && !clientMoniker.equals("")) { - JSONObject superClient = getClientInfoByMoniker(clientMoniker); - if (superClient == null) { - throw new InvalidShortIdException(); - } else { - checkOrgPermission(manager, superClient); - partner.put("parent_client_id", superClient.getIntValue("client_id")); - } - //如果level3商户,为一级商户增加level3_mch_config=true - checkLevel3MchStatus(superClient); - } - partner.put("create_time", new Date()); - partner.put("ali_sub_merchant_id", registery.getClientMoniker()); - partner.put("credential_code", RandomStringUtils.random(32, true, true)); - partner.put("creator", manager.getString("manager_id")); - int orgId = manager.getInteger("org_id") == null ? 1 : manager.getIntValue("org_id"); - partner.put("org_id", orgId); - JSONObject org = orgMapper.findOne(orgId); - if (StringUtils.isNotEmpty(registery.getLogoId())) { - partner.put("logo_url", attachmentClient.getFileUrl(registery.getLogoId())); - partner.put("logo_thumbnail", attachmentClient.getThumbnail(registery.getLogoId(), 600).getString("url")); - } - if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { - partner.put("approve_result", 1); - partner.put("approver", manager.getString("manager_id")); - partner.put("approve_time", new Date()); - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - partner.put("bd_user", manager.getString("manager_id")); - partner.put("bd_user_name", manager.getString("display_name")); - } - if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) { - throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); - } - DefaultClientProfile profile = OrgClientProfileUtils.getOrgProfile(org); - profile.applyToClientConfig(partner); - clientMapper.save(partner); - - try { - JSONObject clientConfig = new JSONObject(); - clientConfig.put("client_id", partner.getIntValue("client_id")); - clientConfig.put("client_moniker", partner.getString("client_moniker")); - clientConfig.put("client_pay_type", partner.getString("client_pay_type")); - clientConfig.put("client_pay_desc", partner.get("client_pay_desc")); - clientConfig.put("enable_cross_payment", partner.get("enable_cross_payment")); - clientConfig.put("enable_card_payment", partner.get("enable_card_payment")); - profile.applyToClientConfig(clientConfig); - clientConfigService.save(clientConfig); - permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker")); - } catch (Exception e) { - throw new ServerErrorException("商户配置信息初始化失败"); - } - try { - saveLegalAndMarketingInfo(partner); - if (registery.isEnableCardPayment()) { - sysClientUpayProfileMapper.save(partner); - } - } catch (Exception e) { - throw new ServerErrorException("商户初始化法人信息失败"); - } - - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - JSONObject client_bd = new JSONObject(); - client_bd.put("client_id", partner.getIntValue("client_id")); - client_bd.put("bd_id", manager.getString("manager_id")); - client_bd.put("bd_name", manager.getString("display_name")); - client_bd.put("create_time", new Date()); - client_bd.put("create_id", manager.getString("manager_id")); - client_bd.put("start_date", new Date()); - client_bd.put("proportion", 1); - clientBDMapper.saveBD(client_bd); - - if (registery.getClient_apply_id() != null) { - JSONObject apply = new JSONObject(); - apply.put("client_apply_id", registery.getClient_apply_id()); - apply.put("client_id", partner.getIntValue("client_id")); - apply.put("apply_approve_result", 2); - apply.put("apply_approve_time", new Date()); - clientApplyMapper.updatePartnerApplication(apply); - } - } - try { - mailGunService.addClientToMailList(partner); - } catch (Exception e) { - logger.error("邮件列表添加成员失败", e); - } - saveWechatMcc(partner); - return partner; - } - - /** - * 保存微信mccode - * - * @param partner - */ - private void saveWechatMcc(JSONObject partner) { - JSONObject wxGoodMcc = paymentChannelMccGoodMapper.findWechatPayMccByClientId(partner.getIntValue("client_id")); - - if ((wxGoodMcc == null || wxGoodMcc.isEmpty()) && !TextUtils.isEmpty(partner.getString("mc_code"))) { - wxGoodMcc = new JSONObject(); - wxGoodMcc.put("client_id", partner.getIntValue("client_id")); - wxGoodMcc.put("mc_code", partner.getString("mc_code")); - wxGoodMcc.put("channel", "Wechat"); - wxGoodMcc.put("creation_date", new Date()); - wxGoodMcc.put("creation_by", "System"); - paymentChannelMccGoodMapper.save(wxGoodMcc); - return; - } - if (!TextUtils.isEmpty(partner.getString("mc_code"))) { - wxGoodMcc.put("mc_code", partner.getString("mc_code")); - paymentChannelMccGoodMapper.update(wxGoodMcc); - } - - } - - @Override - @Transactional - public void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - checkOrgPermission(manager, client); - JSONObject updateInfo = info.updateObject(); - - int clientId = client.getIntValue("client_id"); - List clients = clientMapper.listChildClients(clientId); - if (StringUtils.isNotEmpty(info.getLogoId())) { - String fileUrl = attachmentClient.getFileUrl(info.getLogoId()); - updateInfo.put("logo_url", fileUrl); - String thumbnail = attachmentClient.getThumbnail(info.getLogoId(), 600).getString("url"); - updateInfo.put("logo_thumbnail", thumbnail); - for (JSONObject subClient : clients) { - subClient.put("logo_url", fileUrl); - subClient.put("logo_thumbnail", thumbnail); - } - } - updateInfo.put("client_id", clientId); - JSONObject representativeInfo = new JSONObject(); - representativeInfo.put("client_id", clientId); - representativeInfo.put("representative_person", info.getRepresentativePerson()); - representativeInfo.put("legal_representative_id", info.getRepresentativeId()); - representativeInfo.put("phone", info.getRepresentativePhone()); - representativeInfo.put("email", info.getRepresentativeEmail()); - representativeInfo.put("job_title", info.getRepresentativeJobTitle()); - representativeInfo.put("address", info.getRegisteredAddress()); - representativeInfo.put("suburb", info.getRegisteredSuburb()); - representativeInfo.put("postcode", info.getRegisteredPostcode()); - representativeInfo.put("state", info.getRegisteredState()); - representativeInfo.put("legal_representative_wechatid", info.getRepresentativeWechatId()); -// marketing 联系人 - representativeInfo.put("marketing_person", info.getMarketingPerson()); - representativeInfo.put("marketing_phone", info.getMarketingPhone()); - representativeInfo.put("marketing_email", info.getMarketingEmail()); - representativeInfo.put("marketing_job_title", info.getMarketingJobTitle()); - representativeInfo.put("marketing_wechatid", info.getMarketingWechatId()); - - if (sysClientLegalPersonMapper.findRepresentativeInfo(clientId) != null) { - sysClientLegalPersonMapper.update(representativeInfo); - } else { - sysClientLegalPersonMapper.save(representativeInfo); - } - - if (info.isEnableCardPayment()) { - JSONObject upay = sysClientUpayProfileMapper.findInfo(clientId); - if (upay == null) { - updateInfo.put("client_moniker", clientMoniker); - sysClientUpayProfileMapper.save(updateInfo); - } else { - upay.putAll(updateInfo); - sysClientUpayProfileMapper.update(upay); - } - } - - int originReferrerId = client.getIntValue("referrer_id"); - int updateReferrerId = Integer.parseInt(info.getReferrer_id() == null ? "0" : info.getReferrer_id()); - if (originReferrerId == 0 && updateReferrerId != 0) { - List bds = clientBDMapper.listClientBDAvailable(clientId, new Date()); - if (bds.size() == 1 && bds.get(0).getIntValue("proportion") == 1) { - JSONObject clientBDInfo = bds.get(0); - clientBDInfo.put("proportion", 0.5); - clientBDMapper.update(clientBDInfo); - } - } - clientMapper.update(updateInfo); - saveOrUpdateMailList(updateInfo, client); - JSONObject clientConfig = new JSONObject(); - clientConfig.put("client_id", clientId); - clientConfig.put("client_moniker", client.getString("client_moniker")); - clientConfig.put("enable_cross_payment", updateInfo.getBooleanValue("enable_cross_payment")); - clientConfig.put("enable_card_payment", updateInfo.getBooleanValue("enable_card_payment")); - if (StringUtils.isNotBlank(updateInfo.getString("client_pay_type")) && StringUtils.isNotBlank(updateInfo.getString("client_pay_desc"))) { - clientConfig.put("client_pay_type", updateInfo.getString("client_pay_type")); - clientConfig.put("client_pay_desc", updateInfo.getString("client_pay_desc")); - } - clientConfigMapper.update(clientConfig); - clientInfoCacheSupport.clearClientCache(clientId); - client.put("mc_code", info.getMc_code()); - saveWechatMcc(client); - } - - @Override - @Transactional - public void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - checkOrgPermission(manager, client); - - int clientId = client.getIntValue("client_id"); - List clients = clientMapper.listChildClients(clientId); - String logoId = info.getString("logo_id"); - if (StringUtils.isNotEmpty(logoId)) { - String fileUrl = attachmentClient.getFileUrl(logoId); - info.put("logo_url", fileUrl); - String thumbnail = attachmentClient.getThumbnail(logoId, 600).getString("url"); - info.put("logo_thumbnail", thumbnail); - for (JSONObject subClient : clients) { - subClient.put("logo_url", fileUrl); - subClient.put("logo_thumbnail", thumbnail); - } - } - info.put("client_id", clientId); - - int originReferrerId = client.getIntValue("referrer_id"); - int updateReferrerId = Integer.parseInt(info.getString("referrer_id") == null ? "0" : info.getString("referrer_id")); - if (originReferrerId == 0 && updateReferrerId != 0) { - List bds = clientBDMapper.listClientBDAvailable(clientId, new Date()); - if (bds.size() == 1 && bds.get(0).getIntValue("proportion") == 1) { - JSONObject clientBDInfo = bds.get(0); - clientBDInfo.put("proportion", 0.5); - clientBDMapper.update(clientBDInfo); - } - } - clientMapper.update(info); - if (StringUtils.isNotBlank(info.getString("representative_person"))) { - JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); - if (legalInfo != null) { - legalInfo.put("client_id", client.getIntValue("client_id")); - legalInfo.put("representative_person", info.getString("representative_person")); - legalInfo.put("job_title", info.getString("representative_job_title")); - legalInfo.put("phone", info.getString("representative_phone")); - legalInfo.put("email", info.getString("representative_email")); - legalInfo.put("address", info.getString("registered_address")); - legalInfo.put("suburb", info.getString("registered_suburb")); - legalInfo.put("state", info.getString("registered_state")); - legalInfo.put("postcode", info.getString("registered_postcode")); - sysClientLegalPersonMapper.update(legalInfo); - } else { - JSONObject legal = new JSONObject(); - legal.put("client_id", client.getIntValue("client_id")); - legal.put("representative_person", info.getString("representative_person")); - legal.put("job_title", info.getString("representative_job_title")); - legal.put("phone", info.getString("representative_phone")); - legal.put("email", info.getString("representative_email")); - legal.put("address", info.getString("registered_address")); - legal.put("suburb", info.getString("registered_suburb")); - legal.put("state", info.getString("registered_state")); - legal.put("postcode", info.getString("registered_postcode")); - sysClientLegalPersonMapper.save(legal); - } - } - saveOrUpdateMailList(info, client); - clientInfoCacheSupport.clearClientCache(clientId); - } - - private void saveOrUpdateMailList(JSONObject newClient, JSONObject oldClient) { - if (!oldClient.getString("contact_email").equals(newClient.getString("contact_email"))) { - List exceptClientIds = new ArrayList<>(); - exceptClientIds.add(newClient.getString("client_id")); - JSONObject sameMailClients = getByEmail(oldClient.getString("contact_email"), 1, 1, exceptClientIds); - if (sameMailClients.getJSONArray("data").size() < 1) { - mailGunService.updateClientOfMailList(newClient, oldClient); - } else { - oldClient.put("contact_email", newClient.getString("contact_email")); - mailGunService.addClientToMailList(oldClient); - } - } - } - - @Override - public void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - int clientId = client.getIntValue("client_id"); - String originSubMerchantId = client.getString("sub_merchant_id"); - String subMerchantId = subMerchantInfo.getString("sub_merchant_id"); - ChannelContractSource wxContractSource = paymentApi.channelApi(PayChannel.WECHAT.getChannelCode()).initContractSource(); - MchChannelContract contract = new MchChannelContract().setClientId(clientId).setMid(subMerchantId); - wxContractSource.saveContract(contract); - try { - recordSubMerchantLog(client, subMerchantInfo, manager); - } catch (Exception e) { - logger.error("记录log_client_sub_merchant_id失败", e); - } - List children = clientMapper.listChildClients(clientId); - for (JSONObject child : children) { - if (Objects.equals(child.getString("sub_merchant_id"), originSubMerchantId)) { - MchChannelContract childContract = new MchChannelContract() - .setClientId(child.getIntValue("client_id")) - .setMid(subMerchantId); - try { - recordSubMerchantLog(child, subMerchantInfo, manager); - } catch (Exception e) { - logger.error("记录log_client_sub_merchant_id失败", e); - } - wxContractSource.saveContract(childContract); - } - } - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public void updateClientRpayPaymentConfig(JSONObject manager, String clientMoniker, JSONObject rpaySubMerchantInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject update = new JSONObject(); - int clientId = client.getIntValue("client_id"); - update.put("client_id", clientId); - String subMerchantId = rpaySubMerchantInfo.getString("rpay_enterprise_id"); - update.put("rpay_enterprise_id", subMerchantId); - try { - recordSubMerchantLog(client, rpaySubMerchantInfo, manager); - } catch (Exception e) { - logger.error("记录log_client_sub_merchant_id失败", e); - } - clientMapper.update(update); - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject update = new JSONObject(); - int clientId = client.getIntValue("client_id"); - update.put("client_id", clientId); - update.put("ali_sub_merchant_id", aliSubMerchantInfo.getString("ali_sub_merchant_id")); - clientMapper.update(update); - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public void refreshWechatInstitutionMerchantId(JSONObject manager, String clientMoniker, JSONObject refreshWechatInstitutionMerchantId) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject update = new JSONObject(); - int clientId = client.getIntValue("client_id"); - update.put("client_id", clientId); - String wechatInstitutionMerchantId = RandomStringUtils.random(6, true, true).toUpperCase(); - if (StringUtils.isEmpty(refreshWechatInstitutionMerchantId.getString("wechat_institution_merchant_id"))) { - update.put("wechat_institution_merchant_id", wechatInstitutionMerchantId); - } else { - update.put("wechat_institution_merchant_id", createWechatInstitutionMerchantId(wechatInstitutionMerchantId)); - } - clientMapper.update(update); - clientInfoCacheSupport.clearClientCache(clientId); - } - - private String createWechatInstitutionMerchantId(String wechatInstitutionMerchantId) { - JSONObject client = clientMapper.findByWechatInstitutionMerchantId(wechatInstitutionMerchantId); - if (client == null) { - return wechatInstitutionMerchantId; - } else { - return createWechatInstitutionMerchantId(RandomStringUtils.random(6, true, true).toUpperCase()); - } - } - - private void recordSubMerchantLog(JSONObject client, JSONObject subMerchantInfo, JSONObject manager) { - JSONObject log = new JSONObject(); - log.put("sub_merchant_id_after", subMerchantInfo.getString("sub_merchant_id")); - log.put("operator", manager.getString("display_name")); - log.put("create_time", new Date()); - log.put("wechat_institution_merchant_id", client.getString("wechat_institution_merchant_id")); - log.put("client_id", client.getIntValue("client_id")); - log.put("sub_merchant_id_before", client.getString("sub_merchant_id")); - logClientSubMerchantIdMapper.save(log); - } - - @Override - public void auditClient(JSONObject manager, String clientMoniker, int pass) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - //检查商户是否进入平台黑名单 - int clientId = client.getIntValue("client_id"); - isRiskyMerchant(client, clientBankAccountMapper.clientBankAccounts(clientId).get(0)); - - if (client.getString("sub_merchant_id") == null || client.getString("sub_merchant_id").equals("")) { - throw new BadRequestException("该商户未设置微信 Sub Merchant ID!"); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - Integer open_status = client.getInteger("open_status"); - boolean checkGreenChannel = client.getIntValue("approve_result") == 2 && (client.getIntValue("source") == 1 || client.getIntValue("source") == 2); - AuditModify auditModify = new AuditModify(manager, clientMoniker, pass, manager.getString("manager_id"), new Date()); - auditModify.setOpen_status(5); - client.put("open_status", 5); - if (client.getIntValue("source") == 5) { - auditModify.setSource(1); - } - clientModifySupport.processClientModify(auditModify); - sendCommissionWechatMessage(client);// wxMessage - if (pass == 1) { - createKycAuthStatus(manager, client); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false)); - if (client.getIntValue("source") == 4 || client.getIntValue("source") == 5) { - List accounts = clientAccountMapper.listAdminAccounts(client.getIntValue("client_id")); - if (accounts == null || accounts.size() <= 0) { - initAdminUserAndSendEmail(manager, clientMoniker, client, false); - } else { - JSONObject account = accounts.get(0); - sendInitEmail(client, account.getString("username"), "*****", false); - } - // sendInitEmail(manager, client, account.getString("username"), "*****"); - saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager, 1); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false)); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "common_sub_merchant_id", false)); - gatewayMerchantApply.notifyOrgMerchantStatus(client); - } else if (checkGreenChannel && client.getIntValue("open_status") == 5) { - // 绿色通道通过后不发邮件 - logger.info("PASS 绿色通道:{}", clientMoniker); - saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager, 1); - } else { - initAdminUserAndSendEmail(manager, clientMoniker, client, false); - saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager, 1); - } - } - clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); - } - - @Override - public void auditCardClient(JSONObject manager, String clientMoniker, int pass) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - //检查商户是否进入平台黑名单 - int clientId = client.getIntValue("client_id"); - isRiskyMerchant(client, clientBankAccountMapper.clientBankAccounts(clientId).get(0)); - - JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(clientId); - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - Integer open_status_to = cardFlowInfo != null ? cardFlowInfo.getIntValue("upay_open_status") : null; - cardFlowInfo.put("upay_open_status", 5); - cardFlowInfo.put("upay_approve_result", 1); - sysClientUpayProfileMapper.update(cardFlowInfo); - sendCardCommissionWechatMessage(client);// wxMessage - if (pass == 1) { - createKycAuthStatus(manager, client); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false)); - List accounts = clientAccountMapper.listAdminAccounts(clientId); - if (accounts != null && !accounts.isEmpty()) { - sendInitEmail(client, accounts.get(0).getString("username"), "*******", true); - } else { - initAdminUserAndSendEmail(manager, clientMoniker, client, true); - } - saveClientAuditProcess(client.getIntValue("client_id"), open_status_to, 5, "合规通过", manager, 2); - } - clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); - } - - private void createKycAuthStatus(JSONObject manager, JSONObject client) { - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (compliance != null) { - compliance.put("client_id", client.getIntValue("client_id")); - compliance.put("submit_time", new Date()); - compliance.put("status", 1); - compliance.put("source", 2); - compliance.put("commit_by_id", manager.getString("display_name")); - compliance.put("type", 2); - compliance.put("is_valid", 1); - clientComplianceCompanyMapper.update(compliance); - } else { - compliance = new JSONObject(); - compliance.put("client_id", client.getIntValue("client_id")); - compliance.put("submit_time", new Date()); - compliance.put("status", 1); - compliance.put("source", 2); - compliance.put("commit_by_id", manager.getString("display_name")); - compliance.put("type", 2); - compliance.put("is_valid", 1); - clientComplianceCompanyMapper.save(compliance); - } - } - - @Override - public void auditClientGreenChannel(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - //检查商户是否进入平台黑名单 - int clientId = client.getIntValue("client_id"); - isRiskyMerchant(client, clientBankAccountMapper.clientBankAccounts(clientId).get(0)); - - client.put("approve_result", 2); - client.put("approver", manager.getString("manager_id")); - client.put("approve_time", new Date()); - client.put("skip_clearing", 0); - client.put("open_status", 1); - if (client.getString("sub_merchant_id") == null || client.getString("sub_merchant_id").equals("")) { - throw new BadRequestException("该商户未设置微信 Sub Merchant ID!"); - } - clientModifySupport.processClientModify(new GreenChannelModify(manager, clientMoniker, manager.getString("manager_id"))); - saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager, 1); - sendCommissionWechatMessage(client); - initAdminUserAndSendEmail(manager, clientMoniker, client, false); - } - - private void initAdminUserAndSendEmail(JSONObject manager, String clientMoniker, JSONObject client, boolean isUpayEmail) { - String username = clientMoniker; - boolean duplicated = true; - String pwd = RandomStringUtils.random(8, true, true); - while (duplicated) { - NewAccountBean account = new NewAccountBean(); - account.setDisplayName(clientMoniker + " Admin"); - account.setRole(PartnerRole.ADMIN.getCode()); - account.setUsername(username); - account.setPwd(pwd); - try { - newAccount(clientMoniker, account, manager, 1); - duplicated = false; - } catch (Exception e) { - username += "0"; - } - } - sendInitEmail(client, username.toLowerCase(), pwd, isUpayEmail); - } - - @Override - public void checkAndSendInitEmail(JSONObject manager, String clientMoniker, String type) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - clientModifySupport.processClientModify(new EmailModify(manager, clientMoniker, 4, null)); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - int checkBDPermission = clientBDMapper.checkBDPermission(clientId, manager.getString("manager_id")); - if (checkBDPermission <= 0) { - throw new BadRequestException("This Partner is not belongs to you"); - } - } - List accounts = clientAccountMapper.listAdminAccounts(clientId); - JSONObject cardProfile = clientMapper.findClientAprrovingStatus(clientId); - boolean cardApproving = cardProfile != null && StringUtils.equals("cardpayment", type); - if (client.getIntValue("source") == 4) { - JSONObject account = accounts.get(0); - // sendInitEmail(manager, client, account.getString("username"), "*****"); - sendInitEmail(client, account.getString("username"), "*****", cardApproving); - } else { - if (accounts.isEmpty()) { - initAdminUserAndSendEmail(manager, clientMoniker, client, cardApproving); - } else { - JSONObject account = accounts.get(0); - String pwd = RandomStringUtils.random(8, true, true); - resetAccountPwd(manager, clientMoniker, account.getString("account_id"), pwd); - // sendInitEmail(manager, client, account.getString("username"), pwd); - sendInitEmail(client, account.getString("username"), pwd, cardApproving); - } - } - } - - public void sendInitEmail(final JSONObject client, String username, String pwd, boolean isUpayAuditPass) { - logger.debug("sending email after comply"); - // 配置了部分组织不发送邮件 - JSONObject sysConfig = sysConfigManager.getSysConfig(); - String[] orgs = sysConfig.getString("no_send_email_org").split(","); - for (String org : orgs) { - if (client.getString("org_id").equals(org)) { - logger.info("Merchant of organization does not send email.(org_id:" + org + ")"); - return; - } - } - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - Context ctx = new Context(); - ctx.setVariable("bds", bds); - ctx.setVariable("short_name", client.getString("short_name")); - ctx.setVariable("password", pwd); - ctx.setVariable("username", username); - ctx.setVariable("client_moniker", client.getString("client_moniker")); - ctx.setVariable("contact_person", client.getString("contact_person")); - ctx.setVariable("credential_code", client.getString("credential_code")); - ctx.setVariable("card_approving", isUpayAuditPass); - - final String content = thymeleaf.process("mail/new_client_notice", ctx); - ctx.setVariable("password", "*****"); - final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); - final List mailTos = new ArrayList<>(); - String mailTo = client.getString("contact_email"); - if (StringUtils.isEmpty(mailTo)) { - throw new EmailException("Client Contact Email is invalid"); - } - mailTos.add(mailTo); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null && StringUtils.isNotBlank(clientLegal.getString("email"))) { - mailTos.add(clientLegal.getString("email")); - } - - final List emails = new ArrayList<>(); - for (JSONObject bd : bds) { - String email = bd.getString("email"); - if (StringUtils.isNotEmpty(email)) { - emails.add(email); - } - } - new Thread(() -> { - try { - String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", StringUtils.join(mailTos, ","), "", content); - mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","), - "", contentBd); - JSONObject clientUpdate = new JSONObject(); - if (isUpayAuditPass) { - clientUpdate.put("client_id", client.getIntValue("client_id")); - clientUpdate.put("upay_approve_email_send", 3); - clientUpdate.put("upay_approve_email_id", emailId); - sysClientUpayProfileMapper.update(clientUpdate); - } else { - clientUpdate.put("client_id", client.getIntValue("client_id")); - clientUpdate.put("approve_email_send", 3); - clientUpdate.put("approve_email_id", emailId); - clientMapper.update(clientUpdate); - } - } catch (Exception e) { - JSONObject clientUpdate = new JSONObject(); - if (isUpayAuditPass) { - clientUpdate.put("client_id", client.getIntValue("client_id")); - clientUpdate.put("upay_approve_email_send", 0); - clientUpdate.put("upay_approve_email_id", null); - sysClientUpayProfileMapper.update(clientUpdate); - } else { - clientUpdate.put("client_id", client.getIntValue("client_id")); - clientUpdate.put("approve_email_send", 0); - clientUpdate.put("approve_email_id", null); - clientMapper.update(clientUpdate); - } - throw new EmailException("Email Sending Failed", e); - } - }).start(); - } - - - public void sendAuthInitEmail(JSONObject account, final JSONObject client) { - logger.debug("sending email after comply about a new partner opening by quick access"); - JSONObject model = new JSONObject(); - model.put("client_moniker", client.getString("client_moniker")); - model.put("contact_person", client.getString("contact_person")); - model.put("credential_code", client.getString("credential_code")); - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rate.getInteger("clean_days") == null) { - rate.put("clean_days", client.getIntValue("clean_days")); - } - model.put("clean_days", rate.getIntValue("clean_days")); - // todo velocityEngine - Context ctx = new Context(); - ctx.setVariable("credential_code", client.getString("credential_code")); - ctx.setVariable("contact_person", client.getString("contact_person")); - ctx.setVariable("client_moniker", client.getString("client_moniker")); - final String content = thymeleaf.process("mail/new_client_auth_success_notice", ctx); - // final String content = VelocityEngineUtils.mergeTemplateIntoString(null, - // "mail/new_client_auth_success_notice.vm", "utf-8", model); - final String mailTo = client.getString("contact_email"); - if (StringUtils.isEmpty(mailTo)) { - throw new EmailException("Client Contact Email is invalid"); - } - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - - final Set emails = new HashSet<>(); - for (JSONObject bd : bds) { - String email = bd.getString("email"); - if (StringUtils.isNotEmpty(email)) { - emails.add(email); - } - } - new Thread() { - @Override - public void run() { - try { - SendMail sendMail = new SendMail(); - Set to = new HashSet<>(); - to.add(mailTo); - sendMail.setMailTos(to); - sendMail.setFrom("info@mail.royalpay.com.au"); - sendMail.setMailCcs(emails); - sendMail.setTitle("Your Partner Account Has Been Authenticated Successfully"); - sendMail.setContent(content); - sendMail.setTags(tags); - JSONObject mailResult = mailGunService.sendMail(sendMail); - clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, mailResult.getString("mail_id"))); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - } - }.start(); - } - - @Override - public void markApproveEmailSendStatus(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (client.getIntValue("approve_result") != 1) { - throw new BadRequestException("Client Not Complied yet!"); - } - int clientId = client.getIntValue("client_id"); - updateClientApproveEmailStatus(1, manager, clientMoniker); - } - - private void updateClientApproveEmailStatus(int status, JSONObject account, String client_moniker) { - clientModifySupport.processClientModify(new ApproveEmailModify(account, client_moniker, status)); - } - - @Override - public void checkEmailStatus() { - List clients = clientMapper.listClientsWithEmailNotVerify(); - for (JSONObject client : clients) { - try { - String emailId = client.getString("approve_email_id"); - List statusList = mailService.checkEmailStatus(emailId); - if (!statusList.isEmpty()) { - JSONObject status = statusList.get(0); - int statusNo = status.getIntValue("status"); - logger.debug("get mail status:" + emailId + "--" + statusNo); - int mailStatus = 3; - switch (statusNo) { - case 1: - mailStatus = 1; - break; - case 2: - mailStatus = 2; - break; - } - updateClientApproveEmailStatus(mailStatus, null, client.getString("client_moniker")); - } else { - logger.debug("get mail status:" + emailId + "-- none"); - // updateClientApproveEmailStatus(client.getIntValue("client_id"), 0); - } - - } catch (Exception e) { - logger.error("check email status failed", e); - } - } - } - - @Override - public void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, permissionKey, allow)); - } - - @Override - @Transactional - public void modifyUPayProfile(JSONObject manager, String clientMoniker, String profileKey, boolean allow) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (StringUtils.isEmpty(profileKey)) { - throw new BadRequestException("Key not provided"); - } - clientModifySupport.processModify(new CustomSwitchModify(manager, clientMoniker, profileKey, allow, cli -> { - JSONObject profileUpdate = new JSONObject(); - profileUpdate.put(profileKey, allow); - profileUpdate.put("client_id", cli.getIntValue("client_id")); - sysClientUpayProfileMapper.update(profileUpdate); - })); - } - - @Override - public void switchChannelPermission(JSONObject manager, String clientMoniker, String channel, boolean allow) { - PayChannel payChannel = PayChannel.fromChannelCode(channel); - if (payChannel == PayChannel.ALIPAY_APS) { - ArrayList apsChannels = new ArrayList<>(); - apsChannels.add(PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()); - apsChannels.add(PayChannel.ALIPAY_APS_CASHIER.getChannelCode()); - apsChannels.forEach(apsChannel -> { - extracted(manager, clientMoniker, apsChannel, allow); - }); - } else { - extracted(manager, clientMoniker, channel, allow); - } - } - - private void extracted(JSONObject manager, String clientMoniker, String channel, boolean allow) { - for (PaymentChannelApi channelApi : paymentApi.channels()) { - if (channelApi.channel().equalsIgnoreCase(channel)) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client Not Exists"); - } - try { - clientModifySupport.processModify(new SwitchChannelPermissionModify(manager, clientMoniker, merchantInfoProvider, channelApi.getChannelPermissionResolver(), allow)); - } catch (Exception e) { - logger.error("Failed to change channel switch:{}", channel, e); - } - logger.info("{}({}) switched client {} channel {} to {}", manager.getString("display_name"), manager.getString("manager_id"), clientMoniker, channel, allow); - if (allow && (StringUtils.equalsAnyIgnoreCase("Wechat", channel) || StringUtils.equalsAnyIgnoreCase("Alipay", channel))) { - int clientId = client.getIntValue("client_id"); - List clientBankAccounts = clientBankAccountMapper.clientBankAccounts(clientId); - - if (!clientBankAccounts.isEmpty()) { - isRiskyMerchant(client, clientBankAccounts.get(0)); - } else { - isRiskyMerchant(client, null); - } - - } - return; - } - } - throw new BadRequestException("Invalid Channel:" + channel); - } - - @Override - public List listAccounts(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - if (!client.containsKey("parent_client_id") && client.getBooleanValue("sub_manage")) { - return clientAccountMapper.partnerAndSubPartnerAccounts(client.getIntValue("client_id")); - } - return clientAccountMapper.listPartnerAccounts(client.getIntValue("client_id")); - - } - - @Override - public JSONObject newAccount(String clientMoniker, NewAccountBean account, JSONObject manager, int managerType) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - if (StringUtils.isNotBlank(account.getContactPhone())) { - checkPhoneAndWechatExist(account); - } - JSONObject accountJson = account.toJson(); - JSONObject accountCheck = clientAccountMapper.findByUsernameForDuplicate(accountJson.getString("username")); - if (accountCheck != null) { - throw new BadRequestException("该用户名已存在,请重新输入!"); - } - String salt = PasswordUtils.newSalt(); - accountJson.put("salt", salt); - accountJson.put("password_hash", PasswordUtils.hashPwd(account.getPwd(), salt)); - accountJson.put("password_aes", PasswordUtils.encryptAESPwd(account.getPwd())); - accountJson.put("client_id", account.getClientId() == 0 ? client.getIntValue("client_id") : account.getClientId()); - accountJson.put("creator", managerType == 1 ? manager.getString("manager_id") : manager.getString("account_id")); - accountJson.put("creator_type", managerType); - accountJson.put("create_time", new Date()); - accountJson.put("is_password_expired", 1); - clientAccountMapper.save(accountJson); - accountJson.remove("salt"); - accountJson.remove("password_hash"); - return accountJson; - } - - private void checkPhoneAndWechatExist(NewAccountBean account) { - List accounts = clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+") ? account.getNation_code() : "+" + account.getNation_code()); - if (accounts != null && !accounts.isEmpty()) { - throw new BadRequestException("Mobile phone number has been bound to other accounts"); - } - } - - @Override - @Transactional - public void resetAccountPwd(JSONObject manager, String clientMoniker, String accountId, String pwd) { - JSONObject account = checkAndFindAccount(manager, clientMoniker, accountId); - String salt = PasswordUtils.newSalt(); - String pwdHash = PasswordUtils.hashPwd(pwd, salt); - account.put("salt", salt); - account.put("password_hash", pwdHash); - account.put("password_aes", PasswordUtils.encryptAESPwd(pwd)); - deviceManager.deviceOffline(accountId); - clientAccountMapper.update(account); - signInAccountService.clearAccountCache(accountId); - } - - private JSONObject checkAndFindAccount(JSONObject manager, String clientMoniker, String accountId) { - JSONObject account = clientAccountMapper.findById(accountId); - if (clientMoniker != null) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - //父商户全局管理子商户时候,跳过 - if (account.getIntValue("client_id") != client.getIntValue("client_id")) { - //登录用户所属商户 - JSONObject clientLogin = getClientInfo(account.getIntValue("client_id")); - Boolean validChildClients = clientLogin.containsKey("parent_client_id") ? clientLogin.getIntValue("parent_client_id") == client.getIntValue("client_id") : false; - Boolean validLevel3Clients = listLevel3Client(client.getIntValue("client_id")).contains(clientLogin.getIntValue("parent_client_id")); - if (!(client.getBoolean("sub_manage") && (validChildClients || validLevel3Clients))) { - throw new BadRequestException("error.partner.valid.account_not_match"); - } - } - checkOrgPermission(manager, client); - } - return account; - } - - @Override - @CacheEvict(value = ":login:clients:", key = "''+#accountId") - public void disableAccount(JSONObject manager, String clientMoniker, String accountId) { - JSONObject account = checkAndFindAccount(manager, clientMoniker, accountId); - account.put("is_valid", 0); - clientAccountMapper.update(account); - signInAccountService.clearAccountCache(accountId); - } - - @Override - public JSONObject createBindWechatUserQrCode(String clientMoniker, String accountId) { - JSONObject account = checkAndFindAccount(null, clientMoniker, accountId); - String randomKey = RandomStringUtils.random(20, true, true); - String redisKey = bindWechatUserKey(randomKey); - stringRedisTemplate.boundValueOps(redisKey).set(accountId + "", 3, TimeUnit.MINUTES); - JSONObject res = new JSONObject(); - res.put("url", PlatformEnvironment.getEnv().concatUrl("/client/partner_info/wechat_bind/" + randomKey)); - res.put("key", randomKey); - res.put("account", account); - return res; - } - - @Override - public void bindWechatUser(String randomKey, JSONObject user, Model model) { - String redisKey = bindWechatUserKey(randomKey); - String accountId = stringRedisTemplate.boundValueOps(redisKey).get(); - if (accountId == null) { - throw new BadRequestException("qrcode has been expired!please operate again"); - } - JSONObject account = clientAccountMapper.findById(accountId); - if (account == null) { - throw new BadRequestException("account not exists"); - } - if (user.getString("openid") != null && !"".equals(user.getString("openid"))) { - if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size() > 0) { - throw new BadRequestException("The WeChat has been linked to other accounts"); - } - } - if (user.getString("unioinid") != null && !"".equals(user.getString("unioinid"))) { - if (clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size() > 0) { - throw new BadRequestException("The WeChat has been linked to other accounts"); - } - } - JSONObject res = new JSONObject(); - if (StringUtils.equals(user.getString("openid"), account.getString("wechat_openid"))) { - res.put("notitle", true); - } else { - JSONObject prevAccount = clientAccountMapper.findByOpenId(user.getString("openid")); - if (prevAccount != null) { - prevAccount.put("wechat_openid", null); - prevAccount.put("wechat_name", null); - prevAccount.put("wechat_headimg", null); - clientAccountMapper.update(prevAccount); - } - account.put("wechat_openid", user.getString("openid")); - account.put("wechat_name", user.getString("nickname")); - account.put("wechat_headimg", user.getString("headimgurl")); - account.put("wx_unionid", user.getString("unionid")); - account.put("payment_notice", true); - clientAccountMapper.update(account); - res.put("notitle", false); - } - JSONObject entity = new JSONObject(); - entity.put("key", randomKey); - JSONObject client = getClientInfo(account.getIntValue("client_id")); - publisher.publishEvent(new PartnerPageEvent(this, client.getString("client_moniker"), "notify_wechatuser_bind", entity)); - model.addAttribute("res", res); - model.addAttribute("account", account); - signInAccountService.clearAccountCache(accountId); - } - - @Override - @CacheEvict(value = ":login:clients:", key = "''+#accountId") - public void unbindAccountWechat(String clientMoniker, String accountId) { - JSONObject account = checkAndFindAccount(null, clientMoniker, accountId); - account.put("wechat_openid", null); - account.put("wechat_name", null); - account.put("wechat_headimg", null); - account.put("wx_unionid", null); - clientAccountMapper.update(account); - signInAccountService.clearAccountCache(accountId); - } - - @Override - @CacheEvict(value = ":login:clients:", key = "''+#accountId") - public void toggleAccountReceiveNotice(String clientMoniker, String accountId, boolean enable) { - JSONObject account = checkAndFindAccount(null, clientMoniker, accountId); - account.put("payment_notice", enable); - clientAccountMapper.update(account); - signInAccountService.clearAccountCache(accountId); - } - - @Override - @CacheEvict(value = ":login:clients:", key = "''+#accountId") - public void toggleAccountRefundAuthorize(String clientMoniker, String accountId, boolean enable) { - JSONObject account = checkAndFindAccount(null, clientMoniker, accountId); - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new BadRequestException("Clerk cannot audit refunds!"); - } - account.put("refund_authorised", enable); - clientAccountMapper.update(account); - signInAccountService.clearAccountCache(accountId); - } - - @Override - public void togglePayNotice(JSONObject account, String clientMoniker, boolean enable) { - JSONObject partner = getClientInfoByMoniker(clientMoniker); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_pay_notice", enable)); - clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id")); - } - - @Override - @CacheEvict(value = ":login:clients:", key = "''+#accountId") - public void changeRole(JSONObject manager, String clientMoniker, String accountId, int role) { - JSONObject account = checkAndFindAccount(manager, clientMoniker, accountId); - boolean valid = false; - for (PartnerRole r : PartnerRole.values()) { - if (r.getCode() == role) { - valid = true; - break; - } - } - if (!valid) { - throw new BadRequestException("Invalid Role Code"); - } - account.put("role", role); - clientAccountMapper.update(account); - signInAccountService.clearAccountCache(accountId); - } - - @Override - public void toggleAuditRefund(String clientMoniker, boolean enable, JSONObject account) { - clientModifySupport.processClientConfigModify(new RefundAuditModify(account, clientMoniker, enable)); - } - - @Override - public List listPaymentNoticeAccounts(int clientId) { - return clientAccountMapper.listPaymentNoticeAccounts(clientId); - } - - @Override - public List listRefundAuditAccounts(int clientId) { - return clientAccountMapper.listRefundAuditAccounts(clientId); - } - - @Override - public JSONObject getAccountByOpenId(String openid) { - JSONObject account = clientAccountMapper.findByOpenId(openid); - if (account == null) { - throw new BadRequestException("Your wechat account have not connected to an account."); - } - return account; - } - - @Override - public void updateClientBDUser(JSONObject account, String clientMoniker, int managerId) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientModify(new BDUserModify(account, clientMoniker, String.valueOf(managerId), null)); - List subClients = clientMapper.listChildClients(client.getIntValue("client_id")); - for (JSONObject subClient : subClients) { - subClient.put("bd_user", managerId); - clientModifySupport.processClientModify(new BDUserModify(account, subClient.getString("client_moniker"), String.valueOf(managerId), null)); - } - } - - @Override - public void refreshClientCredentialCode(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - clientModifySupport.processClientConfigModify(new CredentialCodeModify(manager, clientMoniker, RandomStringUtils.random(32, true, true))); - } - - @Override - public JSONObject listClientBankAccounts(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - return getBankAccountByClientId(client.getIntValue("client_id")); - } - - @Override - public JSONObject getBankAccountByClientId(int clientId) { - List list = clientBankAccountMapper.clientBankAccounts(clientId); - return list.isEmpty() ? new JSONObject() : list.get(0); - } - - @Override - public void saveBankAccount(JSONObject manager, String clientMoniker, BankAccountInfo bankAccount) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Partner Not Exists"); - } - checkOrgPermission(manager, client); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && client.getIntValue("approve_result") == 1) { - throw new ForbiddenException("已审核商户修改银行信息请联系合规人员"); - } - clientBankAccountMapper.deleteClientAccounts(client.getIntValue("client_id")); - JSONObject bank = bankAccount.toJSON(); - bank.put("client_id", client.getIntValue("client_id")); - clientBankAccountMapper.save(bank); - } - - @Override - public List clientRates(String clientMoniker, boolean includingInactive) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Partner Not Exists"); - } - int clientId = client.getIntValue("client_id"); - JSONObject clientConfig = clientConfigService.find(clientId); - List rates = new ArrayList<>(); - for (PaymentChannelApi channel : paymentApi.channels()) { - rates.addAll(merchantInfoProvider.listClientRates(clientId, new Date(), channel.channel(), includingInactive)); - } - rates.addAll(merchantInfoProvider.listClientRates(clientId, new Date(), "CB_BankPay", includingInactive)); - if (!rates.isEmpty()) { - try { - for (JSONObject rate : rates) { - if (rate.get("clean_days") == null) { - rate.put("clean_days", clientConfig.getIntValue("clean_days")); - } - if (StringUtils.equalsIgnoreCase("rpaypmt_card", rate.getString("rate_name"))) { - JSONObject extRates = JSON.parseObject(rate.getString("ext_rates")); - convertExtRateValueDataVersion(rate, extRates, "domestic_rate_value"); - convertExtRateValueDataVersion(rate, extRates, "overseas_rate_value"); - rate.put("ext_rates", extRates); - } - TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator(rate.getString("rate_name"))) - .map(calculator -> calculator.convertTransactionFee(rate.getBigDecimal("transaction_fee"))) - .orElse(TransactionFee.ZERO); - rate.put("transaction_fee", transFee.displayValue()); - } - } catch (Exception ignore) { - } - } - return rates; - } - - public void convertExtRateValueDataVersion(JSONObject rate, JSONObject extRates, String subRateKey) { - if (!(extRates.get(subRateKey) instanceof JSON)) { - BigDecimal domesticRate = extRates.getBigDecimal(subRateKey); - JSONObject subRateConfig = new JSONObject(); - subRateConfig.put("rate", domesticRate); - subRateConfig.put("clean_days", rate.getIntValue("clean_days")); - extRates.put(subRateKey, subRateConfig); - } - } - - @Override - public void configSettleHour(JSONObject manager, String clientMoniker, Integer hour) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - clientModifySupport.processClientConfigModify(new SettleHourModify(manager, clientMoniker, hour)); - } - - @Override - public void configRate(JSONObject manager, String clientMoniker, ClientRateConfig config) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - int clientId = client.getIntValue("client_id"); - if (!clientRateMapper.listClientRatesForSaving(clientId, config.getActiveTime(), config.getExpiryTime(), config.getRateValue(), config.getCleanDays(), - config.getRateName()).isEmpty()) { - return; - } - JSONObject configJson = config.toJSON(); - configJson.put("client_id", clientId); - configJson.put("manager_id", manager.getString("manager_id")); - configJson.put("manager_name", manager.getString("display_name")); - configJson.put("create_time", new Date()); - configJson.put("update_time", new Date()); - TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator(config.getRateName())) - .map(calculator -> calculator.convertTransactionFee(config.getTransactionFee())) - .orElse(TransactionFee.ZERO); - configJson.put("transaction_fee", transFee.storeValue()); - clientRateMapper.saveRate(configJson); - // clientMapper.updateCleanDays(clientId, config.getCleanDays()); - } - - @Override - @Transactional - public void newConfigRate(JSONObject manager, String clientMoniker, JSONObject config) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - int clientId = client.getIntValue("client_id"); - JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); - if (config == null) { - throw new ForbiddenException(clientId + "费率参数配置不完整,请重新输入===>"); - } - config.put("client_id", clientId); - config.put("manager_id", manager.getString("manager_id")); - config.put("manager_name", manager.getString("display_name")); - config.put("create_time", new Date()); - config.put("update_time", new Date()); - config.put("active_time", DateFormatUtils.format(config.getDate("active_time"), "yyyy-MM-dd")); - config.put("expiry_time", DateFormatUtils.format(config.getDate("expiry_time"), "yyyy-MM-dd")); - if (isAddCardPaymentRate(config, clientId)) { - return; - } - checkAddRate(config, "Wechat", "wechat_rate_value", org, "min_wechat_rate"); - checkAddRate(config, "Alipay", "alipay_rate_value", org, "min_alipay_rate"); - checkAddRate(config, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); - checkAddRate(config, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); - checkAddRate(config, "CB_BankPay", "min_cb_bankpay_value", org, "min_cb_bankpay_rate"); - checkAddRate(config, "AlipayAps Retail Interchange Fee", "retail_interchange_fee_value", org, "min_retail_interchange_fee_rate"); - checkAddRate(config, "AlipayAps Retail Serivce Fee", "retail_service_fee_value", org, "min_retail_service_fee_rate"); - checkAddRate(config, "AlipayAps Online Interchange Fee", "online_interchange_fee_value", org, "min_online_interchange_fee_rate"); - checkAddRate(config, "AlipayAps Online Serivce Fee", "online_service_fee_value", org, "min_online_service_fee_rate"); - - configNewClientRate(config, clientId, "Wechat", "wechat_rate_value", org, "min_wechat_rate"); - configNewClientRate(config, clientId, "Alipay", "alipay_rate_value", org, "min_alipay_rate"); - configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); - configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); - configNewClientRate(config, clientId, "CB_BankPay", "cb_bankpay_rate_value", org, "min_cb_bankpay_rate"); - configNewClientRate(config, clientId, "ApsInStore", "retail_interchange_fee_value", null, ""); - configNewClientRate(config, clientId, "ApsCashier", "online_interchange_fee_value", null, ""); - addAlipayPlusRateConfig(config, clientId, PayChannel.ALIPAY_PLUS.getChannelCode()); - } - - private void addAlipayPlusRateConfig(JSONObject config, int clientId, String channel) { - if (config.getString("alipay_cn_retail") != null) { - config.put("pay_type", "alipay_cn_retail"); - configNewClientRate(config, clientId, channel, "alipay_cn_retail", null, null); - } - if (config.getString("alipay_cn_online") != null) { - config.put("pay_type", "alipay_cn_online"); - configNewClientRate(config, clientId, channel, "alipay_cn_online", null, null); - } - if (config.getString("alipay_other") != null) { - config.put("pay_type", "alipay_other"); - configNewClientRate(config, clientId, channel, "alipay_other", null, null); - } - config.remove("pay_type"); - } - - - private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) { - if (config.containsKey(rateKey)) { - JSONObject newConfig = new JSONObject(); - newConfig.putAll(config); - newConfig.put("rate_value", config.getBigDecimal(rateKey)); - newConfig.put("rate_name", channel); - newConfig.put("pay_type", config.getString("pay_type")); - if (!clientRateMapper.listClientRatesForSaving(clientId, config.getDate("active_time"), config.getDate("expiry_time"), config.getBigDecimal("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) { - return; - } - if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) { - JSONObject extRateParams = JsonHelper.newJson(json -> { - json.put("domestic_rate_value", subRateObject(config.getBigDecimal("rate_value"), config.getIntValue("clean_days"))); - JSONObject extRates = config.getJSONObject("ext_rates"); - json.put("overseas_rate_value", subRateObject(extRates.getBigDecimal("international_rate_value"), config.getIntValue("clean_days") + 1)); - }); - newConfig.put("ext_rates", extRateParams.toJSONString()); - } else { - List existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel); - existRate.stream().filter(existConfig -> { - if (existConfig.getDate("active_time").equals(config.getDate("active_time")) && existConfig.getDate("expiry_time").equals(config.getDate("expiry_time"))) { - return false; - } - return true; - } - ) - .forEach((rateLog) -> { - rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1)); - clientRateMapper.updateConfig(rateLog); - }); - } - if ("cb_bankpay".equalsIgnoreCase(channel)) { - if (newConfig.getBigDecimal("cb_bankpay_rate_value") != null) { - clientRateMapper.saveRate(newConfig); - } - } else if ("ApsInStore".equalsIgnoreCase(channel)) { - BigDecimal transactionFeeDecimal = config.getBigDecimal("retail_service_fee_value"); - TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator("ApsInStore")) - .map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal)) - .orElse(TransactionFee.ZERO); - newConfig.put("transaction_fee", transFee.storeValue()); - clientRateMapper.saveRate(newConfig); - } else if ("ApsCashier".equalsIgnoreCase(channel)) { - BigDecimal transactionFeeDecimal = config.getBigDecimal("online_service_fee_value"); - TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator("ApsCashier")) - .map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal)) - .orElse(TransactionFee.ZERO); - newConfig.put("transaction_fee", transFee.storeValue()); - clientRateMapper.saveRate(newConfig); - } else { - clientRateMapper.saveRate(newConfig); - } - logger.info("{}的{}费率设置成功", clientId, channel); - } - } - - private JSONObject subRateObject(BigDecimal rate, int cleanDays) { - JSONObject subRate = new JSONObject(); - subRate.put("rate", rate); - subRate.put("clean_days", cleanDays); - return subRate; - } - - @Override - @Transactional - public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject configJson = config.toJSON(); - BigDecimal transactionFeeDecimal = config.getTransactionFee(); - TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator(config.getRateName())) - .map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal)) - .orElse(TransactionFee.ZERO); - configJson.put("transaction_fee", transFee.storeValue()); - JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); - checkModifyRate(org, configJson, "Wechat", "min_wechat_rate"); - checkModifyRate(org, configJson, "Alipay", "min_alipay_rate"); - checkModifyRate(org, configJson, "AlipayOnline", "min_alipayonline_rate"); - configJson.put("client_rate_id", rateId); - configJson.put("manager_id", manager.getString("manager_id")); - configJson.put("manager_name", manager.getString("username")); - configJson.put("update_time", new Date()); - if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getRateName())) { - JSONObject extParams = configJson.getJSONObject("ext_rates"); - - JSONObject domesticRate = subRateObject(config.getRateValue(), config.getCleanDays()); - extParams.put("domestic_rate_value", domesticRate); - configJson.put("ext_rates", extParams.toJSONString()); - } - clientRateMapper.updateConfig(configJson); - if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getRateName())) { - return; - } - int clientId = client.getIntValue("client_id"); - JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat"); - int cleanDays = changeRate.getIntValue("clean_days"); - if (cleanDays != client.getIntValue("clean_days")) { - clientModifySupport.processClientConfigModify(new ClearDaysModify(manager, clientMoniker, cleanDays)); - } - } - - private void checkModifyRate(JSONObject org, JSONObject configJson, String rateName, String rateValueKey) { - if (configJson.getString("rate_name").equals(rateName)) { - if (org.containsKey(rateValueKey)) { - if (configJson.getDouble("rate_value").compareTo(org.getDouble(rateValueKey)) < 0) { - - throw new ForbiddenException("费率参数小于旗下商户最低" + rateName + "费率,请重新输入"); - } - } - } - } - - private void checkAddRate(JSONObject config, String channel, String rateKey, JSONObject org, String rateValueKey) { - if (config.containsKey(rateKey)) { - if (org.containsKey(rateValueKey)) { - if (config.getBigDecimal(rateKey).compareTo(org.getBigDecimal(rateValueKey)) < 0) { - throw new ForbiddenException("费率参数小于旗下商户最低" + channel + "费率,请重新输入"); - } - } - } - } - - @Override - public List listSubClients(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - List listChildClients = clientMapper.listChildClients(client.getIntValue("client_id")); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - if (mchConfig.getBooleanValue("hide_sub_mch")) { - return new ArrayList<>(); - } - if (mchConfig.getBooleanValue("level3_mch_config")) { - for (JSONObject partner : listChildClients) { - List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); - if (!clients.isEmpty()) { - partner.put("level3Clients", clients); - clients.forEach(e -> e.put("parent_client_moniker", partner.getString("client_moniker"))); - } - } - } - return listChildClients; - } - - @Override - public JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker, String searchText, int page) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - - PageBounds pageBounds; - pageBounds = new PageBounds(page, 20, Order.formString("create_time.desc")); - JSONObject params = JsonHelper.newJson(json -> json.put("parent_client_id", client.getIntValue("client_id"))); - if (StringUtils.isNotBlank(searchText)) { - params.put("search_text", searchText); - } - PageList childClients = clientMapper.listChildClientsByPage(params, pageBounds); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - if (mchConfig.getBooleanValue("level3_mch_config")) { - for (JSONObject partner : childClients) { - List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); - if (!clients.isEmpty()) { - partner.put("level3Clients", clients); - clients.forEach(e -> e.put("parent_client_moniker", partner.getString("client_moniker"))); - } - } - } - return PageListUtils.buildPageListResult(childClients); - - } - - @Override - @Cacheable(value = ":sub_clients:", key = "''+#clientId") - public List listSubClients(int clientId) { - return clientMapper.listChildClients(clientId); - } - - - @Override - public void toggleAccountReceiveNoticeByOpenId(String openid, boolean enable) { - JSONObject account = getAccountByOpenId(openid); - toggleAccountReceiveNotice(null, account.getString("account_id"), enable); - } - - private String bindWechatUserKey(String randomKey) { - return redisPrefix + ":bind_wechat_user:" + randomKey; - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @Override - public void validateClients(int clientId, JSONObject params) throws Exception { - if (params.containsKey("client_ids") && params.getString("client_ids") != null) { - String[] client_ids = (String[]) params.get("client_ids"); - if (client_ids.length == 1) { - if (client_ids[0].equals(String.valueOf(clientId))) { - return; - } - } - for (String currentClientId : client_ids) { - JSONObject clientInfo = getClientInfo(Integer.parseInt(currentClientId)); - if (clientInfo.containsKey("parent_client_id")) { - int parentClientId = clientInfo.getIntValue("parent_client_id"); - if (parentClientId != clientId && clientId != Integer.parseInt(currentClientId) && !listLevel3Client(clientId).contains(parentClientId)) { - throw new Exception("partner has no permission"); - } - } - } - } - } - - @Override - public List listLevel3Client(int clientId) { - return clientMapper.childClientId(clientId); - } - - @Override - public void updateRefundCreditLine(JSONObject manager, String clientMoniker, JSONObject refundLineInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - OrgCheckUtils.checkOrgPermission(manager, client); - int clientId = client.getIntValue("client_id"); - BigDecimal refundCreditLine = refundLineInfo.getBigDecimal("refund_credit_line"); - client.put("refund_credit_line", refundCreditLine); - clientMapper.update(client); - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public JSONObject getComplianceFiles(JSONObject account) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject file = signInAccountService.checkAuthFileStatus(client); - JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")); - file.put("file_company", compliance); - JSONObject photoInfo = new JSONObject(); - photoInfo.put("company_photo", client.getString("company_photo")); - photoInfo.put("store_photo", client.getString("store_photo")); - photoInfo.put("web_site", client.getString("company_website")); - if (compliance != null) { - if (StringUtils.isNotBlank(compliance.getString("company_photo"))) { - photoInfo.put("company_photo", compliance.getString("company_photo")); - } - if (StringUtils.isNotBlank(compliance.getString("store_photo"))) { - photoInfo.put("store_photo", compliance.getString("store_photo")); - } - if (StringUtils.isNotBlank(compliance.getString("company_website"))) { - photoInfo.put("web_site", compliance.getString("company_website")); - } - } - file.put("photo_info", photoInfo); - return file; - } - - @Override - public JSONObject getKycFiles(JSONObject account) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject file = signInAccountService.checkKycFileStatus(client, account, "client"); - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id")); - file.put("file_company", compliance); - return file; - } - - @Override - public JSONObject getClientInfoByAggree(JSONObject account) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); - JSONObject sysConfigRate = JSON.parseObject(rateConfig); - - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject cbBankPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay"); - if (cbBankPayRate != null) { - client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - } catch (Exception ignored) { - throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service"); - } - JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); - if (bankAccount == null || bankAccount.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", bankAccount.getString("bank")); - client.put("bsb_no", bankAccount.getString("bsb_no")); - client.put("account_no", bankAccount.getString("account_no")); - client.put("account_name", bankAccount.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - } - return client; - } - - @Override - public JSONObject getComplianceFilesForClient(JSONObject account) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - - JSONObject file = clientComplianceApply.complianceAuthFile(client); - file.put("file_company", clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id"))); - file.put("client", client); - return file; - } - - @Override - public JSONObject getKycFilesForBD(JSONObject client, JSONObject manager, String sourceType) { - JSONObject file = new JSONObject(); - file.put("file", signInAccountService.checkKycFileStatus(client, manager, sourceType)); - file.put("file_company", clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"))); - file.put("client", client); - return file; - } - - @Override - @Transactional - public void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - String managerId = manager.getString("manager_id"); - updateBD(managerId, data, client); - - List subClients = clientMapper.listChildClients(client.getIntValue("client_id")); - for (JSONObject subClient : subClients) { - updateBD(managerId, data, subClient); - } - } - - @Transactional - public void updateBD(String manager_id, JSONObject data, JSONObject client) throws Exception { - String type = data.getString("type").isEmpty() ? "add" : data.getString("type"); - List users = data.getJSONArray("users").toJavaList(JSONObject.class); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - params.put("end_date", null); - params.put("is_valid", "1"); - String start_date = DateFormatUtils.format(data.getDate("start_date"), "yyyy-MM-dd"); - List listClientBDUsers = clientBDMapper.listClientDB(params, new PageBounds(Order.formString("create_time.desc"))); - if (!listClientBDUsers.isEmpty()) { - JSONObject clientBDUser = listClientBDUsers.get(0); - clientBDUser.put("end_date", start_date); - if (type.equals("add") && (clientBDUser.getDate("end_date").getTime() < clientBDUser.getDate("start_date").getTime())) { - throw new Exception("The start_date must be larger than the last one"); - } - if (type.equals("edit")) { - // 查找最大日期并返回 - Date maxBDEndDate = clientBDMapper.findTheMaxBDCommissionEndDate(client.getIntValue("client_id")); - // System.err.print("系统最大时间:" + - // maxBDEndDate.getTime()+",修改时间:"+clientBDUser.getDate("end_date").getTime() + - // "客户端id:"+client.getIntValue("client_id")); - if (maxBDEndDate != null && clientBDUser.getDate("end_date").getTime() < maxBDEndDate.getTime()) { - throw new Exception("The start_date must be larger than the last one"); - } - clientBDUser.put("is_valid", "0"); - clientBDUser.remove("end_date"); - } - clientBDMapper.updateClientDB(clientBDUser); - } - String bd_id = ""; - String bd_name = ""; - for (JSONObject user : users) { - JSONObject client_bd = new JSONObject(); - client_bd.put("bd_id", user.getString("manager_id")); - client_bd.put("bd_name", user.getString("display_name")); - client_bd.put("client_id", client.getIntValue("client_id")); - client_bd.put("create_time", new Date()); - client_bd.put("create_id", manager_id); - client_bd.put("start_date", start_date); - client_bd.put("proportion", user.getDoubleValue("proportion")); - clientBDMapper.saveBD(client_bd); - bd_id = bd_id + user.getString("manager_id") + ","; - bd_name = bd_name + user.getString("display_name") + ","; - } - BDUserModify bdUserModify = new BDUserModify(managerMapper.findById(manager_id), client.getString("client_moniker"), - bd_id.substring(0, bd_id.length() - 1), bd_name.substring(0, bd_name.length() - 1)); - if (!users.isEmpty()) { - String bd_manager_id = users.get(0).getString("manager_id"); - JSONObject manager = managerMapper.findById(bd_manager_id); - bdUserModify.setOrg_id(manager.getIntValue("org_id")); - } - clientModifySupport.processClientModify(bdUserModify); - - } - - @Override - public List listClientDBUsers(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkClientOrg(manager, client); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - params.put("is_valid", "1"); - return clientBDMapper.listClientDB(params, new PageBounds(Order.formString("create_time.desc,proportion.desc"))); - } - - @Override - public JSONObject getQRCode(JSONObject manager, String clientMoniker, QRCodeConfig config) { - String url = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/payment/partners/" + clientMoniker); - if (config.isCNY()) { - url += "_CNY"; - } - url += config.extension(); - url += "?ver=" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss"); - JSONObject res = new JSONObject(); - res.put("url", url); - res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false)); - return res; - } - - @Override - public String getQrCodeBoard(JSONObject client, QRCodeConfig config, JSONObject account, String plantform) { - return merchantInfoProvider.getQrCodeBoard(client, config); - } - - @Override - public void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous, String plantform) { - JSONObject client = clientDetail(manager, clientMoniker); - try { - JSONObject qrboardConfig = new JSONObject(); - qrboardConfig.put("src", PlatformEnvironment.getEnv().concatUrl("/static/images/aggretage_aps_board.jpg")); - qrboardConfig.put("type", "royalpay"); - qrboardConfig.put("x", "835"); - qrboardConfig.put("y", "1290"); - qrboardConfig.put("size", "770"); - qrboardConfig.put("fontsize", "50"); - qrboardConfig.put("fontx", "1235"); - qrboardConfig.put("fonty", "2051"); - qrboardConfig.put("snsize", "50"); - qrboardConfig.put("snx", "1215"); - qrboardConfig.put("sny", "1320"); - qrboardConfig.put("brandx", "930"); - qrboardConfig.put("brandy", "1060"); - qrboardConfig.put("brandw", "600"); - qrboardConfig.put("brandh", "200"); - String type = qrboardConfig.getString("type"); - // QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, - // config,mongoTemplate,manager,plantform); - QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config); - board.drawBoardImage(ous); - } catch (Exception e) { - throw new ServerErrorException("QR board config not set for current organize", e); - } - } - - @Override - public void writeCBBankAggregateQrCodeBoard(JSONObject manager, String clientMoniker, OutputStream ous, String plantform) { - JSONObject client = clientDetail(manager, clientMoniker); - try { - JSONObject qrboardConfig = new JSONObject(); - qrboardConfig.put("src", PlatformEnvironment.getEnv().concatUrl("/static/images/cbbank_aggregate_qr_board.png")); - qrboardConfig.put("type", "royalpay"); - qrboardConfig.put("x", "835"); - qrboardConfig.put("y", "1290"); - qrboardConfig.put("size", "770"); - qrboardConfig.put("fontsize", "50"); - qrboardConfig.put("fontx", "1235"); - qrboardConfig.put("fonty", "2051"); - qrboardConfig.put("snsize", "50"); - qrboardConfig.put("snx", "1215"); - qrboardConfig.put("sny", "1320"); - qrboardConfig.put("brandx", "930"); - qrboardConfig.put("brandy", "1060"); - qrboardConfig.put("brandw", "600"); - qrboardConfig.put("brandh", "200"); - String type = qrboardConfig.getString("type"); - // QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, - // config,mongoTemplate,manager,plantform); - QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, new QRCodeConfig()); - board.drawCBBankBoardImage(ous); - } catch (Exception e) { - throw new ServerErrorException("QR board config not set for current organize", e); - } - } - - @Override - public void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous, String plantform) { - JSONObject client = clientDetail(manager, clientMoniker); - JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); - try { - String qrBoardConfigString = org.getString("qrboard"); - if (qrBoardConfigString == null) { - JSONObject royalpayOrg = orgMapper.findOne(1); - qrBoardConfigString = royalpayOrg.getString("qrboard"); - } - JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString); - - String type = qrboardConfig.getString("type"); - // QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, - // config,mongoTemplate,manager,plantform); - QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config); - board.drawBoardImage(ous); - } catch (Exception e) { - throw new ServerErrorException("QR board config not set for current organize", e); - } - } - - @Override - public void writePoster(JSONObject manager, String clientMoniker, OutputStream ous) { - JSONObject client = clientDetail(manager, clientMoniker); - try { - HttpRequestResult boardBackgroundResult = new HttpRequestGenerator(PlatformEnvironment.getEnv().concatUrl("/static/images/post.jpg"), - RequestMethod.GET).execute(); - if (boardBackgroundResult.isSuccess()) { - InputStream ins = boardBackgroundResult.getResponseContentStream(); - BufferedImage background = ImageIO.read(ins); - IOUtils.closeQuietly(ins); - // Graphics g = background.getGraphics(); - // drawPosterLogo(client, g); - // g.dispose(); - ImageIO.write(background, "jpeg", ous); - ous.flush(); - IOUtils.closeQuietly(ous); - } - } catch (IOException e) { - throw new ServerErrorException("Error", e); - } - } - - @Override - public void writeAggregatePoster(JSONObject manager, String clientMoniker, OutputStream ous) { - JSONObject client = clientDetail(manager, clientMoniker); - try { - String url = PlatformEnvironment.getEnv().concatUrl("/static/images/new_aggregate_poster.png"); - logger.debug("downloading aggregate poster from {}--{}", clientMoniker, url); - HttpRequestResult boardBackgroundResult = new HttpRequestGenerator( - url, RequestMethod.GET).execute(); - if (boardBackgroundResult.isSuccess()) { - try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { - InputStream ins = boardBackgroundResult.getResponseContentStream(); - BufferedImage background = ImageIO.read(ins); - IOUtils.closeQuietly(ins); - logger.debug("aggregate image size {}x{}", background.getWidth(), background.getHeight()); - BufferedImage img = new BufferedImage(background.getWidth(), background.getHeight(), BufferedImage.TYPE_3BYTE_BGR); - Graphics g = img.getGraphics(); - g.drawImage(background, 0, 0, null); - g.dispose(); - ImageIO.write(img, "jpeg", bos); - bos.flush(); - byte[] imageBytes = bos.toByteArray(); - logger.debug("aggregate image length {}", imageBytes.length); - ous.write(imageBytes); - IOUtils.closeQuietly(ous); - } - } else { - logger.error("get aggregate poster file failed:[{}]-{}", boardBackgroundResult.getStatusCode(), - boardBackgroundResult.getResponseContentString(), boardBackgroundResult.getException()); - } - } catch (IOException e) { - logger.error("get aggregate poster file failed:{}", e.getMessage(), e); - throw new ServerErrorException("Error", e); - } - } - - @Override - public void writeActivityPoster(JSONObject manager, String clientMoniker, String activityName, OutputStream ous) throws IOException { - JSONObject client = clientDetail(manager, clientMoniker); - ActivityPosterBuilder builder = ActivityPosterBuilder.Porvider.getBuilder(activityName); - if (builder != null) { - String actId = builder.actId(); - JSONObject invitation = actClientInvitationCodeMapper.getInvitationCode(actId, clientMoniker); - if (invitation == null) { - invitation = new JSONObject(); - invitation.put("client_id", client.getIntValue("client_id")); - invitation.put("client_moniker", clientMoniker.toUpperCase()); - invitation.put("act_id", actId); - invitation.put("invitation_code", RandomStringUtils.random(6, true, true).toUpperCase()); - actClientInvitationCodeMapper.save(invitation); - } - builder.writePoster(client, invitation, ous); - } else { - throw new BadRequestException("Invalid Activity Name"); - } - } - - private void drawPosterLogo(JSONObject client, Graphics g) { - String logoUrl = client.getString("logo_url"); - if (StringUtils.isNotEmpty(logoUrl)) { - try { - HttpRequestResult logoResult = new HttpRequestGenerator(logoUrl, RequestMethod.GET).execute(); - if (logoResult.isSuccess()) { - InputStream logoIns = logoResult.getResponseContentStream(); - BufferedImage logoImg = ImageIO.read(logoIns); - ImageUtils.drawImage(g, logoImg, 588, 1916, 2363, 960); - - } - } catch (IOException ignored) { - } - } - } - - @Override - public void updateTimeZone(JSONObject account, String clientMoniker, String timezone) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientModify(new TimeZoneModify(account, clientMoniker, timezone)); - } - - @Override - public JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String clientType, String[] clientIds) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - if (mchConfig.getBooleanValue("hide_mch_device")) { - return new JSONObject(); - } - if (remark != null) { - params.put("remark", remark); - } - if (clientType != null) { - params.put("client_type", clientType); - } - if (clientIds != null) { - params.put("client_ids", Arrays.asList(clientIds)); - params.remove("client_id"); - } else { - queryModifyClientIds(client.getIntValue("client_id"), params); - } - PageList devices = clientDeviceMapper.listClientDevices(params, new PageBounds(page, limit, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(devices); - } - - @Override - public JSONObject listClientDeviceIds(String clientMoniker, String clientType, String[] clientIds) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(null, client); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - if (mchConfig.getBooleanValue("hide_mch_device")) { - return new JSONObject(); - } - JSONObject params = new JSONObject(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - sdf.setTimeZone(TimeZone.getTimeZone(client.getString("timezone") != null ? client.getString("timezone") : "Australia/Melbourne")); - params.put("client_id", client.getIntValue("client_id")); - if (clientIds != null) { - params.put("client_ids", Arrays.asList(clientIds)); - params.remove("client_id"); - } else { - queryModifyClientIds(client.getIntValue("client_id"), params); - } - List deviceIds = clientDeviceMapper.listClientDeviceIds(params); - return JsonHelper.newJson(json -> json.put("data", deviceIds)); - } - - @Override - @Transactional - public void addDevice(JSONObject manager, String clientMoniker, JSONObject newDevice) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - String clientDevId = newDevice.getString("client_dev_id"); - JSONObject dev = clientDeviceMapper.findDeviceInfoByDeviceNo(clientDevId, InspiryPOSFinder.INSPIRY_DEVICE_TYPE); - if (dev != null) { - throw new ServerErrorException(clientDevId + "当前设备已被使用"); - } - newDevice.put("client_id", client.getString("client_id")); - newDevice.put("create_time", new Date()); - clientDeviceMapper.save(newDevice); - } - - @Override - public void verifyRefundPassword(JSONObject account, JSONObject json) { - JSONObject clientConfig = clientConfigMapper.find(account.getIntValue("client_id")); - String needVerifyPassword = json.getString("refund_password"); - String refundPwdSalt = clientConfig.getString("refund_pwd_salt"); - if (!StringUtils.equals(clientConfig.getString("refund_pwd"), PasswordUtils.hashPwd(needVerifyPassword, refundPwdSalt))) { - throw new BadRequestException("Incorrect refund password"); - } - } - - @Override - public void resetRefundPassword(JSONObject account, JSONObject json) { - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new BadRequestException("You have no permission"); - } - verifyRefundPassword(account, json); - String newSalt = PasswordUtils.newSalt(); - String newPassWord = json.getString("new_refund_password"); - if (!StringUtils.isNumeric(newPassWord)) { - throw new BadRequestException("Refund password must be pure number"); - } - String newPwdHash = PasswordUtils.hashPwd(newPassWord, newSalt); - if (StringUtils.equals(newPwdHash, PasswordUtils.hashPwd(json.getString("refund_password"), newSalt))) { - throw new BadRequestException("Old and new passwords cannot be duplicated"); - } - JSONObject update = new JSONObject(); - update.put("client_id", account.getIntValue("client_id")); - update.put("refund_pwd", newPwdHash); - update.put("refund_pwd_salt", newSalt); - clientConfigMapper.update(update); - } - - @Override - public void resetRefundPasswordByManage(String clientMoniker, JSONObject manage, JSONObject json) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject update = new JSONObject(); - update.put("client_id", client.getIntValue("client_id")); - String newPassWord = json.getString("new_refund_password"); - if (!StringUtils.isNumeric(newPassWord)) { - throw new BadRequestException("Refund password must be pure number"); - } - String newSalt = PasswordUtils.newSalt(); - String newPwdHash = PasswordUtils.hashPwd(newPassWord, newSalt); - update.put("refund_pwd", newPwdHash); - update.put("refund_pwd_salt", newSalt); - clientConfigMapper.update(update); - } - - @Override - public void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject dev = clientDeviceMapper.find(devId); - if (dev.getIntValue("client_id") != client.getIntValue("client_id")) { - throw new NotFoundException("设备不存在"); - } - dev.put("remark", remark); - clientDeviceMapper.update(dev); - } - - @Override - public void toggleDeviceAvailable(JSONObject manager, String clientMoniker, String devId, boolean enable) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject deviceInfo = clientDeviceMapper.find(devId); - if (deviceInfo.getIntValue("client_id") != client.getIntValue("client_id")) { - throw new NotFoundException("设备不存在"); - } - if (StringUtils.equals(InspiryPOSFinder.INSPIRY_DEVICE_TYPE, deviceInfo.getString("client_type")) && enable) { - JSONObject inspiryDevice = clientDeviceMapper.findDeviceInfoByDeviceNo(deviceInfo.getString("client_dev_id"), InspiryPOSFinder.INSPIRY_DEVICE_TYPE); - if (inspiryDevice != null) { - throw new ServerErrorException("当前设备已被使用"); - } - } - deviceInfo.put("is_valid", enable); - clientDeviceMapper.update(deviceInfo); - } - - @Override - public List listClientCurrentBDUsers(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - params.put("is_valid", "1"); - params.put("end_date", null); - return clientBDMapper.listClientDB(params, new PageBounds(Order.formString("create_time.desc,proportion.desc"))); - } - - @Override - public JSONObject getBankInfo(JSONObject manager, String clientMoniker, String bsbNo) { - Optional clientOptional = Optional.ofNullable(getClientInfoByMoniker(clientMoniker)); - - if (!clientOptional.isPresent()) { - throw new AustraliaBankClientNullException(); - } - - checkOrgPermission(manager, clientOptional.get()); - - AustraliaBankInfo bankInfo = AustraliaBank.getBankInfo(bsbNo); - - if (bankInfo.isNone()) { - return new JSONObject(); - } - - return new JSONObject() { - { - put("bsb", bankInfo.getBsb()); - put("valid", bankInfo.getValid()); - put("bank", bankInfo.getBank()); - put("address", bankInfo.getAddress()); - put("system", bankInfo.getSystem()); - put("city", bankInfo.getCity()); - put("postcode", bankInfo.getPostcode()); - put("state", bankInfo.getState()); - put("branch", bankInfo.getBranch()); - } - }; - } - - @Override - public void setMaxOrderAmount(JSONObject account, String clientMoniker, BigDecimal limit) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new MaxOrderAmountModify(account, clientMoniker, limit)); - } - - @Override - public void setCustomerSurchargeRate(JSONObject account, String clientMoniker, BigDecimal customerSurchargeRate) { - - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (customerSurchargeRate == null) { - clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, null)); - } else { - BigDecimal rate_value = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); - if (customerSurchargeRate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 - || customerSurchargeRate.compareTo(rate_value) <= 0) { - throw new ForbiddenException("Invalid Range"); - } - clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, customerSurchargeRate)); - } - } - - @Override - public void setOrderExpiryConfig(JSONObject account, 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 (orderExpiryConfig != null) { - OrderExpiryRuleResolver.resolveExpiryTime(orderExpiryConfig, new Date()); - clientModifySupport.processClientConfigModify(new OrderExpiryModify(account, clientMoniker, orderExpiryConfig)); - } - } - - @Override - @Transactional - public void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - String address = client.getString("address") + "," + client.getString("suburb") + ',' + client.getString("state") + ',' + client.getString("postcode"); - client.remove("address"); - client.put("address", address); - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "Australia Company Number (ACN) :"); - } else { - client.put("acn_type", "Australia Business Number (ABN) :"); - client.put("acn", client.getString("abn")); - } - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("rate_value", rate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + rate.getString("clean_days")); - client.put("clean_days", rate.getString("clean_days")); - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(agreetemplatePdfPath); - pdu.setPdfTemplate(client); - File file = new File(clientMoniker + "_agreement.pdf"); - try (ByteArrayOutputStream bos = pdu.templetPdfBos(file); - InputStream stream = new ByteArrayInputStream(bos.toByteArray())) { - JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_agreement.pdf", false); - importAgreeFile(clientMoniker, manager, fileRes.getString("url"), false); - } catch (Exception e) { - logger.error("合同制作出现问题:", e); - } - } - - @Override - @Transactional - public void getAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - client.put("located_country", "Australia"); - if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) { -// clean_1 clean_1_friday clean_1_saturday - // second, third or fourth - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - } else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - } else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - JSONObject alipayApsCashierRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_CASHIER.getChannelCode()); - if (alipayApsCashierRate != null) { - client.put("aps_cashier_rate", alipayApsCashierRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN) + "%"); - client.put("aps_cashier_service_rate", alipayApsCashierRate.getBigDecimal("transaction_fee").multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.DOWN) + "%"); - } - JSONObject alipayApsInstoreRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()); - if (alipayApsInstoreRate != null) { - client.put("aps_instore_rate", alipayApsInstoreRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN) + "%"); - client.put("aps_instore_service_rate", alipayApsInstoreRate.getBigDecimal("transaction_fee").multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.DOWN) + "%"); - client.put("alipayplus_clean", alipayApsInstoreRate.getString("clean_days")); - } - } catch (Exception ignored) { - // do nothing - } - - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); - pdu.setPdfTemplate(client); - try { - File file = new File(clientMoniker + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - InputStream stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_" + System.currentTimeMillis() + "_agreement.pdf", false); - if (fileRes != null) { - importAgreeFile(clientMoniker, manager, fileRes.getString("url"), renewal); - } - stream.close(); - } catch (Exception e) { - logger.error("合同制作出现问题:", e); - } - } - - @Override - @Transactional - public void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - exportLetterOfferPDF(clientMoniker, manager); -// exportTermsConditionsPDF(clientMoniker, manager); - - if (!renewal) { - JSONObject cardFlow = sysClientUpayProfileMapper.findInfo(client.getInteger("client_id")); - cardFlow.put("upay_open_status", 2); - sysClientUpayProfileMapper.update(cardFlow); - } - if (manager != null) { - saveClientAuditProcess(client.getIntValue("client_id"), 1, 2, "Compliance合同制作中", manager, 2); - } - } - - @Override - @Transactional - public void getAggregateCardAgreeFileAgain(String clientMoniker, JSONObject manager) throws Exception { - logger.info("========>重新制作卡支付合同"); - exportLetterOfferPDF(clientMoniker, manager); - logger.info("========>卡支付合同制作完成"); - - } - - @Override - @Transactional - public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String rateid, HttpServletResponse httpResponse) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - exportPromotionalOfferPDF(clientMoniker, manager, rateid, httpResponse); - } - - @Override - public void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - List clientRate = clientRateMapper.latestConfig(client.getIntValue("client_id"), null); - if (CollectionUtils.isEmpty(clientRate)) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - clientRate.forEach((p) -> { - String rate_name = p.getString("rate_name"); - if ("Wechat".equals(rate_name)) { - client.put("wechat_rate", p.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + p.getString("clean_days")); - client.put("clean_days", p.getString("clean_days")); - if ("1".equalsIgnoreCase(p.getString("clean_days"))) { - client.put("clean_1", p.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - } else if ("2".equalsIgnoreCase(p.getString("clean_days"))) { - client.put("clean_1", p.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - } else if ("3".equalsIgnoreCase(p.getString("clean_days"))) { - client.put("clean_1", p.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - } else if ("Alipay".equals(rate_name)) { - client.put("alipay_rate", p.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } else if ("AlipayOnline".equals(rate_name)) { - client.put("alipay_online_rate", p.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - }); - - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - client.put("located_country", "Australia"); - - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); - pdu.setPdfTemplate(client); - try { - File file = new File(clientMoniker + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - InputStream stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_" + System.currentTimeMillis() + "_agreement.pdf", false); - if (fileRes != null) { - importAgreeFile(clientMoniker, manager, fileRes.getString("url"), renewal); - } - stream.close(); - } catch (Exception e) { - logger.error("合同制作出现问题:", e); - } - } - - @Override - public void temporaryExportPdf(String clientMoniker, JSONObject manager, HttpServletResponse httpResponse) throws Exception { - httpResponse.setContentType("application/pdf"); - httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_AGREEMENT_" + new Date() + ".pdf"); - ServletOutputStream sos = httpResponse.getOutputStream(); - - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - client.put("located_country", "Australia"); - if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) { -// clean_1 clean_1_friday clean_1_saturday - // second, third or fourth - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - } else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - } else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - } catch (Exception ignored) { - // do nothing - } - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); - pdu.setPdfTemplate(client); - File file = new File(clientMoniker + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - sos.write(bos.toByteArray()); - sos.close(); - } - - @Override - @Transactional - public void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile, boolean renewal) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (sourceFile != null) { - List existFiles = clientFilesMapper.findFileByClientAndType(client.getIntValue("client_id"), SOURCE_AGREE_FILE); - JSONObject existFile = null; - if (!CollectionUtils.isEmpty(existFiles)) { - existFile = existFiles.get(0); - } - Date now = new Date(); - JSONObject file = new JSONObject(); - file.put("file_name", SOURCE_AGREE_FILE); - file.put("file_value", sourceFile); - file.put("client_id", client.getIntValue("client_id")); - file.put("last_update_date", now); - file.put("status", 1); - file.put("is_valid", 1); - if (manager == null) { - file.put("last_update_by", "System Import"); - } else { - file.put("last_update_by", manager.getString("display_name")); - } - JSONObject contract = clientsContractMapper.findByClientId(client.getIntValue("client_id")); - if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 || !contract.getBoolean("has_sign") || existFile == null - || existFile.isEmpty()) { - clientFilesMapper.save(file); - } else { - file.put("file_id", existFile.getString("file_id")); - clientFilesMapper.update(file); - } - if (!renewal) { - clientModifySupport.processClientModify(new OpenStatusModify(manager, clientMoniker, 2)); - } - - if (manager != null) { - saveClientAuditProcess(client.getIntValue("client_id"), 1, 2, "Compliance合同制作中", manager, 1); - } - } - } - - @Override - public void completeAgree(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List existFiles = clientFilesMapper.findFileByClientAndType(client.getIntValue("client_id"), SOURCE_AGREE_FILE); - if (CollectionUtils.isEmpty(existFiles)) { - throw new BadRequestException("The Agree File is not Complete!"); - } - client.put("open_status", 3); - clientModifySupport.processClientModify(new OpenStatusModify(manager, clientMoniker, 3)); - saveClientAuditProcess(client.getIntValue("client_id"), 2, 3, "合同制作完成,等待BD处理", manager, 1); - // sendAgreeFileMsgToBD(client,null); - sendCommissionWechatMessage(client); - } - - @Override - public void cardCompleteAgree(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List existLeffterFiles = clientFilesMapper.findFileByClientAndType(client.getIntValue("client_id"), LETTER_OF_OFFER_FILE); -// List existConditionsFiles = clientFilesMapper.findFileByClientAndType(client.getIntValue("client_id"), TERMS_AND_CONDITIONS_FILE); - if (CollectionUtils.isEmpty(existLeffterFiles)) { - throw new BadRequestException("The Agree File is not Complete!"); - } - JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(client.getInteger("client_id")); - cardFlowInfo.put("upay_open_status", 3); - sysClientUpayProfileMapper.update(cardFlowInfo); - saveClientAuditProcess(client.getIntValue("client_id"), 2, 3, "合同制作完成,等待BD处理", manager, 2); - sendCardCommissionWechatMessage(client); - } - - @Override - public void downloadComplianceZip(String clientMoniker, HttpServletResponse response) throws Exception { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List files = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - if (files != null && !files.isEmpty()) { - List filePaths = new ArrayList<>(); - for (JSONObject file : files) { - filePaths.add(file.getString("file_value")); - } - try { - String downloadFilename = clientMoniker + "_Compliance_Files_" + DateFormatUtils.format(new Date(), "dd/MM/yyyy HH:mm:ss").toString() + ".zip";// 文件的名称 - logger.info("正在下载合规文件=====>" + downloadFilename); - // downloadFilename = URLEncoder.encode(downloadFilename, "UTF-8");//转换中文否则可能会产生乱码 - response.setContentType("application/octet-stream");// 指明response的返回对象是文件流 - response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename);// 设置在下载框默认显示的文件名 - ZipOutputStream zos = new ZipOutputStream(response.getOutputStream()); - for (String file : filePaths) { - URL url = new URL(file); - zos.putNextEntry(new ZipEntry(file.substring(file.lastIndexOf("/")))); - InputStream fis = url.openConnection().getInputStream(); - byte[] buffer = new byte[1024]; - int r = 0; - while ((r = fis.read(buffer)) != -1) { - zos.write(buffer, 0, r); - } - fis.close(); - } - zos.flush(); - zos.close(); - logger.info("合规文件下载成功=====>" + downloadFilename); - } catch (IOException e) { - logger.error("合规文件下载失败", e); - - } - } - } - - @Override - public void downloadMWComplianceZip(String clientMoniker, HttpServletResponse response) throws Exception { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List files = clientMWAuthFilesInfo.findClientFile(client.getIntValue("client_id"), new PageBounds(1, 999999, Order.formString("last_update_date.asc"))); - if (files != null && !files.isEmpty()) { - List filePaths = new ArrayList<>(); - for (JSONObject file : files) { - filePaths.add(file.getString("file_value")); - } - try { - String downloadFilename = clientMoniker + "_Compliance_Files_" + DateFormatUtils.format(new Date(), "dd/MM/yyyy HH:mm:ss").toString() + ".zip";// 文件的名称 - logger.info("正在下载合规文件=====>" + downloadFilename); - // downloadFilename = URLEncoder.encode(downloadFilename, "UTF-8");//转换中文否则可能会产生乱码 - response.setContentType("application/octet-stream");// 指明response的返回对象是文件流 - response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename);// 设置在下载框默认显示的文件名 - ZipOutputStream zos = new ZipOutputStream(response.getOutputStream()); - for (String file : filePaths) { - URL url = new URL(file); - zos.putNextEntry(new ZipEntry(file.substring(file.lastIndexOf("/")))); - InputStream fis = url.openConnection().getInputStream(); - byte[] buffer = new byte[1024]; - int r = 0; - while ((r = fis.read(buffer)) != -1) { - zos.write(buffer, 0, r); - } - fis.close(); - } - zos.flush(); - zos.close(); - logger.info("合规文件下载成功=====>" + downloadFilename); - } catch (IOException e) { - logger.error("合规文件下载失败", e); - - } - } - } - - @Override - public void configMasterMerchant(JSONObject manager, String clientMoniker, String masterMerchant) { - - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - if (StringUtils.isNotBlank(masterMerchant)) { - // throw new NotFoundException("Invalid Input"); - JSONObject master_client = getClientInfoByMoniker(masterMerchant); - if (master_client == null) { - throw new InvalidShortIdException(); - } - if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) { - throw new BadRequestException("Master Merchant is not valid"); - } - clientModifySupport.processClientModify(new ParentIdModify(manager, clientMoniker, master_client.getIntValue("client_id"))); - } else { - clientModifySupport.processClientModify(new ParentIdModify(manager, clientMoniker, null)); - } - } - - @Override - public void updateRefundPwd(JSONObject account, String pwd) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new BadRequestException("Client Not Found"); - } - String salt = PasswordUtils.newSalt(); - String pwdHash = PasswordUtils.hashPwd(pwd, salt); - JSONObject record = new JSONObject(); - record.put("client_id", client.getIntValue("client_id")); - record.put("refund_pwd", pwdHash); - record.put("refund_pwd_salt", salt); - clientConfigService.update(record); - clientModifySupport.processClientConfigModify(new RefundPWDModify(account, client.getString("client_moniker"), pwd, salt)); - } - - @Override - public void validRefundPwd(JSONObject account, String pwd) { - JSONObject clientConfig = clientConfigService.find(account.getIntValue("client_id")); - String salt = clientConfig.getString("refund_pwd_salt"); - String pwdHash = PasswordUtils.hashPwd(pwd, salt); - if (!clientConfig.getString("refund_pwd").equals(pwdHash)) { - throw new ForbiddenException("Invalid Pwd"); - } - } - - @Override - public void setWeekendDelay(JSONObject account, String clientMoniker, int clientId, boolean delay) { - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "weekend_delay", delay)); - } - - @Override - public void setClientQRCodePaySurCharge(JSONObject account, String clientMoniker, boolean paySurcharge) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "qrcode_surcharge", paySurcharge)); - } - - @Override - public void setClientApiPaySurCharge(JSONObject account, String clientMoniker, boolean enableApiSurcharge) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "api_surcharge", enableApiSurcharge)); - - } - - @Override - public void setClientRetailPaySurCharge(JSONObject account, String clientMoniker, boolean paySurcharge) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "retail_surcharge", paySurcharge)); - - } - - @Override - public void setClientCBBankPaySurCharge(JSONObject account, String clientMoniker, boolean paySurcharge) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "cbbank_surcharge", paySurcharge), true); - - } - - @Override - public void setClientTaxInSurcharge(JSONObject account, String clientMoniker, boolean taxInSurcharge) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "tax_in_surcharge", taxInSurcharge)); - } - - @Override - public void setClientPreSettle(JSONObject manager, String clientMoniker, boolean presettle) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientModify(new SwitchAllowSurchargeCreditModify(manager, clientMoniker, "enable_presettle", presettle)); - } - - @Override - public void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "customer_tax_free", customerTaxFree)); - } - - @Override - public List listClientsForSettlement() { - return clientMapper.listClientsForSettlement(); - } - - @Override - public List listClientsDetailsForSettlement() { - return clientMapper.listClientsForSettlementWithDetail(); - } - - @Override - public void updateClientCleanDays(int clientId, int cleanDays) { - clientMapper.updateCleanDays(clientId, cleanDays); - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public void updateClientEmail(int clientId, String contactEmail) { - clientMapper.updateClientEmail(clientId, contactEmail); - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public void disableClient(String clientMoniker, JSONObject manager) { - JSONObject client = clientDetail(manager, clientMoniker); - clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false)); - } - - @Override - public void revertClient(String clientMoniker, JSONObject manager) { - JSONObject client = clientDetail(manager, clientMoniker); - clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, true)); - } - - @Override - public void updateClientIdInfo(String clientMoniker, JSONObject params, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - params.put("display_name", manager.getString("display_name")); - clientApproveIdInfo(params, client); - } - - @Override - public void updateMWRiskInfoByClient(String clientMoniker, JSONObject params, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - params.put("client_id", client.getIntValue("client_id")); - params.put("client_moniker", client.getString("client_moniker")); - JSONObject upayInfo = sysClientUpayProfileMapper.findInfo(clientId); - if (upayInfo == null) { - sysClientUpayProfileMapper.save(params); - } else { - sysClientUpayProfileMapper.update(params); - } - } - - @Override - public void checkTodo(JSONObject manager, List notices) { - if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { - PartnerQuery query = new PartnerQuery(); - query.setIs_valid(true); - query.setApproving(true); - JSONObject clients = listClients(manager, query); - if (clients.getJSONArray("data").size() > 0) { - String msg = LocaleSupport.localeMessage("todo.client.approve"); - notices.add(new TodoNotice("clients", msg, "#/partners")); - } - } - - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && manager.getIntValue("org_id") == 1) { - PartnerQuery query = new PartnerQuery(); - query.setIs_valid(true); - query.setGreenChannelAndBDtodo(true); - JSONObject clients = listClients(manager, query); - if (clients.getJSONArray("data").size() > 0) { - String msg = LocaleSupport.localeMessage("todo.client.greenchannel"); - notices.add(new TodoNotice("clients", msg, "#/partners")); - } - } - } - - @Override - public JSONObject getAuthFiles(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - for (JSONObject file : clientFiles) { - fileJson.put(file.getString("file_name"), file.getString("file_value")); - } - String[] fileKeys = {"kyc_utility_bill_file"}; - if (!clientFiles.isEmpty()) { - for (String fileKey : fileKeys) { - List clientFileUrl = clientFiles.stream() - .filter(json -> (fileKey.equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - fileJson.put(fileKey, clientFileUrl); - } - } - } - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (compliance != null) { - fileJson.putAll(compliance); - } - fileJson.put("beneficiary_id_title_list", "Ultimate beneficiary owner,CEO,Director,General Manager,Other"); - return fileJson; - } - - @Override - public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject sourceFile = clientFilesMapper.getSourceAgreeFilesByClientId(client.getIntValue("client_id")); - if (sourceFile != null) { - sourceFile.put(sourceFile.getString("file_name"), sourceFile.getString("file_value")); - } - return sourceFile; - } - - @Override - public JSONObject getSourceCardAgreeFiles(String clientMoniker, JSONObject manager, String fileName) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject sourceFile = clientFilesMapper.getSourceCardAgreeFilesByClientId(client.getIntValue("client_id"), fileName); - if (sourceFile != null) { - sourceFile.put(sourceFile.getString("file_name"), sourceFile.getString("file_value")); - } - return sourceFile; - } - - @Override - public JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file", "kyc_utility_bill_file"}; - if (client == null) { - throw new InvalidShortIdException(); - } - List clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - if (clientFiles != null && !clientFiles.isEmpty()) { - for (String fileKey : fileKeys) { - List clientFileUrl = clientFiles.stream() - .filter(json -> (fileKey.equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - fileJson.put(fileKey, clientFileUrl); - } - } - } - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (compliance != null) { - fileJson.putAll(compliance); - } - fileJson.put("beneficiary_id_title_list", "Ultimate beneficiary owner,CEO,Director,General Manager,Other"); - return fileJson; - } - - @Override - public JSONObject getMWAuthFiles(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String[] fileKeys = UPayAuthFileEnum.ALL.getFileNameArrays(); - List clientFiles = clientMWAuthFilesInfo.findClientFile(client.getIntValue("client_id"), new PageBounds(1, 999999, Order.formString("last_update_date.asc"))); - JSONObject fileJson = new JSONObject(); - if (clientFiles != null && !clientFiles.isEmpty()) { - for (String fileKey : fileKeys) { - List clientFileUrl = clientFiles.stream() - .filter(json -> (fileKey.equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - fileJson.put(fileKey, clientFileUrl); - } - } - } - return fileJson; - } - - @Override - public JSONObject getAllKycFiles(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - String[] fileKeys = {"client_company_file", "kyc_utility_bill_file", "client_id_file"}; - if (client == null) { - throw new InvalidShortIdException(); - } - List clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - JSONObject companyFile = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - fileJson.put("companyFile", companyFile); - if (clientFiles != null && !clientFiles.isEmpty()) { - for (String fileKey : fileKeys) { - List clientFileUrl = clientFiles.stream() - .filter(json -> (fileKey.equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - fileJson.put(fileKey, clientFileUrl); - } - } - } - return fileJson; - } - - - @Override - public JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file"}; - if (client == null) { - throw new InvalidShortIdException(); - } - List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - if (clientFiles != null && !clientFiles.isEmpty()) { - for (String fileKey : fileKeys) { - List clientFileUrl = clientFiles.stream() - .filter(json -> (fileKey.equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - params.put("status", json.getIntValue("status")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - fileJson.put(fileKey, clientFileUrl); - } - } - } - return fileJson; - - } - - @Override - public void deleteAuthFiles(String fileId) { - JSONObject file = clientFilesMapper.findFileById(fileId); - if (file.getIntValue("status") == 1 || file.getIntValue("status") == 2) { - throw new BadRequestException("The file has passed and cannot be deleted"); - } - clientFilesMapper.deleteByClientAndFileId(fileId); - } - - @Override - public void deleteAuthFilesByAdmin(String fileId) { - JSONObject file = clientFilesMapper.findFileById(fileId); - if (file == null) { - throw new BadRequestException("The file has deleted"); - } - clientFilesMapper.deleteByClientAndFileId(fileId); - } - - @Override - public void deleteMWAuthFilesByAdmin(String fileId) { - JSONObject file = clientMWAuthFilesInfo.findFileById(fileId); - if (file == null) { - throw new BadRequestException("The file has deleted"); - } - clientMWAuthFilesInfo.deleteByClientAndFileId(fileId); - } - - @Override - @Transactional - public void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateSysClientFiles(manager, clientId, CLIENT_AGREE_FILE, filesInfo.getFile_agreement_info()); - updateSysClientFiles(manager, clientId, CLIENT_APPLY_FILE, filesInfo.getFile_apply_info()); - updateSysClientFilesWithoutRepeat(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info()); - updateSysClientFilesWithoutRepeat(manager, clientId, CLIENT_COMPANY_FILE, filesInfo.getFile_company_info()); - updateSysClientFilesWithoutRepeat(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info()); - updateSysClientFiles(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info()); - } catch (Exception e) { - logger.error("上传合规文件失败", e); - } - // boolean clientSource = client.getIntValue("source") == 4 ? true : false; - // if (filesInfo.getAuthStatus() == 1 && clientSource) { - // client.put("approve_result", 3); - // clientMapper.update(client); - // } - JSONObject params = filesInfo.toIdInfoJson(); - if (params != null) { - params.put("display_name", manager.getString("display_name")); - clientApproveIdInfo(params, client); - } - } - - @Override - @Transactional - public void uploadAuthFilesManager(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateSysClientFiles(manager, clientId, CLIENT_AGREE_FILE, filesInfo.getFile_agreement_info()); - updateSysClientFiles(manager, clientId, CLIENT_APPLY_FILE, filesInfo.getFile_apply_info()); - updateSysClientFiles(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info()); - updateSysClientFiles(manager, clientId, CLIENT_COMPANY_FILE, filesInfo.getFile_company_info()); - updateSysClientFiles(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info()); - updateSysClientFiles(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info()); - } catch (Exception e) { - logger.error("上传合规文件失败", e); - } - // boolean clientSource = client.getIntValue("source") == 4 ? true : false; - // if (filesInfo.getAuthStatus() == 1 && clientSource) { - // client.put("approve_result", 3); - // clientMapper.update(client); - // } - JSONObject params = filesInfo.toIdInfoJson(); - if (params != null) { - params.put("display_name", manager.getString("display_name")); - clientApproveIdInfo(params, client); - } - } - - @Override - @Transactional - public void uploadMWAuthFilesManager(JSONObject manager, String clientMoniker, ClientMWAuthFilesInfo filesInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.CLIENT_BANK_FILE.getFileName(), filesInfo.getClient_bank_file()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.CLIENT_COMPANY_FILE.getFileName(), filesInfo.getClient_company_file()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_DRIVER_LICENSE.getFileName(), filesInfo.getUpay_driver_license()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.REFUND_EXCHANGE_POLICY.getFileName(), filesInfo.getRefund_exchange_policy()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_PRIVACY_POLICY.getFileName(), filesInfo.getUpay_privacy_policy()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.CARD_SECURITY_POLICY.getFileName(), filesInfo.getCard_security_policy()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_OFFER_LETTER.getFileName(), filesInfo.getUpay_offer_letter()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_PROMOTIONAL_OFFER.getFileName(), filesInfo.getUpay_promotional_offer()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_TERMS_CONDITIONS.getFileName(), filesInfo.getUpay_terms_conditions()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.KYC_UTILITY_BILL_FILE.getFileName(), filesInfo.getKyc_utility_bill_file()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_APPLICATION_FORM.getFileName(), filesInfo.getUpay_application_form()); - updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_DESC_FILE.getFileName(), filesInfo.getUpay_desc_file()); - } catch (Exception e) { - logger.error("上传合规文件失败", e); - } - } - - @Override - @Transactional - public void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateSysClientFiles(manager, clientId, CLIENT_COMPANY_FILE, filesInfo.getFile_company_info()); - updateSysClientFiles(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info()); - updateSysClientFiles(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info()); - } catch (Exception e) { - logger.error("上传合规文件失败", e); - } - } - - @Override - @Transactional - public List uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - List fileResult = new ArrayList<>(); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateAggregateFilesForWaitCompliance(manager, clientId, CLIENT_AGREE_FILE, filesInfo.getFile_agreement_info(), fileResult); - updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_APPLY_FILE, filesInfo.getFile_apply_info(), fileResult); - updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info(), fileResult); - updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_COMPANY_FILE, filesInfo.getFile_company_info(), fileResult); - updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info(), fileResult); - } catch (Exception e) { - logger.error("上传合规文件失败", e); - throw new BadRequestException("合同制作出现问题:" + e.getMessage()); - } - return fileResult; - } - - @Override - @Transactional - public List uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - List fileResult = new ArrayList<>(); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateFilesForWaitAuditWithoutRepeat(manager, clientId, CLIENT_COMPANY_FILE, filesInfo.getFile_company_info(), fileResult); - updateFilesForWaitAuditWithoutRepeat(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info(), fileResult); - updateSysClientFilesForWaitCompliance(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info(), fileResult); - } catch (Exception e) { - logger.error("上传KYC文件失败", e); - throw new BadRequestException("上传KYC文件失败" + e.getMessage()); - } - return fileResult; - } - - @Override - @Transactional - public List uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo, String fileType) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - List fileResult = new ArrayList<>(); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - try { - updateFilesForWaitAuditWithoutRepeatForApp(account, clientId, fileType, filesInfo.getString("url"), fileResult); - } catch (Exception e) { - logger.error("上传KYC文件失败", e); - throw new BadRequestException("上传KYC文件失败" + e.getMessage()); - } - return fileResult; - } - - - @Override - @Transactional - public void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - String companyPhoto = ""; - String storePhoto = ""; - String webSite = ""; - int sourceEnum = 2; - if (client == null) { - throw new InvalidShortIdException(); - } - List clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - if (clientAllAuthFiles == null || clientAllAuthFiles.isEmpty()) { - throw new BadRequestException("Please check the information is uploaded completely"); - } - String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"}; - String[] fileNames = {"bank statement", "Certificate of Registration", "ID", "Agreement"}; - for (int i = 0; i < fileKeys.length; i++) { - String fileKey = fileKeys[i]; - if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { - if ("client_agree_file".equals(fileKey)) { - throw new BadRequestException("Please check that the agreement has been signed"); - } else { - throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely"); - } - } - - } - if ("app".equals(source.toLowerCase())) { - sourceEnum = 1; - } - JSONObject photoInfo = account.getJSONObject("photo_info"); - if (photoInfo != null) { - companyPhoto = photoInfo.getString("company_photo"); - storePhoto = photoInfo.getString("store_photo"); - webSite = photoInfo.getString("web_site"); - } - JSONObject fileComp = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); - if (fileComp == null) { - fileComp = new JSONObject(); - fileComp.put("client_id", client.getIntValue("client_id")); - fileComp.put("submit_time", new Date()); - fileComp.put("status", 0); - fileComp.put("type", 1); - fileComp.put("company_photo", companyPhoto); - fileComp.put("store_photo", storePhoto); - fileComp.put("company_website", webSite); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.getString("account_id")); - clientComplianceCompanyMapper.save(fileComp); - } else if (fileComp.getIntValue("status") == 2) { - fileComp.put("status", 0); - fileComp.put("submit_time", new Date()); - fileComp.put("company_photo", companyPhoto); - fileComp.put("store_photo", storePhoto); - fileComp.put("company_website", webSite); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.getString("account_id")); - clientComplianceCompanyMapper.update(fileComp); - } else { - throw new BadRequestException("please do not repeat submission!"); - } - clientFilesMapper.updateFilesAuthStatus(client.getIntValue("client_id"), - FilesAuthEnum.COMMIT_OPR.getAfterStatus(), - FilesAuthEnum.COMMIT_OPR.getBeforeStatus(), - FilesAuthEnum.COMMIT_OPR.getAuthType("compliance")); - signInAccountService.clearAccountCache(account.getString("account_id")); - } - - @Override - public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException { - if (StringUtils.isBlank(file.getOriginalFilename())) { - throw new BadRequestException("Please Enter Full Name"); - } - JSONObject client = getClientInfo(account.getIntValue("client_id")); - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } - - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+" + weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - client.put("located_country", "Australia"); - if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) { -// clean_1 clean_1_friday clean_1_saturday - // second, third or fourth - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - } else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - } else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) { - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); - JSONObject sysConfigRate = JSON.parseObject(rateConfig); - - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - - JSONObject cbBankPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay"); - if (cbBankPayRate != null) { - client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - } - } catch (Exception ignored) { - throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service"); - } - - JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); - if (bankAccount == null || bankAccount.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } - client.put("bank", bankAccount.getString("bank")); - client.put("bsb_no", bankAccount.getString("bsb_no")); - client.put("account_no", bankAccount.getString("account_no")); - client.put("account_name", bankAccount.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - client.put("full_name", URLDecoder.decode(file.getOriginalFilename(), "UTF-8")); - BufferedImage img = ImageIO.read(file.getInputStream()); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ImageIO.write(img, "png", out); - client.put("img", "data:image/png;base64," + Base64.encodeBase64String(out.toByteArray())); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } - return exportImgAggregateFile(account, client); - } - - @Override - public JSONObject getSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - int clientId = client.getIntValue("client_id"); - if (query.getDatefrom() == null) { - JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(clientId); - if (earlistOrder != null) { - query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd")); - query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd")); - } - } - JSONObject params = query.toParams(TimeZone.getDefault().getID()); - params.put("client_id", clientId); - queryModifyClientIds(clientId, params); - boolean mergeSettle = getMergeSettleStatus(client); - - if (mergeSettle && query.getClient_ids() == null) { - params.remove("client_ids"); - params.put("merge_settle", true); - } - PageList logs = transactionMapper.listSettlementLog(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); - logs.forEach(log -> log.put("padding", log.getBooleanValue("editable"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable"))); - logger.info("##editable{}", result.getBooleanValue("padding")); - return result; - } - - @Override - public void excelSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query, HttpServletResponse response) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - int client_id = client.getIntValue("client_id"); - String timezone = client.getString("timezone"); - if (query.getDatefrom() == null) { - JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client_id); - if (earlistOrder != null) { - query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd")); - query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd")); - } - } - if (query.getClient_ids() != null) { - if (query.getClient_ids().length > 1) { - query.setClient_ids(null); - } - } - JSONObject params = query.toParams(timezone); - params.put("client_id", client_id); - queryModifyClientIds(client_id, params); - boolean mergeSettle = getMergeSettleStatus(client); - - if (mergeSettle && query.getClient_ids() == null) { - params.remove("client_ids"); - params.put("merge_settle", true); - } - PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc"))); - //Excel 多sheet导出 - try (HSSFWorkbook workbook = new HSSFWorkbook()) { - if (query.getClient_ids() == null) { - addSheet(0, workbook, client, logs); - if (!mergeSettle) { - List childs = clientMapper.listChildClients(client.getIntValue("client_id")); - for (int i = 0; i < childs.size(); i++) { - params.put("client_id", childs.get(i).getInteger("client_id")); - PageList childLogs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc"))); - if (!childLogs.isEmpty()) { - addSheet(i + 1, workbook, childs.get(i), childLogs); - } - } - } - } else { - JSONObject chlidClient = clientMapper.findClient(Integer.parseInt(query.getClient_ids()[0])); - addSheet(0, workbook, chlidClient, logs); - } - String fileName = "Settlement Log - " + (query.getDatefrom() + "~" + query.getDateto()); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); - OutputStream outputStream = response.getOutputStream(); - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } catch (IOException e) { - e.printStackTrace(); - } - - } - - private void addSheet(int sheetNum, HSSFWorkbook workbook, JSONObject client, List logs) { - HSSFSheet sheet = workbook.createSheet(); - workbook.setSheetName(sheetNum, client.getString("client_moniker") + "_excel"); - sheet.setDefaultColumnWidth((short) 40); - HSSFCellStyle style = workbook.createCellStyle(); - style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index); - style.setFillPattern(CellStyle.SOLID_FOREGROUND); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font = workbook.createFont(); - font.setFontHeightInPoints((short) 16); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - style.setFont(font); - - HSSFCellStyle style2 = workbook.createCellStyle(); - style2.setFillForegroundColor(HSSFColor.WHITE.index); - style2.setFillPattern(CellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(CellStyle.BORDER_THIN); - style2.setBorderLeft(CellStyle.BORDER_THIN); - style2.setBorderRight(CellStyle.BORDER_THIN); - style2.setBorderTop(CellStyle.BORDER_THIN); - style2.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font2 = workbook.createFont(); - // font.setColor(HSSFColor.VIOLET.index); - font2.setFontHeightInPoints((short) 12); - font2.setBoldweight(Font.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - HSSFRow row0 = sheet.createRow(0); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell02 = row0.createCell(2); - HSSFCell cell03 = row0.createCell(3); - HSSFCell cell04 = row0.createCell(4); - HSSFCell cell05 = row0.createCell(5); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell02.setCellStyle(style); - cell03.setCellStyle(style); - cell04.setCellStyle(style); - cell05.setCellStyle(style); - HSSFRichTextString text00 = new HSSFRichTextString("Short Name"); - HSSFRichTextString text01 = new HSSFRichTextString("Client Moniker"); - HSSFRichTextString text02 = new HSSFRichTextString("Settle Time"); - HSSFRichTextString text03 = new HSSFRichTextString("Transaction Amount"); - HSSFRichTextString text04 = new HSSFRichTextString("to Merchant"); - HSSFRichTextString text05 = new HSSFRichTextString("Service Fee"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell02.setCellValue(text02); - cell03.setCellValue(text03); - cell04.setCellValue(text04); - cell05.setCellValue(text05); - for (int i = 0; i < logs.size(); i++) { - HSSFRow row = sheet.createRow(i + 1); - HSSFCell cell0 = row.createCell(0); - HSSFCell cell1 = row.createCell(1); - HSSFCell cell2 = row.createCell(2); - HSSFCell cell3 = row.createCell(3); - HSSFCell cell4 = row.createCell(4); - HSSFCell cell5 = row.createCell(5); - cell0.setCellStyle(style2); - cell1.setCellStyle(style2); - cell2.setCellStyle(style2); - cell3.setCellStyle(style2); - cell4.setCellStyle(style2); - cell5.setCellStyle(style2); - JSONObject dataItem = logs.get(i); - HSSFRichTextString text0 = new HSSFRichTextString(client.getString("short_name")); - HSSFRichTextString text1 = new HSSFRichTextString(client.getString("client_moniker")); - HSSFRichTextString text2 = new HSSFRichTextString(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dataItem.getDate("report_date"))); - HSSFRichTextString text3 = new HSSFRichTextString(dataItem.getBigDecimal("total").setScale(2, RoundingMode.HALF_DOWN).toString()); - HSSFRichTextString text4 = new HSSFRichTextString(dataItem.getBigDecimal("income").setScale(2, RoundingMode.HALF_DOWN).toString()); - HSSFRichTextString text5 = new HSSFRichTextString(dataItem.getBigDecimal("fee").setScale(2, RoundingMode.HALF_DOWN).toString()); - cell0.setCellValue(text0); - cell1.setCellValue(text1); - cell2.setCellValue(text2); - cell3.setCellValue(text3); - cell4.setCellValue(text4); - cell5.setCellValue(text5); - } - } - - public void updateSysClientFiles(JSONObject manager, int clientId, String fileType, String fileValue) { - if (fileValue != null) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", fileValue); - fileJson.put("status", 1); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - logger.info(clientId + "的fileType文件上传成功"); - } - } - - public void updateSysMWClientFiles(JSONObject manager, int clientId, String fileType, String fileValue) { - if (fileValue != null) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", fileValue); - fileJson.put("is_valid", 1); - clientMWAuthFilesInfo.save(fileJson); - logger.info(clientId + "的fileType文件上传成功"); - } - } - - public void updateSysClientFilesWithoutRepeat(JSONObject manager, int clientId, String fileType, String fileValue) { - List repetitiveFiles = clientFilesMapper.findRepetitiveFilesForDelete(clientId, fileType); - if (fileValue != null) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", fileValue); - fileJson.put("status", 1); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - logger.info(clientId + "的fileType文件上传成功"); - if (repetitiveFiles != null) { - for (JSONObject repetitiveFile : repetitiveFiles) { - clientFilesMapper.deleteByClientAndFileId(repetitiveFile.getString("file_id")); - } - } - } - - - } - - public void updateSysClientFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List fileResult) { - if (fileValue != null) { - String[] values = fileValue.split(","); - for (String value : values) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", value); - fileJson.put("status", 0); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - logger.info(clientId + "的fileType文件上传成功" + fileJson.getString("file_id")); - JSONObject file = new JSONObject(); - file.put("file_id", fileJson.getString("file_id")); - file.put("file_value", fileJson.getString("file_value")); - fileResult.add(file); - } - } - } - - public void updateFilesForWaitAuditWithoutRepeat(JSONObject manager, int clientId, String fileType, String fileValue, List fileResult) { - if (fileValue != null) { - String[] values = fileValue.split(","); - List repetitiveFiles = clientFilesMapper.findRepetitiveFiles(clientId, fileType); - for (String value : values) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", value); - fileJson.put("status", 0); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - logger.info(clientId + "的fileType文件上传成功" + fileJson.getString("file_id")); - JSONObject file = new JSONObject(); - file.put("file_id", fileJson.getString("file_id")); - file.put("file_value", fileJson.getString("file_value")); - fileResult.add(file); - } - if (repetitiveFiles != null) { - for (JSONObject repetitiveFile : repetitiveFiles) { - clientFilesMapper.deleteByClientAndFileId(repetitiveFile.getString("file_id")); - } - } - } - } - - - public void updateFilesForWaitAuditWithoutRepeatForApp(JSONObject account, int clientId, String fileType, String fileValue, List fileResult) { - if (fileValue != null) { - String[] values = fileValue.split(","); - List repetitiveFiles = clientFilesMapper.findRepetitiveFiles(clientId, fileType); - for (String value : values) { - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", account.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", value); - fileJson.put("status", 0); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - logger.info(clientId + "的fileType文件上传成功" + fileJson.getString("file_id")); - JSONObject file = new JSONObject(); - file.put("file_id", fileJson.getString("file_id")); - file.put("file_value", fileJson.getString("file_value")); - fileResult.add(file); - } - if (repetitiveFiles != null) { - for (JSONObject repetitiveFile : repetitiveFiles) { - clientFilesMapper.deleteByClientAndFileId(repetitiveFile.getString("file_id")); - } - } - } - } - - - public void updateAggregateFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List fileResult) { - if (fileValue != null) { - List passAggregateFiles = clientFilesMapper.findClientPassAggreeFile(clientId); - if (passAggregateFiles != null && !passAggregateFiles.isEmpty()) { - throw new BadRequestException("合同已提交或审核通过,请勿重复签订合同"); - } - List aggregateFiles = clientFilesMapper.findClientAggreeFileCommit(clientId); - if (aggregateFiles != null && !aggregateFiles.isEmpty()) { - clientFilesMapper.deleteAggreeByClientId(clientId); - } - String signatureAccountId = StringUtils.isNotBlank("account_id") ? manager.getString("account_id") : manager.getString("manager_id"); - JSONObject fileJson = new JSONObject(); - fileJson.put("client_id", clientId); - fileJson.put("last_update_date", new Date()); - fileJson.put("last_update_by", manager.getString("display_name")); - fileJson.put("file_name", fileType); - fileJson.put("file_value", fileValue); - fileJson.put("signature_time", new Date()); - fileJson.put("signature_ip", manager.getString("signature_ip")); - fileJson.put("user_agent", manager.getString("user_agent")); - fileJson.put("signature_account_id", signatureAccountId); - fileJson.put("status", 0); - fileJson.put("is_valid", 1); - clientFilesMapper.save(fileJson); - logger.info("{}合同文件上传成功,IP:{},us-agent:{},signature_id:{}", clientId, manager.getString("signature_ip"), manager.getString("user_agent"), signatureAccountId); - JSONObject file = new JSONObject(); - file.put("file_id", fileJson.getString("file_id")); - file.put("file_value", fileJson.getString("file_value")); - fileResult.add(file); - - } - } - - - @Override - public JSONObject getClientsAnalysis(JSONObject manager) { - JSONObject params = new JSONObject(); - String tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id"); - if (tempSubMchId != null && tempSubMchId.length() > 0) { - params.put("tempSubMchId", tempSubMchId); - } - return clientMapper.analysisClients(params); - } - - @Override - public List getUnRegister(JSONObject manager) { - return clientAccountMapper.listUnRegisterClientAccounts(new PageBounds(Order.formString("create_time.desc"))); - } - - @Override - @Transactional - public void commitToCompliance(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); - if (bdOperatClientRole <= 0) { - throw new ForbiddenException(); - } - // 暂不启用sys_client权限验证 - // if (client.getString("bd_user").indexOf(manager.getString("manager_id")) < 0) { - // throw new ForbiddenException(); - // } - } - // 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13 - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - checkChannelRate(client,PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()); - checkChannelRate(client,PayChannel.ALIPAY_APS_CASHIER.getChannelCode()); - - List clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - if (clientFiles == null || clientFiles.equals("")) { - throw new BadRequestException("The Compliance File Must Be Uploaded!"); - } - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null) { - throw new BadRequestException("The Partner's Bank Account is not config!"); - } - int open_status_from = client.getIntValue("open_status"); - OpenStatusModify openStatusModify = new OpenStatusModify(manager, clientMoniker, 4); - if ((client.getIntValue("source") == 1 || client.getIntValue("source") == 2) && client.getIntValue("approve_result") == 2) { - openStatusModify.setApprove_time(new Date()); - } else { - openStatusModify.setApprove_time(new Date()); - openStatusModify.setApprove_result(4); - } - client.put("open_status", 4); - clientModifySupport.processClientModify(openStatusModify); - saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "BD完成签字提交compliance审核", manager, 1); - if (manager != null) { - // sendMessagetoCompliance(client, manager.getString("display_name")); - sendCommissionWechatMessage(client); - } - } - private void checkChannelRate(JSONObject client,String channel){ - MerchantChannelPermissionResolver resolver = this.paymentApi.channelApi(channel).getChannelPermissionResolver(); - if (!Objects.isNull(resolver) && - resolver.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency()) - ) { - JSONObject rateApsInstore = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), channel); - if (rateApsInstore == null) { - throw new BadRequestException("The Partner's "+channel+" Rate is not config!"); - } - } - } - - @Override - @Transactional - public void commitToCardCompliance(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); - if (bdOperatClientRole <= 0) { - throw new ForbiddenException(); - } - } - // 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13 - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "rpaypmt_card"); - if (rate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - List clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - if (clientFiles == null || clientFiles.equals("")) { - throw new BadRequestException("The Compliance File Must Be Uploaded!"); - } - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null) { - throw new BadRequestException("The Partner's Bank Account is not config!"); - } - JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(client.getInteger("client_id")); - int open_status_from = cardFlowInfo.getIntValue("upay_open_status"); - cardFlowInfo.put("upay_approve_time", new Date()); - cardFlowInfo.put("upay_approve_result", 4); - cardFlowInfo.put("upay_open_status", 4); - sysClientUpayProfileMapper.update(cardFlowInfo); - saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "BD完成签字提交compliance审核", manager, 2); - if (manager != null) { - sendCardCommissionWechatMessage(client); - } - } - - private void saveClientAuditProcess(int client_id, Integer open_status_form, Integer open_status_to, String remark, JSONObject manager, int type) { - JSONObject log = new JSONObject(); - try { - log.put("client_id", client_id); - if (open_status_form != null) { - log.put("open_status_from", open_status_form); - } - log.put("open_status_to", open_status_to); - log.put("operator_id", StringUtils.isNotEmpty(manager.getString("manager_id")) ? manager.getString("manager_id") : manager.getString("account_id")); - log.put("operator", manager.getString("display_name")); - log.put("create_time", new Date()); - log.put("type", type); - log.put("remark", remark); - clientAuditProcessMapper.save(log); - } catch (Exception e) { - logger.error("ClientAuditProcessError" + e.getMessage()); - } - } - - // bd apply to make the agree file - @Override - public void commitToDoAgreeFile(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - - beforeCommitToDoAgreeValid(client, manager, "Wechat"); - - OpenStatusModify openStatusModify = new OpenStatusModify(manager, clientMoniker, 1); - openStatusModify.setApprove_result(4); - openStatusModify.setApprove_time(new Date()); - clientModifySupport.processClientModify(openStatusModify); - saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Compliance制作合同", manager, 1); - if (manager != null) { -// sendAgreeFileMsgtoCompliance(client, manager.getString("display_name")); - sendCommissionWechatMessage(client); - } - } - - @Override - @Transactional - public void commitToDoCardAgreeFile(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int clientId = client.getIntValue("client_id"); - client.putAll(clientConfigService.find(clientId)); - beforeCommitToDoAgreeValid(client, manager, "rpaypmt_card"); - - JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "rpaypmt_card"); - if (surCharge == null || surCharge.size() <= 0) { - throw new BadRequestException("The Partner's Rpaypmt Card Rate is not config!"); - } - - JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(clientId); - JSONObject cardFlow = JsonHelper.newJson(json -> { - json.put("client_id", clientId); - json.put("upay_approve_result", 4); - json.put("upay_open_status", 1); - json.put("upay_approve_time", new Date()); - }); - sysClientUpayProfileMapper.update(cardFlow); - saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Card Payment Compliance制作合同", manager, 2); - } - - private void beforeCommitToDoAgreeValid(JSONObject client, JSONObject manager, String channel) { - if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); - if (bdOperatClientRole <= 0) { - throw new ForbiddenException(); - } - } - - JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), channel); - if (surCharge == null || surCharge.size() <= 0) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Bank Account is not config!"); - } - } - - @Override - public void commitToGreenChannel(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - - if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); - if (bdOperatClientRole <= 0) { - throw new ForbiddenException(); - } - } - // 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13 - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rate == null || rate.size() <= 0) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Bank Account is not config!"); - } - Integer open_status_from = client.getInteger("open_status"); - OpenStatusModify openStatusModify = new OpenStatusModify(manager, clientMoniker, 10); - openStatusModify.setApprove_result(4); - openStatusModify.setApprove_time(new Date()); - clientModifySupport.processClientModify(openStatusModify); - saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 10, "提交绿色通道申请Compliance审核", manager, 1); - if (manager != null) { - // sendGreenChannelMessagetoCompliance(client, manager.getString("display_name")); - sendCommissionWechatMessage(client); - } - } - - @Override - public void changePaymentPage(JSONObject manager, String clientMoniker, String paypadVersion) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - clientModifySupport.processClientConfigModify(new PaypadVersionModify(manager, clientMoniker, paypadVersion)); - clientInfoCacheSupport.clearClientMonikerConfigCache(clientMoniker); - } - - @Override - public void changeCBBankPaymentPage(JSONObject manager, String clientMoniker, String paypadVersion) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - clientConfig.put("cbbank_paypad_version", paypadVersion); - clientConfigMapper.update(clientConfig); - clientInfoCacheSupport.clearClientMonikerConfigCache(clientMoniker); - } - - @Override - public void changeGatewayVersion(JSONObject account, boolean enableV2) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject gatewaySignInfo = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); - if (gatewaySignInfo == null) { - JSONObject key = getRsaKey(); - gatewaySignInfo = new JSONObject(); - gatewaySignInfo.put("client_moniker", client.getString("client_moniker")); - gatewaySignInfo.put("platform_public_key", key.getString("public_key")); - gatewaySignInfo.put("platform_private_key", key.getString("private_key")); - gatewaySignInfo.put("is_valid", 0); - gatewaySignInfo.put("creation_by", account.getString("account_id")); - gatewaySignInfo.put("creation_date", new Date()); - gatewaySignInfo.put("last_update_by", account.getString("account_id")); - gatewaySignInfo.put("last_update_date", new Date()); - merchantSignInfoMapper.insert(gatewaySignInfo); - } - clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "is_valid", enableV2)); - } - - @Override - public void changeVerifyIp(JSONObject account, boolean enableV2) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "verify_ip", enableV2)); - } - - @Override - public void setIpWhitelistConfig(JSONObject account, String ipWhitelistConfig) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - if (StringUtils.isNotBlank(ipWhitelistConfig)) { - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "ip_whitelist", ipWhitelistConfig, "重新设置IP白名单")); - } - } - - @Override - @Transactional - public void refreshPlatformPublicKeyConfig(JSONObject account) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject key = getRsaKey(); - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "platform_public_key", key.getString("public_key"), "重新生成平台公钥")); - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "platform_private_key", key.getString("private_key"), "重新生成平台私钥")); - } - - @Override - public void setPartnerPublicKeyConfig(JSONObject account, String publicKey) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - if (StringUtils.isNotBlank(publicKey)) { - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "mch_public_key", publicKey, "重新设置商户公钥")); - } - } - - @Override - public void changePaymentSuccessPage(JSONObject manager, String clientMoniker, String paysuccessVersion) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - client.put("paysuccess_version", paysuccessVersion); - clientMapper.update(client); - } - - @Override - public void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - clientConfig.put("child_each_refund", childEachRefund); - clientConfigMapper.update(clientConfig); - clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); - } - - /** - * 支付宝aps海外钱包 开关 - * - * @param manager - * @param clientMoniker - * @param enableOverseaWallet - */ - @Override - public void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - - Boolean overseaSwitch = overseaSwitchConfigMapper.getOverseaSwitch(client.getIntValue("client_id")); - logger.info("======>overseaSwitch:{}", overseaSwitch); - if (overseaSwitch == null) { - ApsOverseasConfigData data = ApsOverseasConfigData.saveData(manager.getString("manager_id"), client.getString("client_id"), enableOverseaWallet); - logger.info("=======>data:OverseasSwitch:{}", data.getOverseasSwitch()); - overseaSwitchConfigMapper.save(data); - } else { - JSONObject config = new JSONObject(); - config.put("clientId", client.getString("client_id")); - config.put("modifier", manager.getString("manager_id")); - config.put("overseas_switch", enableOverseaWallet); - overseaSwitchConfigMapper.updateApsOverseasConfigByClientId(config); - } - } - - @Override - public void changePaymentPage(JSONObject account, String paypadVersion) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new PaypadVersionModify(account, client.getString("client_moniker"), paypadVersion)); - clientInfoCacheSupport.clearClientMonikerConfigCache(client.getString("client_moniker")); - } - - @Override - public void changeCBBankPaymentPage(JSONObject account, String paypadVersion) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - clientConfig.put("cbbank_paypad_version", paypadVersion); - clientConfigMapper.update(clientConfig); - clientInfoCacheSupport.clearClientMonikerConfigCache(client.getString("client_moniker")); - } - - @Override - @Transactional - public void changeManualSettle(JSONObject account, int clientId, boolean manualSettle, String operatorId, int type, String operation) { - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new BadRequestException("merchant not found"); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "manual_settle", manualSettle)); - JSONObject actClientLog = new JSONObject(); - actClientLog.put("client_id", clientId); - actClientLog.put("operator_id", operatorId); - actClientLog.put("operation", operation); - actClientLog.put("create_time", new Date()); - actClientLog.put("operator_type", type); - clientsOperationLogMapper.save(actClientLog); - - } - - @Override - public void changeQRCodePaySurcharge(JSONObject account, boolean paySurcharge) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport - .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "qrcode_surcharge", paySurcharge)); - - } - - @Override - public void changeApiPaySurcharge(JSONObject account, boolean enableApiSurcharge) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport - .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "api_surcharge", enableApiSurcharge)); - - } - - @Override - public void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - if (account.getIntValue("role") == 3) { - // cashier cannot change this config - throw new ForbiddenException("Cashier has no permission to switch retail surcharge"); - } - clientModifySupport - .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", paySurcharge)); - } - - @Override - public void changeCBBankPaySurcharge(JSONObject account, boolean paySurcharge) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - if (account.getIntValue("role") == 3) { - // cashier cannot change this config - throw new ForbiddenException("Cashier has no permission to switch retail surcharge"); - } - clientModifySupport - .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "cbbank_surcharge", paySurcharge), true); - } - - @Override - public void changeRequireCustinfo(JSONObject account, boolean requireCustinfo) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport - .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_custinfo", requireCustinfo)); - - } - - @Override - public void changeRequireRemark(JSONObject account, boolean requireRemark) { - int clientId = account.getIntValue("client_id"); - JSONObject client = getClientInfo(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark)); - - } - - @Override - public void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) { - JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); - if (client == null) { - throw new NotFoundException("Client not found, please check"); - } - if (updateSurchargeDTO.getApiSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "api_surcharge", updateSurchargeDTO.getApiSurcharge())); - } - if (updateSurchargeDTO.getQrcodeSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "qrcode_surcharge", updateSurchargeDTO.getQrcodeSurcharge())); - } - if (updateSurchargeDTO.getRetailSurcharge() != null) { - clientModifySupport.processClientConfigModify( - new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", updateSurchargeDTO.getRetailSurcharge())); - } - } - - @Override - public void refusePartner(String clientMoniker, JSONObject manager, String refuseRemark) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - int openStatus = client.getIntValue("open_status"); - - AuditModify auditModify = new AuditModify(manager, clientMoniker, client.getInteger("approve_result"), manager.getString("manager_id"), new Date()); - if (openStatus == 1) { - auditModify.setOpen_status(null); - } else { - auditModify.setOpen_status(openStatus - 1); - } - if (client.getInteger("approve_result") == null || client.getIntValue("approve_result") == 4) { - auditModify.setApprove_result(5); - } - if (client.getIntValue("source") == 4) { - auditModify.setApprove_result(5); - } - if (refuseRemark != null && !refuseRemark.isEmpty()) { - auditModify.setRefuse_remark(refuseRemark); - } - saveClientAuditProcess(client.getIntValue("client_id"), openStatus, client.getInteger("open_status"), "打回," + refuseRemark, manager, 1); - clientModifySupport.processClientModify(auditModify); - - try { - if (client.getIntValue("source") == 4) { - String contactPhone = client.getString("contact_phone"); - if (contactPhone.startsWith("+61")) { - smsSender.sendRefuseMessage("61", contactPhone, Locale.CHINESE, new RefuseMessage(refuseRemark)); - } - } - if (client.getIntValue("source") == 5) { - gatewayMerchantApply.notifyOrgMerchantStatus(client); - } - } catch (Exception e) { - logger.error("RefusePartnerError=======:{},{}", clientMoniker, e.getMessage()); - } - } - - @Override - public void cardRefusePartner(String clientMoniker, JSONObject manager, String refuseRemark) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - Integer clientId = client.getInteger("client_id"); - JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(clientId); - Integer openStatus = null; - if (null != cardFlowInfo) { - openStatus = cardFlowInfo.getIntValue("upay_open_status"); - if (openStatus == 1) { - cardFlowInfo.put("upay_open_status", null); - } else { - cardFlowInfo.put("upay_open_status", openStatus - 1); - } - if (cardFlowInfo.getIntValue("upay_approve_result") == 4 || client.getIntValue("source") == 4) { - cardFlowInfo.put("upay_approve_result", 5); - } - if (refuseRemark != null && !refuseRemark.isEmpty()) { - cardFlowInfo.put("upay_refuse_remark", refuseRemark); - } - saveClientAuditProcess(client.getIntValue("client_id"), openStatus, cardFlowInfo.getIntValue("open_status"), "打回," + refuseRemark, manager, 2); - sysClientUpayProfileMapper.update(cardFlowInfo); - } - - try { - if (client.getIntValue("source") == 4) { - String contactPhone = client.getString("contact_phone"); - if (contactPhone.startsWith("+61")) { - smsSender.sendRefuseMessage("61", contactPhone, Locale.CHINESE, new RefuseMessage(refuseRemark)); - } - } - if (client.getIntValue("source") == 5) { - gatewayMerchantApply.notifyOrgMerchantStatus(client); - } - } catch (Exception e) { - logger.error("RefusePartnerError=======:{},{}", clientMoniker, e.getMessage()); - } - } - - @Override - @Cacheable(value = ":all_clients:", key = "''+#clientId") - public JSONArray getAllClientIds(int clientId) { - JSONArray clientIds = new JSONArray(); - List children = clientMapper.listChildClients(clientId); - clientIds.add(String.valueOf(clientId)); - if (!children.isEmpty()) { - for (JSONObject client : children) { - clientIds.add(client.getString("client_id")); - } - } - return clientIds; - } - - @Override - public void updateAppClient(JSONObject account, int clientId, AppClientBean appClientBean) { - JSONObject client = getClientInfo(clientId); - JSONObject updateObj = appClientBean.updateObject(); - if (!updateObj.isEmpty()) { - updateObj.put("client_id", clientId); - clientMapper.update(updateObj); - } - JSONObject clientLegal = appClientBean.legalObject(); - if (!clientLegal.isEmpty()) { - clientLegal.put("client_id", clientId); - JSONObject oldClienetLegal = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); - if (oldClienetLegal == null) { - sysClientLegalPersonMapper.save(clientLegal); - } else { - sysClientLegalPersonMapper.update(clientLegal); - } - } - if (appClientBean.getCustomerSurchargeRate() != null) { - BigDecimal customerSurchargeRate = BigDecimal.valueOf(appClientBean.getCustomerSurchargeRate()).setScale(2, RoundingMode.HALF_DOWN); - BigDecimal rateValue = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); - if (customerSurchargeRate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 - || customerSurchargeRate.compareTo(rateValue) <= 0) { - throw new ForbiddenException("Invalid Range"); - } - setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate); - } - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - @Transactional - public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skipClearing, String remark) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skipClearing)); - - if (Boolean.TRUE.equals(skipClearing)) { - if ("".equals(remark) || remark == null) { - throw new ServerErrorException("请填写关闭清算原因"); - } - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - clientConfig.put("skip_settle_remark", remark); - clientConfigMapper.update(clientConfig); - } - - - client.put("skip_clearing", skipClearing); - } - - @Override - public void modifyMinSettle(JSONObject manager, String clientMoniker, BigDecimal minSettle) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientModify(new ClientMinSettleModify(manager, clientMoniker, minSettle)); - } - - @Override - @Transactional - public void setSurchargeMode(JSONObject account, String clientMoniker, String surchargeMode) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientModify(new SurchargeModeModify(account, clientMoniker, surchargeMode)); - - if ("distributed".equals(surchargeMode)) { - JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id")); - - if (surchargeAccount == null) { - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - params.put("create_time", new Date()); - params.put("is_valid", 1); - params.put("balance", 0); - clientsSurchargeAccountsMapper.save(params); - } - } - } - - @Override - public JSONObject surchargeAccount(JSONObject account, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - return clientsSurchargeAccountsMapper.find(client.getIntValue("client_id")); - } - - @Override - @Transactional - public void setAllowSurchargeCredit(JSONObject account, String clientMoniker, Boolean allowSurchargeCredit) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientModify(new SwitchAllowSurchargeCreditModify(account, clientMoniker, "allow_surcharge_credit", allowSurchargeCredit)); - } - - @Override - public List getAccountTransactions(JSONObject account, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List transactions = clearingDistributedSurchargeMapper.findTransactions(client.getIntValue("client_id")); - transactions.forEach(e -> { - if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) { - JSONObject manager = managerMapper.findDetail(e.getString("operation")); - e.put("operator", manager.getString("display_name")); - } - }); - return transactions; - } - - @Override - public List getAccountDetailByMonths(JSONObject account, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - return financialSurchargeAccountDetailMapper.listSettlementDatesByClientId(client.getIntValue("client_id")); - } - - @Override - public List getAccountTransactionsByDetailId(JSONObject account, String clientMoniker, String detailId) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List transactions = clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"), detailId); - transactions.forEach(e -> { - if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) { - JSONObject manager = managerMapper.findDetail(e.getString("operation")); - e.put("operator", manager.getString("display_name")); - } - }); - return transactions; - } - - @Override - public List getAccountMonthDetails(JSONObject account, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - return financialSurchargeAccountDetailMapper.findDetailsByClientId(client.getIntValue("client_id")); - } - - @Override - @Transactional - public void saveAccountTransaction(JSONObject account, String clientMoniker, JSONObject transaction) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - - if (!(ManagerRole.ADMIN.hasRole(account.getIntValue("role")) || ManagerRole.OPERATOR.hasRole(account.getIntValue("role")) || ManagerRole.FINANCIAL_STAFF.hasRole(account.getIntValue("role")))) { - throw new ForbiddenException("无法增加充值记录,权限不足"); - } - if (!locker.lock(clientMoniker + "_surcharge_account_save", 120_000)) { - throw new ServerErrorException("Processing task, wait for a moment"); - } - try { - JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id")); - - transaction.put("client_id", client.getIntValue("client_id")); - transaction.put("type", "Credit"); - transaction.put("total_surcharge", BigDecimal.ZERO); - transaction.put("tax_amount", BigDecimal.ZERO); - transaction.put("post_balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); - transaction.put("operation", account.getString("manager_id")); - transaction.put("create_time", new Date()); - clearingDistributedSurchargeMapper.save(transaction); - - surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); - clientsSurchargeAccountsMapper.update(surchargeAccount); - - } finally { - locker.unlock(clientMoniker + "_surcharge_account_save"); - } - - } - - @Override - public void enableGatewayUpgrade(JSONObject account, String clientMoniker, boolean gatewayUpgrade) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "gateway_upgrade", gatewayUpgrade)); - } - - @Override - public void enableGatewayAlipayOnline(JSONObject account, String clientMoniker, boolean gatewayAlipayOnline) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "gateway_alipay_online", gatewayAlipayOnline)); - } - - private void sendMessagetoCompliance(JSONObject client, String bd_user_name) { - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat"); - MpWechatApi wxApi = mpWechatApiProvider.getWechatApiForTemplateMessage(wxopenid); - String templateId = wxApi.getTemplateId("new-apply"); - try { - TemplateMessage msg = initSendToComplianceTemplate(loginUrl, wxopenid, templateId, bd_user_name, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception e) { - try { - TemplateMessage msg = initSendToComplianceTemplate(loginUrl, wxopenid, templateId, bd_user_name, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception ignore) { - } - } - } - } - } - - private TemplateMessage initSendToComplianceTemplate(String loginUrl, String wxopenid, String templateId, String bd_user_name, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, loginUrl); - msg.put("first", bd_user_name + " 提交了新商户申请,请审核", "#ff0000"); - msg.put("keyword1", "BD提交商户合规申请", "#0000ff"); - msg.put("keyword2", client.getString("company_name"), "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", "联系人:" + client.getString("contact_person") + " 电话:" + client.getString("contact_phone"), "#000000"); - msg.put("remark", "点击处理", "#ff0000"); - return msg; - } - - private void sendMessageToBD(JSONObject client, String refuseRemark) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - // String loginUrl = - // PlatformEnvironment.getEnvironment().concatUrl("/global/userstatus/manager_signin_wechat"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendToBDTemplate(wxopenid, wxApi.getTemplateId("refuse-bd"), refuseRemark, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception ignored) { - } - } - - } - - } - - private TemplateMessage initSendToBDTemplate(String wxopenid, String templateId, String refuseRemark, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, null); - msg.put("first", client.getString("short_name") + " 合规审核申请被退回", "#ff0000"); - msg.put("keyword1", client.getString("client_moniker"), "#0000ff"); - msg.put("keyword2", "Compliance", "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", refuseRemark, "#000000"); - msg.put("remark", "请及时处理", "#ff0000"); - return msg; - } - - private void sendAgreeFileMsgToBD(JSONObject client, String remark) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendToBDAgreeFileTemplate(wxopenid, wxApi.getTemplateId("new-apply"), remark, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception e) { - } - } - - } - - } - - private TemplateMessage initSendToBDAgreeFileTemplate(String wxopenid, String templateId2, String refuseRemark, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, null); - msg.put("first", client.getString("short_name") + "合规文件已生成", "#ff0000"); - msg.put("keyword1", client.getString("client_moniker"), "#0000ff"); - msg.put("keyword2", "Compliance", "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", refuseRemark, "#000000"); - msg.put("remark", "请及时处理", "#ff0000"); - return msg; - } - - private void sendAgreeFileMsgtoCompliance(JSONObject client, String bd_user_name) { - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat"); - MpWechatApi wxApi = mpWechatApiProvider.getWechatApiForTemplateMessage(wxopenid); - String templateId = wxApi.getTemplateId("new-apply"); - try { - TemplateMessage msg = initSendToComAgreeFileTemplate(loginUrl, wxopenid, templateId, bd_user_name, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception e) { - try { - TemplateMessage msg = initSendToComAgreeFileTemplate(loginUrl, wxopenid, templateId, bd_user_name, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception ignore) { - } - } - } - } - } - - private TemplateMessage initSendToComAgreeFileTemplate(String loginUrl, String wxopenid, String templateId2, String bd_user_name, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, null); - msg.put("first", bd_user_name + " 提交了新商户合同申请,请审核", "#ff0000"); - msg.put("keyword1", "BD申请制作" + client.getString("client_moniker") + "商户合同", "#0000ff"); - msg.put("keyword2", client.getString("company_name"), "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", "联系人:" + client.getString("contact_person") + " 电话:" + client.getString("contact_phone"), "#000000"); - msg.put("remark", "点击处理", "#ff0000"); - return msg; - } - - private void sendGreenChannelMessagetoCompliance(JSONObject client, String bd_user_name) { - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat"); - MpWechatApi wxApi = mpWechatApiProvider.getWechatApiForTemplateMessage(wxopenid); - String templateId = wxApi.getTemplateId("new-apply"); - try { - TemplateMessage msg = initSendToComplianceGreenChannelTemplate(loginUrl, wxopenid, templateId, bd_user_name, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception e) { - try { - TemplateMessage msg = initSendToComplianceGreenChannelTemplate(loginUrl, wxopenid, templateId, bd_user_name, client); - wxApi.sendTemplateMessage(msg); - } catch (Exception ignore) { - } - } - } - } - } - - private TemplateMessage initSendToComplianceGreenChannelTemplate(String loginUrl, String wxopenid, String templateId2, String bd_user_name, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, loginUrl); - msg.put("first", bd_user_name + " 提交了新商户绿色通道申请,请审核", "#ff0000"); - msg.put("keyword1", client.getString("client_moniker") + "申请绿色通道", "#0000ff"); - msg.put("keyword2", client.getString("company_name"), "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", "联系人:" + client.getString("contact_person") + " 电话:" + client.getString("contact_phone"), "#000000"); - msg.put("remark", "点击处理", "#ff0000"); - return msg; - } - - private TemplateMessage initSendCommissionTemplate(String wxopenid, String templateId, String first, String keyword1, String keyword2, String keyword4) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, null); - msg.put("first", first, "#ff0000"); - msg.put("keyword1", keyword1, "#0000ff"); - msg.put("keyword2", keyword2, "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", keyword4, "#000000"); - msg.put("remark", "请尽快处理", "#ff0000"); - return msg; - } - - private TemplateMessage initTaskFinishTemplate(String openId, String first, String keyword1, String remark) { - String templateId = mpWechatApiProvider.getNewPaymentApi().getTemplateId("task-finished"); - TemplateMessage msg = new TemplateMessage(openId, templateId, null); - msg.put("first", first, "#ff0000"); - msg.put("keyword1", keyword1, "#000000"); - msg.put("keyword2", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"), "#000000"); - msg.put("remark", remark, "#10b24c"); - return msg; - } - - private void sendCommissionWechatMessage(JSONObject client) { - String bd_user_name = client.getString("bd_user_name"); - String client_moniker = "[" + client.getString("client_moniker") + "]"; - String short_name = client.getString("short_name"); - - if (client.getIntValue("open_status") == 1 && client.getIntValue("approve_result") == 2 - && (client.getIntValue("source") == 1 || client.getIntValue("source") == 2)) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - try { - TemplateMessage msg = initTaskFinishTemplate(wxopenid, client_moniker + "已快速开通", "绿色通道申请通过", ""); - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,绿色通道开通完成", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,绿色通道开通完成,openid=" + wxopenid)); - } - } - } - return; - } - - if (client.getIntValue("open_status") == 1) { - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), "BD申请制作合同" + client_moniker, - bd_user_name, "制作合同申请", "BD申请制作" + short_name + "的合同"); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=1", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=1,openid=" + wxopenid)); - } - } - } - return; - } - if (client.getIntValue("open_status") == 3) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), client_moniker + "合同制作完成", - "Compliance", "合规材料", "上传完整合规材料,商户:" + short_name); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=3", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=3,openid=" + wxopenid)); - - } - } - - } - return; - } - if (client.getIntValue("open_status") == 4) { - if (client.getIntValue("source") == 4 && !StringUtils.isNotEmpty(bd_user_name)) { - bd_user_name = "自助开通商户"; - } - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), client_moniker + "合规材料已提交", - bd_user_name, "审核材料", "已提交合规材料,等待审核"); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=1", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=1,openid=" + wxopenid)); - } catch (Exception e) { - logger.error("Wechat Message Error,open_status=1", e); - } - } - } - return; - } - if (client.getIntValue("open_status") == 5) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - try { - TemplateMessage msg = initTaskFinishTemplate(wxopenid, client_moniker + "已正式开通", "Compliance审核通过", ""); - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=5", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=5,openid=" + wxopenid)); - } - } - } - return; - } - - if (client.getIntValue("open_status") == 10) { - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), client_moniker + "申请绿色通道", - bd_user_name, "绿色通道申请", "BD已提交绿色通道申请,商户:" + short_name); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=10", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=10,openid=" + wxopenid)); - } - } - } - return; - } - - } - - private void sendCardCommissionWechatMessage(JSONObject client) { - String bd_user_name = client.getString("bd_user_name"); - String client_moniker = "[" + client.getString("client_moniker") + "]"; - String short_name = client.getString("short_name"); - JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(client.getInteger("client_id")); - if (null == cardFlowInfo) { - return; - } - if (cardFlowInfo.getIntValue("upay_open_status") == 1) { - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), "BD申请制作信用卡支付合同" + client_moniker, - bd_user_name, "制作卡支付合同申请", "BD申请制作" + short_name + "的卡支付合同"); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=1", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=1,openid=" + wxopenid)); - } - } - } - return; - } - if (cardFlowInfo.getIntValue("upay_open_status") == 3) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), client_moniker + "信用卡支付合同制作完成", - "Compliance", "合规材料", "上传完整合规材料,商户:" + short_name); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=3", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=3,openid=" + wxopenid)); - - } - } - - } - return; - } - if (cardFlowInfo.getIntValue("upay_open_status") == 4) { - if (client.getIntValue("source") == 4 && !StringUtils.isNotEmpty(bd_user_name)) { - bd_user_name = "自助开通商户"; - } - List complianceList = managerMapper.getOnlyCompliance(); - if (complianceList != null && !complianceList.isEmpty()) { - for (JSONObject compliance : complianceList) { - String wxopenid = compliance.getString("wx_openid"); - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, wxApi.getTemplateId("commission"), client_moniker + "信用卡卡支付合规材料已提交", - bd_user_name, "审核材料", "已提交合规材料,等待审核"); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=1", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=1,openid=" + wxopenid)); - } catch (Exception e) { - logger.error("Wechat Message Error,open_status=1", e); - } - } - } - return; - } - if (cardFlowInfo.getIntValue("upay_open_status") == 5) { - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - for (JSONObject bd : bds) { - String wxopenid = bd.getString("wx_openid"); - if (wxopenid != null) { - try { - TemplateMessage msg = initTaskFinishTemplate(wxopenid, client_moniker + "已正式开通", "Card Payment Compliance审核通过", ""); - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - wxApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,open_status=5", e); - publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=5,openid=" + wxopenid)); - } - } - } - return; - } - } - - @Override - @Cacheable(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") - public List listSubMerchantIdApplys(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - List applices = wxMerchantApplyMapper.listWxMerchantApplices(client.getInteger("client_id"), - new PageBounds(Order.formString("create_time.desc"))); - if (!applices.isEmpty()) { - return new ArrayList<>(applices); - } else { - if (StringUtils.isNotEmpty(client.getString("sub_merchant_id")) && StringUtils.isNotEmpty(client.getString("merchant_id"))) { - WxPayMerchantRegister wxRegistry = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)).orElseThrow(() -> new ServerErrorException("No Wechat registry found")); - ChannelMerchantInfo wxMerchantInfo = wxRegistry.findMerchant(client); - List applyQuery = new ArrayList<>(); - applyQuery.add(wxMerchantInfo); - return applyQuery; - } - } - return null; - } - - @Override - public List listRpaySubMerchantIdApplys(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - List applices = sysRpayMerchantApplyMapper.listRpayMerchantApplices(client.getInteger("client_id"), - new PageBounds(Order.formString("create_time.desc"))); - if (!applices.isEmpty()) { - return applices; - } - return null; - } - - @Override - @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") - @Deprecated - public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - - JSONObject params = subMerchantApply.insertObject(); - SubMerchantInfo subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfo.class); - - MerchantApplicationResult res = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegisterLegacy.class)) - .map(channel -> channel.apply(client, subMerchantInfo, manager)) - .orElseThrow(() -> new ServerErrorException("No Wechat merchant registry found")); - if (res.isSuccess()) { - return res.getMid(); - } else { - throw new BadRequestException("Failed to register wechat merchant"); - } - } - - /** - * 微信新进件 - * - * @param clientMoniker - * @param subMerchantApply - * @param manager - * @return - */ - @Override - @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") - public String newSubMerchantApplication(String clientMoniker, NewSubMerchantIdApply subMerchantApply, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - subMerchantApply.setMerchantRemark(client.getString("client_moniker") + "_" + RandomStringUtils.random(8, true, true)); - JSONObject params = subMerchantApply.insertObject(client); - client.put("merchant_id", subMerchantApply.getMerchant_id()); - params.put("merchant_id", subMerchantApply.getMerchant_id()); - params.put("client_id", client.getString("client_id")); - params.put("create_time", new Date()); - params.put("operator", manager.getString("display_name")); - params.put("is_valid", "1"); - SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); - MerchantApplicationResult res = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) - .map(channel -> channel.apply(client, subMerchantInfo, manager)) - .orElseThrow(() -> new ServerErrorException("No Wechat merchant registry found")); - if (res.isSuccess()) { - return res.getMid(); - } else { - throw new BadRequestException("Failed to register wechat merchant"); - } - } - - /** - * 获取指定商户-微信子商户详情 - * - * @param clientMoniker - * @param merchantAppId - */ - @Override - public JSONObject queryApplicationSubMerchantById(String clientMoniker, String merchantAppId) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - WechatMerchantInfo subMerchantApplyInfo = wxMerchantApplyMapper.findByClientIdAndSubMerchantAppId(client.getInteger("client_id"), merchantAppId); - JSONObject resultParams = NewSubMerchantIdApply.resultParams(subMerchantApplyInfo); - resultParams.put("merchant_app_id", subMerchantApplyInfo.getMerchantAppId()); - return resultParams; - - } - - /** - * 修改指定微信子进件商户信息 - * - * @param clientMoniker - * @param merchantAppId - * @param subMerchantIdApply - * @param manager - */ - @Override - @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") - public void changeApplicationSubMerchantById(String clientMoniker, String merchantAppId, NewSubMerchantIdApply subMerchantIdApply, JSONObject manager) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - checkOrgPermission(manager, client); - - JSONObject params = subMerchantIdApply.insertObject(client); - params.put("merchant_app_id", merchantAppId); - SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); - params.put("merchant_id", subMerchantIdApply.getMerchant_id()); - params.put("client_id", client.getString("client_id")); - params.put("create_time", new Date()); - params.put("operator", manager.getString("display_name")); - - WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) - .orElseThrow(() -> new ServerErrorException("No Register found for wechat")); - register.modify(merchantAppId, client, subMerchantInfo, manager); - } - - @Override - public JSONObject querySubMerchantStatus(String clientMoniker, String subMerchantId) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - client.put("sub_merchant_id", subMerchantId); - WechatMerchantInfo info = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) - .map(register -> register.findMerchant(client)) - .orElseThrow(() -> new ServerErrorException("No Register found for wechat")); - Element elem = info.getRawResponseXml(); - JSONObject object = new JSONObject(); - object.put("response_str", info.getRawResponse()); - object.put("apply_status", elem.elementText("result_code")); - return object; - } - - @Override - public void registerAlipayGms(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { - throw new InvalidParameterException("store photo cannot be empty "); - } - - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "Registered body(Sole Trader)"); - } - - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - throw new BadRequestException("Alipay Industry can't be null"); - } - - merchantChannelApplicationManager.getRegister(AlipayRetailApi.class).apply(client, new EmptyMerchantApplication(), manager); - } - - @Override - public String queryAlipayGmsStatus(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - try { - AlipayMerchantEntity alipayMch = merchantChannelApplicationManager.getRegister(AlipayRetailApi.class).findMerchant(client); - Element responseElement = alipayMch.getRawResponseXml(); - String rejectReason = responseElement.elementText("reject_reason"); - return "查询成功:" + responseElement.elementText("secondary_merchant_id") + - "报备状态:" + responseElement.elementText("status") + StringUtils.defaultString(rejectReason, ""); - } catch (BadRequestException e) { - logger.error(e.getMessage(), e); - return e.getMessage(); - } - } - - @Override - public JSONObject queryAlipayGmsJson(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); - JSONObject queryGMSJson = new JSONObject(new LinkedHashMap<>()); - queryGMSJson.put("service", "alipay.overseas.secmerchant.offline.maintain"); - queryGMSJson.put("partner", mch.getPid()); - queryGMSJson.put("sign_type", "MD5"); - queryGMSJson.put("_input_charset", "utf-8"); - queryGMSJson.put("timestamp", DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); - queryGMSJson.put("secondary_merchant_name", client.getString("company_name")); - queryGMSJson.put("secondary_merchant_id", client.getString("client_moniker")); - queryGMSJson.put("store_id", client.getString("client_moniker")); - queryGMSJson.put("store_name", client.getString("short_name")); - queryGMSJson.put("store_country", client.getString("country").substring(0, 2)); - queryGMSJson.put("store_address", client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")); - queryGMSJson.put("store_industry", client.getString("alipayindustry")); - queryGMSJson.put("internal_store_photo", client.getString("company_photo")); - queryGMSJson.put("external_storefront_photo", client.getString("store_photo")); - queryGMSJson.put("register_country", client.getString("country").substring(0, 2)); - queryGMSJson.put("register_address", client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")); - if ("Company".equals(client.getString("business_structure"))) { - queryGMSJson.put("secondary_merchant_type", "ENTERPRISE"); - queryGMSJson.put("registration_no", client.getString("acn")); - } else { - queryGMSJson.put("secondary_merchant_type", "INDIVIDUAL"); - queryGMSJson.put("representative_name", client.getString("contact_person")); - } - queryGMSJson.put("contact_no", client.getString("contact_phone")); - queryGMSJson.put("contact_email", client.getString("contact_email")); - return queryGMSJson; - } - - @Override - public JSONObject queryAlipayOnlineGmsJson(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject queryGMSJson = new JSONObject(new LinkedHashMap<>()); - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - queryGMSJson.put("service", "alipay.overseas.secmerchant.online.maintain"); - queryGMSJson.put("partner", mch.getPid()); - queryGMSJson.put("sign_type", "MD5"); - queryGMSJson.put("_input_charset", "utf-8"); - queryGMSJson.put("timestamp", DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); - queryGMSJson.put("secondary_merchant_name", client.getString("company_name")); - queryGMSJson.put("secondary_merchant_id", client.getString("client_moniker")); - queryGMSJson.put("secondary_merchant_industry", client.getString("alipayindustry")); - queryGMSJson.put("register_country", client.getString("country").substring(0, 2)); - queryGMSJson.put("register_address", client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")); - JSONObject website = new JSONObject(); - List websites = new ArrayList<>(); - website.put("site_type", "WEB"); - website.put("site_url", client.getString("company_website")); - website.put("site_name", client.getString("company_name") + " Website"); - websites.add(website); - queryGMSJson.put("site_infos", websites.toString()); - if ("Company".equals(client.getString("business_structure"))) { - queryGMSJson.put("secondary_merchant_type", "ENTERPRISE"); - queryGMSJson.put("registration_no", client.getString("acn")); - queryGMSJson.put("shareholder_name", client.getString("contact_person")); - } else { - queryGMSJson.put("secondary_merchant_type", "INDIVIDUAL"); - queryGMSJson.put("representative_name", client.getString("contact_person")); - } - queryGMSJson.put("contact_no", client.getString("contact_phone")); - queryGMSJson.put("contact_email", client.getString("contact_email")); - return queryGMSJson; - } - - @Override - public void registerAlipayOnlineGms(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (!client.containsKey("company_website")) { - throw new InvalidParameterException("Website cannot be empty "); - } - if (StringUtils.isBlank(client.getString("business_structure"))) { - client.put("business_structure", "Registered body(Sole Trader)"); - } - - if (StringUtils.isBlank(client.getString("alipayindustry"))) { - throw new BadRequestException("Alipay Industry can't be null"); - } - - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - merchantChannelApplicationManager.getRegister(AlipayOnlineApi.class).apply(client, new EmptyMerchantApplication(), manager); - } - - @Override - public void registerClientApplyGMS(String clientMoniker, String accountId) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject clientConfig = merchantInfoProvider.getClientConfigInfoByMoniker(clientMoniker); - JSONObject account = clientAccountMapper.findById(accountId); - if (clientConfig == null) { - throw new InvalidShortIdException(); - } - if (StringUtils.isNotBlank(clientConfig.getString("client_pay_type"))) { - String[] payType = clientConfig.getString("client_pay_type").split(","); - if (Arrays.asList(payType).contains("1")) { - registerAlipayOnlineGms(clientMoniker, null); - enableGatewayAlipayOnline(account, clientMoniker, true); - } - if (Arrays.asList(payType).contains("2")) { - registerAlipayGms(clientMoniker, null); - switchChannelPermission(account, clientMoniker, "Alipay", true); - } - } - } - - @Override - - public String queryAlipayOnlineGmsStatus(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - try { - AlipayMerchantEntity entity = merchantChannelApplicationManager.getRegister(AlipayOnlineApi.class) - .findMerchant(client); - Element responseElement = entity.getRawResponseXml(); - String rejectReason = responseElement.elementText("reject_reason"); - return "查询成功:" + responseElement.elementText("secondary_merchant_id") + - "报备状态:" + responseElement.elementText("status") + StringUtils.defaultString(rejectReason, ""); - } catch (BadRequestException e) { - logger.error(e.getMessage(), e); - return e.getMessage(); - } - } - - @Override - public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - - List listByshortName = sysRpayMerchantApplyMapper.listByShortName(merchantInfo.getString("company_shortname")); - - if (!listByshortName.isEmpty()) { - throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(Short Name 已被使用)"); - } - if (client.getString("rpay_enterprise_id") != null) { - throw new BadRequestException("您已申请成功子商务号,请勿重复申请"); - } - - SubRpayMerchantInfo subRpayMerchantInfo = JSON.toJavaObject(merchantInfo, SubRpayMerchantInfo.class); - subRpayMerchantInfo.CheckEmpty(); - MerchantApplicationResult rpayMerchantInfo = merchantChannelApplicationManager.getRegister(RPayMerchantRegister.class) - .apply(client, subRpayMerchantInfo, manager); - - if (rpayMerchantInfo != null) { - - clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getMid()); - } else { - throw new BadRequestException("请求失败"); - } - } - - @Override - public List listMerchantIds(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - List list = new ArrayList<>(); - for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()) { - JSONObject merchantIds = new JSONObject(); - merchantIds.put("merchant_id", mch.getMerchantId()); - list.add(merchantIds); - } - return list; - } - - @Override - public JSONObject getCheckClientInfo(int client_id, String account_id, String channel) { - JSONObject result = null; - JSONObject expireInfo = clientContractService.getClientContractExpire(client_id, channel); - JSONObject account = clientAccountMapper.findById(account_id); - if (account == null || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - return result; - } else { - if (expireInfo.getBooleanValue("alert")) { - result = new JSONObject(); - result.put("content", - "

    Dear Valued Merchants,


    We would like to extend our warm gratitude to your business for your continued support of RoyalPay. Without our merchants we wouldn't be where we are today. 


    RoyalPay has and always will be committed to complying with all Australian laws, rules and regulations. With our deep roots in China, we also work with all Chinese regulations simultaneously with Australia. Since our humble beginnings in 2016 we have worked with the ATO (Australian Tax Office) to make sure that we are in alignment with all tax requirements. 


    During FY18 we entered negotiations with the ATO to file for GST exemptions for the part of surcharge fees. The ATO has recently advised that we have been unsuccessful in this bid. To ensure we comply with the ATO, we will need to adjust our current service agreements to be exclusionary of GST. 


    This will result in contractual changes to your agreement. However, your business may be eligible to claim this amount back depending on the tax relationship of your business. Please consult with your accounting team in relation to these changes. 


    If you have any questions related to this change please direct them to our Sales Management Team or your relevant BD officer.


    (note: GST is for the surcharge fee only, not related to the price of the goods.)


    尊敬的商户,


    感谢您选择RoyalPay。作为澳洲移动支付的先行者和领导者,RoyalPay自2016年起就开始针对交易手续费这一澳洲目前空白的税务问题对接澳大利亚相关监管机构。作为市场上全新的支付模式,这两年来我们不断地与相关机构探讨最为合适的监管法令应用,同时澳洲的相应法律法规也在不断地完善来提供更全面的监管,来营造更加稳定、健康、健全的金融市场。


    RoyalPay于近期正式收到澳洲监管机构的通知,针对手续费Tax Free的申请和特殊税务条款考量做出了相应的回复:目前澳洲市场上的移动支付(扫码)解决方案所产生的手续费部分的GST并不能享受Tax Free及部分减免的政策条款。我们已经替2018年前交易的商户补足了手续费部分的税金,并应澳大利亚税务局ATO的要求进行了合同上手续费GST部分的相应调整。您也可咨询专业的会计师来申请您额外的手续费GST Return。感谢您的支持和理解,愿我们一起共同努力,塑造一个良好而有序的澳洲移动支付市场。


    有任何疑问,请随时联络我们的客服与公众号。

    (注:GST只针对手续费部分,与商品价格无关)


    "); - result.put("title", "【Important!重要!!】GST Modification Notice | 澳洲监管机构关于手续费GST调整问题通知\n"); - } - } - return result; - } - - private String editContractOrdinaryWaring(String[] key, String sourceStr) { - if (StringUtils.isEmpty(sourceStr) || ArrayUtils.isEmpty(key)) { - return ""; - } - for (int i = 0; i < key.length; i++) { - if (key[i] == null) { - return ""; - } - sourceStr = sourceStr.replace("{" + i + "}", key[i]); - } - return sourceStr; - } - - @Override - public List getClientSubMerchantIdLogs(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - return logClientSubMerchantIdMapper.listLogsByClientId(client.getInteger("client_id"), new PageBounds(Order.formString("create_time.desc"))); - } - - @Override - public void applyToCompliance(String client_moniker, JSONObject client_account, JSONObject params) { - JSONObject client = getClientInfoByMoniker(client_moniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (client.getIntValue("approve_result") == 1) { - throw new BadRequestException("The merchant has been passed"); - } - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - - // 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13 - JSONObject rate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - List clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); - if (clientFiles == null || clientFiles.equals("")) { - throw new BadRequestException("The Compliance File Must Be Uploaded!"); - } - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null) { - throw new BadRequestException("The Partner's Bank Account is not config!"); - } - JSONObject representativeInfo = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (representativeInfo == null) { - throw new BadRequestException("The LegalPersonInfo is not config!Please upgrade the RoyalPay App version"); - } - for (String str : representativeInfo.keySet()) { - if (representativeInfo.getString(str) == null || !(representativeInfo.getString(str).length() > 0) || !(client.getString("contact_job") != null && client.getString("contact_job").length() > 0)) { - throw new BadRequestException("The LegalPersonInfo is not config!Please upgrade the RoyalPay App version"); - } - } - if (!(StringUtils.isNotBlank(client.getString("client_pay_type"))) || !(StringUtils.isNotBlank(client.getString("client_pay_desc")))) { - throw new BadRequestException("Merchant Payment Scenario is not config!"); - } - - int open_status_from = client.getIntValue("open_status"); - OpenStatusModify openStatusModify = new OpenStatusModify(client_account, client_moniker, 4); - if ((client.getIntValue("source") == 1 || client.getIntValue("source") == 2) && client.getIntValue("approve_result") == 2) { - openStatusModify.setApprove_time(new Date()); - } else { - openStatusModify.setApprove_time(new Date()); - openStatusModify.setApprove_result(3); - } - client.put("open_status", 4); - clientModifySupport.processClientModify(openStatusModify); - saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "自助开通商户提交compliance审核", client_account, 1); - - if (params != null) { - params.put("display_name", client_account.getString("display_name")); - clientApproveIdInfo(params, client); - } - if (client_account != null) { - // sendMessagetoCompliance(client, manager.getString("display_name")); - sendCommissionWechatMessage(client); - } - } - - @Override - public void sendVerifyEmail(JSONObject client, String accountId) { - JSONObject clientAccount = clientAccountMapper.findById(accountId); - simpleClientApplyService.sendVerifyEmail(client.getString("contact_email"), client.getIntValue("client_id"), clientAccount.getString("username")); - } - - @Override - public JSONObject getWithConfig(int client_id) { - JSONObject clientWithConfig = getClientInfo(client_id); - clientWithConfig.putAll(clientConfigService.find(client_id)); - return clientWithConfig; - } - - @Override - public List getClientsByBD(String bd_user) { - return clientMapper.listClientsByBD(bd_user); - } - - @Override - public JSONObject simpleQuery(JSONObject param, int page, int limit) { - PageList partners = clientMapper.listPartners(param, new PageBounds(page, limit, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(partners); - } - - @Override - public JSONObject getByEmail(String email, int page, int limit, List exceptClientIds) { - JSONObject param = new JSONObject(); - param.put("contact_email", email); - param.put("except_client_ids", exceptClientIds); - return PageListUtils.buildPageListResult(clientMapper.simpleQuery(param, new PageBounds(page, limit))); - } - - @Override - public void addSub(String client_moniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(client_moniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - mailService.addUnsub(client_moniker); - } - - @Override - public void removeSub(String client_moniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(client_moniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject sub = mailUnsubMapper.findOneByClientMoniker(client_moniker); - if (sub == null) { - throw new BadRequestException(); - } - mailService.removeUnsub(sub.getLong("id")); - } - - @Override - public void switchHfLink(JSONObject manager, String clientMoniker, boolean allow) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - - if (allow) { - if (StringUtils.isEmpty(client.getString("hf_pay_url"))) { - String hf_pay_url = getShortLink(clientMoniker); - client.put("hf_pay_url", hf_pay_url); - JSONObject clientConfig = new JSONObject(); - clientConfig.put("hf_pay_url", hf_pay_url); - clientConfig.put("client_id", client.getIntValue("client_id")); - clientConfigMapper.update(clientConfig); - clientMapper.update(client); - } - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_link", allow)); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_hf", allow)); - - } - - @Override - public void switchGatewayLink(JSONObject manager, String clientMoniker, String channel, boolean allow) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - - if (allow) { - if (StringUtils.isEmpty(client.getString(channel + "_pay_url"))) { - String channel_pay_url = getGatewayShortLink(clientMoniker, channel.toLowerCase()); - client.put(channel + "_pay_url", channel_pay_url); - JSONObject clientConfig = new JSONObject(); - clientConfig.put(channel + "_pay_url", channel_pay_url); - clientConfig.put("client_id", client.getIntValue("client_id")); - clientConfigMapper.update(clientConfig); - clientMapper.update(client); - } - } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel + "_link", allow)); - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel, allow)); - - } - - @Override - public void sendHfEmailNotice(JSONObject order) { - JSONObject client = clientMapper.findClient(order.getIntValue("client_id")); - JSONObject clientConfig = clientConfigMapper.find(order.getIntValue("client_id")); - if (client == null || clientConfig == null) { - return; - } - if (client.getString("contact_email") == null || - !clientConfig.getBoolean("enable_hf_email_notice")) { - return; - } - Context ctx = new Context(); - ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png")); - ctx.setVariable("name", client.getString("contact_person")); - ctx.setVariable("order_id", order.getString("order_id")); - ctx.setVariable("amount", order.getString("total_amount")); - ctx.setVariable("currency", order.getString("currency")); - String create_time = ""; - if (client.getString("timezone") != null) { - create_time = DateFormatUtils.format(order.getDate("create_time"), - "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone(client.getString("timezone"))); - } else { - create_time = DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss"); - } - ctx.setVariable("time", create_time); - final String content = thymeleaf.process("mail/hf_email_notice", ctx); - final String mailTo = client.getString("contact_email"); - if (StringUtils.isEmpty(mailTo)) { - throw new EmailException("Client Contact Email is invalid"); - } - new Thread(() -> { - try { - mailService.sendEmail("你刚刚有一笔到账信息", mailTo, "", content); - } catch (Exception ignored) { - logger.error("邮件发送失败", ignored); - } - }).start(); - } - - @Override - public void sendGatewayEmailNotice(JSONObject order) { - JSONObject client = clientMapper.findClient(order.getIntValue("client_id")); - JSONObject clientConfig = clientConfigMapper.find(order.getIntValue("client_id")); - if (client == null || clientConfig == null) { - return; - } - if (client.getString("contact_email") == null || - !clientConfig.getBoolean("enable_" + order.getString("channel").toLowerCase() + "_email_notice")) { - return; - } - Context ctx = new Context(); - ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png")); - ctx.setVariable("name", client.getString("contact_person")); - ctx.setVariable("order_id", order.getString("order_id")); - ctx.setVariable("amount", order.getString("total_amount")); - ctx.setVariable("currency", order.getString("currency")); - ctx.setVariable("channel", order.getString("channel")); - String create_time = ""; - if (client.getString("timezone") != null) { - create_time = DateFormatUtils.format(order.getDate("create_time"), - "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone(client.getString("timezone"))); - } else { - create_time = DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss"); - } - ctx.setVariable("time", create_time); - final String content = thymeleaf.process("mail/gateway_email_notice", ctx); - final String mailTo = client.getString("contact_email"); - if (StringUtils.isEmpty(mailTo)) { - throw new EmailException("Client Contact Email is invalid"); - } - new Thread(() -> { - try { - mailService.sendEmail("你刚刚有一笔到账信息", mailTo, "", content); - } catch (Exception ignored) { - logger.error("邮件发送失败", ignored); - } - }).start(); - } - - @Override - public void updateAllPartnerPassword(String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject sysConfig = sysConfigManager.getSysConfig(); - String accountWhiteList = sysConfig.getString("reset_password.account_white_list"); - List partners = clientAccountMapper.partnerAndSubPartnerAccounts(client.getIntValue("client_id")); - if (!StringUtils.isEmpty(accountWhiteList)) { - partners = partners.stream().filter(partner -> - !Arrays.asList(accountWhiteList.split(",")).contains(partner.getString("username")) - ).collect(Collectors.toList()); - } - partners.forEach( - partner -> { - String pwd = RandomStringUtils.random(8, true, true); - String salt = PasswordUtils.newSalt(); - String pwdHash = PasswordUtils.hashPwd(pwd, salt); - partner.put("salt", salt); - partner.put("password_hash", pwdHash); - partner.put("password_aes", PasswordUtils.encryptAESPwd(pwd)); - deviceManager.deviceOffline(partner.getString("account_id")); - clientAccountMapper.update(partner); - signInAccountService.clearAccountCache(partner.getString("account_id")); - partner.put("password", pwd); - } - ); - sendTestMerchantPassword(partners); - } - - @Override - public String getShortLink(String clientMoniker) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump/pc"); - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - return api.registerShortUrl(longUrl); - } - - @Override - public String getGatewayShortLink(String clientMoniker, String channel) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/" + channel + "/partners/" + clientMoniker + "/jump/pc"); - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - return api.registerShortUrl(longUrl); - } - - - private void isRiskyMerchant(JSONObject client, JSONObject bankAccount) { - JSONObject needCheckParams = new JSONObject(); - needCheckParams.put("client_moniker", client.getString("client_moniker")); - needCheckParams.put("abn", client.getString("abn")); - needCheckParams.put("acn", client.getString("acn")); - needCheckParams.put("contact_phone", client.getString("contact_phone")); - needCheckParams.put("contact_person", client.getString("contact_person")); - if (bankAccount != null) { - needCheckParams.put("bank_account_no", bankAccount.getString("account_no")); - } - List listRiskySimilarMerchants = riskAttentionMerchantsMapper.listRiskySimilarMerchants(needCheckParams); - if (!listRiskySimilarMerchants.isEmpty()) { - StringBuilder appendStr = new StringBuilder(); - StringBuilder infoStr = new StringBuilder(); - - listRiskySimilarMerchants.forEach(json -> { - appendStr.append(json.getString("client_moniker")).append(","); - JSONObject riskInfo = riskAttentionMerchantsMapper.findByClientMoniker(json.getString("client_moniker")); - infoStr.append("ABN = " + riskInfo.getString("abn") + ",ACN = " + riskInfo.getString("acn") + ",contact_phone = " + riskInfo.getString("contact_phone") + ",contact_person = " + riskInfo.getString("contact_person") + ",bank_account_no = " + riskInfo.getString("bank_account_no")); - }); - appendStr.deleteCharAt(appendStr.length() - 1); - throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr.toString().toUpperCase() + "】【" + infoStr.toString() + "】"); - } - - } - - private void sendClientPostponeNotify(JSONObject account, String newExpireDate) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); - - try { - if (StringUtils.isEmpty(account.getString("wechat_openid"))) { - return; - } - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid")); - if (api != null) { - String templateId = api.getTemplateId("client-postpone"); - if (templateId != null) { - TemplateMessage notice = initClientMessage(client, newExpireDate, account.getString("wechat_openid"), templateId); - api.sendTemplateMessage(notice); - } - } - } catch (Exception e) { - logger.error("Sending Notify failure", e); - } - } - - @Override - public List getClientBySimpleQuery(JSONObject param) { - String subMerchantId = param.getString("sub_merchant_id"); - if (StringUtils.isNotBlank(subMerchantId)) { - return clientMapper.getClientBySubMerchantId(subMerchantId); - } - return null; - } - - @Override - @Transactional - public boolean postponeClientRate(int clientId, String clientMoniker, String nextYearExipryDate, List channels) { - try { - for (String channel : channels) { - clientRateMapper.postponeMerchantRateByClientId(clientId, channel); - } -// List adminAccounts = clientAccountMapper.listAdminAccounts(clientId); -// adminAccounts.forEach(o -> sendClientPostponeNotify(o, nextYearExipryDate)); - logger.error("[{}]费率自动延期成功", clientMoniker); - return true; - } catch (Exception e) { - logger.error("[{}]费率自动延期失败", clientMoniker, e); - return false; - } - } - - @Cacheable("common_sub_mch_id:") - public boolean checkSubMerchantIdInCommonPool(String subMerchantId) { - JSONObject json = commonSubMerchantIdMapper.find(subMerchantId); - return json != null; - } - - @Override - public JSONObject comListPartnerSelection(JSONObject manager, PartnerQuery query) { - JSONObject params = query.toJsonParam(); - String tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id"); - String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source"); - tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource; - if (query.isTempMchId()) { - params.put("temp_mch_id", tempSubMchId); - params.put("temp_mch_id_source", tempSubMchSource); - } - PageList partners = clientMapper.comListPartners(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc"))); - int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期 - for (JSONObject partner : partners) { - String subMerchantId = partner.getString("sub_merchant_id"); - if (subMerchantId != null) { - partner.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); - } - if (partner.getIntValue("approve_result") == 2) { - partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays)); - partner.put("pass_timeout", DateUtils.addDays(partner.getDate("approve_time"), authDays).compareTo(new Date()) < 0); - } - } - return PageListUtils.buildPageListResult(partners); - } - - @Override - public void switchPaymentConfig(String clientMoniker, HttpServletResponse response) throws IOException { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - JSONObject paymentConfig = sysChannelConfigMapper.findOne(1); - if (paymentConfig == null) { - throw new BadRequestException("服务商未开启快捷支付"); - } - if (client.getString("cb_channel_id") != null) { - JSONObject channelConfig = sysChannelConfigMapper.selectByChannelId(client.getString("cb_channel_id")); - if (channelConfig != null) { - paymentConfig = channelConfig; - } - } - response.sendRedirect(String.format(PlatformEnvironment.getEnv().concatUrl(paymentConfig.getString("path")), clientMoniker)); - } - - @Override - public void switchCBBankLink(JSONObject manager, String clientMoniker, boolean allow) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - if (StringUtils.isEmpty(client.getString("cb_bankpay_url"))) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link/pc"); - String cb_bankpay_url = getCBBankShortLink(longUrl); - client.put("cb_bankpay_url", cb_bankpay_url); - client.put("enable_cb_bankpay_link", allow); - clientMapper.update(client); - } else { - client.put("enable_cb_bankpay_link", allow); - clientMapper.update(client); - } - } - - @Override - public String cbBankPayLink(String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - JSONObject paymentConfig = sysChannelConfigMapper.findOne(1); - if (paymentConfig == null) { - throw new BadRequestException("服务商未开启快捷支付"); - } - if (client.getString("cb_channel_id") != null) { - JSONObject channelConfig = sysChannelConfigMapper.selectByChannelId(client.getString("cb_channel_id")); - if (channelConfig != null) { - paymentConfig = channelConfig; - } - } - return String.format(PlatformEnvironment.getEnv().concatUrl(paymentConfig.getString("path")), clientMoniker); - } - - @Override - public void switchPaymentConfigPC(String clientMoniker, HttpServletResponse response) throws IOException { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - JSONObject paymentConfig = sysChannelConfigMapper.findOne(1); - if (paymentConfig == null) { - throw new BadRequestException("服务商未开启快捷支付"); - } - if (client.getString("cb_channel_id") != null) { - JSONObject channelConfig = sysChannelConfigMapper.selectByChannelId(client.getString("cb_channel_id")); - if (channelConfig != null) { - paymentConfig = channelConfig; - } - } - String path = paymentConfig.getString("path"); - path = path.replace("app", "pc"); - response.sendRedirect(String.format(PlatformEnvironment.getEnv().concatUrl(path), clientMoniker)); - } - - @Override - public void partnerCBChannelConfig(String clientMoniker, String channelKey, String channel_id) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("partner code is not exists!"); - } - if (StringUtils.isNotEmpty(channel_id)) { - JSONObject cbBankConfig = sysChannelConfigMapper.selectByChannelId(channel_id); - if (cbBankConfig == null) { - throw new BadRequestException("不存在该支付渠道"); - } - } - JSONObject updateClient = new JSONObject(); - updateClient.put("client_id", client.getIntValue("client_id")); - updateClient.put(channelKey, channel_id); - clientMapper.update(updateClient); - } - - private JSONObject exportImgAggregateFile(JSONObject account, JSONObject client) throws IOException { - JSONObject result = new JSONObject(); - InputStream stream = null; - try { - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE); - pdu.setPdfTemplate(client); - File file = new File(client.getString("client_moniker") + "_agreement.pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file, "STSong-Light", "UniGB-UCS2-H"); - stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileInfo = attachmentClient.uploadFile(stream, client.getString("client_moniker") + "_" + System.currentTimeMillis() + "_agreement.pdf", false); - ClientAuthFilesInfo clientAuthFilesInfo = new ClientAuthFilesInfo(); - clientAuthFilesInfo.setFile_agreement_info(fileInfo.getString("url")); - clientAuthFilesInfo.setFile_apply_info(null); - clientAuthFilesInfo.setFile_bank_info(null); - clientAuthFilesInfo.setFile_company_info(null); - clientAuthFilesInfo.setFile_id_info(null); - clientAuthFilesInfo.setAuthStatus(0); - result = uploadAuthFilesForWaitCompliance(account, client.getString("client_moniker"), clientAuthFilesInfo).get(0); - } catch (Exception e) { - logger.error("合同制作出现问题:", e); - throw new BadRequestException("合同制作出现问题:" + e.getMessage()); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - return result; - } - - private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) { - TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null); - notice.put("first", "您好,您的合同费率已到期,根据合同协议系统已自动为您延期1年。", "#ff0000"); - notice.put("keyword1", client.getString("short_name") + "(" + client.getString("client_moniker") + ")", "#ff0000"); - notice.put("keyword2", newExpiryDate, "#0000ff"); - notice.put("remark", "如有疑问请联系RoyalPay", "#000000"); - return notice; - } - - - private void sendTestMerchantPassword(List accounts) { - List royalPayUsers = managerMapper.listRoyalPayUsers(); - List needNotifyUsers = royalPayUsers.stream().filter(user -> StringUtils.isNotEmpty(user.getString("wx_openid"))).map(user -> user.getString("wx_openid")).collect(Collectors.toList()); - accounts.forEach(account -> { - TestMerchantAccountInfo accountInfo = new TestMerchantAccountInfo(); - accountInfo.setId(account.getString("username")); - accountInfo.setClientMoniker(account.getString("client_moniker")); - accountInfo.setRole(account.getIntValue("role")); - accountInfo.setUsername(account.getString("username")); - accountInfo.setPassword(account.getString("password")); - mongoTemplate.save(accountInfo); - }); - needNotifyUsers.forEach(userOpenId -> { - try { - MpWechatApi wxApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendTestPasswordTemplate(userOpenId, wxApi.getTemplateId("test-merchant-password")); - wxApi.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e); - } - }); - } - - private TemplateMessage initSendTestPasswordTemplate(String wxopenid, String templateId) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, PlatformEnvironment.getEnv().concatUrl("testMerchantPassword")); - msg.put("first", "系统测试商户账户已重置", "#000000"); - msg.put("keyword1", "PINE", "#0000ff"); - msg.put("keyword2", "账号密码重置", "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("remark", "点击查看", "#0000FF"); - return msg; - } - - private String getCBBankShortLink(String longUrl) { - MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); - return api.registerShortUrl(longUrl); - } - - private JSONObject getRsaKey() { - JSONObject key = new JSONObject(); - KeyPair keyPairGen = RSACrypt.generateKeyPairs(); - RSAPublicKey publicKey = (RSAPublicKey) keyPairGen.getPublic(); - RSAPrivateKey privateKey = (RSAPrivateKey) keyPairGen.getPrivate(); - key.put("public_key", Base64.encodeBase64String(publicKey.getEncoded())); - key.put("private_key", Base64.encodeBase64String(privateKey.getEncoded())); - return key; - } - - @Override - public JSONObject partnerIncrementalService(String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List service = clientIncrementalMapper.findAllByclientMoniker(client.getInteger("client_id")); - List incrementalChannels = new ArrayList<>(); - for (IncrementalChannel e : IncrementalChannel.values()) { - boolean exist = false; - for (JSONObject s : service) { - exist = e.getChannel().equals(s.getString("channel")); - if (exist) { - break; - } - } - if (!exist) { - incrementalChannels.add(e.getChannel()); - } - } - incrementalChannels.remove("system"); - return JsonHelper.newJson(json -> { - json.put("all_service", service); - json.put("incremental_channel", incrementalChannels); - }); - } - - @Override - public JSONObject isLessFiles(JSONObject partner) { - JSONObject client = clientMapper.findClientByMoniker(partner.getString("client_moniker")); - if (client == null) { - throw new InvalidShortIdException(); - } - if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5)) { - boolean lessKycFiles = isPartnerKycfilesComplete(partner.getString("client_moniker")); - partner.put("lessKycFiles", lessKycFiles); - partner.put("lessComplianceFiles", signInAccountService.checkAuthFileStatus(partner.getJSONObject("client")).getBoolean("client_less_file")); - } - partner.put("lessKycFiles", false); - partner.put("lessComplianceFiles", false); - - //todo debug - if ("PINE".equals(partner.getString("client_moniker")) || "LEOH".equals(partner.getString("client_moniker"))) { - partner.put("lessKycFiles", isPartnerKycfilesComplete(partner.getString("client_moniker"))); - partner.put("lessComplianceFiles", signInAccountService.checkAuthFileStatus(partner.getJSONObject("client")).getBoolean("client_less_file")); - } - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - if (clientConfig != null) { - partner.put("geek_shop_status", clientConfig.getBooleanValue("geek_shop_status")); - } - return partner; - } - - @Override - public boolean isPartnerKycfilesComplete(String clientMoniker) { - boolean lessKycFiles = true; - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject KycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id")); - if (KycFilesAuth != null) { - lessKycFiles = false; - } - return lessKycFiles; - } - - @Override - public JSONObject partnerIncrementalServiceInfo(String clientMoniker, String channel) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - JSONObject incrementalInfo = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), channel); - if (!clientConfig.getBooleanValue("geek_shop_status")) { - throw new BadRequestException("Merchant service not opened"); - } - return incrementalInfo; - } - - @Override - public JSONObject getClientIncrementalServiceLoginToken(JSONObject account, String sourceCode) { - JSONObject client = clientMapper.findClient(account.getIntValue("client_id")); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject clientConfig = clientConfigMapper.find(account.getIntValue("client_id")); - if (!clientConfig.getBooleanValue("geek_shop_status")) { - throw new BadRequestException("Merchant service not opened"); - } - return retailRSvcService.getGeekSsoTokenInfo(sourceCode, client.getString("client_moniker")); - } - - @Override - public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel")); - JSONObject saveIncrementalService = new JSONObject(); - if (existIncrementalService == null) { - saveIncrementalService.put("incremental_id", UUID.randomUUID().toString()); - saveIncrementalService.put("channel", incrementalService.getString("channel")); - saveIncrementalService.put("create_time", new Date()); - saveIncrementalService.put("update_time", new Date()); - saveIncrementalService.put("is_valid", 1); - } else { - saveIncrementalService.put("incremental_id", incrementalService.getString("incremental_id")); - saveIncrementalService.put("update_time", new Date()); - } - saveIncrementalService.put("client_id", client.getInteger("client_id")); - saveIncrementalService.put("operator", manager.getString("display_name")); - //增值模式1:固定手续费;2:固定金额扣款 - saveIncrementalService.put("incremental_mode", incrementalService.getIntValue("incremental_rate_value") == 0 ? 2 : 1); - saveIncrementalService.put("incremental_rate_value", incrementalService.getString("incremental_rate_value")); - saveIncrementalService.put("total_incremental_amount", incrementalService.getString("total_incremental_amount")); - saveIncrementalService.put("title", incrementalService.getString("title")); - if (existIncrementalService == null) { - clientIncrementalMapper.save(saveIncrementalService); - if (StringUtils.equalsIgnoreCase("RP跨境商城", saveIncrementalService.getString("channel"))) { - afterGeekShopSave(saveIncrementalService, client); - } - } else { - clientIncrementalMapper.update(saveIncrementalService); - } - } - - @Override - public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel")); - if (existIncrementalService == null) { - throw new BadRequestException("Incremental service is not exist"); - } - - existIncrementalService.put("update_time", new Date()); - existIncrementalService.put("incremental_id", incrementalService.getString("incremental_id")); - existIncrementalService.put("is_valid", incrementalService.getInteger("is_valid")); - existIncrementalService.put("operator", manager.getString("display_name")); - clientIncrementalMapper.update(existIncrementalService); - } - - @Override - public JSONObject findByLookupCode(String code) { - JSONObject industryInfo = industryLookupMapper.findByLookupCode(code); - if (industryInfo == null) { - return JsonHelper.newJson(json -> { - json.put("lookup_code", "code"); - json.put("lookup_value", "未知行业"); - }); - } - return industryInfo; - } - - @Override - public RSvcMchBean findSvcMchByAccountId(String accountId) { - JSONObject mchInfo = clientAccountMapper.findRSvcClientInfo(accountId); - if (mchInfo == null || mchInfo.isEmpty()) { - throw new BadRequestException("Client Not Exists!"); - } - RSvcMchBean svcMchBean = new RSvcMchBean(); - svcMchBean.setMerchantNumber(mchInfo.getString("username")); - svcMchBean.setMerchantName(mchInfo.getString("company_name")); - svcMchBean.setShortName(mchInfo.getString("short_name")); - svcMchBean.setPartnerCode(mchInfo.getString("client_moniker")); - svcMchBean.setCredentialCode(mchInfo.getString("credential_code")); - svcMchBean.setPayHost(PlatformEnvironment.getEnv().mainHost()); - svcMchBean.setLogo(mchInfo.getString("logo_url")); - svcMchBean.setIndustryCode(mchInfo.getString("industry")); - svcMchBean.setIndustryName(findByLookupCode(mchInfo.getString("industry")).getString("lookup_value")); - - svcMchBean.setAddress(mchInfo.getString("mch_address")); - svcMchBean.setRegisteredAddress(mchInfo.getString("bank_address")); - svcMchBean.setContactPerson(mchInfo.getString("contact_person")); - svcMchBean.setContactPhone(mchInfo.getString("contact_phone")); - svcMchBean.setContactEmail(mchInfo.getString("contact_email")); - svcMchBean.setBsbNumber(mchInfo.getString("bsb_no")); - svcMchBean.setAccountNo(mchInfo.getString("account_no")); - svcMchBean.setAccountName(mchInfo.getString("account_name")); - svcMchBean.setTelNumber(""); - svcMchBean.setAbn(mchInfo.getString("abn")); - svcMchBean.setAcn(mchInfo.getString("acn")); - return svcMchBean; - } - - @Override - public void queryModifyClientIds(int clientId, JSONObject params) { - if (StringUtils.isBlank(params.getString("client_ids"))) { - String[] clientIds = getChildClientIds(clientId); - if (clientIds.length > 1) { - params.put("client_ids", clientIds); - } - } - } - - @Override - public boolean getMergeSettleStatus(JSONObject client) { - String extParams = client.getString("ext_params"); - if (extParams != null) { - try { - JSONObject ext = JSON.parseObject(extParams); - return ext.getBooleanValue("merge_settle"); - } catch (JSONException e) { - return false; - } - } - return false; - } - - private void afterGeekShopSave(JSONObject serviceInfo, JSONObject client) { - JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id")); - clientConfig.put("geek_shop_status", 1); - clientConfigMapper.update(clientConfig); - if (serviceInfo.getBigDecimal("total_incremental_amount").compareTo(new BigDecimal(0)) > 0) { - serviceInfo.put("amount", serviceInfo.getString("total_incremental_amount")); - serviceInfo.put("service_code", "RYCBSM"); - String title = serviceInfo.getString("title"); - if (StringUtils.isBlank(title)) { - title = "RP跨境商城开通费用"; - } - serviceInfo.put("title", title); - rServicesApplyService.saveDebitDetail(serviceInfo, client); - } - } - - private String[] getChildClientIds(int clientId) { - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(clientId); - List clientIds = new ArrayList<>(); - List childs = clientMapper.listChildClients(clientId); - clientIds.add(String.valueOf(clientId)); - childs.forEach(p -> { - clientIds.add(p.getString("client_id")); - if (mchConfig.getBooleanValue("level3_mch_config")) { - List clients = clientMapper.listChildClients(p.getIntValue("client_id")); - if (!clients.isEmpty()) { - clients.forEach(e -> clientIds.add(e.getString("client_id"))); - } - } - }); - return clientIds.toArray(new String[]{}); - } - - private void clientApproveIdInfo(JSONObject params, JSONObject client) { - if (StringUtils.isBlank(params.getString("id_type"))) { - params.remove("id_type"); - } - if (StringUtils.isBlank(params.getString("beneficiary_id_title"))) { - params.remove("beneficiary_id_title"); - } - if (StringUtils.isBlank(params.getString("other_id_title_desc"))) { - params.remove("other_id_title_desc"); - } - - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (compliance != null) { - params.put("submit_time", new Date()); - params.put("commit_by_id", params.getString("display_name")); - params.put("status", 1); - compliance.putAll(params); - clientComplianceCompanyMapper.update(compliance); - } else { - params.put("client_id", client.getIntValue("client_id")); - params.put("submit_time", new Date()); - params.put("status", 1); - params.put("source", 2); - params.put("commit_by_id", params.getString("display_name")); - params.put("type", 2); - params.put("is_valid", 1); - clientComplianceCompanyMapper.save(params); - } - } - - private void checkLevel3MchStatus(JSONObject superClient) { - if (superClient.containsKey("parent_client_id") && superClient.getIntValue("parent_client_id") != 0) { - JSONObject superParentClient = getClientInfo(superClient.getIntValue("parent_client_id")); - if (superParentClient == null) { - throw new InvalidShortIdException(); - } - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(superParentClient.getIntValue("client_id")); - if (!mchConfig.getBooleanValue("level3_mch_config")) { - mchConfig.put("level3_mch_config", true); - superParentClient.put("ext_params", mchConfig.toJSONString()); - clientMapper.update(superParentClient); - } - } - } - - @Override - public void changeExtParams(String clientMoniker, JSONObject manager, JSONObject params) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject extParmas = JSON.parseObject(client.getString("ext_params")); - if ("true".equals(params.getString("value")) || "false".equals(params.getString("value"))) { - extParmas.put(params.getString("key"), params.getBoolean("value")); - } else { - extParmas.put(params.getString("key"), params.getString("value")); - } - client.put("ext_params", extParmas.toString()); - clientMapper.update(client); - } - - @Override - public RPayMerchantEntity applyMWMerchantId(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - MerchantApplicationResult result = rPayPaymentCardSvcApi.apply(client, new EmptyMerchantApplication(), manager); - if (result == null) { - throw new ServerErrorException("Failed To Apply For Merchant Warrior Sub Merchant ID"); - } - return rPayMerchantMapper.findMerchant(client.getIntValue("client_id")); - } - - @Override - public RPayMerchantEntity queryMWMerchantIdStatus(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - return rPayPaymentCardSvcApi.findMerchant(client); - } - - @Override - public RPayMerchantEntity queryMWMerchantInfo(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); - return (new RPayMerchantEntity()).applyClientInfo(client).applyBankAccount(bankAccount); - } - - private boolean isAddCardPaymentRate(JSONObject config, int clientId) { - if (!StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type")) - && !StringUtils.equalsIgnoreCase("rpaypmt_dd", config.getString("type"))) { - return false; - } - configNewClientRate(config, clientId, config.getString("type"), "rate_value", null, null); - return true; - } - - @Override - public void selectBillCodeVersion(JSONObject manager, String clientMoniker, String version) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.put("billcode_version", version); - clientMapper.update(client); - clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); - } - - /** - * alipayplus(aps) 注册商户 - * - * @param clientMoniker - * @param apsMerchantApplication - * @param manager - * @return - */ - @Override - public MerchantApplicationResult alipayPlusRegisterMerchant(String clientMoniker, ApsMerchantApplication apsMerchantApplication, JSONObject manager) { - logger.info("====>getWebsiteType:" + apsMerchantApplication.getWebsiteType()); - logger.info("====>getProductCodes:" + apsMerchantApplication.getProductCodes().toString()); - boolean offline = apsMerchantApplication.getProductCodes().stream().allMatch(s -> s.equalsIgnoreCase(ProductCodeType.IN_STORE_PAYMENT.toString())); - logger.info("====>offline:" + offline); - if (offline) { - apsMerchantApplication.setPid(AlipayEnvironment.getEnv().getAlipayPlusApsRetailConfig().getPid()); - } else { - apsMerchantApplication.setPid(AlipayEnvironment.getEnv().getAlipayPlusApsOnlineConfig().getPid()); - } - apsMerchantApplication.setRegion("AU"); - - JSONObject client = sysClientMapper.findClientByMoniker(clientMoniker); - AlipayApsMerchantRegister alipayApsMerchantRegister = Optional.ofNullable(merchantChannelApplicationManager.getRegister(AlipayApsMerchantRegister.class)).orElseThrow(() -> new ServerErrorException("No AlipayAps registry found")); - - MerchantApplicationResult result = alipayApsMerchantRegister.apply(client, apsMerchantApplication, manager); - return result; - } - - @Override - public String queryAlipayPlusOnlineStatus(boolean isRetail, String clientMoniker, JSONObject manager) { - JSONObject client = sysClientMapper.findClientByMoniker(clientMoniker); - client.put("isRetail", isRetail); - String pid = ""; - if (isRetail) { - pid = AlipayEnvironment.getEnv().getAlipayPlusApsRetailConfig().getPid(); - } else { - pid = AlipayEnvironment.getEnv().getAlipayPlusApsOnlineConfig().getPid(); - - } - client.put("pid", pid); - List channelContractDAOS = mchChannelContractMapper.listByPidClientId(isRetail ? PayChannel.ALIPAY_APS_IN_STORE.getChannelCode() : PayChannel.ALIPAY_APS_CASHIER.getChannelCode(), pid, client.getInteger("client_id")); - MchChannelContractDAO mchChannelContractDAO = channelContractDAOS.stream().max(Comparator.comparing(MchChannelContractDAO::getCreateTime)).orElse(null); - String mid = client.getString("client_moniker"); - //数据库有数据 - if (mchChannelContractDAO != null && StringUtils.isNotEmpty(mchChannelContractDAO.getMid())) { - mid = mchChannelContractDAO.getMid(); - } else { - mid = client.getString("client_moniker"); - } - client.put("mid", mid); - AlipayApsMerchantRegister alipayApsMerchantRegister = Optional.ofNullable(merchantChannelApplicationManager.getRegister(AlipayApsMerchantRegister.class)).orElseThrow(() -> new ServerErrorException("No AlipayAps registry found")); - AlipayPlusRegisterResult alipayPlusRegisterResult = alipayApsMerchantRegister.findMerchant(client); - return alipayPlusRegisterResult.getRawResponse(); - } - - @Override - public String queryAlipayPlusOfflineStatus(String clientMoniker, JSONObject manager) { - return null; - } - - @Override - public JSONObject getApsKycClient(JSONObject account, String clientMoniker) { - return apsNoticeClientMapper.getApsKycClient(clientMoniker); - } - - @Override - public void updateApsKycClient(JSONObject account, JSONObject item) { - ApsNoticeClient apsNoticeClientById = apsNoticeClientMapper.getApsNoticeClientById(item.getString("id")); - if (apsNoticeClientById.getReadTime() == null) { - item.put("read_time", new Date()); - } - item.put("status_time", new Date()); - item.put("user_id", account.getString("account_id")); - apsNoticeClientMapper.toUpdateApsKycClient(item); - } - - private void exportLetterOfferPDF(String clientMoniker, JSONObject manage) { - JSONObject info = convertClientLetterOfferInfo(clientMoniker); - String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/letter_of_offer.pdf"; - String fileName = clientMoniker + "Upay Letter Of Variation (business day, amendment).pdf"; - publishExcelCardPDFFile(clientMoniker, manage, fileName, pdfPath, info, LETTER_OF_OFFER_FILE); - } - - private JSONObject convertClientLetterOfferInfo(String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - //合规状态 - if (client.getIntValue("approve_result") != 1 && client.getIntValue("approve_result") == 3) { - throw new BadRequestException("The merchant failed the audit!"); - } - //获取数据源 - int clientId = client.getInteger("client_id"); - JSONObject clientRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "rpaypmt_card"); - if (clientRate == null) { - throw new BadRequestException("rpaypmt_card rate Not configured"); - } - JSONObject cardRate = clientRate.getJSONObject("ext_rates"); - //增加transaction_fee为null异常 - if (!cardRate.containsKey("transaction_fee") || StringUtils.isEmpty(cardRate.getString("transaction_fee"))) { - cardRate.put("transaction_fee", BigDecimal.ZERO); - } - JSONObject bankAccountInfo = clientBankAccountMapper.clientBankAccounts(clientId).get(0); - JSONObject upayProfileInfo = sysClientUpayProfileMapper.findInfo(clientId); - JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); - //装在数据 - JSONObject info = new JSONObject(); - info.put("down_date", formatter.print(new DateTime()));//下载文件日期 - info.put("bussiness_name", (client.containsKey("company_name") ? client.getString("company_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型 - info.put("partner_address", client.getString("address"));//商家店铺地址 - info.put("partner_country", client.getString("country"));//国家 - info.put("partner_state", client.getString("state"));//洲 - info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称 - info.put("clean_days", clientRate.getInteger("clean_days"));//T+规则清算天数 - info.put("partner_industry_mcc", upayProfileInfo.getString("mw_industry"));//信用卡注册商户行业编码 - info.put("legal_bussiness", client.getString("company_name") + " AS " + (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码 - info.put("annual_rate", cardAnnualRate);//年费率 - info.put("cost_per_transaction", clientRate.getString("transaction_fee"));//每次交易成本 - String domesticRateValue = cardRate.getString("domestic_rate_value"); - info.put("domestic_fee", domesticRateValue.contains("rate") ? JSON.parseObject(domesticRateValue).getString("rate") : domesticRateValue);//国内服务费 - String overseasRateValue = cardRate.getString("overseas_rate_value"); - info.put("international_fee", upayProfileInfo.getBooleanValue("enable_international_card") ? - overseasRateValue.contains("rate") ? JSON.parseObject(overseasRateValue).getString("rate") : overseasRateValue : "-");//国际服务费 - BigDecimal reserve = (upayProfileInfo.getBigDecimal("expected_card_revenue").multiply(new BigDecimal("0.005")).setScale(0, RoundingMode.HALF_UP)); - info.put("account_reserve", reserve.compareTo(new BigDecimal(200)) <= 0 ? new BigDecimal(200).toPlainString() : reserve.toPlainString());//账户储备金 - //银行账号信息 - info.put("account_name", bankAccountInfo.getString("account_name"));// - info.put("bsb", bankAccountInfo.getString("bsb_no")); - info.put("account_no", bankAccountInfo.getString("account_no")); - info.put("card_acceptor_name", upayProfileInfo.getString("acceptor_name")); - return info; - } - - private void exportPromotionalOfferPDF(String clientMoniker, JSONObject manager, String rateid, HttpServletResponse httpResponse) { - httpResponse.setContentType("application/pdf"); - httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_PROMOTIONAL_OFFER_" + new Date() + ".pdf"); - JSONObject info = convertPromotionalOfferInfo(clientMoniker, rateid); - String pdfPath = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath() + "templates/pdf/promotional_offer.pdf"; - String fileName = clientMoniker + "_Promotional_Offer.pdf"; - try (ServletOutputStream sos = httpResponse.getOutputStream()) { - File file = new File(fileName); - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(pdfPath); - pdu.setPdfTemplate(info); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - sos.write(bos.toByteArray()); - } catch (Exception e) { - throw new ServerErrorException(); - } - } - - private JSONObject convertPromotionalOfferInfo(String clientMoniker, String rateid) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - //合规状态 - if (client.getIntValue("approve_result") != 1 && client.getIntValue("approve_result") == 3) { - throw new BadRequestException("The merchant failed the audit!"); - } - int clientId = client.getInteger("client_id"); - JSONObject currentRate = clientRateMapper.findRateByRateId(rateid); - if (currentRate == null) { - throw new BadRequestException("rpaypmt_card rate Not configured"); - } - JSONObject cardRate = currentRate.getJSONObject("ext_rates"); - JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); - JSONObject upayProfileInfo = sysClientUpayProfileMapper.findInfo(clientId); - JSONObject info = new JSONObject(); - info.put("down_date", formatter.print(new DateTime()));//下载文件日 - info.put("letter_offer_sub_time", currentRate.getDate("active_time")); - info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型 - info.put("partner_address", client.getString("address"));//商家店铺地址 - info.put("partner_country", client.getString("country"));//国家 - info.put("partner_state", client.getString("state"));//洲 - info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称 - info.put("legal_bussiness", legalInfo.getString("representative_person") + " AS " + (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码 - info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费 - String domesticRateValue = cardRate.getString("domestic_rate_value"); - info.put("domestic_fee", domesticRateValue.contains("rate") ? JSON.parseObject(domesticRateValue).getString("rate") : domesticRateValue);//国内服务费 - String overseasRateValue = cardRate.getString("overseas_rate_value"); - info.put("international_fee", upayProfileInfo.getBooleanValue("enable_international_card") ? - overseasRateValue.contains("rate") ? JSON.parseObject(overseasRateValue).getString("rate") : overseasRateValue : "-");//国际服务费 - info.put("promotional_effective_date", formatter.print(currentRate.getDate("active_time").getTime())); - info.put("promotional_period", formatter.print(currentRate.getDate("expiry_time").getTime())); - return info; - } - - /*private void exportTermsConditionsPDF(String clientMoniker, JSONObject manage) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (client.getIntValue("approve_result") != 1 && client.getIntValue("approve_result") == 3) { - throw new BadRequestException("The merchant failed the audit!"); - } - String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/terms_and_conditions.pdf"; - String fileName = clientMoniker + "_Terms_And_Conditions.pdf"; - publishExcelCardPDFFile(clientMoniker, manage, fileName, pdfPath, new JSONObject(), TERMS_AND_CONDITIONS_FILE); - }*/ - - private void publishExcelCardPDFFile(String clientMoniker, JSONObject manager, String fileName, String pdfPath, JSONObject info, String fileLabel) { - try { - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(pdfPath); - pdu.setPdfTemplate(info); - try { - File file = new File(fileName); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - InputStream stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileRes = attachmentClient.uploadFile(stream, fileName, false); - if (fileRes != null) { - importCardAgreeFile(clientMoniker, manager, fileRes.getString("url"), fileLabel); - } - stream.close(); - } catch (Exception e) { - logger.error("合同制作出现问题:", e); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void importCardAgreeFile(String clientMoniker, JSONObject manager, String sourceFile, String fileLabel) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - if (sourceFile != null) { - List existFiles = clientFilesMapper.findFileByClientAndType(client.getIntValue("client_id"), fileLabel); - JSONObject existFile = null; - if (!CollectionUtils.isEmpty(existFiles)) { - existFile = existFiles.get(0); - } - Date now = new Date(); - JSONObject file = new JSONObject(); - file.put("file_name", fileLabel); - file.put("file_value", sourceFile); - file.put("client_id", client.getIntValue("client_id")); - file.put("last_update_date", now); - file.put("status", 1); - file.put("is_valid", 1); - if (manager == null) { - file.put("last_update_by", "System Import"); - } else { - file.put("last_update_by", manager.getString("display_name")); - } - JSONObject contract = clientsContractMapper.findByClientId(client.getIntValue("client_id")); - if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 || !contract.getBoolean("has_sign") || existFile == null - || existFile.isEmpty()) { - clientFilesMapper.save(file); - } else { - file.put("file_id", existFile.getString("file_id")); - clientFilesMapper.update(file); - } - } - } - - public void saveLegalAndMarketingInfo(JSONObject partner) { - JSONObject representativeInfo = new JSONObject(); - representativeInfo.put("client_id", partner.getIntValue("client_id")); - representativeInfo.put("representative_person", partner.getString("legal_representative_person")); - representativeInfo.put("phone", partner.getString("legal_representative_phone")); - representativeInfo.put("email", partner.getString("legal_representative_email")); - representativeInfo.put("job_title", partner.getString("legal_representative_job")); - representativeInfo.put("address", partner.getString("registered_address")); - representativeInfo.put("suburb", partner.getString("registered_suburb")); - representativeInfo.put("postcode", partner.getString("registered_postcode")); - representativeInfo.put("state", partner.getString("registered_state")); - representativeInfo.put("legal_representative_wechatid", partner.getString("legal_representative_wechatid")); - representativeInfo.put("legal_representative_id", partner.getString("legal_representative_id")); - representativeInfo.put("marketing_person", partner.getString("marketing_person")); - representativeInfo.put("marketing_phone", partner.getString("marketing_phone")); - representativeInfo.put("marketing_email", partner.getString("marketing_email")); - representativeInfo.put("marketing_job_title", partner.getString("marketing_job")); - representativeInfo.put("marketing_wechatid", partner.getString("marketing_wechatid")); - sysClientLegalPersonMapper.save(representativeInfo); - } - @Override - public JSONObject getSettleConfig(String clientMoniker, JSONObject manager) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - return getSettleConfigIgnoreValid(client, manager); - } - - /** - * 获取清算配置抽离出来 - * - * @param client - * @param manager - * @return - */ - private JSONObject getSettleConfigIgnoreValid(JSONObject client, JSONObject manager) { - OrgCheckUtils.checkOrgPermission(manager, client); - JSONObject clientConfig = clientConfigService.find(client.getIntValue("client_id")); - JSONObject config = new JSONObject(); - config.put("enable_cross_payment",clientConfig.getBoolean("enable_cross_payment")); - config.put("enable_card_payment",clientConfig.getBoolean("enable_card_payment")); - config.put("manual", client.getBooleanValue("manual_settle") ); - config.put("min", new BigDecimal( client.getString("min_settle")).toPlainString()); - config.put("settle_hour", client.getInteger("settle_hour")); - if (clientConfig == null) { - clientConfig = new JSONObject(); - clientConfig.put("client_id", client.getIntValue("client_id")); - clientConfig.put("terminal_charge_rule", "1 * ?"); - clientConfig.put("terminal_charge_skip", 1); - clientConfig.put("free_charge_amount", 0); - clientConfig.put("terminal_per_amount", 0); - clientConfig.put("creation_date", new Date()); - clientConfig.put("creation_by", "System"); - clientConfig.put("last_update_date", new Date()); - clientConfig.put("enable_org_rate_value", 0); - clientConfig.put("ladder_charge", 0); - clientConfig.put("max_settle_days", 0); - clientConfigService.save(clientConfig); - } -// config.put("max_settle_days", clientConfig.getInteger("max_settle_days")); - String settleRule = client.getString("settle_rule"); - if ("* * ?".equals(settleRule)) { - config.put("everyday", true); - } else { - config.put("everyday", false); - CronDefinition cronDefinition = - CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ); - CronParser parser = new CronParser(cronDefinition); - Cron cron = parser.parse("0 0 0 " + settleRule); - if (settleRule.startsWith("? * ")) { - String dayOfWeek = cron.retrieve(CronFieldName.DAY_OF_WEEK).getExpression().asString(); -// logger.info("DAY_OF_WEEK CRON => " + dayOfWeek); - config.put("rule_type", "DAY_OF_WEEK"); - config.put("days", dayOfWeek.split(",")); - } - if (settleRule.endsWith(" * ?")) { - String dayOfMon = cron.retrieve(CronFieldName.DAY_OF_MONTH).getExpression().asString(); -// logger.info("DAY_OF_WEEK CRON => " + dayOfMon); - config.put("rule_type", "DAY_OF_MONTH"); - config.put("days", dayOfMon.split(",")); - } - } - logger.info("=====>config:"+config.toJSONString()); - return config; - } - @Override - public void configSettleDetail(JSONObject manager, String clientMoniker, SettleDetail detail) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - OrgCheckUtils.checkOrgPermission(manager, client); - logger.info(manager.getString("username") + " changed settle hour to " + detail.getHour()); - JSONObject update = new JSONObject(); - update.put("client_id", client.getIntValue("client_id")); - update.put("settle_hour", detail.getHour()); - update.put("settle_rule", detail.ruleToCron()); -// if (detail.isManual()) { -// update.put("allow_settle", 1); -// update.put("skip_clearing", 1); -// } - update.put("min_settle", CurrencyAmountUtils.scale(detail.getMin(), PlatformEnvironment.getEnv().getForeignCurrency())); - clientMapper.update(update); - logger.info("=====>update:{}",update.toJSONString()); - -// JSONObject clientConfig = clientConfigService.find(client.getIntValue("client_id")); -// clientConfig.put("max_settle_days", detail.getMax_settle_days()); -// clientConfigService.update(clientConfig); - - clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); - - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java deleted file mode 100644 index cbfe34003..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; -import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; -import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Create by yixian at 2018-04-12 16:25 - */ -@Service -public class ClientModifySupportImpl implements ClientModifySupport { - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private MerchantSignInfoMapper merchantSignInfoMapper; - @Resource - private ClientInfoCacheSupport clientInfoCacheSupport; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientConfigMapper clientConfigMapper; - @Resource - private MongoTemplate mongoTemplate; - - @Override - public void processModify(ClientModifyOperation modify) { - int clientId = modify.processModify(merchantInfoProvider, mongoTemplate); - clientInfoCacheSupport.clearClientCache(clientId); - } - - @Override - public void processClientModify(ClientModify modify) { - processModify(modify.setModifyConsumer(modifyObj -> clientMapper.update(modifyObj))); - } - - @Override - public void processClientConfigModify(ClientModify clientConfigModify) { - processModify(clientConfigModify.setModifyConsumer(modifyObj -> { - clientMapper.update(modifyObj); - clientConfigMapper.update(modifyObj); - })); - } - - @Override - public void processClientConfigModify(ClientModify clientConfigModify, boolean onlyModifyConfig) { - processModify(clientConfigModify.setModifyConsumer(modifyObj -> { - if (!onlyModifyConfig) { - clientMapper.update(modifyObj); - } - clientConfigMapper.update(modifyObj); - })); - } - - @Override - public void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify) { - processModify(clientGatewaySignModify.setMerchantSignInfoMapper(merchantSignInfoMapper)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientSignEventSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientSignEventSupportImpl.java deleted file mode 100644 index f365a83fd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientSignEventSupportImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.manage.mappers.act.ActSignEventsSignLogMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; -import au.com.royalpay.payment.manage.merchants.events.ClientSignEvent; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-04-11. - */ -@Service -public class ClientSignEventSupportImpl implements ClientSignEventSupport, ApplicationEventPublisherAware { - @Resource - private ActSignEventsSignLogMapper actSignEventsSignLogMapper; - private ApplicationEventPublisher publisher; - - @Override - public List listUnhandledSignEvents(int clientId) { - return actSignEventsSignLogMapper.checkUnsigned(clientId); - } - - @Override - public void sign(JSONObject account, String signId) { - JSONObject sign = actSignEventsSignLogMapper.find(signId); - if (sign == null || sign.getIntValue("client_id") != account.getIntValue("client_id")) { - throw new BadRequestException("合同不存在"); - } - actSignEventsSignLogMapper.updateSignInfo(signId, new Date(), account.getString("account_id"), RequestEnvironment.getClientIp()); - publisher.publishEvent(new ClientSignEvent(this, sign.getIntValue("sign_event_id"), sign.getIntValue("client_id"))); - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/MerchantChannelPermissionServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/MerchantChannelPermissionServiceImpl.java deleted file mode 100644 index 6d5681fe0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/MerchantChannelPermissionServiceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls; - -import au.com.royalpay.payment.channels.rpaypaymentsvc.mappers.RPayMerchantMapper; -import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.request.entities.RPayMerchantEntity; -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; -import au.com.royalpay.payment.manage.mappers.system.SysClientUpayProfileMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.merchants.core.MerchantChannelPermissionService; -import au.com.royalpay.payment.tools.defines.PayChannel; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.merchants.exceptions.NoRateConfigException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Date; - -@Service -public class MerchantChannelPermissionServiceImpl implements MerchantChannelPermissionService { - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private ClientManager clientManager; - @Resource - private SysClientUpayProfileMapper sysClientUpayProfileMapper; - @Resource - private RPayMerchantMapper rPayMerchantMapper; - @Resource - private ClientRateMapper clientRateMapper; - @Resource - private PaymentApi paymentApi; - - @Override - @Transactional - public RPayMerchantEntity copyMerchantWarriorConfig(JSONObject manager, String targetClientMoniker, String sourceClientMoniker) { - JSONObject targetMerchant = merchantInfoProvider.getClientInfoByMoniker(targetClientMoniker); - if (targetMerchant == null) { - throw new NotFoundException("Merchant not found:" + targetClientMoniker); - } - JSONObject sourceMerchant = merchantInfoProvider.getClientInfoByMoniker(sourceClientMoniker); - if (sourceMerchant == null) { - throw new NotFoundException("Merchant not found:" + sourceClientMoniker); - } - int sourceClientId = sourceMerchant.getIntValue("client_id"); - int targetClientId = targetMerchant.getIntValue("client_id"); - JSONObject targetProfile = sysClientUpayProfileMapper.findInfo(targetClientId); - if (targetProfile == null) { - JSONObject sourceProfile = sysClientUpayProfileMapper.findInfo(sourceClientId); - if (sourceProfile == null) { - throw new BadRequestException("Missing merchant's UPay profile"); - } - targetProfile = new JSONObject(sourceProfile); - targetProfile.put("client_id", targetClientId); - targetProfile.put("client_moniker", targetMerchant.getString("client_moniker")); - sysClientUpayProfileMapper.save(targetProfile); - } - RPayMerchantEntity targetRPayMch = rPayMerchantMapper.findMerchant(targetClientId); - if (targetRPayMch == null) { - RPayMerchantEntity sourceRPayMch = rPayMerchantMapper.findMerchant(sourceClientId); - if (sourceRPayMch == null) { - throw new BadRequestException("Source merchant not enabled card payment"); - } - targetRPayMch = sourceRPayMch; - targetRPayMch.setClientId(targetMerchant.getIntValue("client_id")); - targetRPayMch.setClientMoniker(targetMerchant.getString("client_moniker")); - rPayMerchantMapper.save(targetRPayMch); - } - boolean enableCard = paymentApi.channelApi(PayChannel.RPAY_CHANNEL_CARD.getChannelCode()).getChannelPermissionResolver().channelEnabled(sourceMerchant); - boolean enableDd = paymentApi.channelApi(PayChannel.RPAY_CHANNEL_DD.getChannelCode()).getChannelPermissionResolver().channelEnabled(sourceMerchant); - clientManager.switchChannelPermission(manager, targetClientMoniker, PayChannel.RPAY_CHANNEL_CARD.getChannelCode(), enableCard); - clientManager.switchChannelPermission(manager, targetClientMoniker, PayChannel.RPAY_CHANNEL_DD.getChannelCode(), enableDd); - try { - merchantInfoProvider.clientCurrentRate(targetClientId, new Date(), PayChannel.RPAY_CHANNEL_CARD.getChannelCode()); - } catch (NoRateConfigException e) { - JSONObject rate = merchantInfoProvider.clientCurrentRate(sourceClientId, new Date(), PayChannel.RPAY_CHANNEL_CARD.getChannelCode()); - rate.put("client_id", targetClientId); - rate.remove("client_rate_id"); - clientRateMapper.saveRate(rate); - } - return targetRPayMch; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplyBankAccountValidator.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplyBankAccountValidator.java deleted file mode 100644 index fa0020a33..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplyBankAccountValidator.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls.complyValidators; - -import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2017-02-15. - */ -@Service -public class ClientComplyBankAccountValidator implements ClientComplyValidator { - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - - @Override - public void validClient(JSONObject client) { - List accounts = clientBankAccountMapper.clientBankAccounts(client.getIntValue("client_id")); - if (accounts.isEmpty()) { - throw new BadRequestException("Bank Account Not set!"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplyRateValidator.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplyRateValidator.java deleted file mode 100644 index a10f014dd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplyRateValidator.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls.complyValidators; - -import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2017-02-15. - */ -@Service -public class ClientComplyRateValidator implements ClientComplyValidator { - @Resource - private ClientRateMapper clientRateMapper; - - @Override - public void validClient(JSONObject client) { - List rates = clientRateMapper.listCurrentClientRates(client.getIntValue("client_id"), new Date(), "Wechat"); - if (rates.size() != 1) { - throw new BadRequestException("Client Rate not configured or duplicated!"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplySubMerchantIDValidator.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplySubMerchantIDValidator.java deleted file mode 100644 index 2ffaa5da7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/complyValidators/ClientComplySubMerchantIDValidator.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.core.impls.complyValidators; - -import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -/** - * Created by yixian on 2017-02-15. - */ -@Service -public class ClientComplySubMerchantIDValidator implements ClientComplyValidator { - @Override - public void validClient(JSONObject client) { - if (StringUtils.isEmpty(client.getString("sub_merchant_id"))) { - throw new BadRequestException("Sub Merchant ID Not set!"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/deacriptor/ApsConfigDescriptor.java b/src/main/java/au/com/royalpay/payment/manage/merchants/deacriptor/ApsConfigDescriptor.java deleted file mode 100644 index 32869a109..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/deacriptor/ApsConfigDescriptor.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.deacriptor; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Accessors(chain = true) -public class ApsConfigDescriptor { - - private Boolean alipayCnSwitch; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ApsConfigData.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ApsConfigData.java deleted file mode 100644 index 017a014e7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ApsConfigData.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity; - - -import au.com.royalpay.payment.manage.merchants.deacriptor.ApsConfigDescriptor; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; -import java.util.UUID; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Accessors(chain = true) -public class ApsConfigData implements Serializable { - - private String id; - - private String creator; - - private Date createTime; - - private String modifier; - - private Date modifyTime; - - private String clientId; - - private Boolean alipayCnSwitch; - - public static ApsConfigData saveData(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor) { - return new ApsConfigData() - .setClientId(clientId) - .setId(UUID.randomUUID().toString().replace("-", "")) - .setAlipayCnSwitch(apsConfigDescriptor.getAlipayCnSwitch()) - .setCreator(managerId) - .setCreateTime(new Date()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java deleted file mode 100644 index e3dd601ca..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity; - -import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; -import java.util.function.Consumer; - -/** - * Create by yixian at 2018-04-12 16:19 - */ -public abstract class ClientGatewaySignModify extends ClientModifyOperation { - - private MerchantSignInfoMapper merchantSignInfoMapper; - - public ClientGatewaySignModify(JSONObject account, String clientMoniker) { - super(account, clientMoniker); - } - - protected abstract String business(); - - protected abstract JSONObject getModifyResult(); - - @Override - protected Consumer getModifyProcess() { - return client -> { - JSONObject modifyResult = getModifyResult(); - modifyResult.put("client_moniker", getClientMoniker()); - modifyResult.put("last_update_by", getAccount().getString("account_id")); - modifyResult.put("last_update_date", new Date()); - merchantSignInfoMapper.update(modifyResult); - }; - } - - public ClientGatewaySignModify setMerchantSignInfoMapper(MerchantSignInfoMapper merchantSignInfoMapper) { - this.merchantSignInfoMapper = merchantSignInfoMapper; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModify.java deleted file mode 100644 index d0e036a35..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModify.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity; - -import com.alibaba.fastjson.JSONObject; - -import java.util.function.Consumer; - -/** - * Create by yixian at 2018-04-12 16:19 - */ -public abstract class ClientModify extends ClientModifyOperation { - - private Consumer modifyConsumer; - - public ClientModify(JSONObject account, String clientMoniker) { - super(account, clientMoniker); - } - - @Override - protected Consumer getModifyProcess() { - return client -> { - JSONObject modifyResult = getModifyResult(); - int clientId = client.getIntValue("client_id"); - modifyResult.put("client_id", clientId); - modifyConsumer.accept(modifyResult); - }; - } - - public ClientModify setModifyConsumer(Consumer modifyConsumer) { - this.modifyConsumer = modifyConsumer; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModifyOperation.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModifyOperation.java deleted file mode 100644 index d84d8c4ca..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModifyOperation.java +++ /dev/null @@ -1,79 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity; - -import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.utils.id.IdUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.data.mongodb.core.MongoTemplate; - -import java.util.Date; -import java.util.Map; -import java.util.function.Consumer; -import java.util.stream.Collectors; - -/** - * Create by davep at 2020-05-12 14:32 - */ -public abstract class ClientModifyOperation { - private final JSONObject account; - private final String clientMoniker; - - protected ClientModifyOperation(JSONObject account, String clientMoniker) { - this.account = account; - this.clientMoniker = clientMoniker; - } - - protected abstract String business(); - - protected abstract JSONObject getModifyResult(); - - protected abstract Consumer getModifyProcess(); - - public int processModify(MerchantInfoProvider merchantInfoProvider, MongoTemplate mongoTemplate) { - JSONObject client = merchantInfoProvider.getClientInfoByMoniker(getClientMoniker()); - JSONObject modifyResult = getModifyResult(); - try { - saveModifyHistory(client, modifyResult, mongoTemplate); - } catch (Exception e) { - - } - getModifyProcess().accept(client); - return client.getIntValue("client_id"); - } - - protected void saveModifyHistory(JSONObject client, JSONObject modifyResult, MongoTemplate mongoTemplate) { - if (account == null) { - return; - } - ClientConfigLog clientConfigLog = new ClientConfigLog(); - clientConfigLog.setId(IdUtil.getId()); - clientConfigLog.setBusiness(business()); - clientConfigLog.setClientId(client.getIntValue("client_id")); - - boolean isPartner = true; - if (StringUtils.isNotEmpty(account.getString("account_id"))) { - isPartner = true; - } - if (StringUtils.isNotEmpty(account.getString("manager_id"))) { - isPartner = false; - } - clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager"); - clientConfigLog.setCreateTime(new Date()); - clientConfigLog.setNewData(modifyResult.toJSONString()); - clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id")); - Map beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get)); - clientConfigLog.setOriginData(JSON.toJSONString(beforeModify)); - clientConfigLog.setUserName(account.getString("display_name")); - mongoTemplate.insert(clientConfigLog); - } - - public JSONObject getAccount() { - return account; - } - - public String getClientMoniker() { - return clientMoniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ApproveEmailModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ApproveEmailModify.java deleted file mode 100644 index 6f9c5f960..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ApproveEmailModify.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class ApproveEmailModify extends ClientModify { - private int approve_email_send; - - public ApproveEmailModify(JSONObject account, String clientMoniker, int approve_email_send) { - super(account, clientMoniker); - this.approve_email_send = approve_email_send; - - } - - @Override - protected String business() { - return "开启绿色通道"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("approve_email_send", approve_email_send); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java deleted file mode 100644 index ec3e02f5a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java +++ /dev/null @@ -1,69 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; - -import java.util.Date; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class AuditModify extends ClientModify { - private Integer source; - private Integer open_status; - private Integer approve_result; - private String approver; - private Date approve_time; - private String refuse_remark; - - public AuditModify(JSONObject account, String clientMoniker, Integer approve_result, String approver, Date approve_time) { - super(account, clientMoniker); - this.approve_result = approve_result; - this.approver = approver; - this.approve_time = approve_time; - } - - @Override - protected String business() { - return "修改商户source状态为:" + source; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("approve_result", approve_result); - modify.put("approver", approver); - modify.put("approve_time", approve_time); - if (source != null) { - modify.put("source", source); - } - modify.put("open_status", open_status); - if (StringUtils.isNotEmpty(refuse_remark)) { - modify.put("refuse_remark", refuse_remark); - } - return modify; - } - - public void setSource(Integer source) { - this.source = source; - } - - public void setOpen_status(Integer open_status) { - this.open_status = open_status; - } - - public void setRefuse_remark(String refuse_remark) { - this.refuse_remark = refuse_remark; - } - - public void setApprove_result(Integer approve_result) { - this.approve_result = approve_result; - } - - public Integer getOpen_status() { - return open_status; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/BDUserModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/BDUserModify.java deleted file mode 100644 index c6014b97a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/BDUserModify.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class BDUserModify extends ClientModify { - private String bd_user; - private String bd_user_name; - private int org_id; - - public BDUserModify(JSONObject account, String clientMoniker, String bd_user, String bd_user_name) { - super(account, clientMoniker); - this.bd_user = bd_user; - this.bd_user_name = bd_user_name; - } - - public int getOrg_id() { - return org_id; - } - - public void setOrg_id(int org_id) { - this.org_id = org_id; - } - - @Override - protected String business() { - return "修改商户BD为"+bd_user_name+"("+bd_user+")"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("bd_user", bd_user); - if(StringUtils.isNotEmpty(bd_user_name)) { - modify.put("bd_user_name", bd_user_name); - } - if(org_id!=0){ - modify.put("org_id",org_id); - } - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CBBankPaypadVersionModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CBBankPaypadVersionModify.java deleted file mode 100644 index 6d87f14ec..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CBBankPaypadVersionModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class CBBankPaypadVersionModify extends ClientModify { - private String cbbankPaypadVersion; - - public CBBankPaypadVersionModify(JSONObject account, String clientMoniker, String paypad_version) { - super(account, clientMoniker); - this.cbbankPaypadVersion = paypad_version; - } - - @Override - protected String business() { - - return ""; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("cbbank_paypad_version", cbbankPaypadVersion); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ClearDaysModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ClearDaysModify.java deleted file mode 100644 index 18d53654c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ClearDaysModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class ClearDaysModify extends ClientModify { - private int settleHour; - - public ClearDaysModify(JSONObject account, String clientMoniker, int settleHour) { - super(account, clientMoniker); - this.settleHour = settleHour; - } - - @Override - protected String business() { - - return "修改商户清算截止时间为:" + settleHour; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("settle_hour", settleHour); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ClientMinSettleModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ClientMinSettleModify.java deleted file mode 100644 index 2e9f9cd18..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ClientMinSettleModify.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; - -public class ClientMinSettleModify extends ClientModify { - private final BigDecimal minSettle; - - public ClientMinSettleModify(JSONObject account, String clientMoniker, BigDecimal minSettle) { - super(account, clientMoniker); - this.minSettle = minSettle; - } - - @Override - protected String business() { - return "设置起结金额:" + minSettle.toPlainString(); - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("min_settle", minSettle); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CredentialCodeModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CredentialCodeModify.java deleted file mode 100644 index 83bf41b6e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CredentialCodeModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class CredentialCodeModify extends ClientModify { - private String credentialCode; - - - public CredentialCodeModify(JSONObject account, String clientMoniker, String credentialCode) { - super(account, clientMoniker); - this.credentialCode = credentialCode; - } - - @Override - protected String business() { - return "重置商户secret"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("credential_code", credentialCode); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CustomSwitchModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CustomSwitchModify.java deleted file mode 100644 index 82b180a0d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CustomSwitchModify.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation; -import com.alibaba.fastjson.JSONObject; - -import java.util.function.Consumer; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class CustomSwitchModify extends ClientModifyOperation { - private final String key; - private final boolean value; - private final Consumer modifyProcess; - - - public CustomSwitchModify(JSONObject account, String clientMoniker, String key, boolean value, Consumer modifyProcess) { - super(account, clientMoniker); - this.key = key; - this.value = value; - this.modifyProcess = modifyProcess; - } - - @Override - protected String business() { - - return (value ? "开启 " : "关闭 ") + key; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put(key, value); - return modify; - } - - @Override - protected Consumer getModifyProcess() { - return modifyProcess; - } - - -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CustomerSurchargeRateModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CustomerSurchargeRateModify.java deleted file mode 100644 index 1afc7b5f4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/CustomerSurchargeRateModify.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class CustomerSurchargeRateModify extends ClientModify { - private BigDecimal customerSurchargeRate; - - public CustomerSurchargeRateModify(JSONObject account, String clientMoniker, BigDecimal customerSurchargeRate) { - super(account, clientMoniker); - this.customerSurchargeRate = customerSurchargeRate; - } - - @Override - protected String business() { - - return "修改商户客户手续费率为:" + customerSurchargeRate; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("customer_surcharge_rate", customerSurchargeRate); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/DisableModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/DisableModify.java deleted file mode 100644 index 9f0c57741..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/DisableModify.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class DisableModify extends ClientModify { - private boolean is_valid; - - - public DisableModify(JSONObject account, String clientMoniker, boolean is_valid) { - super(account, clientMoniker); - this.is_valid = is_valid; - } - - @Override - protected String business() { - return is_valid?"开启":"禁用"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("is_valid", is_valid); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/EmailModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/EmailModify.java deleted file mode 100644 index 3a2818bff..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/EmailModify.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class EmailModify extends ClientModify { - private int approve_email_send; - private String approve_email_id; - - public EmailModify(JSONObject account, String clientMoniker, int approve_email_send, String approve_email_id) { - super(account, clientMoniker); - this.approve_email_send = approve_email_send; - this.approve_email_id = approve_email_id; - } - - @Override - protected String business() { - return "修改商户邮件发送状态为准备发送"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("approve_email_send", approve_email_send); - modify.put("approve_email_id", approve_email_id); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/EmailSendStandByModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/EmailSendStandByModify.java deleted file mode 100644 index ad9db9163..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/EmailSendStandByModify.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class EmailSendStandByModify extends ClientModify { - private BigDecimal maxOrderAmount; - - - public EmailSendStandByModify(JSONObject account, String clientMoniker, BigDecimal maxOrderAmount) { - super(account, clientMoniker); - this.maxOrderAmount = maxOrderAmount; - } - - @Override - protected String business() { - return "修改商户最大订单额为:" + maxOrderAmount; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("max_order_amount", maxOrderAmount); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GatewayInfoModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GatewayInfoModify.java deleted file mode 100644 index f369c0d8b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GatewayInfoModify.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class GatewayInfoModify extends ClientGatewaySignModify { - private String key; - private String value; - private String changeMess; - - - public GatewayInfoModify(JSONObject account, String clientMoniker, String key, String value, String changeMess) { - super(account, clientMoniker); - this.key = key; - this.value = value; - this.changeMess = changeMess; - } - - @Override - protected String business() { - return changeMess; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put(key, value); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GreenChannelModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GreenChannelModify.java deleted file mode 100644 index 77b8e35b4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GreenChannelModify.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class GreenChannelModify extends ClientModify { - private String manager_id; - - public GreenChannelModify(JSONObject account, String clientMoniker, String manager_id) { - super(account, clientMoniker); - this.manager_id = manager_id; - - } - - @Override - protected String business() { - return "开启绿色通道"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("approver", manager_id); - modify.put("approve_result", 2); - modify.put("approve_time", new Date()); - modify.put("skip_clearing", 0); - modify.put("open_status", 1); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/MaxOrderAmountModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/MaxOrderAmountModify.java deleted file mode 100644 index d1c186876..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/MaxOrderAmountModify.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class MaxOrderAmountModify extends ClientModify { - private BigDecimal maxOrderAmount; - - - public MaxOrderAmountModify(JSONObject account, String clientMoniker, BigDecimal maxOrderAmount) { - super(account, clientMoniker); - this.maxOrderAmount = maxOrderAmount; - } - - @Override - protected String business() { - return "修改商户最大订单额为:" + maxOrderAmount; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("max_order_amount", maxOrderAmount); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/MerchantIdModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/MerchantIdModify.java deleted file mode 100644 index c7422e6ba..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/MerchantIdModify.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class MerchantIdModify extends ClientModify { - private String sub_merchant_id; - private String merchant_id; - - public MerchantIdModify(JSONObject account, String clientMoniker, String sub_merchant_id, String merchant_id) { - super(account, clientMoniker); - this.sub_merchant_id = sub_merchant_id; - this.merchant_id = merchant_id; - - } - - @Override - protected String business() { - return "修改商户号:sub_merchant_id:"+ sub_merchant_id +" merchant_id:"+merchant_id; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("sub_merchant_id", sub_merchant_id); - modify.put("merchant_id", merchant_id); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/OpenStatusModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/OpenStatusModify.java deleted file mode 100644 index 6885ee6c8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/OpenStatusModify.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class OpenStatusModify extends ClientModify { - private int open_status; - private Date approve_time; - private Integer approve_result; - - public OpenStatusModify(JSONObject account, String clientMoniker, int open_status) { - super(account, clientMoniker); - this.open_status = open_status; - } - - @Override - protected String business() { - return "修改商户状态为:" + open_status; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("open_status", open_status); - if(approve_time != null){ - modify.put("approve_time", approve_time); - } - if(approve_result != null){ - modify.put("approve_result", approve_result); - } - return modify; - } - - public void setApprove_time(Date approve_time) { - this.approve_time = approve_time; - } - - public void setApprove_result(Integer approve_result) { - this.approve_result = approve_result; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/OrderExpiryModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/OrderExpiryModify.java deleted file mode 100644 index 163d874e7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/OrderExpiryModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class OrderExpiryModify extends ClientModify { - private String orderExpiryConfig; - - - public OrderExpiryModify(JSONObject account, String clientMoniker, String orderExpiryConfig) { - super(account, clientMoniker); - this.orderExpiryConfig = orderExpiryConfig; - } - - @Override - protected String business() { - return "重新设置商户订单有效期"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("order_expiry_config", orderExpiryConfig); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ParentIdModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ParentIdModify.java deleted file mode 100644 index 4d18a671c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/ParentIdModify.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class ParentIdModify extends ClientModify { - private Integer parent_client_id; - - public void setParent_client_id(int parent_client_id) { - this.parent_client_id = parent_client_id; - } - - public ParentIdModify(JSONObject account, String clientMoniker, Integer parent_client_id) { - super(account, clientMoniker); - this.parent_client_id = parent_client_id; - } - - @Override - protected String business() { - return "修改商户父id为:"+parent_client_id; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("parent_client_id", parent_client_id); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/PaypadVersionModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/PaypadVersionModify.java deleted file mode 100644 index ea81abe5d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/PaypadVersionModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class PaypadVersionModify extends ClientModify { - private String paypadVersion; - - public PaypadVersionModify(JSONObject account, String clientMoniker, String paypadVersion) { - super(account, clientMoniker); - this.paypadVersion = paypadVersion; - } - - @Override - protected String business() { - - return ""; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("paypad_version", paypadVersion); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundAuditModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundAuditModify.java deleted file mode 100644 index c68e90989..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundAuditModify.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class RefundAuditModify extends ClientModify { - private boolean enable; - - public RefundAuditModify(JSONObject account, String clientMoniker, boolean enable) { - super(account, clientMoniker); - this.enable = enable; - } - - @Override - protected String business() { - return (enable ? "打开" : "关闭") + "refund_audit"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("enable_refund_auth", enable); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundPWDModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundPWDModify.java deleted file mode 100644 index 2c3bea1aa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundPWDModify.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class RefundPWDModify extends ClientModify { - private String refund_pwd; - private String refund_pwd_salt; - - public RefundPWDModify(JSONObject account, String clientMoniker, String refund_pwd, String refund_pwd_salt) { - super(account, clientMoniker); - this.refund_pwd = refund_pwd; - this.refund_pwd_salt = refund_pwd_salt; - } - - @Override - protected String business() { - - return "修改退款密码为:"+refund_pwd; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("refund_pwd", refund_pwd); - modify.put("refund_pwd_salt", refund_pwd_salt); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefuseModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefuseModify.java deleted file mode 100644 index cd8b57b4e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefuseModify.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import com.alibaba.fastjson.JSONObject; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class RefuseModify extends ClientModify { - private int source; - - public RefuseModify(JSONObject account, String clientMoniker, int source) { - super(account, clientMoniker); - this.source = source; - } - - @Override - protected String business() { - return "修改商户source状态为:" + source; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("source", source); - return modify; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java deleted file mode 100644 index cf963abc8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class SettleHourModify extends ClientModify { - private Integer settleHour; - - public SettleHourModify(JSONObject account, String clientMoniker, Integer settleHour) { - super(account, clientMoniker); - this.settleHour = settleHour; - } - - @Override - protected String business() { - - return "修改商户清算截止时间为:" + settleHour; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("settle_hour", settleHour); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SourceModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SourceModify.java deleted file mode 100644 index c8a571728..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SourceModify.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class SourceModify extends ClientModify { - private int source; - - public SourceModify(JSONObject account, String clientMoniker, int source) { - super(account, clientMoniker); - this.source = source; - } - - @Override - protected String business() { - return "修改商户source状态为:" + source; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("source", source); - return modify; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SurchargeModeModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SurchargeModeModify.java deleted file mode 100644 index 4bd56b6c0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SurchargeModeModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class SurchargeModeModify extends ClientModify { - private String surcharge_mode; - - - public SurchargeModeModify(JSONObject account, String clientMoniker, String surcharge_mode) { - super(account, clientMoniker); - this.surcharge_mode = surcharge_mode; - } - - @Override - protected String business() { - return "切换商户清算模式(surcharge_mode)"; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("surcharge_mode", surcharge_mode); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchAllowSurchargeCreditModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchAllowSurchargeCreditModify.java deleted file mode 100644 index a6b676057..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchAllowSurchargeCreditModify.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class SwitchAllowSurchargeCreditModify extends ClientModify { - private String key; - private boolean value; - - public SwitchAllowSurchargeCreditModify(JSONObject account, String clientMoniker, String key, boolean value) { - super(account, clientMoniker); - this.key = key; - this.value = value; - } - - @Override - protected String business() { - - return (value?"开启 ":"关闭 ")+key; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put(key, value); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchChannelPermissionModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchChannelPermissionModify.java deleted file mode 100644 index 5328c3074..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchChannelPermissionModify.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation; -import au.com.royalpay.payment.tools.merchants.core.MerchantChannelPermissionResolver; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.utils.JsonUtils; -import com.alibaba.fastjson.JSONObject; - -import java.util.function.Consumer; - -public class SwitchChannelPermissionModify extends ClientModifyOperation { - private final MerchantInfoProvider mchInfoProvider; - private final MerchantChannelPermissionResolver channelResolver; - private final boolean enableFlag; - - public SwitchChannelPermissionModify(JSONObject account, String clientMoniker, MerchantInfoProvider mchInfoProvider, MerchantChannelPermissionResolver channelResolver, boolean enableFlag) { - super(account, clientMoniker); - this.mchInfoProvider = mchInfoProvider; - this.channelResolver = channelResolver; - this.enableFlag = enableFlag; - } - - @Override - protected String business() { - return (enableFlag ? "开启 " : "关闭 ") + "渠道[" + channelResolver.payChannel().getChannelCode() + "]"; - } - - @Override - protected JSONObject getModifyResult() { - return JsonUtils.newJson(json -> json.put("enable_" + channelResolver.payChannel().getChannelCode(), enableFlag + "")); - } - - @Override - protected Consumer getModifyProcess() { - return client -> channelResolver.switchPermission(mchInfoProvider, client.getIntValue("client_id"), enableFlag); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchGatewaySignPermissionModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchGatewaySignPermissionModify.java deleted file mode 100644 index 2488499b6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchGatewaySignPermissionModify.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class SwitchGatewaySignPermissionModify extends ClientGatewaySignModify { - private String key; - private boolean value; - - public SwitchGatewaySignPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) { - super(account, clientMoniker); - this.key = key; - this.value = value; - } - - @Override - protected String business() { - - return (value?"开启 ":"关闭 ")+key; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put(key, value); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchPermissionModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchPermissionModify.java deleted file mode 100644 index c351fe7df..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchPermissionModify.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class SwitchPermissionModify extends ClientModify { - private final String key; - private final boolean value; - - public SwitchPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) { - super(account, clientMoniker); - this.key = key; - this.value = value; - } - - @Override - protected String business() { - return (value ? "开启 " : "关闭 ") + key; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put(key, value); - return modify; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/TimeZoneModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/TimeZoneModify.java deleted file mode 100644 index 75c132bac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/TimeZoneModify.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.entity.impls; - -import au.com.royalpay.payment.manage.merchants.entity.ClientModify; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by yixian at 2018-04-12 16:43 - */ -public class TimeZoneModify extends ClientModify { - private String timezone; - - public TimeZoneModify(JSONObject account, String clientMoniker, String timezone) { - super(account, clientMoniker); - this.timezone = timezone; - } - - @Override - protected String business() { - return "修改商户时区为:"+timezone; - } - - @Override - protected JSONObject getModifyResult() { - JSONObject modify = new JSONObject(); - modify.put("timezone", timezone); - return modify; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java b/src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java deleted file mode 100644 index ad64320e6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java +++ /dev/null @@ -1,59 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.enums; - -/** - * @Author: luoyang - * @Date: 2019-05-29 10:30 - */ -public enum PaymentScenarioEnum { - PC_WEB("101", "PC网站"),//1 - - MOBILE_WEB("102", "手机端网站"),//2 - - APP("103", "APP"),//3 - - WECHAT_ALIPAY_WEB("104", "微信内、支付宝内网站"),//4 - - MINIPROGRAM("105", "小程序"),//5 - - QRCODE_BOARD("201", "二维码立牌"),//6 - - ROYALPAY_POS("202", "Royalpay POS"),//7 - - CASHIER_POS("203", "收银系统"),//8 - - IPOS("20301", "ipos"),//9 - - POSPAL("20302", "pospal"),//10 - - AUPOS("20303", "AUS POST"),//11 - - OTHER("20399", "other"),//12 - - VENDING_MACHINE("204", "无人售货机"),//13 - - LOTUS("20304", "Lotus"), - - AOSHANGBAO("20305", "AoShangBao"), - - INFINITY("20306", "Infinity"), - - EASY_CLOUD("20307", "EasyCloud"), - - AOMAIKE("20308", "AoMaiKe"); - - private final String scenarioTypeId; - private final String desc; - - public String getScenarioTypeId() { - return scenarioTypeId; - } - - public String getDesc() { - return desc; - } - - PaymentScenarioEnum(String scenarioTypeId, String desc) { - this.scenarioTypeId = scenarioTypeId; - this.desc = desc; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/UPayAuthFileEnum.java b/src/main/java/au/com/royalpay/payment/manage/merchants/enums/UPayAuthFileEnum.java deleted file mode 100644 index c81cfb906..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/UPayAuthFileEnum.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.enums; - -public enum UPayAuthFileEnum { - ALL(""), - CLIENT_BANK_FILE("client_bank_file"), - CLIENT_COMPANY_FILE("client_company_file"), - UPAY_DRIVER_LICENSE("upay_driver_license"), - REFUND_EXCHANGE_POLICY("refund_exchange_policy"), - UPAY_PRIVACY_POLICY("upay_privacy_policy"), - CARD_SECURITY_POLICY("card_security_policy"), - UPAY_OFFER_LETTER("upay_offer_letter"), - UPAY_PROMOTIONAL_OFFER("upay_promotional_offer"), - UPAY_TERMS_CONDITIONS("upay_terms_conditions"), - KYC_UTILITY_BILL_FILE("kyc_utility_bill_file"), - UPAY_APPLICATION_FORM("upay_application_form"), - UPAY_DESC_FILE("upay_desc_file"); - - private final String fileName; - - public String getFileName() { - return fileName; - } - - UPayAuthFileEnum(String fileName) { - this.fileName = fileName; - } - - public String[] getFileNameArrays() { - return new String[]{CLIENT_BANK_FILE.getFileName(), - CLIENT_COMPANY_FILE.getFileName(), - UPAY_DRIVER_LICENSE.getFileName(), - REFUND_EXCHANGE_POLICY.getFileName(), - UPAY_PRIVACY_POLICY.getFileName(), - CARD_SECURITY_POLICY.getFileName(), - UPAY_OFFER_LETTER.getFileName(), - UPAY_PROMOTIONAL_OFFER.getFileName(), - UPAY_TERMS_CONDITIONS.getFileName(), - KYC_UTILITY_BILL_FILE.getFileName(), - UPAY_APPLICATION_FORM.getFileName(), - UPAY_DESC_FILE.getFileName()}; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientApplyEvent.java b/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientApplyEvent.java deleted file mode 100644 index 6aa5ee400..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientApplyEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.events; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEvent; - -/** - * Created by yixian on 2016-11-07. - */ -public class ClientApplyEvent extends ApplicationEvent { - private final JSONObject applyInfo; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - * @param applyInfo - */ - public ClientApplyEvent(Object source, JSONObject applyInfo) { - super(source); - this.applyInfo = applyInfo; - } - - public JSONObject getApplyInfo() { - return applyInfo; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientApplyNotifyBDEvent.java b/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientApplyNotifyBDEvent.java deleted file mode 100644 index 912a55885..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientApplyNotifyBDEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.events; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEvent; - -/** - * Created by Tayl0r on 2017/6/30. - */ -public class ClientApplyNotifyBDEvent extends ApplicationEvent { - private JSONObject clientApply; - - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public ClientApplyNotifyBDEvent(Object source, JSONObject clientApply) { - super(source); - this.clientApply = clientApply; - } - - public JSONObject getClientApply() { - return clientApply; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientSignEvent.java b/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientSignEvent.java deleted file mode 100644 index 88918ffbe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/events/ClientSignEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.events; - -import org.springframework.context.ApplicationEvent; - -/** - * Created by yixian on 2017-04-11. - */ -public class ClientSignEvent extends ApplicationEvent { - private final int clientId; - private final int eventId; - - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - * @param eventId - * @param clientId - */ - public ClientSignEvent(Object source, int eventId, int clientId) { - super(source); - this.eventId = eventId; - this.clientId = clientId; - } - - public int getClientId() { - return clientId; - } - - public int getEventId() { - return eventId; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/NewRateEventListener.java b/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/NewRateEventListener.java deleted file mode 100644 index dedd73d20..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/NewRateEventListener.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.events.listeners; - -import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.merchants.events.ClientSignEvent; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSONObject; -import org.joda.time.DateTime; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.Date; - -/** - * Created by yixian on 2017-04-11. - */ -@Component -public class NewRateEventListener implements ApplicationListener { - @Resource - private ClientManager clientManager; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private ClientConfigService clientConfigService; - - @Override - public void onApplicationEvent(ClientSignEvent event) { - if (event.getEventId() == 1) { - JSONObject client = clientManager.getClientInfo(event.getClientId()); - if (client == null) { - return; - } - JSONObject clientConfig = clientConfigService.find(event.getClientId()); - JSONObject currentRate = merchantInfoProvider.clientCurrentRate(event.getClientId(), new Date(), "Wechat"); - ClientRateConfig rate = new ClientRateConfig(); - rate.setActiveTime(new DateTime(2017, 5, 1, 0, 0, 0, 0).toDate()); - rate.setExpiryTime(new DateTime(2018, 5, 1, 0, 0, 0, 0).toDate()); - rate.setCleanDays(currentRate.getInteger("clean_days") == null ? clientConfig.getIntValue("clean_days") : currentRate.getIntValue("clean_days")); - rate.setRateValue(BigDecimal.valueOf(1.4).min(currentRate.getBigDecimal("rate_value"))); - JSONObject mockManager = new JSONObject(); - mockManager.put("manager_id", 0); - mockManager.put("display_name", "System"); - clientManager.configRate(mockManager, client.getString("client_moniker"), rate); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/NotyfyBDEventListener.java b/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/NotyfyBDEventListener.java deleted file mode 100644 index 19b9feaf3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/NotyfyBDEventListener.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.events.listeners; - -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.merchants.events.ClientApplyNotifyBDEvent; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/6/30. - */ -@Service -public class NotyfyBDEventListener implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ManagerMapper managerMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - @Override - public void onApplicationEvent(ClientApplyNotifyBDEvent event) { - JSONObject bdInfo = managerMapper.findById(event.getClientApply().getString("bd_user")); - String uri = "/partners/application/partner_apply_info/" + event.getClientApply().getString("client_apply_id"); - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat") + "?target=" + uri; - logger.info("sending new client request to wechat binded bd"); - String wxOpenid = bdInfo.getString("wx_openid"); - if (wxOpenid != null && !wxOpenid.equals("")) { - try { - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initTemplate(event, loginUrl, wxOpenid, paymentApi.getTemplateId("commission")); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e) { - logger.debug("新商户消息通知BD失败,等待3秒后重试:"+e.toString(),e.toString()); - } - } - } - - private TemplateMessage initTemplate(ClientApplyNotifyBDEvent event, String loginUrl, String wxOpenid, String templateId) { - TemplateMessage msg = new TemplateMessage(wxOpenid, templateId, loginUrl); - msg.put("first", "有新商户提交了开通申请,请及时处理", "#ff0000"); - msg.put("keyword1", "商户开通申请", "#0000ff"); - msg.put("keyword2", event.getClientApply().getString("company_name"), "#000000"); - msg.put("keyword3", DateFormatUtils.format(event.getTimestamp(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", "联系人:" + event.getClientApply().getString("contact_person") + " 电话:" + event.getClientApply().getString("contact_phone"), "#000000"); - msg.put("remark", "点击查看", "#ff0000"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/SendingApplyToWechatMessageListener.java b/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/SendingApplyToWechatMessageListener.java deleted file mode 100644 index 9725e960c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/events/listeners/SendingApplyToWechatMessageListener.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.events.listeners; - -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.merchants.events.ClientApplyEvent; -import au.com.royalpay.payment.manage.officialwebsit.domain.entity.PartnerApplyType; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yixian on 2016-11-07. - */ -@Service -public class SendingApplyToWechatMessageListener implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ManagerMapper managerMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - @Override - public void onApplicationEvent(ClientApplyEvent event) { - List managerOpenIds = managerMapper.listOpenIdsOfCompliances(); - String uri = "/partners/application/partner_apply_info/" + event.getApplyInfo().getString("client_apply_id"); - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat") + "?target=" + uri; - logger.info("sending new client request to wechat binded compliances"); - for (String wxOpenid : managerOpenIds) { - try { - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initTemplate(event, loginUrl, wxOpenid, paymentApi.getTemplateId("new-apply")); - paymentApi.sendTemplateMessage(msg); - } catch (Exception e) { - } - } - } - - private TemplateMessage initTemplate(ClientApplyEvent event, String loginUrl, String wxOpenid, String templateId) { - TemplateMessage msg = new TemplateMessage(wxOpenid, templateId, loginUrl); - if (event.getApplyInfo().containsKey("type")) { - String type = event.getApplyInfo().getString("type"); - if (PartnerApplyType.typeOf(type).isCard()) { - msg.put("first", "有新商户提交了卡支付开通申请,请审核", "#ff0000"); - } - if (PartnerApplyType.typeOf(type).isLoans()) { - msg.put("first", "有新商户提交了贷款开通申请,请审核", "#ff0000"); - } - } else { - msg.put("first", "有新商户提交了开通申请,请审核", "#ff0000"); - } - msg.put("keyword1", "商户开通申请", "#0000ff"); - msg.put("keyword2", event.getApplyInfo().getString("company_name"), "#000000"); - msg.put("keyword3", DateFormatUtils.format(event.getTimestamp(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", "联系人:" + event.getApplyInfo().getString("contact_person") + " 电话:" + event.getApplyInfo().getString("contact_phone"), "#000000"); - msg.put("remark", "点击处理", "#ff0000"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/package-info.java b/src/main/java/au/com/royalpay/payment/manage/merchants/package-info.java deleted file mode 100644 index 9988c0518..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * partner manage - * Created by yixian on 2016-06-25. - */ -package au.com.royalpay.payment.manage.merchants; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/AlipayConfigController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/AlipayConfigController.java deleted file mode 100644 index 88e78fa6f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/AlipayConfigController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.web; - - -import au.com.royalpay.payment.manage.merchants.core.impls.AlipayChannelsConfig; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -/** - * @Description - * @title: - * @Date 2021/2/1 9:42 - * @author: zhangTao - */ -@RestController -@RequestMapping("/sys/partners") -public class AlipayConfigController { - - @Resource - AlipayChannelsConfig alipayChannelsConfig; - - @RequestMapping(method = RequestMethod.PUT,value = "/modifyAlipayPaymentChannels/{clientId}/{alipayPaymentChannelsStatus}") - public void modifyAlipayPaymentChannels(@PathVariable Integer clientId, @PathVariable Boolean alipayPaymentChannelsStatus) { - alipayChannelsConfig.modifyAlipayPaymentChannels(clientId,alipayPaymentChannelsStatus); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/ApsConfigController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/ApsConfigController.java deleted file mode 100644 index a67e25f67..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/ApsConfigController.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.web; - -import au.com.royalpay.payment.manage.merchants.core.ApsConfigService; -import au.com.royalpay.payment.manage.merchants.deacriptor.ApsConfigDescriptor; -import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@RequestMapping("/sys/partners/aps") -public class ApsConfigController { - - @Resource - private ApsConfigService apsConfigService; - - /** - * 获取aps配置信息 - * - * @param clientId - * @return - */ - @GetMapping("/{clientId}") - public ApsConfigData getApsConfigByClientId(@PathVariable("clientId") String clientId) { - return apsConfigService.getApsConfigByClientId(clientId); - } - - /** - * 初始化aps配置 - * - * @param clientId - * @param apsConfigDescriptor - * @return - */ - @ManagerMapping(value = "/{clientId}", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SITE_MANAGER}) - public ApsConfigData saveApsConfigClientId(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable("clientId") String clientId, @RequestBody ApsConfigDescriptor apsConfigDescriptor) { - return apsConfigService.saveApsConfigClientId(manager.getString("managerId"), clientId, apsConfigDescriptor); - } - - /** - * 修改aps配置 - * - * @param clientId - * @param apsConfig - * @return - */ - @ManagerMapping(value = "/{clientId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SITE_MANAGER}) - public ApsConfigData updateApsConfigClientId(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable("clientId") String clientId, @RequestBody JSONObject apsConfig) { - return apsConfigService.updateApsConfigClientId(manager.getString("managerId"), clientId, apsConfig); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java deleted file mode 100644 index ac03b0122..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java +++ /dev/null @@ -1,171 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.web; - -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import com.google.code.kaptcha.Producer; - -import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.core.ClientApply; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.RandomStringUtils; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import java.awt.image.BufferedImage; -import java.util.List; - -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -/** - * Created by yishuqian on 18/10/2016. - */ -@RestController -@RequestMapping("/partners/application") -public class PartnerApplyController { - @Resource - private ClientApply clientApply; - @Resource - private Producer captchaProducer; - @Resource - private ClientManager clientManager; - - - @RequestMapping(method = RequestMethod.POST) - public void applyPartner(@CookieValue(CommonConsts.CODE_KEY) String codeKey, @RequestBody @Valid ClientApplyInfo apply, - Errors errors, HttpServletResponse response) throws Exception { - String codeValue = clientApply.getVerifyCode(codeKey); - if (codeValue == null) { - throw new Exception("Verification code has expired"); - } - if (!codeValue.equals(apply.getCaptcha())){ - throw new Exception("Verification code is not correct"); - }else { - clientApply.deleteVerifyCodeKey(codeKey); - HttpUtils.dropCookie(response, CommonConsts.CODE_KEY); - } - if (!PlatformEnvironment.getEnv().enablePartnerApply()){ - throw new BadRequestException("商户自主申请暂时关闭. Merchant Apply disabled at the moment."); - } - HttpUtils.handleValidErrors(errors); - clientApply.applyPartner(apply); - } - - @RequestMapping(method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject applyPartnerList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery apply) { - return clientApply.listPartnerApply(manager,apply); - } - - - @RequestMapping(value = "/{client_apply_id}",method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject getApplicationDetail(@PathVariable String client_apply_id) { - return clientApply.getPartnerApplicationDetail(client_apply_id); - } - - @RequestMapping(value = "/notice",method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject getNewPartnerApplications(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery apply) { - return clientApply.getNewPartnerApplications(manager,apply); - } - - @ManagerMapping(value = "/{client_apply_id}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) - public void updatePartnerInfo(@PathVariable String client_apply_id, @RequestBody ClientApplyInfo info, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientApply.handlePartnerApplication(client_apply_id, info,manager); - } - - @ManagerMapping(value = "/{client_apply_id}/pass", method = RequestMethod.PUT, role = { ManagerRole.BD_USER}) - public JSONObject passPartnerApplication(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_apply_id, @RequestBody ClientApplyInfo info) { - return clientApply.passPartnerApplication(client_apply_id, info,manager); - } - - @ManagerMapping(value = "/{client_apply_id}/link", method = RequestMethod.PUT, role = { ManagerRole.BD_USER,ManagerRole.ADMIN}) - public void linkPartnerApplication(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_apply_id, @RequestBody ClientApplyInfo info) { - clientApply.linkPartnerApplication(client_apply_id, info,manager); - } - - @RequestMapping(value = "captcha-image",method = RequestMethod.GET) - public void getKaptchaImage(HttpServletResponse response) throws Exception { - response.setDateHeader("Expires", 0); - response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - response.addHeader("Cache-Control", "post-check=0, pre-check=0"); - response.setHeader("Pragma", "no-cache"); - response.setContentType("image/jpeg"); - - String capText = RandomStringUtils.random(4, false, true); -// String capText = captchaProducer.createText(); - System.out.println("商户注册验证码: " + capText ); - // session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); - - String statusKey = clientApply.addVerifyCode(capText); - HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); - - BufferedImage bi = captchaProducer.createImage(capText); - ServletOutputStream out = response.getOutputStream(); - ImageIO.write(bi, "jpg", out); - try { - out.flush(); - } finally { - out.close(); - } - } - - - - @ManagerMapping(value = "/unregister_accounts/{accountId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void updateRemarkAccount(@PathVariable String accountId, @RequestBody JSONObject account, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientApply.remarkAccount(manager, accountId, account.getString("remark")); - } - - @WechatMapping(value = "/partner_apply_info/{partnerApplyId}",method = RequestMethod.GET) - public ModelAndView getPartnerApplyInfo(@PathVariable String partnerApplyId){ - ModelAndView view = new ModelAndView("partner_apply_info"); - JSONObject applyClient = clientApply.getPartnerApplicationDetail(partnerApplyId); - if (applyClient.getString("state") == null) { - applyClient.put("state",""); - } - view.addObject("applyClient", applyClient); - - List orgs = clientApply.listAlllOrgs(); - view.addObject("orgs", orgs); - - String bd_id = applyClient.getString("bd_user"); - if(bd_id!=null&&!"".equals(bd_id)){ - JSONObject bdOrg = clientApply.findOrgByBDId(bd_id); - view.addObject("bdOrg", bdOrg); - } - return view; - } - - @WechatMapping(value = "/notify_bd/{partnerApplyId}", method = RequestMethod.PUT) - public void notifyBD(@PathVariable String partnerApplyId) { - clientApply.notifyBD(partnerApplyId); - } - - @RequestMapping(value = "/orgs/{org_id}/bd_list",method = RequestMethod.GET) - public List getBDListByOrgs(@PathVariable int org_id){ - return clientApply.listBDByOrg(org_id); - } - - @GetMapping("/export_xls") - public void exportApplyPartnerList(HttpServletResponse httpResponse, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception{ - clientApply.exportApplyPartnerList(manager, httpResponse); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerChannelSettlementController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerChannelSettlementController.java deleted file mode 100644 index 889fd689c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerChannelSettlementController.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.web; - -import au.com.royalpay.payment.manage.merchants.beans.SettleDetail; -import au.com.royalpay.payment.manage.merchants.core.impls.ClientChannelSettlement; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * 分渠道清算规则配置资源 - */ -@RestController -@RequestMapping("/sys/partners/{clientMoniker}/channel_settle_config") -public class PartnerChannelSettlementController { - - @Autowired - private ClientChannelSettlement channelSettlement; - - /** - * 结算规则配置详情 - * - * @param clientMoniker - * @param manager - * @return - */ - @ManagerMapping(method = RequestMethod.GET) - public JSONObject getClientChannelSettleConfig(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestParam(value = "group") String group) { - return channelSettlement.getClientChannelSettleConfig(clientMoniker, manager, group); - } - - - /** - * 设置结算规则配置 - * - * @param clientMoniker - * @param settleDetail - * @param manager - */ - @ManagerMapping(method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void configClientChannelSettleDetails(@PathVariable String clientMoniker, @RequestBody SettleDetail settleDetail, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - channelSettlement.configClientChannelSettleDetails(manager, clientMoniker, settleDetail); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java deleted file mode 100644 index 5f847b1f1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ /dev/null @@ -1,1123 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.web; - -import au.com.royalpay.payment.channels.alipay.beans.plus.ApsMerchantApplication; -import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.request.entities.RPayMerchantEntity; -import au.com.royalpay.payment.core.beans.ChannelMerchantInfo; -import au.com.royalpay.payment.core.beans.MerchantApplicationResult; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; -import au.com.royalpay.payment.manage.merchants.beans.*; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.merchants.core.MerchantChannelPermissionService; -import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankClientNullException; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.util.List; -import java.util.Optional; - -/** - * Created by yixian on 2016-06-27. - */ -@RestController -@RequestMapping("/sys/partners") -public class PartnerManageController { - - @Resource - private ClientManager clientManager; - @Resource - private TradeLogService tradeLogService; - @Resource - private MerchantChannelPermissionService merchantChannelPermissionService; - @Resource - private MerchantLocationService merchantLocationService; - - @RequestMapping(method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.FINANCIAL_STAFF, ManagerRole.DIRECTOR}) - public JSONObject listClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query) { - return clientManager.listClients(manager, query); - } - - @ManagerMapping(value = "/exporting_excel", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void exportClientsExcel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query, HttpServletResponse resp) { - clientManager.exportClients(manager, query, resp); - } - - @GetMapping("/list") - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - public List lisPartners(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query) { - return clientManager.listPartners(manager, query); - } - - - @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET, produces = "application/json") - public JSONObject initMerchantCode() { - JSONObject result = new JSONObject(); - result.put("partner_code", clientManager.initMerchantCode()); - return result; - } - - @GetMapping("/init/check_code_isvalid") - public boolean getMerchantIsValid(@RequestParam String clientMoniker) { - return clientManager.getMerchantIsValid(clientMoniker); - } - - @RequestMapping(method = RequestMethod.POST) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) - public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ClientRegisterInfo registery, - Errors errors) { - HttpUtils.handleValidErrors(errors); - return clientManager.registerClient(null, registery, manager); - } - - @ManagerMapping(value = "/{clientMoniker}", method = RequestMethod.GET) - public JSONObject getClientByMoniker(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.clientDetail(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}", method = RequestMethod.DELETE, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void disableClient(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.disableClient(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/revert", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void revertClient(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.revertClient(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/id_info", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void updateClientIdInfo(@PathVariable String clientMoniker, @RequestBody JSONObject params, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateClientIdInfo(clientMoniker, params, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/mw_risk_info", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void updateMWRiskInfoByClient(@PathVariable String clientMoniker, @RequestBody JSONObject params, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateMWRiskInfoByClient(clientMoniker, params, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/qrcode", method = RequestMethod.GET) - public JSONObject getQrCodeImg(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QRCodeConfig config) { - return clientManager.getQRCode(manager, clientMoniker, config); - } - - @ManagerMapping(value = "/{clientMoniker}/qrcode_board", method = RequestMethod.GET) - public void getQRCodeBoardImage(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QRCodeConfig config, - HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeQrCodeBoard(manager, clientMoniker, config, ous, "PC"); - } - - @ManagerMapping(value = "/{clientMoniker}/qrcode_board/aggregate", method = RequestMethod.GET) - public void getAggregateQRCodeBoardImage(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QRCodeConfig config, - HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); - try(OutputStream ous = response.getOutputStream()) { - clientManager.writeAggregateQrCodeBoard(manager, clientMoniker, config, ous, "PC"); - ous.flush(); - } - } - - @ManagerMapping(value = "/{clientMoniker}/qrcode_board/CBBankAggregate", method = RequestMethod.GET) - public void getCBBankAggregateQRCodeBoardImage(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeCBBankAggregateQrCodeBoard(manager, clientMoniker, ous, "PC"); - } - - @ManagerMapping(value = "/{clientMoniker}/poster", method = RequestMethod.GET) - public void getPosterImage(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=poster.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writePoster(manager, clientMoniker, ous); - } - - @ManagerMapping(value = "/{clientMoniker}/poster/aggregate", method = RequestMethod.GET) - public void getAggregatePosterImage(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=poster.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeAggregatePoster(manager, clientMoniker, ous); - } - - @ManagerMapping(value = "/{clientMoniker}/activities/{activityName}/poster", method = RequestMethod.GET, role = {ManagerRole.BD_USER, ManagerRole.OPERATOR}) - public void getActivityPoster(@PathVariable String activityName, @PathVariable String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=poster_" + activityName + ".jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeActivityPoster(manager, clientMoniker, activityName, ous); - } - - @ManagerMapping(value = "/{clientMoniker}/max_order_amount", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void setMaxOrderAmount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject limit) { - clientManager.setMaxOrderAmount(manager, clientMoniker, limit.getBigDecimal("limit")); - } - - @ManagerMapping(value = "/{clientMoniker}/customer_surcharge_rate", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) - public void setCustomerSurchargeRate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setCustomerSurchargeRate(manager, clientMoniker, config.getBigDecimal("customer_surcharge_rate")); - } - - @ManagerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) - public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setOrderExpiryConfig(manager, clientMoniker, config.getString("order_expiry_config")); - } - - @ManagerMapping(value = "/{clientMoniker}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) - public void updatePartnerInfo(@PathVariable String clientMoniker, @RequestBody ClientRegisterInfo info, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateClientRegisterInfo(manager, clientMoniker, info); - } - - @ManagerMapping(value = "/{clientMoniker}/bd_user", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) - public List listPartnerBDUser(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listClientDBUsers(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/bd_user/current", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR, ManagerRole.DIRECTOR}) - public List listPartnerCurrentBDUser(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listClientCurrentBDUsers(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/bd_user", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void setPartnerBDUser(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject jsonObject) throws Exception { - clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject); - } - - @ManagerMapping(value = "/{clientMoniker}/payment_config", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void updatePartnerPaymentConfig(@PathVariable String clientMoniker, @RequestBody JSONObject subMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateClientPaymentConfig(manager, clientMoniker, subMerchantInfo); - } - - @ManagerMapping(value = "/{clientMoniker}/refund_credit_line", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void updateRefundCreditLine(@PathVariable String clientMoniker, @RequestBody JSONObject refundLineInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateRefundCreditLine(manager, clientMoniker, refundLineInfo); - } - - @ManagerMapping(value = "/{clientMoniker}/rpay_payment_config", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void updatePartnerRpayPaymentConfig(@PathVariable String clientMoniker, @RequestBody JSONObject rpaySubMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateClientRpayPaymentConfig(manager, clientMoniker, rpaySubMerchantInfo); - } - - @ManagerMapping(value = "/{clientMoniker}/ali_sub_merchant_id", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void updateAliSubMerchantId(@PathVariable String clientMoniker, @RequestBody JSONObject aliSubMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateAliSubMerchantId(manager, clientMoniker, aliSubMerchantInfo); - } - - @ManagerMapping(value = "/{clientMoniker}/wechat_institution_merchant_id", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void refreshWechatInsMerchantId(@PathVariable String clientMoniker, @RequestBody JSONObject refreshWechatInstitutionMerchantId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.refreshWechatInstitutionMerchantId(manager, clientMoniker, refreshWechatInstitutionMerchantId); - } - - @ManagerMapping(value = "/{clientMoniker}/qrcode_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void setClientPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientQRCodePaySurCharge(manager, clientMoniker, config.getBooleanValue("qrcode_surcharge")); - } - - @ManagerMapping(value = "/{clientMoniker}/gateway_upgrade", method = RequestMethod.PUT, role = {ManagerRole.DEVELOPER}) - public void enableGatewayUpgrade(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.enableGatewayUpgrade(manager, clientMoniker, config.getBooleanValue("gateway_upgrade")); - } - - @ManagerMapping(value = "/{clientMoniker}/gateway_alipay_online", method = RequestMethod.PUT, role = {ManagerRole.DEVELOPER}) - public void enableGatewayAlipayOnline(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.enableGatewayAlipayOnline(manager, clientMoniker, config.getBooleanValue("gateway_alipay_online")); - } - - @ManagerMapping(value = "/{clientMoniker}/api_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void setClientApiPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientApiPaySurCharge(manager, clientMoniker, config.getBooleanValue("api_surcharge")); - } - - @ManagerMapping(value = "/{clientMoniker}/retail_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void setClientRetailPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientRetailPaySurCharge(manager, clientMoniker, config.getBooleanValue("retail_surcharge")); - } - - @ManagerMapping(value = "/{clientMoniker}/cbbank_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER}) - public void setClientCBBankPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientCBBankPaySurCharge(manager, clientMoniker, config.getBooleanValue("cbbank_surcharge")); - } - - @ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void setClientTaxPayer(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientTaxInSurcharge(manager, clientMoniker, config.getBooleanValue("tax_in_surcharge")); - } - - @ManagerMapping(value = "/{clientMoniker}/presettle", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void setClientPreSettle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientPreSettle(manager, clientMoniker, config.getBooleanValue("enable_presettle")); - } - - @ManagerMapping(value = "/{clientMoniker}/customer_tax_free", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void setClientCustomerTaxFree(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientCustomerTaxFree(manager, clientMoniker, config.getBooleanValue("customer_tax_free")); - } - - @ManagerMapping(value = "/{clientMoniker}/credential_code", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void updateCredentialCode(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.refreshClientCredentialCode(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/audit", method = RequestMethod.PUT, role = ManagerRole.OPERATOR) - public void auditPartner(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject pass) { - clientManager.auditClient(manager, clientMoniker, pass.getIntValue("pass")); - } - - @ManagerMapping(value = "/{clientMoniker}/card_audit", method = RequestMethod.PUT, role = ManagerRole.OPERATOR) - public void auditCardPartner(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject pass) { - clientManager.auditCardClient(manager, clientMoniker, pass.getIntValue("pass")); - } - - @ManagerMapping(value = "/{clientMoniker}/aduit/green_channel", method = RequestMethod.PUT, role = ManagerRole.OPERATOR) - public void auditPartnerGreenChannel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - clientManager.auditClientGreenChannel(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/audit/send_email", method = RequestMethod.PUT, role = {ManagerRole.BD_USER, ManagerRole.OPERATOR}) - public void resendEmail(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String type) { - clientManager.checkAndSendInitEmail(manager, clientMoniker, type); - } - - @ManagerMapping(value = "/{clientMoniker}/audit/email_sending_status", method = RequestMethod.PUT, role = ManagerRole.OPERATOR) - public void markApproveEmailSendStatus(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.markApproveEmailSendStatus(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/audit/refuse", method = RequestMethod.PUT, role = ManagerRole.OPERATOR) - public void refusePartner(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject refuse) { - clientManager.refusePartner(clientMoniker, manager, refuse.getString("refuse_remark")); - } - - @ManagerMapping(value = "/{clientMoniker}/card_audit/refuse", method = RequestMethod.PUT, role = ManagerRole.OPERATOR) - public void cardRefusePartner(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject refuse) { - clientManager.cardRefusePartner(clientMoniker, manager, refuse.getString("refuse_remark")); - } - - @ManagerMapping(value = "/{clientMoniker}/common_sub_merchant_id", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void switchCommonSubMerchantId(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "common_sub_merchant_id", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/selectBillVersion", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void selectBillVersion(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.selectBillCodeVersion(manager, clientMoniker, pass.getString("version")); - } - - /** - * 父商户全局管理子商户 - * - * @param clientMoniker - * @param pass - * @param manager - */ - @ManagerMapping(value = "/{clientMoniker}/sub_manage", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void switchSubManage(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "sub_manage", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/child_each_refund", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void switchChildEachRefund(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchChildEachRefund(manager, clientMoniker, pass.getBooleanValue("allow")); - } - @ManagerMapping(value = "/{clientMoniker}/switch_oversea_wallet", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void switchOverseaWallet(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchOverseaWallet(manager, clientMoniker, pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/channels/{channel}/permission", method = RequestMethod.PUT, role = {ManagerRole.SERVANT, ManagerRole.DEVELOPER}) - public void switchChannelPermission(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchChannelPermission(manager, clientMoniker, channel, pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/jsapi_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchJsApiPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_jsapi", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/gateway_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchGatewayPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_gateway", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/offline_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchOfflinePermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_retail", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/refund_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchRefundPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_refund", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/pre_refund_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void switchPreRefundPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_pre_refund", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/reset/refund_pwd", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.DEVELOPER}) - public void changeRefundPwd(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject config) { - clientManager.resetRefundPasswordByManage(clientMoniker, manager, config); - } - - - @ManagerMapping(value = "/{clientMoniker}/payment_page_version", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void changePaymentPage(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changePaymentPage(manager, clientMoniker, pass.getString("paypad_version")); - } - - @ManagerMapping(value = "/{clientMoniker}/cbbank_payment_page_version", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void changeCBBankPaymentPage(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changeCBBankPaymentPage(manager, clientMoniker, pass.getString("cbbank_paypad_version")); - } - - @ManagerMapping(value = "/{clientMoniker}/paysuccess_version", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void changePaymentSuccessPage(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changePaymentSuccessPage(manager, clientMoniker, pass.getString("paysuccess_version")); - } - - @ManagerMapping(value = "/{clientMoniker}/trade_logs", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR, ManagerRole.FINANCIAL_STAFF}) - public JSONObject listPartnerTradeLogs(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - return tradeLogService.listPartnerTradeLogs(manager, null, clientMoniker, query, null); - } - - @ManagerMapping(value = "/{clientMoniker}/trade_logs/{orderId}", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - public JSONObject getOrderDetail(@PathVariable String clientMoniker, @PathVariable String orderId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return tradeLogService.getOrderDetail(manager, clientMoniker, orderId, null); - } - - @ManagerMapping(value = "/{clientMoniker}/trade_logs/{orderId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - public List listOrderRefunds(@PathVariable String orderId, @PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return tradeLogService.listOrderRefunds(orderId, null); - } - - @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR, ManagerRole.DEVELOPER}) - public List partnerAccounts(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listAccounts(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) - public JSONObject addPartnerAccount(@RequestBody @Valid NewAccountBean account, Errors errors, @PathVariable String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - return clientManager.newAccount(clientMoniker, account, manager, 1); - } - - @ManagerMapping(value = "/{clientMoniker}/accounts/{accountId}/pwd", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void resetPassword(@PathVariable String clientMoniker, @PathVariable String accountId, @RequestBody JSONObject pwd, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.resetAccountPwd(manager, clientMoniker, accountId, pwd.getString("pwd")); - } - - @ManagerMapping(value = "/{clientMoniker}/accounts/{accountId}/role", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void resetRole(@PathVariable String clientMoniker, @PathVariable String accountId, @RequestBody JSONObject role, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changeRole(manager, clientMoniker, accountId, role.getIntValue("role")); - } - - @ManagerMapping(value = "/{clientMoniker}/accounts/{accountId}", method = RequestMethod.DELETE, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void disableAccount(@PathVariable String clientMoniker, @PathVariable String accountId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.disableAccount(manager, clientMoniker, accountId); - } - - @ManagerMapping(value = "/{clientMoniker}/bank_account", method = RequestMethod.GET) - public JSONObject listClientBankAccounts(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listClientBankAccounts(manager, clientMoniker); - } - - @GetMapping("/{clientMoniker}/bank_account/bank_info/{bsb_no}") - public JSONObject getBankInfo(@PathVariable String clientMoniker, @PathVariable("bsb_no") String bsbNo, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - try { - return clientManager.getBankInfo(manager, clientMoniker, bsbNo); - } catch (AustraliaBankClientNullException e) { - throw new InvalidShortIdException(); - } - } - - @ManagerMapping(value = "/{clientMoniker}/bank_account", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF}) - public void saveBankAccount(@PathVariable String clientMoniker, @RequestBody @Valid BankAccountInfo bankAccount, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - clientManager.saveBankAccount(manager, clientMoniker, bankAccount); - } - - @ManagerMapping(value = "/{clientMoniker}/skip_clearing", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void skipClearing(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject skip_clearing) { - clientManager.setSkipClearing(manager, clientMoniker, skip_clearing.getBooleanValue("skip_clearing"), skip_clearing.getString("remark")); - } - - @ManagerMapping(value = "/{clientMoniker}/min_settle", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void setClientMinSettle(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject data) { - BigDecimal minSettle = Optional.ofNullable(data.getBigDecimal("min_settle")).orElse(BigDecimal.ZERO); - if (minSettle.compareTo(BigDecimal.ZERO) < 0) { - throw new BadRequestException("min settle must not be less than 0"); - } - clientManager.modifyMinSettle(manager, clientMoniker, minSettle); - } - - @ManagerMapping(value = "/{clientMoniker}/surcharge_mode", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void updateSurchargeMode(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject surcharge_mode) { - clientManager.setSurchargeMode(manager, clientMoniker, surcharge_mode.getString("surcharge_mode")); - } - - @ManagerMapping(value = "/{clientMoniker}/surcharge_account", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject surchargeAccount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientManager.surchargeAccount(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/allow_surcharge_credit", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void allowSurchargeCredit(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject allow_surcharge_credit) { - clientManager.setAllowSurchargeCredit(manager, clientMoniker, allow_surcharge_credit.getBooleanValue("allow_surcharge_credit")); - } - - @ManagerMapping(value = "/{clientMoniker}/account/transactions", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - @ReadOnlyConnection - public List accountTransactions(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientManager.getAccountTransactions(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - @ReadOnlyConnection - public List accountTransactionsByDate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String detailId) { - return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, detailId); - } - - @ManagerMapping(value = "/{clientMoniker}/account/save", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - @ReadOnlyConnection - public void saveAccountTransaction(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject transaction) { - clientManager.saveAccountTransaction(manager, clientMoniker, transaction); - } - - @ManagerMapping(value = "/{clientMoniker}/surcharge_account/month_detail", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public List surchargeAccountMonthDetail(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientManager.getAccountMonthDetails(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/settle_hour", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.FINANCIAL_STAFF}) - public void configSettleHour(@PathVariable String clientMoniker, @RequestBody JSONObject config, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.configSettleHour(manager, clientMoniker, config.getInteger("hour")); - } - - @ManagerMapping(value = "/{clientMoniker}/rates", method = RequestMethod.GET) - public List getClientRates(@PathVariable String clientMoniker) { - return clientManager.clientRates(clientMoniker, true); - } - - @ManagerMapping(value = "/{clientMoniker}/rates", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF}) - public void newRate(@PathVariable String clientMoniker, @RequestBody JSONObject config, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - clientManager.newConfigRate(manager, clientMoniker, config); - } - - @GetMapping("/sys_rates") - public JSONObject getSysRate() { - return clientManager.getSysRateConfig(); - } - - @GetMapping("/sys_card_rates") - public JSONObject getSysCardRate() { - return clientManager.getSysCardRateConfig(); - } - - @ManagerMapping(value = "/{clientMoniker}/rates/{rateId}", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void updateRate(@PathVariable String clientMoniker, @PathVariable int rateId, @RequestBody @Valid ClientRateConfig config, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - clientManager.modifyRateConfig(manager, clientMoniker, rateId, config); - } - - @ManagerMapping(value = "/{clientMoniker}/sub_clients", method = RequestMethod.GET) - public List listSubClients(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listSubClients(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/sub_clients/page", method = RequestMethod.GET) - public JSONObject listSubClientsByPage(@PathVariable String clientMoniker, @RequestParam(defaultValue = "1") int page, - @RequestParam(required = false) String searchText, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listSubClientsByPage(manager, clientMoniker, searchText, page); - } - - //创建子商户 - @ManagerMapping(value = "/{clientMoniker}/sub_clients", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) - public void newSubClient(@PathVariable String clientMoniker, @RequestBody @Valid ClientRegisterInfo registery, Errors errors, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - HttpUtils.handleValidErrors(errors); - clientManager.registerClient(clientMoniker, registery, manager); - } - - //商户设备管理 获取商户设备信息 - @ManagerMapping(value = "/{clientMoniker}/devices", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) - public JSONObject listClientDevices(@PathVariable String clientMoniker, @RequestParam(required = false) String remark, @RequestParam(required = false) String client_type, - @RequestParam(required = false) String[] client_ids, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listClientDevices(manager, clientMoniker, remark, page, limit, client_type, client_ids); - } - - //给商户新增设备 - @ManagerMapping(value = "/{clientMoniker}/add_device", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void addDevice(@PathVariable String clientMoniker, @RequestBody JSONObject device, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.addDevice(manager, clientMoniker, device); - } - - @ManagerMapping(value = "/{clientMoniker}/devices/{devId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void modifyDevice(@PathVariable String clientMoniker, @PathVariable String devId, @RequestBody JSONObject remark, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.updateDevie(manager, clientMoniker, devId, remark.getString("remark")); - } - - @ManagerMapping(value = "/{clientMoniker}/devices/{devId}/enable", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void toggleDeviceAvailable(@PathVariable String clientMoniker, @PathVariable String devId, @RequestBody JSONObject enable, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.toggleDeviceAvailable(manager, clientMoniker, devId, enable.getBooleanValue("enable")); - } - - @ManagerMapping(value = "/{clientMoniker}/file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getAllAuthFiles(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/mw_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public JSONObject getMWAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getMWAuthFiles(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public JSONObject getKycFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getAllKycFiles(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/file/source_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public JSONObject getSourceAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getSourceAgreeFiles(manager, clientMoniker); - } - - /** - * 下载商户卡支付合规文件 - * - * @param clientMoniker - */ - @ManagerMapping(value = "/{clientMoniker}/file/source_card_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public JSONObject getSourceCardAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam("fileName") String fileName) { - return clientManager.getSourceCardAgreeFiles(clientMoniker, manager, fileName); - } - - @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.deleteAuthFilesByAdmin(fileId); - } - - @ManagerMapping(value = "/auth_file/{fileId}/mw_delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void deleteMWAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.deleteMWAuthFilesByAdmin(fileId); - } - - @ManagerMapping(value = "/{clientMoniker}/file", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void uploadAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientAuthFilesInfo filesInfo, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.uploadAuthFilesManager(manager, clientMoniker, filesInfo); - } - - @ManagerMapping(value = "/{clientMoniker}/mw_file", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void uploadMWAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientMWAuthFilesInfo filesInfo, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.uploadMWAuthFilesManager(manager, clientMoniker, filesInfo); - } - - @ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void uploadKycFiles(@PathVariable String clientMoniker, @RequestBody ClientKycFilesInfo filesInfo, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.uploadKycFiles(manager, clientMoniker, filesInfo); - } - - @ManagerMapping(value = "/analysis", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public JSONObject getClientsAnalysis(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getClientsAnalysis(manager); - } - - - @ManagerMapping(value = "/unregister", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public List getUnregister(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getUnRegister(manager); - } - - @ManagerMapping(value = "/{clientMoniker}/to_compliance", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER}) - public void commitToCompliance(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.commitToCompliance(clientMoniker, manager); - } - - /** - * 提交资料,BD提交卡支付最终审核 - * - * @param clientMoniker - * @param manager - */ - @ManagerMapping(value = "/{clientMoniker}/to_card_compliance", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER}) - public void commitToCardCompliance(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.commitToCardCompliance(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/make_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER}) - public void commitToDoAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.commitToDoAgreeFile(clientMoniker, manager); - } - - /** - * 提交资料,申请卡支付 - * - * @param clientMoniker - * @param manager - */ - @ManagerMapping(value = "/{clientMoniker}/make_card_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER}) - public void commitToDoCardAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.commitToDoCardAgreeFile(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/compliance/green_channel", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER}) - public void commitToGreenChannel(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.commitToGreenChannel(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - clientManager.getAgreeFile(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - clientManager.getAggregateAgreeFile(clientMoniker, manager, false); - } - - /** - * 制作卡支付合同 - * - * @param clientMoniker - * @param manager - * @throws Exception - */ - @ManagerMapping(value = "/{clientMoniker}/export/aggregate/card_agree_pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAggregateCardAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - clientManager.getAggregateCardAgreeFile(clientMoniker, manager, false); - } - - /** - * 制作促销合同 - * - * @param clientMoniker - * @param manager - * @throws Exception - */ - @GetMapping(value = "/{clientMoniker}/export/aggregate/card_promotion_agree_pdf") - public void exportAggregateCardPromotionaAgreeFile(@PathVariable String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam("rateid") String rateid, - HttpServletResponse httpResponse - ) { - clientManager.getAggregateCardPromotionaAgreeFile(clientMoniker, manager, false, rateid, httpResponse); - } - - @ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void temporaryExportPDF(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - clientManager.temporaryExportPdf(clientMoniker, manager, httpResponse); - } - - @ManagerMapping(value = "/{clientMoniker}/import/agreepdf", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void importAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject source) throws Exception { - clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file"), false); - } - - @ManagerMapping(value = "/{clientMoniker}/notify/completeAgree", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void completeAgree(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.completeAgree(clientMoniker, manager); - } - - /** - * 信用卡合同生成完毕通知BD - * - * @param clientMoniker - * @param manager - */ - @ManagerMapping(value = "/{clientMoniker}/notify/cardCompleteAgree", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void cardCompleteAgree(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.cardCompleteAgree(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/download/complianceAsZIP", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void downloadComplianceZip(@PathVariable String clientMoniker, HttpServletResponse response) throws Exception { - clientManager.downloadComplianceZip(clientMoniker, response); - } - - @ManagerMapping(value = "/{clientMoniker}/download/MWcomplianceAsZIP", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void downloadMWComplianceZip(@PathVariable String clientMoniker, HttpServletResponse response) throws Exception { - clientManager.downloadMWComplianceZip(clientMoniker, response); - } - - @ManagerMapping(value = "/{clientMoniker}/master_configuration", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void configMasterMerchant(@PathVariable String clientMoniker, @RequestBody JSONObject merchant, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.configMasterMerchant(manager, clientMoniker, merchant.getString("master_merchant")); - } - - @ManagerMapping(value = "/{clientMoniker}/lists_settlements", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) - @ReadOnlyConnection - public JSONObject getSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getSettlementLog(manager, clientMoniker, query); - } - - @GetMapping(value = "/{clientMoniker}/lists_settlements/excel") - @ReadOnlyConnection - public void excelSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) { - clientManager.excelSettlementLog(manager, clientMoniker, query, response); - } - - @ManagerMapping(value = "/{clientMoniker}/requireCustinfo", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchRequireCustinfoPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "require_custinfo", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/requireRemark", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchRequireRemarkPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "require_remark", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/merchant/list_locations", method = RequestMethod.GET) - public List getMerchantLocations(PartnerQuery query) { - return merchantLocationService.listMerchantsLocations(query); - } - - @ManagerMapping(value = "/{clientMoniker}/location", method = RequestMethod.GET) - public JSONObject getMerchantLocationByMoniker(@PathVariable String clientMoniker) { - return merchantLocationService.getMerchantLocationByMoniker(clientMoniker); - } - - @ManagerMapping(value = "/modify/{clientMoniker}/location", method = RequestMethod.PUT) - public void updateMerchantLocationByMoniker(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @PathVariable String clientMoniker, - @RequestBody JSONObject geoData) { - merchantLocationService.updateMerchantLocation(manager, clientMoniker, geoData); - } - - @ManagerMapping(value = "/{clientMoniker}/wechat_compliance_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void wechatCcompliancePermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "wechat_compliance", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/local_merchant_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/list_sub_applices", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public List listSubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listSubMerchantIdApplys(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/list_rpay_sub_applices", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public List listRpaySubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listRpaySubMerchantIdApplys(manager, clientMoniker); - } - - @ManagerMapping(value = "/{clientMoniker}/sub_apply", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - @Deprecated - public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.subMerchantApplication(clientMoniker, subMerchantIdApply, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/new_sub_apply", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public String newSubMerchantApplication(@PathVariable String clientMoniker, @RequestBody NewSubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.newSubMerchantApplication(clientMoniker, subMerchantIdApply, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids/{merchantAppId}", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject querySubMerchantApplication(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("merchantAppId") String merchantAppId) { - return clientManager.queryApplicationSubMerchantById(clientMoniker, merchantAppId); - } - - - @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids/{merchantAppId}", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void changeSubMerchantApplication(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("merchantAppId") String merchantAppId, - @RequestBody NewSubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changeApplicationSubMerchantById(clientMoniker, merchantAppId, subMerchantIdApply, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids/{subMerchantId}/status", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject querySubMerchantStatus(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("subMerchantId") String subMerchantId) { - return clientManager.querySubMerchantStatus(clientMoniker, subMerchantId); - } - - @ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayGms(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayGms(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/query/alipay_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject queryAlipayGmsStatus(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject result = new JSONObject(); - result.put("result_status", clientManager.queryAlipayGmsStatus(clientMoniker, manager)); - return result; - } - - @ManagerMapping(value = "/{clientMoniker}/register/alipayOnline_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayOnlineGms(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayOnlineGms(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject queryAlipayOnlineGmsStatus(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject result = new JSONObject(); - result.put("result_status", clientManager.queryAlipayOnlineGmsStatus(clientMoniker, manager)); - return result; - } - - @ManagerMapping(value = "/{clientMoniker}/query/alipay_gms_json", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject queryAlipayGmsJson(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.queryAlipayGmsJson(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms_json", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject queryAlipayOnlineGmsJson(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.queryAlipayOnlineGmsJson(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public List getMerchantIds(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listMerchantIds(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/get_sub_merchant_id_logs", method = RequestMethod.GET, role = {ManagerRole.OPERATOR}) - public List getClientSubMerchantIdLogs(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getClientSubMerchantIdLogs(clientMoniker, manager); - } - - @ManagerMapping(value = "/unsub/{clientMoniker}", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void addSub(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.addSub(clientMoniker, manager); - } - - @ManagerMapping(value = "/unsub/{clientMoniker}", method = RequestMethod.DELETE, role = {ManagerRole.OPERATOR}) - public void removeSub(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.removeSub(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/hf", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchHfPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchHfLink(manager, clientMoniker, pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/hf/email_notice", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/{channel}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchGateWayLinkPermission(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchGatewayLink(manager, clientMoniker, channel, pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/{channel}/email_notice", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void switchGatewayEmailNotice(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchPermission(manager, clientMoniker, "enable_" + channel + "_email_notice", pass.getBooleanValue("allow")); - } - - @ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void subRpayMerchantApplication(@PathVariable String clientMoniker, @RequestBody JSONObject merchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.subRpayMerchantApplication(clientMoniker, merchantInfo, manager); - } - - @GetMapping("/compliance") - @RequireManager(role = {ManagerRole.OPERATOR}) - public JSONObject lisPartnersByCompliance(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query) { - return clientManager.comListPartnerSelection(manager, query); - } - - - @GetMapping("/{clientMoniker}/cb_bankpay/link") - public void switchPaymentWay(@PathVariable String clientMoniker, HttpServletResponse response) throws IOException { - clientManager.switchPaymentConfig(clientMoniker, response); - } - - @ManagerMapping(value = "/{clientMoniker}/cb_bankpay", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchCBBankPayLinkPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchCBBankLink(manager, clientMoniker, pass.getBooleanValue("allow")); - } - - @GetMapping("/{clientMoniker}/jump/link") - public String jumpCBBankPayLink(@PathVariable String clientMoniker) { - return clientManager.cbBankPayLink(clientMoniker); - } - - - @GetMapping("/{clientMoniker}/cb_bankpay/link/pc") - public void switchPaymentWayPC(@PathVariable String clientMoniker, HttpServletResponse response) throws IOException { - clientManager.switchPaymentConfigPC(clientMoniker, response); - } - - - /** - * 商户设置单独的网银和快捷通道 - * - * @param clientMoniker - * @param channelKey - * @throws IOException - */ - @ManagerMapping(value = "/{clientMoniker}/cb_bankpay/{channelKey}/channel_id", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchPartnerCBChannelConfig(@PathVariable String clientMoniker, @PathVariable String channelKey, @RequestBody JSONObject channel) { - clientManager.partnerCBChannelConfig(clientMoniker, channelKey, channel.getString("channel_id")); - } - - /** - * 获取商户所有增值服务 - * - * @param clientMoniker - * @return - */ - @ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject getClientIncrementalService(@PathVariable String clientMoniker) { - return clientManager.partnerIncrementalService(clientMoniker); - } - - /** - * 保存/修改增值服务配置 - * - * @param clientMoniker - * @param incrementalService - */ - @ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void updateClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker, @RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changePartnerIncrementalService(clientMoniker, incrementalService, manager); - } - - /** - * 禁用/启用增值服务 - * - * @param clientMoniker - * @param incrementalService - */ - @ManagerMapping(value = "/{clientMoniker}/incremental_service/status", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker, @RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.changeSwitchIncrementalService(clientMoniker, incrementalService, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/ext_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void changeClientExtConfigs(@PathVariable("clientMoniker") String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestBody JSONObject params) { - clientManager.changeExtParams(clientMoniker, manager, params); - } - - @ManagerMapping(value = "/{clientMoniker}/applyMWMerchantId", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public RPayMerchantEntity applyMWMerchantId(@PathVariable("clientMoniker") String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.applyMWMerchantId(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/queryMWMerchantIdStatus", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public RPayMerchantEntity queryMWMerchantIdStatus(@PathVariable("clientMoniker") String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.queryMWMerchantIdStatus(clientMoniker, manager); - } - - @ManagerMapping(value = "/{clientMoniker}/copy_mw_config", method = RequestMethod.POST, role = {ManagerRole.DEVELOPER}) - public RPayMerchantEntity copyMWConfig(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestBody JSONObject body) { - return merchantChannelPermissionService.copyMerchantWarriorConfig(manager, clientMoniker, body.getString("client_moniker")); - } - - @ManagerMapping(value = "/{clientMoniker}/query/mw_info", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public RPayMerchantEntity queryMWMerchantInfo(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.queryMWMerchantInfo(clientMoniker, manager); - } - - /** - * 启用/禁用国际卡支付 - * - * @param clientMoniker - */ - @ManagerMapping(value = "/{clientMoniker}/payment_card_permission", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchInternationalCard(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.modifyUPayProfile(manager, clientMoniker, pass.getString("key"), pass.getBooleanValue("allow")); - } - - /** - * alipayplus 商户注册 - * @param clientMoniker - * @param manager - * @return - */ - @ManagerMapping(value = "/{clientMoniker}/apply_alipayplus", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject applyAlipayPlusMerchant(@PathVariable String clientMoniker, @RequestBody ApsMerchantApplication apsMerchantApplication, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - MerchantApplicationResult result= clientManager.alipayPlusRegisterMerchant(clientMoniker,apsMerchantApplication,manager); - JSONObject jsonObject=new JSONObject(); - if(result.isSuccess()){ - jsonObject.put("result",true); - }else{ - jsonObject.put("result",false); - } - return jsonObject; - } - - @ManagerMapping(value = "/{clientMoniker}/query/alipay_aps_online", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject queryAlipayApsOnlineStatus(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject result = new JSONObject(); - result.put("response_str", clientManager.queryAlipayPlusOnlineStatus(false,clientMoniker, manager)); - return result; - } - @ManagerMapping(value = "/{clientMoniker}/query/alipay_aps_retail", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject queryAlipayApsOfflineStatus(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject result = new JSONObject(); - result.put("response_str", clientManager.queryAlipayPlusOnlineStatus(true,clientMoniker, manager)); - return result; - } - - /** - * 结算规则配置详情 - * - * @param clientMoniker - * @param manager - * @return - */ - @ManagerMapping(value = "/{clientMoniker}/settle_config", method = RequestMethod.GET) - public JSONObject getClientSettleConfig(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getSettleConfig(clientMoniker, manager); - } - - /** - * 设置结算规则配置 - * - * @param clientMoniker - * @param settleDetail - * @param manager - */ -// @PartnerChangesLog(description = "配置解决细节") - @ManagerMapping(value = "/{clientMoniker}/settle_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void configSettleDetails(@PathVariable String clientMoniker, @RequestBody SettleDetail settleDetail, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.configSettleDetail(manager, clientMoniker, settleDetail); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java deleted file mode 100644 index 882d1f65c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ /dev/null @@ -1,709 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.web; - -import au.com.royalpay.payment.core.cancelorder.service.CancelOrderService; -import au.com.royalpay.payment.core.cancelorder.service.impl.CancelOrderServiceImpl; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.kyc.core.KycService; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; -import au.com.royalpay.payment.manage.system.core.ClientContractService; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.util.Assert; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.io.OutputStream; -import java.util.List; - -/** - * view for partner client - * Created by yixian on 2016-07-03. - */ -@Controller -@RequestMapping("/client/partner_info") -public class PartnerViewController { - @Resource - private TradeLogService tradeLogService; - @Resource - private ClientManager clientManager; - @Resource - private ClientSignEventSupport clientSignEventSupport; - @Resource - private ClientContractService clientContractService; - @Resource - private SignInAccountService signInAccountService; - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource - private KycService kycService; - - @Resource - private CancelOrderService cancelOrderService; - - @Resource - private OrderMapper orderMapper; - - @RequestMapping(method = RequestMethod.GET) - @RequirePartner - @ResponseBody - public JSONObject getPartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - final String clientMoniker = account.getString("client_moniker"); - return clientManager.clientDetail(null, clientMoniker); - } - - @RequestMapping(method = RequestMethod.PUT) - @ResponseBody - public void updatePartnerEmail(@RequestBody JSONObject partner) { - clientManager.updateClientEmail(partner.getIntValue("client_id"), partner.getString("contact_email")); - } - - @PartnerMapping(value = "/qrcode", method = RequestMethod.GET) - @ResponseBody - public JSONObject getQrCodeImg(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, QRCodeConfig config) { - return clientManager.getQRCode(null, account.getString("client_moniker"), config); - } - - @PartnerMapping(value = "/qrcode_board", method = RequestMethod.GET) - public void getQRCodeBoardImage(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, QRCodeConfig config, - HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream"); - response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeQrCodeBoard(null, account.getString("client_moniker"), config, ous, "PC"); - } - - @PartnerMapping(value = "/qrcode_board/aggregate", method = RequestMethod.GET) - public void getAggregateQRCodeBoardImage(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, QRCodeConfig config, - HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream"); - response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeAggregateQrCodeBoard(null, account.getString("client_moniker"), config, ous, "pc"); - } - - @PartnerMapping(value = "/qrcode_board/CBBankAggregate", method = RequestMethod.GET) - public void getCBBankAggregateQRCodeBoardImage(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, - HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream"); - response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeCBBankAggregateQrCodeBoard(null, account.getString("client_moniker"), ous, "pc"); - } - - @PartnerMapping(value = "/poster", method = RequestMethod.GET) - public void getPosterImage(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=poster.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writePoster(null, account.getString("client_moniker"), ous); - } - - @PartnerMapping(value = "/poster/aggregate", method = RequestMethod.GET) - public void getAggregatePosterImage(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=poster.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeAggregatePoster(null, account.getString("client_moniker"), ous); - } - - @PartnerMapping(value = "/activities/{activityName}/poster", method = RequestMethod.GET) - public void getActivityPoster(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, HttpServletResponse response, - @PathVariable String activityName) throws IOException { - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", "attachment; filename=lucky_money_poster.jpg"); - OutputStream ous = response.getOutputStream(); - clientManager.writeActivityPoster(null, account.getString("client_moniker"), activityName, ous); - } - - @PartnerMapping(value = "/accounts", method = RequestMethod.GET, roles = PartnerRole.ADMIN) - @ResponseBody - public List listAccounts(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.listAccounts(account, account.getString("client_moniker")); - } - - @PartnerMapping(value = "/accounts", method = RequestMethod.POST, roles = PartnerRole.ADMIN) - @ResponseBody - public JSONObject newAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody @Valid NewAccountBean newAccount, Errors errors) { - HttpUtils.handleValidErrors(errors); - return clientManager.newAccount(account.getString("client_moniker"), newAccount, account, 2); - } - - @PartnerMapping(value = "/accounts/{accountId}/pwd", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void resetPwd(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String accountId, @RequestBody JSONObject pwd) { - clientManager.resetAccountPwd(null, account.getString("client_moniker"), accountId, pwd.getString("pwd")); - } - - @PartnerMapping(value = "/accounts/{accountId}/role", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void changeRole(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject role) { - clientManager.changeRole(null, account.getString("client_moniker"), accountId, role.getIntValue("role")); - } - - @PartnerMapping(value = "/accounts/{accountId}/enable_notice", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void toggleAccountNotice(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.toggleAccountReceiveNotice(account.getString("client_moniker"), accountId, enable.getBooleanValue("enable")); - } - - @PartnerMapping(value = "/current_account/enable_notice", method = RequestMethod.PUT) - @ResponseBody - public void toggleCurrentAccountNotice(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.toggleAccountReceiveNotice(account.getString("client_moniker"), account.getString("account_id"), enable.getBooleanValue("enable")); - } - - - @PartnerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT) - @ResponseBody - public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setOrderExpiryConfig(account, clientMoniker, config.getString("order_expiry_config")); - } - - @PartnerMapping(value = "/{clientMoniker}/surcharge_account", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public JSONObject surchargeAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientManager.surchargeAccount(manager, clientMoniker); - } - - @PartnerMapping(value = "/{clientMoniker}/account/transactions", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ReadOnlyConnection - @ResponseBody - public List accountTransactions(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientManager.getAccountTransactions(manager, clientMoniker); - } - - @PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ReadOnlyConnection - @ResponseBody - public List accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String date) { - return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, date); - } - - @PartnerMapping(value = "/{clientMoniker}/account/months", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public List getAccountDetailByMonths(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientManager.getAccountDetailByMonths(manager, clientMoniker); - } - - @PartnerMapping(value = "/accounts/{accountId}/audit_refund", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void toggleAccountAuditRefund(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.toggleAccountRefundAuthorize(account.getString("client_moniker"), accountId, enable.getBooleanValue("enable")); - } - - @PartnerMapping(value = "/current_account/audit_refund", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void toggleCurrentAccountAuditRefund(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.toggleAccountRefundAuthorize(account.getString("client_moniker"), account.getString("account_id"), enable.getBooleanValue("enable")); - } - - @PartnerMapping(value = "/accounts/{accountId}", method = RequestMethod.DELETE, roles = PartnerRole.ADMIN) - @ResponseBody - public void disableAccount(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - if (accountId.equals(account.getString("account_id"))) { - throw new BadRequestException("You cannot disable yourself"); - } - clientManager.disableAccount(null, account.getString("client_moniker"), accountId); - } - - @PartnerMapping(value = "/accounts/{accountId}/wechat", method = RequestMethod.DELETE, roles = PartnerRole.ADMIN) - @ResponseBody - public void unbindWechat(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.unbindAccountWechat(account.getString("client_moniker"), accountId); - } - - @PartnerMapping(value = "/bind_qrcode", method = RequestMethod.GET) - @ResponseBody - public JSONObject bindWechatUserQRCode(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, - @RequestParam(name = "account_id", required = false) String accountId) { - if (accountId == null) { - accountId = account.getString("account_id"); - } else { - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException("You have no permission to bind wechat user to another account"); - } - } - return clientManager.createBindWechatUserQrCode(account.getString("client_moniker"), accountId); - } - - @WechatMapping(value = "/wechat_bind/{randomKey}", method = RequestMethod.GET, oauthType = WxOauthType.USERINFO, - addonMp = {KangaLandWechatApiImpl.class}) - public String bindWechatUser(@PathVariable String randomKey, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user, Model model) { - clientManager.bindWechatUser(randomKey, user, model); - return "wechat_bind"; - } - - @PutMapping(value = "/account_receive_notice") - @ResponseBody - public JSONObject toggleReceiveNotice(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user, @RequestBody JSONObject enable) { - if (user == null) { - throw new ForbiddenException("Please visit with wechat."); - } - clientManager.toggleAccountReceiveNoticeByOpenId(user.getString("openid"), enable.getBooleanValue("enable")); - return new JSONObject(); - } - - @PartnerMapping(value = "/pay_notice", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void togglePayNotice(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.togglePayNotice(account, account.getString("client_moniker"), enable.getBooleanValue("enable")); - } - - @PartnerMapping(value = "/audit_refund", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void toggleAuditRefund(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.toggleAuditRefund(account.getString("client_moniker"), enable.getBooleanValue("enable"), account); - } - - @PartnerMapping(value = "/refund_pwd", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void updateRefundPwd(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject req) { - clientManager.updateRefundPwd(account, req.getString("pwd")); - } - - @PartnerMapping(value = "/refund_pwd_new", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN}) - @ResponseBody - public void updateRefundPwdNew(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject req) { - clientManager.resetRefundPassword(account, req); - } - - @PartnerMapping(value = "/trade_logs", method = RequestMethod.GET) - @ResponseBody - public JSONObject listTradeLogs(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, TradeLogQuery query) throws Exception { - return tradeLogService.listPartnerTradeLogs(null, account, account.getString("client_moniker"), query, account.getJSONObject("client").getString("timezone")); - } - - @PartnerMapping(value = "/incremental_trade_logs", method = RequestMethod.GET) - @ResponseBody - public JSONObject listIncrementalTradeLogs(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, TradeLogQuery query) throws Exception { - return tradeLogService.listPartnerIncrementalTradeLogs(null, account, account.getString("client_moniker"), query, account.getJSONObject("client").getString("timezone")); - } - - @PartnerMapping(value = "/trade_logs/{orderId}", method = RequestMethod.GET) - @ResponseBody - public JSONObject getOrderDetail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String orderId) { - return tradeLogService.getOrderDetail((JSONObject) null, account.getString("client_moniker"), orderId, account.getJSONObject("client").getString("timezone")); - } - - @PartnerMapping(value = "/trade_logs/{orderId}/release_preauth", method = RequestMethod.PUT) - @ResponseBody - public void releasePreAuthorization(@PathVariable String orderId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - tradeLogService.releasePreAuthorization(account.getString("client_moniker"), orderId); - } - - @PartnerMapping(value = "/trade_logs/{orderId}", method = RequestMethod.PUT) - @ResponseBody - public void updateOrderDetail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String orderId, @RequestBody JSONObject order) throws Exception { - order.put("order_id", orderId); - tradeLogService.updateOrderDetail(account.getIntValue("client_id"), order); - } - - @PartnerMapping(value = "/bank_account", method = RequestMethod.GET) - @ResponseBody - public JSONObject getClientBankAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - JSONObject bankInfo = clientManager.listClientBankAccounts(null, account.getString("client_moniker")); - bankInfo.put("account_no", "***" + StringUtils.substring(bankInfo.getString("account_no"), -4)); - return bankInfo; - } - - @PartnerMapping(value = "/rates", method = RequestMethod.GET) - @ResponseBody - public List listClientRates(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.clientRates(account.getString("client_moniker"), true); - } - - @PartnerMapping(value = "/timezone", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void updateClientTimeZone(@RequestBody JSONObject tz, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - String timezone = tz.getString("timezone"); - if (!timezone.matches("^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$")) { - throw new ParamInvalidException("timezone", "error.payment.valid.invalid_timezone"); - } - clientManager.updateTimeZone(account, account.getString("client_moniker"), timezone); - } - - @PartnerMapping(value = "/sub_partners", method = RequestMethod.GET) - @ResponseBody - public List listSubPartners(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.listSubClients(null, account.getString("client_moniker")); - } - - @PartnerMapping(value = "/sub_partners/page", method = RequestMethod.GET) - @ResponseBody - public JSONObject listSubPartnersByPage(@RequestParam(defaultValue = "1") int page, - @RequestParam(required = false) String searchText, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.listSubClientsByPage(null, account.getString("client_moniker"), searchText, page); - } - - @PartnerMapping(value = "/devices", method = RequestMethod.GET, roles = PartnerRole.ADMIN) - @ResponseBody - public JSONObject listClientDevices(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam(required = false) String remark, - @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, - @RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids) { - return clientManager.listClientDevices(null, account.getString("client_moniker"), remark, page, limit, client_type, client_ids); - } - - @PartnerMapping(value = "/device_ids", method = RequestMethod.GET, roles = PartnerRole.ADMIN) - @ResponseBody - public JSONObject listClientDeviceIds(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, - @RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids) { - return clientManager.listClientDeviceIds(account.getString("client_moniker"), client_type, client_ids); - } - - @PartnerMapping(value = "/devices/{devId}", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void modifyDevice(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String devId, @RequestBody JSONObject remark) { - clientManager.updateDevie(null, account.getString("client_moniker"), devId, remark.getString("remark")); - } - - @PartnerMapping(value = "/devices/{devId}/enable", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void toggleDeviceAvailable(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String devId, @RequestBody JSONObject enable) { - clientManager.toggleDeviceAvailable(null, account.getString("client_moniker"), devId, enable.getBooleanValue("enable")); - } - - @PartnerMapping(value = "/orderscount", method = RequestMethod.GET) - @ResponseBody - public int getOrders(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return tradeLogService.getOrdersCount(account); - } - - @PartnerMapping(value = "/switch_gateway_v2", method = RequestMethod.PUT) - @ResponseBody - public void changeGatewayVersion(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeGatewayVersion(account, pass.getBooleanValue("enable_gateway_version2")); - } - - @PartnerMapping(value = "/verify_ip", method = RequestMethod.PUT) - @ResponseBody - public void changeVerifyIp(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeVerifyIp(account, pass.getBooleanValue("verify_ip")); - } - - @PartnerMapping(value = "/ip_whitelist", method = RequestMethod.PUT) - @ResponseBody - public void setIpWhitelistConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject config) { - clientManager.setIpWhitelistConfig(account, config.getString("ip_whitelist")); - } - - @PartnerMapping(value = "/partner_public_key", method = RequestMethod.PUT) - @ResponseBody - public void setPartnerPublicKeyConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject config) { - clientManager.setPartnerPublicKeyConfig(account, config.getString("partner_public_key")); - } - - @PartnerMapping(value = "/refresh_platform_public_key", method = RequestMethod.PUT) - @ResponseBody - public void refreshPlatformPublicKeyConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.refreshPlatformPublicKeyConfig(account); - } - - @PartnerMapping(value = "/payment_page_version", method = RequestMethod.PUT) - @ResponseBody - public void changePaymentPage(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changePaymentPage(account, pass.getString("paypad_version")); - } - - @PartnerMapping(value = "/cbbank_payment_page_version", method = RequestMethod.PUT) - @ResponseBody - public void changeCBBankPaymentPage(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeCBBankPaymentPage(account, pass.getString("cbbank_paypad_version")); - } - - @PartnerMapping(value = "/qrcode_surcharge", method = RequestMethod.PUT) - @ResponseBody - public void changeQRCodePaySurCharge(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeQRCodePaySurcharge(account, pass.getBooleanValue("qrcode_surcharge")); - } - - @PartnerMapping(value = "/api_surcharge", method = RequestMethod.PUT) - @ResponseBody - public void changeApiPaySurCharge(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeApiPaySurcharge(account, pass.getBooleanValue("api_surcharge")); - } - - @PartnerMapping(value = "/retail_surcharge", method = RequestMethod.PUT) - @ResponseBody - public void changeRetailPaySurCharge(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeRetailPaySurcharge(account, pass.getBooleanValue("retail_surcharge")); - } - - @PartnerMapping(value = "/cbbank_surcharge", method = RequestMethod.PUT) - @ResponseBody - public void changeCBBankPaySurCharge(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeCBBankPaySurcharge(account, pass.getBooleanValue("cbbank_surcharge")); - } - - @PartnerMapping(value = "/require_custinfo", method = RequestMethod.PUT) - @ResponseBody - public void changeRequireCustinfo(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeRequireCustinfo(account, pass.getBooleanValue("require_custinfo")); - } - - @PartnerMapping(value = "/require_remark", method = RequestMethod.PUT) - @ResponseBody - public void changeRequireRemark(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.changeRequireRemark(account, pass.getBooleanValue("require_remark")); - } - - - @PartnerMapping(value = "/sign_events", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public List listUnhandledSignEvents(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientSignEventSupport.listUnhandledSignEvents(account.getIntValue("client_id")); - } - - @PartnerMapping(value = "/sign_events/{signId}", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void listUnhandledSignEventsBySignId(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String signId) { - clientSignEventSupport.sign(account, signId); - } - - @PartnerMapping(value = "/customer_surcharge_rate", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void setCustomerSurchargeRate(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.setCustomerSurchargeRate(account, account.getString("client_moniker"), pass.getBigDecimal("customer_surcharge_rate")); - } - - @PartnerMapping(value = "/trade_logs/full_release_preauth", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void fullReleasePreAuthorization(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody TradeLogQuery query) throws Exception { - tradeLogService.fullReleasePreAuthorization(account, query); - } - - - @PartnerMapping(value = "/manual_settle", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void manualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam boolean manual_settle) { - clientManager.changeManualSettle(account, account.getIntValue("client_id"), manual_settle, account.getString("account_id"), 1, "商户" + (manual_settle ? "打开" : "关闭") + "手动清算"); - } - - @PartnerMapping(value = "/checkContract", method = RequestMethod.GET) - @ResponseBody - public JSONObject getCheckClientInfov2(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getCheckClientInfo(account.getIntValue("client_id"), account.getString("account_id"), "PC"); - } - - @PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientContractService.confirmSourceAgreement(account.getIntValue("client_id"), account.getString("account_id"), "PC"); - } - - @PartnerMapping(value = "/compliance_audit", method = RequestMethod.POST, roles = PartnerRole.ADMIN) - @ResponseBody - public void commitAudit(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody(required = false) JSONObject params) { - clientManager.applyToCompliance(account.getString("client_moniker"), account, params); - } - - @PartnerMapping(value = "/compliance/files", method = RequestMethod.GET) - @ResponseBody - public JSONObject complianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getAuthFiles(null, account.getString("client_moniker")); - } - - - @PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET) - @ResponseBody - public JSONObject complianceInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return null; - } - - @PartnerMapping(value = "/compliance/clientViewFiles", method = RequestMethod.GET) - @ResponseBody - public JSONObject complianceFiles(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getComplianceFiles(account); - } - - @PartnerMapping(value = "/kyc/clientViewFiles", method = RequestMethod.GET) - @ResponseBody - public JSONObject kycFiles(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getKycFiles(account); - } - - - @PartnerMapping(value = "/aggregateFile/client_info", method = RequestMethod.GET) - @ResponseBody - public JSONObject getClientInfoByAggree(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getClientInfoByAggree(account); - } - -/* @PartnerMapping(value = "/{clientMoniker}/clientViewFiles", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getAllAuthFiles(manager, clientMoniker); - }*/ - - @PartnerMapping(value = "/verify/email", method = RequestMethod.PUT) - @ResponseBody - public void sendVerifyEmail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.sendVerifyEmail(account.getJSONObject("client"), account.getString("account_id")); - } - - @PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientRegisterInfo info) { - JSONObject client = account.getJSONObject("client"); - - if (client.getIntValue("approve_result") != 1) { - clientManager.updateClientRegisterInfo(null, account.getString("client_moniker"), info); - } else { - throw new BadRequestException("已通过审核,暂不能提交和修改"); - } - - } - - @PartnerMapping(value = "/update/file", method = RequestMethod.PUT) - @ResponseBody - public void updateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) { - JSONObject client = account.getJSONObject("client"); - if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4) { - JSONObject manager = new JSONObject(); - manager.put("display_name", "client"); - clientManager.uploadAuthFiles(manager, account.getString("client_moniker"), filesInfo); - } else { - throw new BadRequestException("已通过审核,暂不能提交和修改"); - } - } - - @PartnerMapping(value = "/update/wait_compliance_file", method = RequestMethod.PUT) - @ResponseBody - public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) { - JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); - JSONObject authFileStatus = signInAccountService.checkAuthFileStatus(client); - if (authFileStatus.getBooleanValue("client_less_file")) { - JSONObject manager = new JSONObject(); - manager.put("display_name", "client"); - clientManager.uploadAuthFilesForWaitCompliance(manager, account.getString("client_moniker"), filesInfo); - } else { - throw new BadRequestException("已通过审核,暂不能提交和修改"); - } - } - - @PartnerMapping(value = "/clientCompliance/{clientMoniker}/viewCommit", method = RequestMethod.POST) - @ResponseBody - public void clientComplianceViewCommit(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject photoInfo) { - account.put("photo_info", photoInfo); - clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web"); - } - - @PartnerMapping(value = "/clientCompliance/{clientMoniker}/kycFilesViewCommit", method = RequestMethod.POST) - @ResponseBody - public void clientKycFilesViewCommit(@PathVariable String clientMoniker, @RequestBody JSONObject params, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - account.putAll(params); - kycService.commitAuthKycFilesToCompliance(clientMoniker, account, "Web"); - } - - @PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST) - @ResponseBody - public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request) throws IOException { - account.put("signature_ip", RequestEnvironment.getClientIp()); - account.put("user_agent", userAgent); - return clientManager.getClientAggregateFile(account, file); - } - - @PartnerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.deleteAuthFiles(fileId); - } - - @PartnerMapping(value = "/auth_file/{fileId}/deleteByAdmin", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void deleteAuthFilesByAdmin(@PathVariable String fileId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientManager.deleteAuthFilesByAdmin(fileId); - } - - /** - * 获取商户所有增值服务 - * - * @param clientMoniker - * @return - */ - @PartnerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getClientIncrementalService(@PathVariable String clientMoniker) { - return clientManager.partnerIncrementalService(clientMoniker); - } - - /** - * 获取商户增值服务详情 - * - * @param clientMoniker - * @param channel - * @return - */ - @PartnerMapping(value = "/{clientMoniker}/incremental_service/{channel}/info", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getClientIncrementalServiceInfo(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("channel") String channel) { - return clientManager.partnerIncrementalServiceInfo(clientMoniker, channel); - } - - @PartnerMapping(value = "/incremental_service/{channel}/login_token", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getClientIncrementalServiceLoginToken(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable("channel") String sourceCode) { - return clientManager.getClientIncrementalServiceLoginToken(account, sourceCode); - } - - @PartnerMapping(value = "/{clientMoniker}/aps_kyc", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public JSONObject getApsKycClient(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable("clientMoniker") String clientMoniker) { - return clientManager.getApsKycClient(account, clientMoniker); - } - - @PartnerMapping(value = "/aps_kyc", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - @ResponseBody - public void updateApsKycClient(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject item) { - clientManager.updateApsKycClient(account, item); - } - @PartnerMapping(value = "/cancel_order", method = RequestMethod.POST) - @ResponseBody - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - @RequirePartner - public JSONObject cancel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject order, Errors errors) { - System.out.println("=====>cancel_order"); - order = orderMapper.getOrderDetail(order.getString("orderId")); - Assert.notNull(order, "Order Not Exists!"); - int clientId = order.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - int accountClientId = account.getIntValue("client_id"); - Assert.isTrue(accountClientId == client.getIntValue("client_id") || accountClientId == client.getIntValue("parent_client_id") - || clientManager.listLevel3Client(accountClientId).contains(client.getIntValue("parent_client_id")), - "This order is not belong to current merchant"); - - //暂时未给运营端使用,仅商户端使用 - return cancelOrderService.cancelOrderOrNot(order.getString("order_id")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeBean.java b/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeBean.java deleted file mode 100644 index 8571c3c0d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeBean.java +++ /dev/null @@ -1,121 +0,0 @@ -package au.com.royalpay.payment.manage.notice.beans; - -import com.alibaba.fastjson.JSONObject; - -import javax.mail.internet.MimeBodyPart; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by yishuqian on 17/01/2017. - * 邮件消息 - */ -public class NoticeBean { - private String notice_id; - private String title; - private List mailClients = new ArrayList<>(); - private List attachments = new ArrayList<>(); - @NotNull - private String senderAddress; - private String password; - private String content = "Auto sended by system, do not reply"; - private String fileIds; - private String files; - private List attachFiles = new ArrayList<>(); - - - public JSONObject toMailJson() { - JSONObject res = new JSONObject(); - if (notice_id != null) { - res.put("notice_id", notice_id); - } - res.put("title", title); - res.put("sender_address", senderAddress); - res.put("password", password); - res.put("content", content); - res.put("file_ids", fileIds); - return res; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - - public List getAttachments() { - return attachments; - } - - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - public String getSenderAddress() { - return senderAddress; - } - - public void setSenderAddress(String senderAddress) { - this.senderAddress = senderAddress; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getNotice_id() { - return notice_id; - } - - public void setNotice_id(String notice_id) { - this.notice_id = notice_id; - } - - public String getFileIds() { - return fileIds; - } - - public void setFileIds(String fileIds) { - this.fileIds = fileIds; - } - - public String getFiles() { - return files; - } - - public void setFiles(String files) { - this.files = files; - } - - public List getMailClients() { - return mailClients; - } - - public void setMailClients(List mailClients) { - this.mailClients = mailClients; - } - - public List getAttachFiles() { - return attachFiles; - } - - public void setAttachFiles(List attachFiles) { - this.attachFiles = attachFiles; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java b/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java deleted file mode 100644 index b3c16cda0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java +++ /dev/null @@ -1,277 +0,0 @@ -package au.com.royalpay.payment.manage.notice.beans; - - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import javax.validation.constraints.NotNull; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Created by yishuqian on 28/09/2016. - * 后台消息 - */ -public class NoticeInfo { - private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - @NotNull - private String title; - private String desc; - private String end_time; - private String content; - private String status; - private String send_clients; - private boolean is_tomail; - private boolean is_tomail_cc_stockholder; - private boolean is_to_app; - private boolean is_app_window; - private int merchants_type=0; - private String notice_id; - private String button0; - private String button1; - private String button2; - private String url; - private String aggregate_file; - private String type; - - public JSONObject toJson() { - JSONObject res = new JSONObject(); - if (end_time != null) { - try { - res.put("end_time", format.parse(end_time)); - } catch (ParseException e) { - throw new ParamInvalidException("end_time", "error.payment.valid.invalid_date_format"); - } - } - res.put("title",title); - if (desc != null){ - res.put("desc",desc); - } - res.put("merchants_type",merchants_type); - if (content != null){ - if (content.contains(" buttons = new ArrayList<>(); - if (button0 != null) { - JSONObject buttonJson = JSON.parseObject(button0); - if (StringUtils.isNotBlank(buttonJson.getString("name")) && StringUtils.isNotBlank(buttonJson.getString("type"))) { - buttons.add(buttonJson); - } - } - if (button1 != null) { - JSONObject buttonJson = JSON.parseObject(button1); - if (StringUtils.isNotBlank(buttonJson.getString("name")) && StringUtils.isNotBlank(buttonJson.getString("type"))) { - buttons.add(buttonJson); - } - } - if (button2 != null) { - JSONObject buttonJson = JSON.parseObject(button2); - if (StringUtils.isNotBlank(buttonJson.getString("name")) && StringUtils.isNotBlank(buttonJson.getString("type"))) { - buttons.add(buttonJson); - } - } - if (!buttons.isEmpty()) { - res.put("buttons", buttons); - } - if (aggregate_file != null) { - res.put("aggregate_file", aggregate_file); - } - if (url != null) { - res.put("url",url); - } - if (type != null) { - res.put("type", type); - }else { - res.put("type", 1); - } - return res; - } - - private void initImgAutoSize() { - String regxpForIMGTag = "<\\s*img\\s+([^>]*)\\s*/>"; - Pattern pattern = Pattern.compile(regxpForIMGTag); - Matcher matcher = pattern.matcher(content); - while (matcher.find()) { - String imgStr = matcher.group(1); - String regxpForWidth = "width=\"([^\"]+)\""; - String regxpForHeight = "height=\"([^\"]+)\""; - Matcher matcherForWidth = Pattern.compile(regxpForWidth).matcher(imgStr); - if (matcherForWidth.find()){ - setContent(content.replaceAll("(]*?)\\s+width\\s*=\\s*\\S+", "$1 width=100%")); - }else { - String regex = "(?i)(\\]+\\>)"; - setContent(content.replaceAll(regex, "$1 width =\"100%\"$2")); - } - Matcher matcherForHeight = Pattern.compile(regxpForHeight).matcher(imgStr); - if (matcherForHeight.find()){ - setContent(content.replaceAll("(]*?)\\s+height\\s*=\\s*\\S+", "$1 height=100%")); - }else { - String regex = "(?i)(\\]+\\>)"; - setContent(content.replaceAll(regex, "$1 height =\"100%\"$2")); - } - } - } - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public void setEnd_time(String end_time) { - this.end_time = end_time; - } - - public String getSend_clients() { - return send_clients; - } - - public void setSend_clients(String send_clients) { - this.send_clients = send_clients; - } - - public boolean isIs_tomail() { - return is_tomail; - } - - public void setIs_tomail(boolean is_tomail) { - this.is_tomail = is_tomail; - } - - public boolean isIs_tomail_cc_stockholder() { - return is_tomail_cc_stockholder; - } - - public void setIs_tomail_cc_stockholder(boolean is_tomail_cc_stockholder) { - this.is_tomail_cc_stockholder = is_tomail_cc_stockholder; - } - - public boolean isIs_to_app() { - return is_to_app; - } - - public void setIs_to_app(boolean is_to_app) { - this.is_to_app = is_to_app; - } - - public String getNotice_id() { - return notice_id; - } - - public void setNotice_id(String notice_id) { - this.notice_id = notice_id; - } - - public boolean isIs_app_window() { - return is_app_window; - } - - public void setIs_app_window(boolean is_app_window) { - this.is_app_window = is_app_window; - } - - public int getMerchants_type() { - return merchants_type; - } - - public void setMerchants_type(int merchants_type) { - this.merchants_type = merchants_type; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public void setButton1(String button1) { - this.button1 = button1; - } - - public String getButton1() { - return button1; - } - public void setButton2(String button2) { - this.button2 = button2; - } - - public String getButton2() { - return button2; - } - public void setButton0(String button0) { - this.button0 = button0; - } - - public String getButton0() { - return button0; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getAggregate_file() { - return aggregate_file; - } - - public void setAggregate_file(String aggregate_file) { - this.aggregate_file = aggregate_file; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeQuery.java b/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeQuery.java deleted file mode 100644 index 222c04e84..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeQuery.java +++ /dev/null @@ -1,83 +0,0 @@ -package au.com.royalpay.payment.manage.notice.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Created by yishuqian on 10/10/2016. - */ -public class NoticeQuery { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private String title; - private String datefrom; - private String dateto; - private int page = 1; - private int limit = 20; - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getDatefrom() { - return datefrom; - } - - public void setDatefrom(String datefrom) { - this.datefrom = datefrom; - } - - public String getDateto() { - return dateto; - } - - public void setDateto(String dateto) { - this.dateto = dateto; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (datefrom != null) { - try { - params.put("from", format.parse(datefrom)); - } catch (ParseException e) { - throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format"); - } - } - if (dateto != null) { - try { - params.put("to", DateUtils.addDays(format.parse(dateto), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format"); - } - } - if (title != null){ - params.put("title",title); - } - return params; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/MailService.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/MailService.java deleted file mode 100644 index 395525536..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/MailService.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.notice.core; - -import com.alibaba.fastjson.JSONObject; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.List; - -/** - * Created by yishuqian on 18/01/2017. - */ -public interface MailService { - - String sendEmailNotice(String notice_id, String title, List mailTo, String content) throws URISyntaxException, IOException; - - String sendEmail(String title, String mailTos, String mailCcs, String content) throws URISyntaxException, IOException; - - String sendEmailWhihBcc(String title, String mailTos, String mailBccs, String content) throws URISyntaxException, IOException; - - String sendEmail(String title, String mailTos, String mailCcs, String content, List attachFiles) throws URISyntaxException, IOException; - - String sendRiskEmail(String title, String mailTos, String mailCcs,String mailBcc, String content, List attachFiles, int order_type) throws URISyntaxException, IOException; - - List checkEmailStatus(String emailId); - - void removeUnsub(Long id); - - JSONObject queryUnsubPageable(JSONObject params, int limit, int page); - - void addUnsub(String ClientMoniker); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/NoticeManage.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/NoticeManage.java deleted file mode 100644 index 00e461615..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/NoticeManage.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.notice.core; - -import au.com.royalpay.payment.manage.notice.beans.NoticeInfo; -import au.com.royalpay.payment.manage.notice.beans.NoticeQuery; -import com.alibaba.fastjson.JSONObject; -import org.springframework.transaction.annotation.Transactional; - -/** - * Created by yishuqian on 28/09/2016. - */ -public interface NoticeManage { - JSONObject listNotices(NoticeQuery query); - - JSONObject addNotice(NoticeInfo noticeInfo, JSONObject manager); - - @Transactional - JSONObject saveNotice(NoticeInfo noticeInfo, JSONObject manager); - - JSONObject getNoticeById(String noticeId); - - void updateNotice(JSONObject manager, String noticeId, NoticeInfo info) throws Exception; - - int listNoticeClients(String noticeId); - - JSONObject listNoticeReadClients(String noticeId, int page, int limit); - - void toggleNoticeAppWindow(String noticeId, Boolean isAppWindow); - - JSONObject getLatestWindowNotice(int client_id); - - JSONObject getLatestWindowConfirmNotice(int client_id); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/NoticePartner.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/NoticePartner.java deleted file mode 100644 index 5c8dfc685..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/NoticePartner.java +++ /dev/null @@ -1,12 +0,0 @@ -package au.com.royalpay.payment.manage.notice.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 29/09/2016. - */ -public interface NoticePartner { - JSONObject listNotices(JSONObject partner, JSONObject params); - - void updateReadStatus(JSONObject partner, String noticeId) throws Exception; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java deleted file mode 100644 index 5b3ff5ed9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java +++ /dev/null @@ -1,327 +0,0 @@ -package au.com.royalpay.payment.manage.notice.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.beans.NoticeBean; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.tools.codec.AESCrypt; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.id.IdUtil; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.charset.StandardCharsets; -import java.security.Key; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by yishuqian on 18/01/2017. - */ -@Service -public class MailServiceImp implements MailService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Value("${app.mail.appid}") - private String app_mail; - @Value("${app.mail.host}") - private String mailHost; - @Value("${mail.send.credentialCode}") - private String credentialCode; - @Resource - private MailUnsubMapper mailUnsubMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClientManager clientManager; - @Value("${app.settle.aes-key}") - private String settleAESKey; - @Value("${app.partner.aes-key}") - private String partnerAESKey; - @Value("${app.risk.aes-key}") - private String riskAESKey; - @Value("${app.risk.control.aes-key}") - private String riskControlAESKey; - - - @Override - public String sendEmailNotice(String notice_id, String title, List mailTo, String content) throws URISyntaxException, IOException { - List unsubAddress = mailUnsubMapper.getAllAddress(); - List mailToWithoutUnsub = new ArrayList<>(); - mailTo.parallelStream().forEach(p -> { - if (!unsubAddress.contains(p.getString("mailto"))) { - mailToWithoutUnsub.add(p); - } - }); - Document doc = Jsoup.parse(content); - Elements links = doc.select("a[href]"); - List files = new ArrayList(); - for (Element link : links) { - String linkHref = link.attr("href"); - String linkText = link.text(); - Element e = link.previousElementSibling(); - if (e != null && "img".equalsIgnoreCase(e.tagName())) { - e.remove(); - } - -// JSONObject file = attachmentClient.getFile(linkHref); -// fileIds = fileIds+file.getString("file_id")+","; - - if (linkHref.contains("mailto")) { - continue; - } - JSONObject file = new JSONObject(); - file.put("url", linkHref); - file.put("filename", linkText); - files.add(file); - } - - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setTitle(title); - noticeBean.setNotice_id(notice_id); - noticeBean.setMailClients(mailToWithoutUnsub); - noticeBean.setContent(doc.outerHtml()); - if (!files.isEmpty()) { - noticeBean.setFiles(files.toString()); - } - JSONObject sysConfig = sysConfigManager.getSysConfig(); - noticeBean.setSenderAddress(sysConfig.getString("partner.email.address")); - String mailPwdEncrypted = sysConfig.getString("partner.email.password"); - Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured"); - Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey)); - String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8); - noticeBean.setPassword(mailPwd); - String postUrl = mailHost + "/mail?" + generateMailSignParam(); - - - HttpRequestResult result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).execute(); - if (result.isSuccess()) { - String mail_id = result.getResponseContentJSONObj().getString("mail_id"); - return mail_id; - //System.out.println("send Mail=============="+mail_id); - } else { - throw new ServerErrorException("Error Connection " + result.getStatusCode()); - } - - } - - private String generateMailSignParam() { - long time = System.currentTimeMillis(); - String nonceStr = RandomStringUtils.random(15, true, true); - String validStr = time + "&" + nonceStr + "&" + credentialCode; - String sign = DigestUtils.sha256Hex(validStr).toLowerCase(); - return "appid=" + app_mail + "&time=" + time + "&nonce_str=" + nonceStr + "&sign=" + sign; - } - - @Override - public String sendEmail(String title, String mailTos, String mailCcs, String content) throws IOException { - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setTitle(title); - List mailClients = new ArrayList<>(); - JSONObject mailClient = new JSONObject(); - mailClient.put("mailto", mailTos); - if (StringUtils.isNotBlank(mailCcs)) { - mailClient.put("mailcc", mailCcs); - } - mailClients.add(mailClient); - noticeBean.setMailClients(mailClients); - noticeBean.setContent(content); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - noticeBean.setSenderAddress(sysConfig.getString("partner.email.address")); - String mailPwdEncrypted = sysConfig.getString("partner.email.password"); - Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured"); - Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey)); - String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8); - noticeBean.setPassword(mailPwd); - String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); - HttpRequestResult result = null; - logger.info("===sendEmail===noticeBean:{}", JSON.toJSON(noticeBean)); - result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute(); - if (result.isSuccess()) { - String mail_id = result.getResponseContentJSONObj().getString("mail_id"); - return mail_id; - //System.out.println("send Mail=============="+mail_id); - } else { - throw new ServerErrorException("Error Connection"); - } - } - - @Override - public String sendEmailWhihBcc(String title, String mailTos, String mailBccs, String content) throws IOException { - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setTitle(title); - List mailClients = new ArrayList<>(); - JSONObject mailClient = new JSONObject(); - mailClient.put("mailto", mailTos); - mailClient.put("mailcc", ""); - mailClient.put("mailbcc", mailBccs); - mailClients.add(mailClient); - noticeBean.setMailClients(mailClients); - noticeBean.setContent(content); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - noticeBean.setSenderAddress(sysConfig.getString("partner.email.address")); - String mailPwdEncrypted = sysConfig.getString("partner.email.password"); - Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured"); - Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey)); - String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8); - noticeBean.setPassword(mailPwd); - String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); - HttpRequestResult result = null; - logger.info("===sendEmail===noticeBean:" + JSON.toJSON(noticeBean)); - result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute(); - if (result.isSuccess()) { - String mail_id = result.getResponseContentJSONObj().getString("mail_id"); - return mail_id; - //System.out.println("send Mail=============="+mail_id); - } else { - throw new ServerErrorException("Error Connection"); - } - } - - @Override - public List checkEmailStatus(String emailId) { - String url = mailHost + "/mail/clients/" + emailId + "?" + generateMailSignParam(); - try { - HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute(); - if (result.isSuccess()) { - JSONArray array = result.getResponseContentJSONArr(); - List res = new ArrayList<>(); - for (int i = 0, len = array.size(); i < len; i++) { - res.add(array.getJSONObject(i)); - } - return res; - } else { - throw new ServerErrorException("Mail Service failed; status code=" + result.getStatusCode()); - } - } catch (IOException e) { - throw new ServerErrorException("Mail Service failed", e); - } - - } - - @Override - public void removeUnsub(Long id) { - mailUnsubMapper.delete(id); - } - - @Override - public JSONObject queryUnsubPageable(JSONObject params, int limit, int page) { - return PageListUtils.buildPageListResult(mailUnsubMapper.queryPageable(params, new PageBounds(page, limit, Order.formString("create_time.desc")))); - } - - - @Override - public void addUnsub(String ClientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(ClientMoniker); - if (client == null) { - throw new NotFoundException("Merchant not Found"); - } - JSONObject existRecord = mailUnsubMapper.getOne(null, client.getString("contact_email")); - if (existRecord != null) { - throw new BadRequestException("Client has already existed"); - } - JSONObject record = new JSONObject(); - record.put("id", IdUtil.getId()); - record.put("address", client.getString("contact_email")); - record.put("client_id", client.getIntValue("client_id")); - record.put("client_moniker", client.getString("client_moniker")); - mailUnsubMapper.save(record); - } - - @Override - public String sendEmail(String title, String mailTos, String mailCcs, String content, List attachFiles) throws URISyntaxException, IOException { - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setTitle(title); - List mailClients = new ArrayList<>(); - JSONObject mailClient = new JSONObject(); - mailClient.put("mailto", mailTos); - mailClient.put("mailcc", mailCcs); - mailClients.add(mailClient); - noticeBean.setMailClients(mailClients); - noticeBean.setContent(content); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - noticeBean.setSenderAddress(sysConfig.getString("settle.email.address")); - String mailPwdEncrypted = sysConfig.getString("settle.email.password"); - Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "Settlement mail pwd not configured"); - Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(settleAESKey)); - String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8); - noticeBean.setPassword(mailPwd); - noticeBean.setAttachFiles(attachFiles); - String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); - HttpRequestResult result = null; - logger.info("===sendEmail===noticeBean:" + JSON.toJSON(noticeBean)); - result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute(); - if (result.isSuccess()) { - String mail_id = result.getResponseContentJSONObj().getString("mail_id"); - return mail_id; - //System.out.println("send Mail=============="+mail_id); - } else { - throw new ServerErrorException("Error Connection"); - } - } - - @Override - public String sendRiskEmail(String title, String mailTos, String mailCcs, String mailBcc, String content, List attachFiles, int orderType) throws IOException { - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setTitle(title); - List mailClients = new ArrayList<>(); - JSONObject mailClient = new JSONObject(); - mailClient.put("mailto", mailTos); - mailClient.put("mailcc", mailCcs); - mailClient.put("mailbcc", mailBcc); - mailClients.add(mailClient); - noticeBean.setMailClients(mailClients); - noticeBean.setContent(content); - noticeBean.setAttachFiles(attachFiles); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - noticeBean.setSenderAddress(sysConfig.getString("riskControl.email.address")); - String riskControlMailPwdEncrypted = sysConfig.getString("riskControl.email.password"); - Assert.isTrue(StringUtils.isNotEmpty(riskControlMailPwdEncrypted), "riskControl mail pwd not configured"); - Key riskControlAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskControlAESKey)); - String riskControlMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskControlMailPwdEncrypted), riskControlAesKey), StandardCharsets.UTF_8); - noticeBean.setPassword(riskControlMailPwd); - if (orderType == 1 || orderType == 2) { - String riskMailPwdEncrypted = sysConfig.getString("risk.email.password"); - Assert.isTrue(StringUtils.isNotEmpty(riskMailPwdEncrypted), "risk mail pwd not configured"); - Key riskAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskAESKey)); - String riskMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskMailPwdEncrypted), riskAesKey), StandardCharsets.UTF_8); - noticeBean.setSenderAddress(sysConfig.getString("risk.email.address")); - noticeBean.setPassword(riskMailPwd); - } - String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); - HttpRequestResult result = null; - logger.info("===sendEmail===noticeBean:{}", JSON.toJSON(noticeBean)); - result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute(); - if (result.isSuccess()) { - return result.getResponseContentJSONObj().getString("mail_id"); - } else { - throw new ServerErrorException("Error Connection"); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/NoticeManageImpl.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/NoticeManageImpl.java deleted file mode 100644 index cc488a4f4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/NoticeManageImpl.java +++ /dev/null @@ -1,376 +0,0 @@ -package au.com.royalpay.payment.manage.notice.core.impls; - -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper; -import au.com.royalpay.payment.manage.mappers.notice.NoticeManageMapper; -import au.com.royalpay.payment.manage.mappers.notice.NoticePartnerMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.beans.NoticeInfo; -import au.com.royalpay.payment.manage.notice.beans.NoticeQuery; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.notice.core.NoticeManage; -import au.com.royalpay.payment.manage.system.core.MailGunService; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 28/09/2016. - */ -@Service -public class NoticeManageImpl implements NoticeManage { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private NoticeManageMapper noticeManageMapper; - @Resource - private NoticePartnerMapper noticePartnerMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientManager clientManager; - @Resource - private MailService mailService; - @Resource - private MailGunService mailGunService; - @Resource - private RetailAppService retailAppService; - @Resource - private NotifyErrorLogMapper notifyErrorLogMapper; - - @Value("${stockholder.mails}") - private String stockholder_mails; - - @Value("${mail.mailgun.default.merchantlist}") - private String mailListDefault; - - - - @Override - public JSONObject listNotices(NoticeQuery query) { - PageList notices = noticeManageMapper.listPageNotices(query.toParams(), new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - for (JSONObject notice : notices) { - if (notice.getIntValue("type") == 2) { - if (notice.get("buttons") != null) { - List buttons = JSONObject.parseArray(notice.getString("buttons"), JSONObject.class); - if (buttons != null && !buttons.isEmpty()) { - for (int i = 0; i < buttons.size(); i++) { - notice.put("button" + i, buttons.get(i)); - } - } - } - } - } - return PageListUtils.buildPageListResult(notices); - } - - @Transactional - @Override - public JSONObject addNotice(NoticeInfo noticeInfo, JSONObject manager) { - Date date = new Date(); - JSONObject notice = noticeInfo.toJson(); - notice.put("create_time", date); - notice.put("create_id", manager.getString("manager_id")); - notice.put("create_name", manager.getString("display_name")); - if (noticeInfo.getStatus() != null && noticeInfo.getStatus().equals("1")) { - notice.put("send_time", date); - notice.put("send_id", manager.getString("manager_id")); - notice.put("send_name", manager.getString("display_name")); - } - noticeManageMapper.createNotice(notice); - if (noticeInfo.getStatus() != null && noticeInfo.getStatus().equals("1")) { - List clients = clientMapper.listClients(); - if (!clients.isEmpty()) { - for (JSONObject client : clients) { - client.put("create_time", date); - client.put("notice_id", notice.getString("notice_id")); - noticePartnerMapper.save(client); - } - } - } - return notice; - } - - @Transactional - @Override - public JSONObject saveNotice(NoticeInfo noticeInfo, JSONObject manager) { - Date date = new Date(); - List buttons = new ArrayList<>(); - JSONObject notice = noticeInfo.toJson(); - notice.put("create_time", date); - notice.put("create_id", manager.getString("manager_id")); - notice.put("create_name", manager.getString("display_name")); - if (notice.getInteger("merchants_type") != 1){ - StringBuilder sendClients = new StringBuilder(); - List clients = clientMapper.listValidClientFor90Days(notice); - clients.forEach(c -> { - if (c.getInteger("parent_client_id")==null || c.getInteger("parent_client_id")!=9){ - String p = c.getString("client_moniker")+","; - sendClients.append(p); - } - }); - if (sendClients.length()>0){ - notice.put("send_clients",sendClients.substring(0,sendClients.length()-1)); - } - } - buttons = JSONObject.parseArray(notice.getString("buttons"),JSONObject.class); - notice.remove("buttons"); - noticeManageMapper.createNotice(notice); - if (notice.getIntValue("type")==2) { - for (JSONObject button : buttons) { - if (StringUtils.isNotBlank(button.getString("link"))) { - if (button.getString("link").indexOf("%noticeId%") > 0) { - button.put("link", button.getString("link").replace("%noticeId%", notice.getString("notice_id"))); - } - } - } - notice.put("buttons", buttons.toString()); - noticeManageMapper.updateNotice(notice); - } - return notice; - } - - @Override - public JSONObject getNoticeById(String noticeId) { - JSONObject notice = noticeManageMapper.getNoticeDetailById(noticeId); - if (notice.getIntValue("type") == 2) { - if (notice.get("buttons") != null) { - List buttons = JSONObject.parseArray(notice.getString("buttons"), JSONObject.class); - if (buttons != null && !buttons.isEmpty()) { - for (int i = 0; i < buttons.size(); i++) { - notice.put("button" + i, buttons.get(i)); - } - } - } - } - return notice; - } - - @Override - @Transactional - public void updateNotice(JSONObject manager, String noticeId, NoticeInfo info) throws Exception { - List buttons = new ArrayList<>(); - JSONObject noticeInfo = noticeManageMapper.getNoticeDetailById(noticeId); - Assert.notNull(noticeInfo); - Date date = new Date(); - JSONObject notice = info.toJson(); - notice.put("notice_id", noticeId); - if (info.getStatus().equals("1")) { - notice.put("send_time", date); - notice.put("send_id", manager.getString("manager_id")); - notice.put("send_name", manager.getString("display_name")); - } - if (notice.getInteger("merchants_type") != 1){ - StringBuilder sendClients = new StringBuilder(); - - List clients = clientMapper.listValidClientFor90Days(notice); - clients.forEach(c -> { - if (c.getInteger("parent_client_id")==null || c.getInteger("parent_client_id")!=9){ - String p = c.getString("client_moniker")+","; - sendClients.append(p); - } - }); - if (sendClients.length()>0){ - notice.put("send_clients",sendClients.substring(0,sendClients.length()-1)); - - } - } - if (notice.getIntValue("type")==2) { - buttons = JSONObject.parseArray(notice.getString("buttons"),JSONObject.class); - for (JSONObject button : buttons) { - if (StringUtils.isNotBlank(button.getString("link"))) { - if (button.getString("link").indexOf("%noticeId%") > 0) { - button.put("link", button.getString("link").replace("%noticeId%", notice.getString("notice_id"))); - } - } - } - notice.put("buttons", buttons.toString()); - }else { - notice.remove(buttons); - } - noticeManageMapper.updateNotice(notice); - if (info.getStatus() != null && info.getSend_clients() != null) { - if (info.getStatus().equals("1") && noticeInfo.getString("status").equals("0") && !info.getSend_clients().isEmpty()) { - String client_monikers []=info.getSend_clients().split(","); - List mailto = new ArrayList<>(); - ArrayList mailboxs = new ArrayList<>(); - for (String clientMoniker : client_monikers) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if(client==null){ - continue; - } - JSONObject c = new JSONObject(); - c.put("create_time", date); - c.put("notice_id", noticeId); - c.put("client_id", client.getIntValue("client_id")); - noticePartnerMapper.save(c); - String contact_email = client.getString("contact_email"); - if (contact_email!=null && !mailboxs.contains(contact_email)){ - c.put("mailto",contact_email); - mailto.add(c); - mailboxs.add(contact_email); - } - } - if(info.isIs_tomail()){ - //同时发送给股东 - if (info.isIs_tomail_cc_stockholder()){ - String stockholder_mails_mailto [] = stockholder_mails.trim().split(","); - for (String stockholder_mailto:stockholder_mails_mailto){ - JSONObject stockholder = new JSONObject(); - stockholder.put("mailto",stockholder_mailto); - stockholder.put("client_id",0); - mailto.add(stockholder); - } - } - try { - logger.info(noticeId+"|"+info.getTitle()+"|"+mailto); - - String mail_id = mailService.sendEmailNotice(noticeId,info.getTitle(),mailto,info.getContent()); - notice.put("mail_id",mail_id); - noticeManageMapper.updateNotice(notice); - } catch (URISyntaxException | IOException e) { - e.printStackTrace(); - logger.error("sending email failed:", e.getMessage(), e); - throw new Exception(e.getMessage()); - } - } - if (info.isIs_to_app()){ - info.setNotice_id(noticeId); - retailAppService.sendNoticeMessage(info,client_monikers); - } - } - - } - } -// public void updateNotice(JSONObject manager, String noticeId, NoticeInfo info) throws Exception { -// JSONObject noticeInfo = noticeManageMapper.getNoticeDetailById(noticeId); -// Assert.notNull(noticeInfo); -// Date date = new Date(); -// JSONObject notice = info.toJson(); -// notice.put("notice_id", noticeId); -// if (info.getStatus().equals("1")) { -// notice.put("send_time", date); -// notice.put("send_id", manager.getString("manager_id")); -// notice.put("send_name", manager.getString("display_name")); -// } -// if (!notice.getBoolean("merchants_type")){ -// StringBuilder sendClients = new StringBuilder(); -// -// List clients = clientMapper.listValidClient(); -// clients.forEach(c -> { -// if (c.getInteger("parent_client_id")==null || c.getInteger("parent_client_id")!=9){ -// String p = c.getString("client_moniker")+","; -// sendClients.append(p); -// } -// }); -// if (sendClients.length()>0){ -// notice.put("send_clients",sendClients.substring(0,sendClients.length()-1)); -// -// } -// } -// noticeManageMapper.updateNotice(notice); -// if (info.getStatus() != null && info.getSend_clients() != null) { -// if (info.getStatus().equals("1") && noticeInfo.getString("status").equals("0") && !info.getSend_clients().isEmpty()) { -// String client_monikers []=info.getSend_clients().split(","); -// List mailto = new ArrayList<>(); -// ArrayList mailboxs = new ArrayList<>(); -// for (String clientMoniker : client_monikers) { -// JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); -// client.put("create_time", date); -// client.put("notice_id", noticeId); -// noticePartnerMapper.save(client); -// String contact_email = client.getString("contact_email"); -// if (contact_email!=null && !mailboxs.contains(contact_email)){ -// client.put("mailto",contact_email); -// mailto.add(client); -// mailboxs.add(contact_email); -// } -// } -// if(info.isIs_tomail()){ -// //同时发送给股东 -// if (info.isIs_tomail_cc_stockholder()){ -// String stockholder_mails_mailto [] = stockholder_mails.trim().split(","); -// for (String stockholder_mailto:stockholder_mails_mailto){ -// JSONObject stockholder = new JSONObject(); -// stockholder.put("mailto",stockholder_mailto); -// stockholder.put("client_id",0); -// mailto.add(stockholder); -// } -// } -// try { -// String mail_id = mailService.sendEmail(noticeId,info.getTitle(),mailto,info.getContent()); -// notice.put("mail_id",mail_id); -// noticeManageMapper.updateNotice(notice); -// } catch (URISyntaxException | IOException e) { -// e.printStackTrace(); -// logger.error("sending email failed:", e.getMessage(), e); -// throw new Exception(e.getMessage()); -// } -// } -// if (info.isIs_to_app()){ -// info.setNotice_id(noticeId); -// retailAppService.sendNoticeMessage(info,client_monikers); -// } -// } -// -// } -// } - - - - @Override - public int listNoticeClients(String noticeId) { - JSONObject params = new JSONObject(); - params.put("notice_id", noticeId); - return noticePartnerMapper.countClientsByNoticeId(params); - - } - - @Override - public JSONObject listNoticeReadClients(String noticeId, int page, int limit) { - JSONObject params = new JSONObject(); - params.put("notice_id", noticeId); - params.put("status", '1'); - PageList clients = noticePartnerMapper.listClientsByNoticeId(params, new PageBounds(page, limit, Order.formString("read_time.desc"))); - return PageListUtils.buildPageListResult(clients); - } - - @Override - public JSONObject getLatestWindowNotice(int client_id) { - return noticeManageMapper.getLatestWindowNotice(client_id,new Date()); - } - - @Override - public JSONObject getLatestWindowConfirmNotice(int client_id) { - return noticeManageMapper.getLatestWindowConfirmNotice(client_id,new Date()); - } - - @Override - public void toggleNoticeAppWindow(String noticeId, Boolean isAppWindow) { - JSONObject notice = noticeManageMapper.getNoticeDetailById(noticeId); - if (notice.getDate("end_time")!=null && notice.getDate("end_time").compareTo(new Date())<0){ - throw new ForbiddenException("The Notice has expired"); - } - notice.put("is_app_window",isAppWindow); - noticeManageMapper.updateNotice(notice); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/NoticePartnerImpl.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/NoticePartnerImpl.java deleted file mode 100644 index a3efbda06..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/NoticePartnerImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package au.com.royalpay.payment.manage.notice.core.impls; - -import au.com.royalpay.payment.manage.mappers.notice.NoticePartnerMapper; -import au.com.royalpay.payment.manage.notice.core.NoticePartner; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -/** - * Created by yishuqian on 29/09/2016. - */ -@Service -public class NoticePartnerImpl implements NoticePartner { - @Resource - private NoticePartnerMapper noticePartnerMapper; - @Override - public JSONObject listNotices(JSONObject partner, JSONObject params) { - params.put("client_id",partner.getIntValue("client_id")); - if (!params.containsKey("page")){ - params.put("page",1); - } - if (!params.containsKey("limit")){ - params.put("limit",10); - } - JSONObject unReadParams = new JSONObject(); - unReadParams.put("client_id",partner.getIntValue("client_id")); - unReadParams.put("status",0); - unReadParams.put("is_to_app",1); - int counts = noticePartnerMapper.countNoticePartner(unReadParams); - PageList partnerNotices =noticePartnerMapper.listNoticesByClientId(params, - new PageBounds(params.getIntValue("page"), params.getIntValue("limit"), Order.formString("status.asc,send_time.desc"))); - JSONObject res = PageListUtils.buildPageListResult(partnerNotices); - if(partnerNotices.size()<1){ - res.put("data", Collections.EMPTY_LIST); - } - res.put("unReadCounts",counts); - return res; - } - - @Override - public void updateReadStatus(JSONObject partner, String noticeId) throws Exception { - JSONObject params = new JSONObject(); - params.put("client_id",partner.getIntValue("client_id")); - params.put("notice_id",noticeId); - List partnerNotices = noticePartnerMapper.listNoticePartner(params); - if (!partnerNotices.isEmpty()) { - JSONObject noticePartner = partnerNotices.get(0); - noticePartner.put("status", '1'); - noticePartner.put("read_id", partner.getString("account_id")); - noticePartner.put("read_time", new Date()); - noticePartnerMapper.update(noticePartner); - } else { - throw new Exception("there is no notice for the noticeId"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/web/NoticeManageController.java b/src/main/java/au/com/royalpay/payment/manage/notice/web/NoticeManageController.java deleted file mode 100644 index 78b6446e7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/web/NoticeManageController.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.notice.web; - -import au.com.royalpay.payment.manage.notice.beans.NoticeInfo; -import au.com.royalpay.payment.manage.notice.beans.NoticeQuery; -import au.com.royalpay.payment.manage.notice.core.NoticeManage; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.Map; - -/** - * Created by yishuqian on 28/09/2016. - */ -@RestController -@RequestMapping("/sys/notice") -public class NoticeManageController { - @Resource - private NoticeManage noticeManage; - @RequestMapping(method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject listNotices(NoticeQuery query) { - return noticeManage.listNotices(query); - } - @RequestMapping(method = RequestMethod.POST) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject addNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid NoticeInfo noticeInfo, - Errors errors) { - HttpUtils.handleValidErrors(errors); - return noticeManage.saveNotice(noticeInfo, manager); - } - @ManagerMapping(value = "/{noticeId}", method = RequestMethod.GET) - public JSONObject getNoticeById(@PathVariable String noticeId) { - return noticeManage.getNoticeById(noticeId); - } - - @ManagerMapping(value = "/{noticeId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void updateNoticeInfo(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String noticeId, @RequestBody NoticeInfo info) throws Exception { - noticeManage.updateNotice(manager,noticeId, info); - } - @ManagerMapping(value = "/{noticeId}/readclients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject listNoticeReadClients(@PathVariable String noticeId, @RequestParam Map map){ - int page = map.get("page")==null?1:Integer.valueOf(map.get("page").toString()); - int limit = map.get("limit")==null?20:Integer.valueOf(map.get("limit").toString()); - return noticeManage.listNoticeReadClients(noticeId,page,limit); - } - - @ManagerMapping(value = "/{noticeId}/app_window", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void toggleNoticeAppWindow(@PathVariable String noticeId, @RequestBody JSONObject jsonObject){ - Boolean isAppWindow = jsonObject.getBoolean("is_app_window"); - noticeManage.toggleNoticeAppWindow(noticeId,isAppWindow); - } - - @ManagerMapping(value = "/{noticeId}/clients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public int listNoticeClients(@PathVariable String noticeId){ - return noticeManage.listNoticeClients(noticeId); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/web/NoticePartnerController.java b/src/main/java/au/com/royalpay/payment/manage/notice/web/NoticePartnerController.java deleted file mode 100644 index 50c3ccca2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/notice/web/NoticePartnerController.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.notice.web; - -import au.com.royalpay.payment.manage.notice.core.NoticePartner; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.Map; - -/** - * Created by yishuqian on 29/09/2016. - */ -@RestController -@RequestMapping("/partner/notice") -public class NoticePartnerController { - @Resource - private NoticePartner noticePartner; - - @RequestMapping(method = RequestMethod.GET) - @RequirePartner(roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - public JSONObject listNotices(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestParam Map params) { - return noticePartner.listNotices(partner, (JSONObject) JSON.toJSON(params)); - } - - @PartnerMapping(value = "/{noticeId}", method = RequestMethod.PUT) - public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String noticeId) throws Exception { - noticePartner.updateReadStatus(partner, noticeId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/bean/PhoneTopUpQuery.java b/src/main/java/au/com/royalpay/payment/manage/ofei/bean/PhoneTopUpQuery.java deleted file mode 100644 index d7e72fac5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/bean/PhoneTopUpQuery.java +++ /dev/null @@ -1,78 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.bean; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 2018/1/3. - */ -public class PhoneTopUpQuery { - - private String status; - - private int amount; - - private String phone; - - private String type; - - private int page = 1; - - private int limit = 10; - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public int getAmount() { - return amount; - } - - public void setAmount(int amount) { - this.amount = amount; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public JSONObject toParam(){ - JSONObject param = new JSONObject(); - param.put("status",this.status); - param.put("amount",this.amount); - param.put("customer_number",this.phone); - param.put("type",this.type); - return param; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/core/OfeiClient.java b/src/main/java/au/com/royalpay/payment/manage/ofei/core/OfeiClient.java deleted file mode 100644 index 561baab46..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/core/OfeiClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.core; - - -import org.dom4j.Element; - -/** - * Created by wangning on 2017/12/7. - */ -public interface OfeiClient { - - void phoneTopUp(String price, boolean quickTopUp, String topUpDelayTime, String phoneNumber); - - void chekcPhoneNumber(String phoneNumber, String price); - - void flowTopUp(String phoneNumber, String flowValue, String perValue); - - void checkFlow(String phoneNumber, String flowValue, String perValue); - - Element checkOrderStatus(String orderId); - - void qbTopUp(String price, String qqNumber); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/core/OfeiServer.java b/src/main/java/au/com/royalpay/payment/manage/ofei/core/OfeiServer.java deleted file mode 100644 index fc8c0503e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/core/OfeiServer.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 2017/12/8. - */ -public interface OfeiServer { - void checkOrderForNotify(JSONObject param); - - void checkOrder(String orderId); - - void phoneTopUp(String price, boolean quickTopUp, String topUpDelayTime, String phoneNumber); - - void qbTopUp(String price, String phoneNumber); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/core/PhoneTopUpService.java b/src/main/java/au/com/royalpay/payment/manage/ofei/core/PhoneTopUpService.java deleted file mode 100644 index c8240ed22..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/core/PhoneTopUpService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.core; - -import au.com.royalpay.payment.manage.ofei.bean.PhoneTopUpQuery; - -import com.alibaba.fastjson.JSONObject; - - -/** - * Created by wangning on 2018/1/3. - */ -public interface PhoneTopUpService { - - JSONObject listPageable(PhoneTopUpQuery phoneTopUpQuery); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/OfeiClientImpl.java b/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/OfeiClientImpl.java deleted file mode 100644 index d8b9f391d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/OfeiClientImpl.java +++ /dev/null @@ -1,303 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.core.impl; - -import au.com.royalpay.payment.core.exceptions.ChannelNetworkException; -import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper; -import au.com.royalpay.payment.manage.ofei.core.OfeiClient; -import au.com.royalpay.payment.manage.ofei.enums.OfeiType; -import au.com.royalpay.payment.tools.codec.MD5Hash; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.fixing.FixedDocumentHelper; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.http.NameValuePair; -import org.apache.http.message.BasicNameValuePair; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.*; - -/** - * Created by wangning on 2017/12/7. - */ -@Service -public class OfeiClientImpl implements OfeiClient { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${app.ofei.md5-key}") - private String md5key; - @Value("${app.ofei.pwd}") - private String pwd; - @Value("${app.ofei.sp-code}") - private String spCode; - @Resource - private TopUpOrderMapper topUpOrderMapper; - - private final String checkUrl = "http://api2.ofpay.com/telcheck.do"; - private final String topUPUrl = "http://api2.ofpay.com/onlineorder.do"; - private final String flowTopUPUrl = "http://api2.ofpay.com/flowOrder.do"; - private final String checkFlowUrl = "http://api2.ofpay.com/flowCheck.do"; - private final String checkOrderUrl = "http://api2.ofpay.com/queryOrderInfo.do"; - private final String qbTopUpUrl = "http://api2.ofpay.com/onlineorder.do"; - private static final Map qbCardId = new HashMap<>(); - static { - qbCardId.put("10","220615"); - qbCardId.put("30","220617"); - qbCardId.put("50","220698"); - qbCardId.put("100","220699"); - } - - @Override - public void phoneTopUp(String price, boolean quickTopUp, String topUpDelayTime, String phoneNumber) { - chekcPhoneNumber(phoneNumber, price); - String orderId = "ofei-" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + "-" + RandomStringUtils.random(5, true, true); - List params = new ArrayList<>(); - String md5Pwd = MD5Hash.hashToHex(pwd); - Date now = new Date(); - params.add(new BasicNameValuePair("userid", spCode)); - params.add(new BasicNameValuePair("userpws", md5Pwd)); - params.add(new BasicNameValuePair("cardid", quickTopUp ? "140101" : "170101")); - params.add(new BasicNameValuePair("cardnum", String.valueOf(price))); - if (!quickTopUp) { - params.add(new BasicNameValuePair("mctype", topUpDelayTime)); - } - params.add(new BasicNameValuePair("sporder_id", orderId)); - params.add(new BasicNameValuePair("sporder_time", DateFormatUtils.format(now, "yyyyMMddHHmmss"))); - params.add(new BasicNameValuePair("game_userid", phoneNumber)); - params.add(new BasicNameValuePair("ret_url", PlatformEnvironment.getEnv().concatUrl("/ofei/notice/"+orderId))); - - saveOrder(orderId, now, OfeiType.PHONE.getMask(), price, phoneNumber); - HttpRequestGenerator req = initRequest(topUPUrl, signAndEncryptForm(params), RequestMethod.GET); - Element respXml = executeRequestXML(req, "ofei phone top up fail"); - handleResponse(orderId, respXml,phoneNumber); - } - - private void handleResponse(String orderId, Element respXml,String customerNumber) { - JSONObject detail = new JSONObject(); - if ("1".equals(respXml.elementText("retcode"))) { - detail.put("cardname", respXml.elementText("cardname")); - String gameState = respXml.elementText("game_state"); - switch (gameState) { - case "1": - updateOrder(orderId, "1", detail); - break; - case "0": - updateOrder(orderId, "10", detail); - break; - case "9": - updateOrder(orderId, "20", detail); - break; - default: - updateOrder(orderId,"100",detail); - break; - } - }else { - detail.put("err_msg",respXml.elementText("err_msg")); - updateOrder(orderId,"99",detail); - logger.debug("Customer NUmber->"+customerNumber+" top up error orderId->"+orderId); - throw new ServerErrorException("System error"); - } - } - - @Override - public void chekcPhoneNumber(String phoneNumber, String price) { - List params = new ArrayList<>(); - params.add(new BasicNameValuePair("userid", spCode)); - params.add(new BasicNameValuePair("phoneno", phoneNumber)); - params.add(new BasicNameValuePair("price", String.valueOf(price))); - HttpRequestGenerator req = initRequest(checkUrl, params, RequestMethod.GET); - String respStr = executeRequestString(req, "ofei phoneNumberCheck"); - String resultCode = respStr.substring(0, respStr.indexOf("#")); - switch (resultCode) { - case "1": - break; - case "321": - throw new BadRequestException("暂时不支持此类手机号的充值"); - case "11": - throw new BadRequestException("运营商地区维护,暂不能充值"); - default: - throw new ServerErrorException("系统异常"); - } - } - - @Override - public void flowTopUp(String phoneNumber, String flowValue, String perValue) { - checkFlow(phoneNumber, flowValue, perValue); - String orderId = "ofei-" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + "-" + RandomStringUtils.random(5, true, true); - List params = new ArrayList<>(); - String md5Pwd = MD5Hash.hashToHex(pwd); - params.add(new BasicNameValuePair("userid", spCode)); - params.add(new BasicNameValuePair("userpws", md5Pwd)); - params.add(new BasicNameValuePair("phoneno", phoneNumber)); - params.add(new BasicNameValuePair("perValue", perValue)); - params.add(new BasicNameValuePair("flowValue", flowValue)); - params.add(new BasicNameValuePair("range", "2")); - params.add(new BasicNameValuePair("effectStartTime", "1")); - params.add(new BasicNameValuePair("effectTime", "1")); - params.add(new BasicNameValuePair("netType", "4G")); - params.add(new BasicNameValuePair("sporderId", orderId)); - saveOrder(orderId, new Date(), OfeiType.FLOW.getMask(), perValue, phoneNumber); - HttpRequestGenerator req = initRequest(flowTopUPUrl, signAndEncryptForm(params), RequestMethod.GET); - Element respXml = executeRequestXML(req, "ofei flowTopUp"); - handleResponse(orderId, respXml,phoneNumber); - } - - @Override - public void checkFlow(String phoneNumber, String flowValue, String perValue) { - List params = new ArrayList<>(); - String md5Pwd = MD5Hash.hashToHex(pwd); - params.add(new BasicNameValuePair("userid", spCode)); - params.add(new BasicNameValuePair("userpws", md5Pwd)); - params.add(new BasicNameValuePair("phoneno", phoneNumber)); - params.add(new BasicNameValuePair("perValue", perValue)); - params.add(new BasicNameValuePair("flowValue", flowValue)); - params.add(new BasicNameValuePair("range", "2")); - params.add(new BasicNameValuePair("effectStartTime", "1")); - params.add(new BasicNameValuePair("effectTime", "1")); - params.add(new BasicNameValuePair("netType", "4G")); - HttpRequestGenerator req = initRequest(checkFlowUrl, signAndEncryptForm(params), RequestMethod.GET); - Element respXml = executeRequestXML(req, "ofei flowCheck"); - String returnCode = respXml.elementText("retcode"); - switch (returnCode) { - case "1": - break; - case "11": - throw new BadRequestException(respXml.elementText("err_msg")); - default: - throw new ServerErrorException("系统异常"); - } - } - - @Override - public Element checkOrderStatus(String orderId) { - List params = new ArrayList<>(); - String md5Pwd = MD5Hash.hashToHex(pwd); - params.add(new BasicNameValuePair("userid", spCode)); - params.add(new BasicNameValuePair("userpws", md5Pwd)); - params.add(new BasicNameValuePair("sporder_id", orderId)); - HttpRequestGenerator req = initRequest(checkOrderUrl,signAndEncryptForm(params), RequestMethod.GET); - return executeRequestXML(req,"ofei check order status error"); - } - - @Override - public void qbTopUp(String price, String qqNumber) { - if(price.contains(".")){ - throw new BadRequestException("Invalid Price"); - } - String orderId = "ofei-" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + "-" + RandomStringUtils.random(5, true, true); - List params = new ArrayList<>(); - String md5Pwd = MD5Hash.hashToHex(pwd); - Date now = new Date(); - params.add(new BasicNameValuePair("userid", spCode)); - params.add(new BasicNameValuePair("userpws", md5Pwd)); - if(qbCardId.containsKey(price)){ - params.add(new BasicNameValuePair("cardid", qbCardId.get(price))); - params.add(new BasicNameValuePair("cardnum", "1")); - }else { - params.add(new BasicNameValuePair("cardid", "220612")); - params.add(new BasicNameValuePair("cardnum", price)); - } - params.add(new BasicNameValuePair("sporder_id", orderId)); - params.add(new BasicNameValuePair("sporder_time", DateFormatUtils.format(now, "yyyyMMddHHmmss"))); - params.add(new BasicNameValuePair("game_userid", qqNumber)); - params.add(new BasicNameValuePair("ret_url", PlatformEnvironment.getEnv().concatUrl("/ofei/notice/" + orderId))); - saveOrder(orderId, now, OfeiType.QB.getMask(), price, qqNumber); - HttpRequestGenerator req = initRequest(qbTopUpUrl, signAndEncryptForm(params), RequestMethod.POST); - Element respXml = executeRequestXML(req, "ofei QB top up fail"); - handleResponse(orderId, respXml, qqNumber); - } - - - private List signAndEncryptForm(List params) { - String signStr = ""; - for (NameValuePair pair : params) { - if ("md5Str,retUrl,version,mctype,md5_str,ret_url,buyNum".contains(pair.getName())) { - continue; - } else { - signStr += pair.getValue(); - } - } - signStr += md5key; - params.add(new BasicNameValuePair("md5_str", MD5Hash.hashToHex(signStr).toUpperCase())); - params.add(new BasicNameValuePair("version", "6.0")); - params.add(new BasicNameValuePair("md5Str", MD5Hash.hashToHex(signStr).toUpperCase())); - return params; - } - - private HttpRequestGenerator initRequest(String url, List params, RequestMethod requestMethod) { - HttpRequestGenerator gen = new HttpRequestGenerator(url, requestMethod); - for (NameValuePair pair : params) { - gen.addQueryString(pair.getName(), pair.getValue()); - } - return gen; - } - - private Element executeRequestXML(HttpRequestGenerator gen, String errMsg) { - try { - HttpRequestResult res = gen.execute(); - if (res.isSuccess()) { - byte[] respArr = res.getResponseContentBytes(); - String respStr = new String(respArr, "GB2312"); - logger.debug("ofei server response:" + respStr); - Document respXml = FixedDocumentHelper.parseText(respStr); - Element respRoot = respXml.getRootElement(); - return respRoot; - } else { - throw new ChannelNetworkException(errMsg + "-->Network Error:" + res.getStatusCode()); - } - } catch (DocumentException | IOException e) { - throw new ChannelNetworkException(errMsg + "-->Network Error", e); - } - } - - private String executeRequestString(HttpRequestGenerator gen, String errMsg) { - try { - HttpRequestResult res = gen.execute(); - if (res.isSuccess()) { - byte[] respArr = res.getResponseContentBytes(); - String respStr = new String(respArr, "GB2312"); - logger.debug("ofei server response:" + respStr); - return respStr; - } else { - throw new ChannelNetworkException(errMsg + "-->Network Error:" + res.getStatusCode()); - } - } catch (IOException e) { - throw new ChannelNetworkException(errMsg + "-->Network Error", e); - } - - } - - private void saveOrder(String orderId, Date now, String type, String price, String customerNumber) { - JSONObject order = new JSONObject(); - order.put("id", orderId); - order.put("create_time", now); - order.put("type", type); - order.put("amount", price); - order.put("customer_number", customerNumber); - order.put("status", "0"); - topUpOrderMapper.save(order); - } - - private void updateOrder(String orderId, String status, JSONObject detail) { - JSONObject record = new JSONObject(); - record.put("id", orderId); - record.put("status", status); - record.put("detail", detail.toJSONString()); - topUpOrderMapper.update(record); - } - - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/OfeiServceImpl.java b/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/OfeiServceImpl.java deleted file mode 100644 index 616d93f8c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/OfeiServceImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.core.impl; - -import java.util.concurrent.TimeUnit; - -import javax.annotation.Resource; - -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.dom4j.Element; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONObject; - -import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper; -import au.com.royalpay.payment.manage.ofei.core.OfeiClient; -import au.com.royalpay.payment.manage.ofei.core.OfeiServer; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; - -/** - * Created by wangning on 2017/12/8. - */ -@Service -public class OfeiServceImpl implements OfeiServer { - @Resource - private TopUpOrderMapper topUpOrderMapper; - @Resource - private OfeiClient ofeiClient; - @Resource - private StringRedisTemplate stringRedisTemplate; - - @Override - public void checkOrderForNotify(JSONObject param) { - JSONObject order = topUpOrderMapper.findById(param.getString("orderId")); - if (order == null) { - return; - } - String ret_code = param.getString("ret_code"); - switch (ret_code) { - case "1": - order.put("status", "1"); - break; - case "9": - order.put("status", 20); - JSONObject detail = new JSONObject(); - detail.put("err_msg", param.getString("err_msg")); - order.put("detail", detail.toJSONString()); - } - topUpOrderMapper.update(order); - - } - - @Override - public void checkOrder(String orderId) { - JSONObject order = topUpOrderMapper.findById(orderId); - if (order==null){ - return; - } - Element orderStats = ofeiClient.checkOrderStatus(orderId); - JSONObject detail = new JSONObject(); - if ("1".equals(orderStats.elementText("retcode"))) { - detail.put("cardname", orderStats.elementText("cardname")); - order.put("detail",detail.toJSONString()); - String gameState = orderStats.elementText("game_state"); - switch (gameState) { - case "1": - order.put("status","1"); - break; - case "0": - order.put("status","10"); - break; - case "9": - order.put("status","20"); - break; - } - - }else { - order.put("status","99"); - order.put("detail",order.getJSONObject("detail").put("err_msg",orderStats.elementText("err_msg"))); - detail.put("err_msg",orderStats.elementText("err_msg")); - } - topUpOrderMapper.update(order); - } - - @Override - public void phoneTopUp(String price, boolean quickTopUp, String topUpDelayTime, String phoneNumber) { - String reidsCheckCodeKey = "topup"+phoneNumber; - String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); - if (!StringUtils.isEmpty(value)) { - throw new ForbiddenException("A phone number can only be recharged in 10 minutes"); - } - ofeiClient.phoneTopUp(price,quickTopUp,topUpDelayTime,phoneNumber); - String bindId = RandomStringUtils.random(6, false, true); - stringRedisTemplate.boundValueOps(reidsCheckCodeKey).set(bindId, 10, TimeUnit.MINUTES); - } - - @Override - public void qbTopUp(String price, String qqNumber) { - String reidsCheckCodeKey = "qbtopup"+qqNumber; - String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); - if (!StringUtils.isEmpty(value)) { - throw new ForbiddenException("A phone number can only be recharged in 10 minutes"); - } - ofeiClient.qbTopUp(price,qqNumber); - String bindId = RandomStringUtils.random(6, false, true); - stringRedisTemplate.boundValueOps(reidsCheckCodeKey).set(bindId, 10, TimeUnit.MINUTES); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/PhoneTopUpServieImpl.java b/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/PhoneTopUpServieImpl.java deleted file mode 100644 index 5cb6d6fdb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/core/impl/PhoneTopUpServieImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.core.impl; - -import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper; -import au.com.royalpay.payment.manage.ofei.bean.PhoneTopUpQuery; -import au.com.royalpay.payment.manage.ofei.core.PhoneTopUpService; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by wangning on 2018/1/3. - */ -@Service -public class PhoneTopUpServieImpl implements PhoneTopUpService { - @Resource - private TopUpOrderMapper topUpOrderMapper; - @Override - public JSONObject listPageable(PhoneTopUpQuery phoneTopUpQuery) { - PageList topUpOrders = topUpOrderMapper.listPageable(phoneTopUpQuery.toParam(),new PageBounds(phoneTopUpQuery.getPage(), phoneTopUpQuery.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(topUpOrders); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/enums/OfeiType.java b/src/main/java/au/com/royalpay/payment/manage/ofei/enums/OfeiType.java deleted file mode 100644 index a41042ba4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/enums/OfeiType.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.enums; - -/** - * Created by wangning on 30/01/2018. - */ -public enum OfeiType { - PHONE("1"), // 话费 - FLOW("2"), // 流量 - QB("3");// Q币 - - private String mask; - - OfeiType(String mask) { - this.mask = mask; - } - - public String getMask() { - return mask; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/web/OfeiNotifyController.java b/src/main/java/au/com/royalpay/payment/manage/ofei/web/OfeiNotifyController.java deleted file mode 100644 index 7acb3e52f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/web/OfeiNotifyController.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.web; - -import au.com.royalpay.payment.manage.ofei.core.OfeiServer; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.web.bind.annotation.PathVariable; -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 javax.annotation.Resource; - -/** - * Created by wangning on 2017/12/8. - */ -@RestController -@RequestMapping("/ofei/notice") -public class OfeiNotifyController { - @Resource - private OfeiServer ofeiServer; - - @RequestMapping(value = "/{order_id}",method = {RequestMethod.GET, RequestMethod.POST}) - public void listNotices(@PathVariable String order_id, @RequestParam String ret_code, @RequestParam String ordersuccesstime, @RequestParam String err_msg) { - JSONObject params =new JSONObject(); - params.put("orderId",order_id); - params.put("ret_code",ret_code); - params.put("ordersuccesstime",ordersuccesstime); - params.put("err_msg",err_msg); - ofeiServer.checkOrderForNotify(params); - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/ofei/web/PhoneTopUpController.java b/src/main/java/au/com/royalpay/payment/manage/ofei/web/PhoneTopUpController.java deleted file mode 100644 index dd3b68d92..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/ofei/web/PhoneTopUpController.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.ofei.web; - -import au.com.royalpay.payment.manage.ofei.bean.PhoneTopUpQuery; -import au.com.royalpay.payment.manage.ofei.core.OfeiServer; -import au.com.royalpay.payment.manage.ofei.core.PhoneTopUpService; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; - -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 javax.annotation.Resource; - -/** - * Created by wangning on 2017/12/8. - */ -@RestController -@RequestMapping("/top_up") -public class PhoneTopUpController { - @Resource - private OfeiServer ofeiServer; - @Resource - private PhoneTopUpService phoneTopUpService; - - @RequestMapping(value = "/recharge", method = { RequestMethod.GET, RequestMethod.POST }) - public void recharge(@RequestParam String customerNumber, @RequestParam String amount, @RequestParam(defaultValue = "1") String type) { - switch (type) { - case "1": - ofeiServer.phoneTopUp(amount, true, null, customerNumber); - break; - case "3": - ofeiServer.qbTopUp(amount, customerNumber); - break; - default: - throw new BadRequestException("unknow top up type"); - } - } - - @RequestMapping(value = "/list", method = { RequestMethod.GET, RequestMethod.GET }) - public JSONObject list(PhoneTopUpQuery phoneTopUpQuery) { - return phoneTopUpService.listPageable(phoneTopUpQuery); - } - -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/entity/PartnerApplyType.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/entity/PartnerApplyType.java deleted file mode 100644 index 604c61fa8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/entity/PartnerApplyType.java +++ /dev/null @@ -1,104 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.domain.entity; - -/** - * 申请类型:0,CARD 卡支付;1,LOANS 贷款申请 - */ -public enum PartnerApplyType { - - /** - * 卡支付 - */ - CARD { - @Override - public int code() { - return 0; - } - - @Override - public String value() { - return "CARD"; - } - - @Override - public String description() { - return "卡支付"; - } - - @Override - public boolean isCard() { - return true; - } - - @Override - public boolean isLoans() { - return false; - } - }, - /** - * 贷款申请 - */ - LOANS { - @Override - public int code() { - return 1; - } - - @Override - public String value() { - return "LOANS"; - } - - @Override - public String description() { - return "贷款申请"; - } - - @Override - public boolean isCard() { - return false; - } - - @Override - public boolean isLoans() { - return true; - } - }; - - /** - * 获取代码。 - * - * @return 代码 - */ - public abstract int code(); - - /** - * 获取代码对应的值。 - * - * @return 代码值 - */ - public abstract String value(); - - public abstract String description(); - - public static PartnerApplyType codeOf(int code) { - for (PartnerApplyType status : PartnerApplyType.values()) { - if (status.code() == code) { - return status; - } - } - return PartnerApplyType.CARD; - } - - public static PartnerApplyType typeOf(String type) { - for (PartnerApplyType status : PartnerApplyType.values()) { - if (status.value().equalsIgnoreCase(type)) { - return status; - } - } - return PartnerApplyType.CARD; - } - - public abstract boolean isCard(); - - public abstract boolean isLoans(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/repository/PartnerApplyRepository.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/repository/PartnerApplyRepository.java deleted file mode 100644 index 742d71afe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/repository/PartnerApplyRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.domain.repository; - -import com.alibaba.fastjson.JSONObject; - -public interface PartnerApplyRepository { - void save(JSONObject applyInfo); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/service/PartnerApplyService.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/service/PartnerApplyService.java deleted file mode 100644 index 517571e68..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/service/PartnerApplyService.java +++ /dev/null @@ -1,7 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.domain.service; - -import au.com.royalpay.payment.manage.officialwebsit.domain.web.command.PartnerApplyInfo; - -public interface PartnerApplyService { - void applyPartner(PartnerApplyInfo apply); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/web/RestPartnerApplyController.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/web/RestPartnerApplyController.java deleted file mode 100644 index 5147109a3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/web/RestPartnerApplyController.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.domain.web; - -import au.com.royalpay.payment.manage.officialwebsit.domain.service.PartnerApplyService; -import au.com.royalpay.payment.manage.officialwebsit.domain.web.command.PartnerApplyInfo; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -/** - * 卡支付/贷款申请资源 - */ -@RestController -@RequestMapping("/partners") -public class RestPartnerApplyController { - - @Resource - private PartnerApplyService applyService; - - - /** - * 卡支付/贷款申请入口 - * - * @param apply - * @param errors - * @param response - * @throws Exception - */ - @RequestMapping(value = "/website/application", method = RequestMethod.POST) - public void applyPartner(@RequestBody @Valid PartnerApplyInfo apply, - Errors errors, HttpServletResponse response) throws Exception { - if (!PlatformEnvironment.getEnv().enablePartnerApply()) { - throw new BadRequestException("商户自主申请暂时关闭. Merchant Apply disabled at the moment."); - } - HttpUtils.handleValidErrors(errors); - applyService.applyPartner(apply); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/web/command/PartnerApplyInfo.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/web/command/PartnerApplyInfo.java deleted file mode 100644 index baa320260..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/domain/web/command/PartnerApplyInfo.java +++ /dev/null @@ -1,104 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.domain.web.command; - -/** - * 卡支付/贷款申请信息请求入参 - */ -public class PartnerApplyInfo { - /** - * 前缀name - */ - private String firstName; - /** - * 后缀name - */ - private String surname; - /** - * 手机号 - */ - private String phoneNumber; - /** - * email - */ - private String emailAddress; - /** - * 公司名称 - */ - private String businessName; - /** - *行业 - */ - private String industry; - /** - * 申请类型:0,CARD 卡支付;1,LOANS 贷款申请 - */ - private String type; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getSurname() { - return surname; - } - - public void setSurname(String surname) { - this.surname = surname; - } - - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - public String getEmailAddress() { - return emailAddress; - } - - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - public String getBusinessName() { - return businessName; - } - - public void setBusinessName(String businessName) { - this.businessName = businessName; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public String toString() { - return "PartnerApplyInfo{" + - "firstName='" + firstName + '\'' + - ", Surname='" + surname + '\'' + - ", phoneNumber='" + phoneNumber + '\'' + - ", emailAddress='" + emailAddress + '\'' + - ", businessName='" + businessName + '\'' + - ", industry='" + industry + '\'' + - ", type='" + type + '\'' + - '}'; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/infrastructure/repository/PartnerApplyRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/infrastructure/repository/PartnerApplyRepositoryImpl.java deleted file mode 100644 index ff39a81a9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/infrastructure/repository/PartnerApplyRepositoryImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.infrastructure.repository; - -import au.com.royalpay.payment.manage.mappers.loanapplication.LoanApplicationMapper; -import au.com.royalpay.payment.manage.officialwebsit.domain.repository.PartnerApplyRepository; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Repository; - -import javax.annotation.Resource; - -@Repository -public class PartnerApplyRepositoryImpl implements PartnerApplyRepository { - - @Resource - private LoanApplicationMapper mapper; - - @Override - public void save(JSONObject applyInfo) { - mapper.save(applyInfo); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/infrastructure/service/PartnerApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/officialwebsit/infrastructure/service/PartnerApplyServiceImpl.java deleted file mode 100644 index 534129e57..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/officialwebsit/infrastructure/service/PartnerApplyServiceImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package au.com.royalpay.payment.manage.officialwebsit.infrastructure.service; - -import au.com.royalpay.payment.manage.loanapplicaiton.domain.entity.LoanApplicationStatus; -import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper; -import au.com.royalpay.payment.manage.merchants.events.ClientApplyEvent; -import au.com.royalpay.payment.manage.officialwebsit.domain.entity.PartnerApplyType; -import au.com.royalpay.payment.manage.officialwebsit.domain.repository.PartnerApplyRepository; -import au.com.royalpay.payment.manage.officialwebsit.domain.service.PartnerApplyService; -import au.com.royalpay.payment.manage.officialwebsit.domain.web.command.PartnerApplyInfo; -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.UUID; - -@Slf4j -@Service -public class PartnerApplyServiceImpl implements PartnerApplyService, ApplicationEventPublisherAware { - - @Resource - private ClientApplyMapper clientApplyMapper; - - @Resource - private PartnerApplyRepository applyRepository; - - @Resource - private ApplicationEventPublisher publisher; - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @Override - public void applyPartner(PartnerApplyInfo apply) { - PartnerApplyType applyType = PartnerApplyType.typeOf(apply.getType()); - if (applyType.isCard()) { - JSONObject applyInfo = this.buildCardPaymentApplyInfo(apply); - clientApplyMapper.save(applyInfo); - publisher.publishEvent(new ClientApplyEvent(this, applyInfo)); - } - if (applyType.isLoans()) { - JSONObject applyInfo = this.buildLoansApplyInfo(apply); - applyRepository.save(applyInfo); - publisher.publishEvent(new ClientApplyEvent(this, applyInfo)); - } - - } - - private JSONObject buildLoansApplyInfo(PartnerApplyInfo apply) { - JSONObject result = new JSONObject(); - String name = apply.getFirstName() + " " + apply.getSurname(); - result.put("id", UUID.randomUUID().toString()); - result.put("name", name); - result.put("phone", apply.getPhoneNumber()); - result.put("email", apply.getEmailAddress()); - result.put("industry", apply.getIndustry()); - result.put("business_name", apply.getBusinessName()); - result.put("status", LoanApplicationStatus.READY.code()); - result.put("source", 0); - return result; - } - - private JSONObject buildCardPaymentApplyInfo(PartnerApplyInfo apply) { - JSONObject result = new JSONObject(); - String name = apply.getFirstName() + " " + apply.getSurname(); - result.put("client_apply_id", UUID.randomUUID().toString()); - result.put("contact_person", name); - result.put("contact_phone", apply.getPhoneNumber()); - result.put("contact_email", apply.getEmailAddress()); - result.put("company_name", apply.getBusinessName()); - result.put("short_name", apply.getBusinessName()); - result.put("industry", apply.getIndustry()); - result.put("type", 1); - return result; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/OpenimController.java b/src/main/java/au/com/royalpay/payment/manage/openim/OpenimController.java deleted file mode 100644 index 781922365..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/OpenimController.java +++ /dev/null @@ -1,67 +0,0 @@ -package au.com.royalpay.payment.manage.openim; - -import au.com.royalpay.payment.manage.openim.core.CustomerServiceService; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -/** - * @author kira - * @date 2018/7/11 - */ -@RestController -@RequestMapping("/sys/openim") -public class OpenimController { - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private CustomerServiceService customerServiceService; - - @PutMapping("/check") - @RequireManager - public JSONObject check(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return customerServiceService.checkAndSaveManager(manager); - } - - @PostMapping("/signin") - public void partnerSignIn(@RequestBody @Valid LoginInfo loginInfo, Errors errors, HttpServletResponse response) throws Exception { - HttpUtils.handleValidErrors(errors); - HttpUtils.setCookie(response, CommonConsts.MANAGER_STATUS,signInStatusManager.managerSignIn(loginInfo)); - } - - @RequestMapping(value = "/list",method = RequestMethod.GET) - public List query(@RequestParam(required = false) String clientMoniker,@RequestParam(required = false) String userNames){ - JSONObject params = new JSONObject(); - params.put("clientMoniker",clientMoniker); - params.put("userNames",userNames); - return customerServiceService.query(clientMoniker,userNames); - } - - @ManagerMapping(value = "/servant/{manager_id}/onoff", method = RequestMethod.PUT,role = {ManagerRole.ADMIN}) - public void onoff(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager,@PathVariable String manager_id, @RequestBody JSONObject param) { - param.put("manager_id",manager_id); - customerServiceService.onoff(param); - } - - @ManagerMapping(value = "/servant/{manager_id}/nick", method = RequestMethod.PUT,role = {ManagerRole.ADMIN}) - public void changeNick(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager,@PathVariable String manager_id, @RequestBody JSONObject param) { - param.put("manager_id",manager_id); - customerServiceService.changeNick(param); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/beans/OpenimUser.java b/src/main/java/au/com/royalpay/payment/manage/openim/beans/OpenimUser.java deleted file mode 100644 index 52162d649..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/beans/OpenimUser.java +++ /dev/null @@ -1,170 +0,0 @@ -package au.com.royalpay.payment.manage.openim.beans; - -/** - * @author kira - * @date 2018/7/11 - */ -public class OpenimUser { - private String nick; - private String icon_url; - private String email; - private String mobile; - private String taobaoid; - private String userid; - private String passowrd; - private String remark; - private String extra; - private String career; - private String vip; - private String address; - private String name; - private Integer age; - private String gender; - private String wechat; - private String qq; - private String weibo; - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick; - } - - public String getIcon_url() { - return icon_url; - } - - public void setIcon_url(String icon_url) { - this.icon_url = icon_url; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getTaobaoid() { - return taobaoid; - } - - public void setTaobaoid(String taobaoid) { - this.taobaoid = taobaoid; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getPassowrd() { - return passowrd; - } - - public void setPassowrd(String passowrd) { - this.passowrd = passowrd; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getExtra() { - return extra; - } - - public void setExtra(String extra) { - this.extra = extra; - } - - public String getCareer() { - return career; - } - - public void setCareer(String career) { - this.career = career; - } - - public String getVip() { - return vip; - } - - public void setVip(String vip) { - this.vip = vip; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public String getWechat() { - return wechat; - } - - public void setWechat(String wechat) { - this.wechat = wechat; - } - - public String getQq() { - return qq; - } - - public void setQq(String qq) { - this.qq = qq; - } - - public String getWeibo() { - return weibo; - } - - public void setWeibo(String weibo) { - this.weibo = weibo; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/beans/OpenimUserVO.java b/src/main/java/au/com/royalpay/payment/manage/openim/beans/OpenimUserVO.java deleted file mode 100644 index a00e73df7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/beans/OpenimUserVO.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.openim.beans; - -/** - * @author kira - * @date 2018/7/17 - */ -public class OpenimUserVO { - private String nick; - private String userid; - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/beans/PushMsgBean.java b/src/main/java/au/com/royalpay/payment/manage/openim/beans/PushMsgBean.java deleted file mode 100644 index 314dd3ebd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/beans/PushMsgBean.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.openim.beans; - -import java.util.List; - -/** - * @author kira - * @date 2018/7/11 - */ -public class PushMsgBean { - - private String from_user; - private List to_users; - private String summary; - private String data; - - - public String getFrom_user() { - return from_user; - } - - public void setFrom_user(String from_user) { - this.from_user = from_user; - } - - public List getTo_users() { - return to_users; - } - - public void setTo_users(List to_users) { - this.to_users = to_users; - } - - public String getSummary() { - return summary; - } - - public void setSummary(String summary) { - this.summary = summary; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/CustomerServiceService.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/CustomerServiceService.java deleted file mode 100644 index 4b6c769e0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/CustomerServiceService.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.openim.core; - -import au.com.royalpay.payment.manage.openim.beans.OpenimUserVO; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * @author kira - * @date 2018/7/11 - */ -public interface CustomerServiceService { - - JSONObject checkAndSavePartner(JSONObject account); - - JSONObject checkAndSaveManager(JSONObject manager); - - OpenimUserVO findOne(int clientId,String userName); - - List query(String clientMoniker,String userNames); - - void onoff(JSONObject param); - - void changeNick(JSONObject param); - - void addUnreadMsg(JSONObject params); - - void sendUnreadWxMsg(); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimApi.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimApi.java deleted file mode 100644 index 92104d912..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimApi.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.openim.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * @author kira - * @date 2018/7/11 - */ -public interface OpenimApi { - - void addUser(JSONObject record); - - void updateUser(JSONObject record); - - void pushMsh(); - - JSONObject getUserInfo(String userId); - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java deleted file mode 100644 index ab45ce25e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java +++ /dev/null @@ -1,113 +0,0 @@ -package au.com.royalpay.payment.manage.openim.core; - -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.taobao.api.ApiException; -import com.taobao.api.DefaultTaobaoClient; -import com.taobao.api.TaobaoClient; -import com.taobao.api.domain.Userinfos; -import com.taobao.api.request.OpenimCustmsgPushRequest; -import com.taobao.api.request.OpenimUsersAddRequest; -import com.taobao.api.request.OpenimUsersGetRequest; -import com.taobao.api.request.OpenimUsersUpdateRequest; -import com.taobao.api.response.OpenimCustmsgPushResponse; -import com.taobao.api.response.OpenimUsersAddResponse; -import com.taobao.api.response.OpenimUsersGetResponse; -import com.taobao.api.response.OpenimUsersUpdateResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author kira - * @date 2018/7/11 - */ -@Service -public class OpenimClient { - Logger logger = LoggerFactory.getLogger(getClass()); - @Value("${im.openim.appkey}") - private String appkey; - @Value("${im.openim.secret}") - private String secret; - private final String url = "https://eco.taobao.com/router/rest"; - - public JSONObject getUser(String userId) { - TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); - OpenimUsersGetRequest req = new OpenimUsersGetRequest(); - // 批量为userid逗号分隔字符串 - req.setUserids(userId); - OpenimUsersGetResponse rsp = null; - try { - rsp = client.execute(req); - } catch (ApiException e) { - logger.info("openim get user fail", e); - } - JSONObject openInfo = JSON.parseObject(rsp.getBody()); - if (openInfo.getJSONObject("openim_users_get_response").getJSONObject("userinfos").size() < 1) { - return null; - } - return openInfo; - } - - public void addUser(List users) { - TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); - OpenimUsersAddRequest req = new OpenimUsersAddRequest(); - req.setUserinfos(users); - OpenimUsersAddResponse rsp = null; - try { - rsp = client.execute(req); - } catch (ApiException e) { - logger.info("openim add user fail", e); - } - JSONObject result = JSON.parseObject(rsp.getBody()); - JSONObject failMsg = result.getJSONObject("openim_users_add_response").getJSONObject("fail_msg"); - if (!failMsg.isEmpty()) { - if ("data exist".equals(failMsg.getJSONArray("string").get(0))) { - return; - } - logger.info("openim add user fail reason:" + failMsg.getJSONArray("string").toJSONString()); - throw new ServerErrorException("System error"); - } - } - - public void updateUser(List users) { - TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); - OpenimUsersUpdateRequest req = new OpenimUsersUpdateRequest(); - req.setUserinfos(users); - OpenimUsersUpdateResponse rsp = null; - try { - rsp = client.execute(req); - } catch (ApiException e) { - logger.info("openim update user fail", e); - } - JSONObject result = JSON.parseObject(rsp.getBody()); - if (result.getJSONObject("openim_users_update_response").getJSONObject("fail_msg").size() > 0) { - logger.info("openim update user fail reason:" - + result.getJSONObject("openim_users_update_response").getJSONObject("fail_msg").getJSONArray("string").toJSONString()); - throw new ServerErrorException("System error"); - } - } - - public void pushMsg(OpenimCustmsgPushRequest.CustMsg msg) { - TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); - OpenimCustmsgPushRequest req = new OpenimCustmsgPushRequest(); - req.setCustmsg(msg); - OpenimCustmsgPushResponse rsp = null; - try { - rsp = client.execute(req); - } catch (ApiException e) { - logger.info("openim push msg fail", e); - } - JSONObject result = JSON.parseObject(rsp.getBody()); - if (result.getJSONObject("openim_custmsg_push_response").getJSONObject("fail_msg").size() > 0) { - logger.info("openim push message fail reason:" - + result.getJSONObject("openim_custmsg_push_response").getJSONObject("fail_msg").getJSONArray("string").toJSONString()); - throw new ServerErrorException("System error"); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/impl/CustomerServiceServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/impl/CustomerServiceServiceImpl.java deleted file mode 100644 index 62962b6d2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/impl/CustomerServiceServiceImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -package au.com.royalpay.payment.manage.openim.core.impl; - -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.SysCustomerServiceMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.openim.beans.OpenimUserVO; -import au.com.royalpay.payment.manage.openim.core.CustomerServiceService; -import au.com.royalpay.payment.manage.openim.core.OpenimApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.BoundListOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.util.*; - -/** - * @author kira - * @date 2018/7/11 - */ -@Service -public class CustomerServiceServiceImpl implements CustomerServiceService { - - @Resource - private OpenimApi openimApi; - @Resource - private ClientManager clientManager; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private SysCustomerServiceMapper sysCustomerServiceMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private StringRedisTemplate stringRedisTemplate; - private final String REDIS_UNREADMSG_PREFIX = "REDIS_UNREADMSG_PREFIX"; - - @Value("${im.openim.appkey}") - private String appkey; - - @Override - public JSONObject checkAndSavePartner(JSONObject account) { - JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); - if (client == null) { - throw new BadRequestException("Merchant Not Found"); - } - JSONObject userInfo = clientAccountMapper.findById(account.getString("account_id")); - JSONObject checkRecord = new JSONObject(); - checkRecord.put("nick", userInfo.getString("username") + "_" + client.getString("client_moniker")); - checkRecord.put("user_id", userInfo.getString("username") + "_" + client.getString("client_moniker")); - checkRecord.put("password", DigestUtils.md5Hex("uid")); - checkRecord.put("icon_url",client.getString("logo_thumbnail")); - openimApi.addUser(checkRecord); - checkRecord.put("servants", sysCustomerServiceMapper.findOnline()); - checkRecord.put("appkey", appkey); - return checkRecord; - } - - @Override - public JSONObject checkAndSaveManager(JSONObject manager) { - if (StringUtils.isEmpty(manager.getString("manager_id"))) { - throw new ServerErrorException("manager id is null"); - } - JSONObject result = sysCustomerServiceMapper.findByManagerId(manager.getString("manager_id")); - if (result == null) { - JSONObject managerDetail = managerMapper.findDetail(manager.getString("manager_id")); - JSONObject checkRecord = new JSONObject(); - checkRecord.put("user_id", managerDetail.getString("username")); - int num = sysCustomerServiceMapper.countAll(); - checkRecord.put("nick", "客服" + num); - checkRecord.put("icon_url","https://file.royalpay.com.au/open/2017/10/17/1508233432777_7X9kTmbsHUDv0iFD1zmYrDzNkrsBBk.jpg"); - checkRecord.put("password", RandomStringUtils.random(12, true, true).toLowerCase()); - openimApi.addUser(checkRecord); - result = checkRecord; - } - result.put("appkey", appkey); - result.remove("manager_id"); - result.remove("onoff"); - return result; - } - - @Override - public OpenimUserVO findOne(int clientId, String userName) { - JSONObject client = clientManager.getClientInfo(clientId); - if (client == null) { - throw new BadRequestException("Merchant Not Found"); - } - JSONObject account = clientAccountMapper.findByUsername(userName); - if (account == null) { - throw new BadRequestException("Account Not Found"); - } - if (account.getIntValue("client_id") != clientId) { - throw new ForbiddenException("No Rights"); - } - OpenimUserVO result = new OpenimUserVO(); - result.setNick(account.getString("display_name")); - result.setUserid(account.getString("username") + "_" + client.getString("client_moniker")); - return result; - } - - @Override - public List query(String clientMoniker, String userNames) { - JSONObject queryParams = new JSONObject(); - if (StringUtils.isNotEmpty(clientMoniker)) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - return Collections.EMPTY_LIST; - } - queryParams.put("clientId", client.getIntValue("client_id")); - } - if (StringUtils.isNotEmpty(userNames)) { - List userNams = Arrays.asList(userNames.split(",")); - if (CollectionUtils.isEmpty(userNams)) { - return Collections.EMPTY_LIST; - } - queryParams.put("userNames", userNams); - } - if (queryParams.size() < 1) { - return Collections.emptyList(); - } - List accounts = clientAccountMapper.query(queryParams); - List result = new ArrayList<>(accounts.size()); - accounts.forEach(p -> { - JSONObject openimUser = new JSONObject(); - openimUser.put("userid", p.getString("username") + "_" + p.getString("client_moniker")); - openimUser.put("nick", p.getString("username") + "_" + p.getString("client_moniker")); - openimUser.put("headimg", p.getString("wechat_headimg")); - result.add(openimUser); - }); - return result; - } - - @Override - public void onoff(JSONObject manager) { - saveOrUpdate(manager,false); - } - - @Override - public void changeNick(JSONObject param) { - saveOrUpdate(param,true); - } - - @Override - public void addUnreadMsg(JSONObject params) { - String uid = params.getString("uid"); - String tuid = params.getString("tuid"); - if (StringUtils.isEmpty(uid) || StringUtils.isEmpty(tuid)) { - return; - } - BoundListOperations ops = stringRedisTemplate.boundListOps(REDIS_UNREADMSG_PREFIX + tuid); - for (int i = 0; i < ops.size(); i++) { - String jStr = ops.index(i); - if (jStr.contains(uid)) { - JSONObject record = JSON.parseObject(jStr); - record.put("unreadMsg", record.getIntValue("unreadMsg") + 1); - ops.set(i, record.toJSONString()); - return; - } - } - params.put("unreadMsg", 1); - ops.rightPush(params.toJSONString()); - } - - @Override - public void sendUnreadWxMsg() { - List servants = sysCustomerServiceMapper.findAllWithDetail(); - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - servants.parallelStream().forEach(p -> { - p.getString("user_id"); - BoundListOperations ops = stringRedisTemplate.boundListOps(REDIS_UNREADMSG_PREFIX + p.getString("user_id")); - if (ops.size() < 1) { - return; - } - int clients = 0; - int unreadMsg = 0; - for (int i = 0; i < ops.size(); i++) { - clients++; - unreadMsg += JSON.parseObject(ops.index(i)).getIntValue("unreadMsg"); - } - TemplateMessage msg = initUnreadMsg(unreadMsg, clients, p.getString("wx_openid"), paymentApi.getTemplateId("commission")); - paymentApi.sendTemplateMessage(msg); - stringRedisTemplate.delete(REDIS_UNREADMSG_PREFIX + p.getString("user_id")); - }); - - } - - private TemplateMessage initUnreadMsg(int unreadMsg, int clients, String openId, String templateId) { - TemplateMessage msg = new TemplateMessage(openId, templateId, null); - msg.put("first", "你好,你有" + unreadMsg + "个未读消息", "#000000"); - msg.put("keyword1", "商户", "#000000"); - msg.put("keyword2", "问题咨询", "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"), "#000000"); - msg.put("keyword4", "你有" + clients + "个商户咨询待处理", "#0000ff"); - msg.put("remark", "", "#000000"); - return msg; - } - - private void saveOrUpdate(JSONObject servant, boolean updateOpenim) { - if (StringUtils.isEmpty(servant.getString("manager_id"))) { - throw new ServerErrorException("manager id is null"); - } - JSONObject existCS = sysCustomerServiceMapper.findByManagerId(servant.getString("manager_id")); - if (existCS == null) { - JSONObject userInfo = checkAndSaveManager(servant); - servant.put("password", userInfo.getString("password")); - servant.put("nick", userInfo.getString("nick")); - servant.put("user_id", userInfo.getString("user_id")); - sysCustomerServiceMapper.save(servant); - } else { - sysCustomerServiceMapper.update(servant); - if (updateOpenim) { - servant.put("user_id", existCS.getString("user_id")); - openimApi.updateUser(servant); - - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/impl/OpenimApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/impl/OpenimApiImpl.java deleted file mode 100644 index 44b7bd062..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/impl/OpenimApiImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package au.com.royalpay.payment.manage.openim.core.impl; - -import au.com.royalpay.payment.manage.openim.core.OpenimApi; -import au.com.royalpay.payment.manage.openim.core.OpenimClient; - -import com.alibaba.fastjson.JSONObject; -import com.taobao.api.domain.Userinfos; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -/** - * @author kira - * @date 2018/7/11 - */ -@Service -public class OpenimApiImpl implements OpenimApi { - - @Resource - private OpenimClient openimClient; - - @Override - public void addUser(JSONObject user) { - JSONObject opemInfo = openimClient.getUser(user.getString("user_id")); - if(opemInfo!=null){ - return; - } - List saveList = new ArrayList<>(); - Userinfos record = new Userinfos(); - record.setUserid(user.getString("user_id")); - record.setNick(user.getString("nick")); - record.setPassword(user.getString("password")); - if(StringUtils.isNotEmpty(user.getString("icon_url"))){ - record.setIconUrl(user.getString("icon_url")); - } - saveList.add(record); - openimClient.addUser(saveList); - } - - @Override - public void updateUser(JSONObject user) { - List updateList = new ArrayList<>(); - Userinfos record = new Userinfos(); - record.setUserid(user.getString("user_id")); - record.setNick(user.getString("nick")); - updateList.add(record); - openimClient.updateUser(updateList); - } - - @Override - public void pushMsh() { - - } - - @Override - public JSONObject getUserInfo(String userId) { - return openimClient.getUser(userId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java b/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java deleted file mode 100644 index e6fa261f3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java +++ /dev/null @@ -1,143 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.PropertyNamingStrategy; -import com.alibaba.fastjson.annotation.JSONType; -import com.google.common.base.CaseFormat; -import com.yixsoft.support.mybatis.utils.ClassFieldsDescription; -import com.yixsoft.support.mybatis.utils.FieldDescription; -import org.apache.commons.lang3.ClassUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.hibernate.validator.constraints.Range; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.core.annotation.AnnotatedElementUtils; - -import java.lang.reflect.InvocationTargetException; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -@JSONType(naming = PropertyNamingStrategy.SnakeCase) -public class DefaultClientProfile { - private final Logger logger = LoggerFactory.getLogger(getClass()); - @ProfileDesc(value = "周末延迟清算", detail = "周末交易延迟到周二清算") - private boolean weekendDelay = true; - @ProfileDesc("手续费包含GST") - private boolean taxInSurcharge = false; - @ProfileDesc("允许退款") - private boolean enableRefund = true; - @ProfileDesc(value = "每日清算截止时间", detail = "默认基于GMT+10的0点,有效范围0-24,时区为商户时区") - @Range(max = 24) - private Integer settleHour; - @ProfileDesc("自动获取消费者信息") - private boolean requireCustinfo = true; - @ProfileDesc(value = "交易备注必填", detail = "仅限于商户静态码") - private boolean requireRemark = false; - - public List desc() { - return new ClassFieldsDescription<>(getClass()).getFields().stream() - .filter(field -> !"class".equalsIgnoreCase(field.getFieldName())) - .map(this::convertFieldInfo) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - private JSONObject convertFieldInfo(FieldDescription field) { - try { - Object value = field.readField(this); - String fieldName = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.LOWER_UNDERSCORE).convert(field.getFieldName()); - JSONObject info = new JSONObject(); - info.put("field", fieldName); - info.put("value", value); - Class fieldType = field.getMethod().getReturnType(); - if (ClassUtils.isPrimitiveOrWrapper(fieldType)) { - if (ClassUtils.isPrimitiveWrapper(fieldType)) { - fieldType = ClassUtils.wrapperToPrimitive(fieldType); - } - if (fieldType.equals(boolean.class)) { - info.put("type", "checkbox"); - } else { - info.put("type", "number"); - } - } else { - info.put("type", "text"); - } - - ProfileDesc getterDesc = AnnotatedElementUtils.findMergedAnnotation(field.getMethod(), ProfileDesc.class); - try { - ProfileDesc fieldDesc = AnnotatedElementUtils.findMergedAnnotation(getClass().getDeclaredField(field.getFieldName()), ProfileDesc.class); - ProfileDesc desc = ObjectUtils.defaultIfNull(getterDesc, fieldDesc); - if (desc != null) { - info.put("title", desc.value()); - info.put("detail", desc.detail()); - } - } catch (NoSuchFieldException e) { - } - return info; - } catch (IllegalAccessException | InvocationTargetException e) { - logger.error("failed to access getter of field {}", field.getFieldName(), e); - return null; - } - } - - public void applyToClientConfig(JSONObject client) { - JSONObject profile = (JSONObject) JSON.toJSON(this); - profile.forEach(client::putIfAbsent); - } - - public boolean isWeekendDelay() { - return weekendDelay; - } - - public DefaultClientProfile setWeekendDelay(boolean weekendDelay) { - this.weekendDelay = weekendDelay; - return this; - } - - public boolean isTaxInSurcharge() { - return taxInSurcharge; - } - - public DefaultClientProfile setTaxInSurcharge(boolean taxInSurcharge) { - this.taxInSurcharge = taxInSurcharge; - return this; - } - - public boolean isEnableRefund() { - return enableRefund; - } - - public DefaultClientProfile setEnableRefund(boolean enableRefund) { - this.enableRefund = enableRefund; - return this; - } - - public Integer getSettleHour() { - return settleHour; - } - - public DefaultClientProfile setSettleHour(Integer settleHour) { - this.settleHour = settleHour; - return this; - } - - public boolean isRequireCustinfo() { - return requireCustinfo; - } - - public DefaultClientProfile setRequireCustinfo(boolean requireCustinfo) { - this.requireCustinfo = requireCustinfo; - return this; - } - - public boolean isRequireRemark() { - return requireRemark; - } - - public DefaultClientProfile setRequireRemark(boolean requireRemark) { - this.requireRemark = requireRemark; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/OrgInfo.java b/src/main/java/au/com/royalpay/payment/manage/organizations/beans/OrgInfo.java deleted file mode 100644 index 0b9b73f7b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/OrgInfo.java +++ /dev/null @@ -1,492 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.beans; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-10-18. - */ -public class OrgInfo { - @NotEmpty - private String name; - private String type; - private String logo; - @NotEmpty - private String location; - @NotEmpty - private String contact_person; - @NotEmpty - private String Contact_phone; - @NotEmpty - private String Contact_mail; - private boolean commission; - private Double rate_value; - private String remark; - private Double alipay_rate_value; - private Double wechat_rate_value; - private Double alipayonlinecn_rate_value; - private Double alipayother_rate_value; - private Double alipayonline_rate_value; - private Double alipayplus_rate_value; - private Double cb_bankpay_rate_value; - // private Double rpaypmt_card_rate_value; - //卡支付-国内卡费率配置 - private Double rpaypmt_domestic_card_rate_value; - //卡支付-国际卡费率配置 - private Double rpaypmt_overseas_card_rate_value; - private Double rpaypmt_dd_rate_value; - private int is_valid; - private String search_text; - private int page = 1; - private int limit = 10; - private String parent_org_id; - private String org_id; - private String commission_type; - private Double min_wechat_rate; - private Double min_alipayplus_rate; - private Double min_alipay_rate; - private Double min_alipayonline_rate; - private Double min_alipayonlinecn_rate_value; - private Double min_alipayother_rate_value; - private Double min_cb_bankpay_rate; - private Double min_rpaypmt_card_rate; - private Double min_rpaypmt_domestic_card_rate; - private Double min_rpaypmt_overseas_card_rate; - private Double min_rpaypmt_dd_rate; - private String state; - private String senior_parent_org_id; - private Double retail_interchange_fee_value; - private Double min_retail_interchange_fee_value; - private Double retail_service_fee_value; - private Double min_retail_service_fee_value; - private Double online_interchange_fee_value; - private Double min_online_interchange_fee_value; - private Double online_service_fee_value; - private Double min_online_service_fee_value; - - - public JSONObject toJsonParam() { - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(name)) { - param.put("name", name); - } - if (StringUtils.isNotBlank(contact_person)) { - param.put("contact_person", contact_person); - } - if (StringUtils.isNotBlank(search_text)) { - param.put("search_text", search_text); - } - if (type != null) { - param.put("type", type); - } - if (StringUtils.isNotBlank(parent_org_id)) { - param.put("parent_org_id", parent_org_id); - } - if (StringUtils.isNotBlank(org_id)) { - param.put("org_id", org_id); - } - if (StringUtils.isNotBlank(senior_parent_org_id)) { - param.put("senior_parent_org_id", senior_parent_org_id); - } - return param; - } - - public Double getAlipayonlinecn_rate_value() { - return alipayonlinecn_rate_value; - } - - public void setAlipayonlinecn_rate_value(Double alipayonlinecn_rate_value) { - this.alipayonlinecn_rate_value = alipayonlinecn_rate_value; - } - - public Double getAlipayother_rate_value() { - return alipayother_rate_value; - } - - public void setAlipayother_rate_value(Double alipayother_rate_value) { - this.alipayother_rate_value = alipayother_rate_value; - } - - public Double getMin_alipayonlinecn_rate_value() { - return min_alipayonlinecn_rate_value; - } - - public void setMin_alipayonlinecn_rate_value(Double min_alipayonlinecn_rate_value) { - this.min_alipayonlinecn_rate_value = min_alipayonlinecn_rate_value; - } - - public Double getMin_alipayother_rate_value() { - return min_alipayother_rate_value; - } - - public void setMin_alipayother_rate_value(Double min_alipayother_rate_value) { - this.min_alipayother_rate_value = min_alipayother_rate_value; - } - - public Double getAlipayplus_rate_value() { - return alipayplus_rate_value; - } - - public void setAlipayplus_rate_value(Double alipayplus_rate_value) { - this.alipayplus_rate_value = alipayplus_rate_value; - } - - public Double getMin_alipayplus_rate() { - return min_alipayplus_rate; - } - - public void setMin_alipayplus_rate(Double min_alipayplus_rate) { - this.min_alipayplus_rate = min_alipayplus_rate; - } - - public int getIs_valid() { - return is_valid; - } - - public void setIs_valid(int is_valid) { - this.is_valid = is_valid; - } - - public JSONObject toJSON() { - return (JSONObject) JSONObject.toJSON(this); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLogo() { - return logo; - } - - public void setLogo(String logo) { - this.logo = logo; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getContact_person() { - return contact_person; - } - - public void setContact_person(String contact_person) { - this.contact_person = contact_person; - } - - public String getContact_phone() { - return Contact_phone; - } - - public void setContact_phone(String contact_phone) { - Contact_phone = contact_phone; - } - - public String getContact_mail() { - return Contact_mail; - } - - public void setContact_mail(String contact_mail) { - Contact_mail = contact_mail; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Double getRate_value() { - return rate_value; - } - - public void setRate_value(Double rate_value) { - this.rate_value = rate_value; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public boolean isCommission() { - return commission; - } - - public void setCommission(boolean commission) { - this.commission = commission; - } - - public Double getAlipay_rate_value() { - return alipay_rate_value; - } - - public void setAlipay_rate_value(Double alipay_rate_value) { - this.alipay_rate_value = alipay_rate_value; - } - - public Double getWechat_rate_value() { - return wechat_rate_value; - } - - public void setWechat_rate_value(Double wechat_rate_value) { - this.wechat_rate_value = wechat_rate_value; - } - - public Double getAlipayonline_rate_value() { - return alipayonline_rate_value; - } - - public void setAlipayonline_rate_value(Double alipayonline_rate_value) { - this.alipayonline_rate_value = alipayonline_rate_value; - } - - public String getSearch_text() { - return search_text; - } - - public void setSearch_text(String search_text) { - this.search_text = search_text; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getParent_org_id() { - return parent_org_id; - } - - public void setParent_org_id(String parent_org_id) { - this.parent_org_id = parent_org_id; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public String getCommission_type() { - return commission_type; - } - - public void setCommission_type(String commission_type) { - this.commission_type = commission_type; - } - - public Double getMin_wechat_rate() { - return min_wechat_rate; - } - - public void setMin_wechat_rate(Double min_wechat_rate) { - this.min_wechat_rate = min_wechat_rate; - } - - public Double getMin_alipay_rate() { - return min_alipay_rate; - } - - public void setMin_alipay_rate(Double min_alipay_rate) { - this.min_alipay_rate = min_alipay_rate; - } - - public Double getMin_alipayonline_rate() { - return min_alipayonline_rate; - } - - public void setMin_alipayonline_rate(Double min_alipayonline_rate) { - this.min_alipayonline_rate = min_alipayonline_rate; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getSenior_parent_org_id() { - return senior_parent_org_id; - } - - public void setSenior_parent_org_id(String senior_parent_org_id) { - this.senior_parent_org_id = senior_parent_org_id; - } - - public Double getCb_bankpay_rate_value() { - return cb_bankpay_rate_value; - } - - public void setCb_bankpay_rate_value(Double cb_bankpay_rate_value) { - this.cb_bankpay_rate_value = cb_bankpay_rate_value; - } - - public Double getMin_cb_bankpay_rate() { - return min_cb_bankpay_rate; - } - - public void setMin_cb_bankpay_rate(Double min_cb_bankpay_rate) { - this.min_cb_bankpay_rate = min_cb_bankpay_rate; - } - - public Double getRpaypmt_dd_rate_value() { - return rpaypmt_dd_rate_value; - } - -/* public Double getRpaypmt_card_rate_value() { - return rpaypmt_card_rate_value; - } - - public void setRpaypmt_card_rate_value(Double rpaypmt_card_rate_value) { - this.rpaypmt_card_rate_value = rpaypmt_card_rate_value; - }*/ - - public void setRpaypmt_dd_rate_value(Double rpaypmt_dd_rate_value) { - this.rpaypmt_dd_rate_value = rpaypmt_dd_rate_value; - } - - public Double getMin_rpaypmt_card_rate() { - return min_rpaypmt_card_rate; - } - - public Double getMin_rpaypmt_dd_rate() { - return min_rpaypmt_dd_rate; - } - - public void setMin_rpaypmt_card_rate(Double min_rpaypmt_card_rate) { - this.min_rpaypmt_card_rate = min_rpaypmt_card_rate; - } - - public void setMin_rpaypmt_dd_rate(Double min_rpaypmt_dd_rate) { - this.min_rpaypmt_dd_rate = min_rpaypmt_dd_rate; - } - - public Double getRpaypmt_domestic_card_rate_value() { - return rpaypmt_domestic_card_rate_value; - } - - public void setRpaypmt_domestic_card_rate_value(Double rpaypmt_domestic_card_rate_value) { - this.rpaypmt_domestic_card_rate_value = rpaypmt_domestic_card_rate_value; - } - - public Double getRpaypmt_overseas_card_rate_value() { - return rpaypmt_overseas_card_rate_value; - } - - public void setRpaypmt_overseas_card_rate_value(Double rpaypmt_overseas_card_rate_value) { - this.rpaypmt_overseas_card_rate_value = rpaypmt_overseas_card_rate_value; - } - - - public Double getMin_rpaypmt_domestic_card_rate() { - return min_rpaypmt_domestic_card_rate; - } - - public void setMin_rpaypmt_domestic_card_rate(Double min_rpaypmt_domestic_card_rate) { - this.min_rpaypmt_domestic_card_rate = min_rpaypmt_domestic_card_rate; - } - - public Double getMin_rpaypmt_overseas_card_rate() { - return min_rpaypmt_overseas_card_rate; - } - - public void setMin_rpaypmt_overseas_card_rate(Double min_rpaypmt_overseas_card_rate) { - this.min_rpaypmt_overseas_card_rate = min_rpaypmt_overseas_card_rate; - } - - public Double getRetail_interchange_fee_value() { - return retail_interchange_fee_value; - } - - public void setRetail_interchange_fee_value(Double retail_interchange_fee_value) { - this.retail_interchange_fee_value = retail_interchange_fee_value; - } - - public Double getMin_retail_interchange_fee_value() { - return min_retail_interchange_fee_value; - } - - public void setMin_retail_interchange_fee_value(Double min_retail_interchange_fee_value) { - this.min_retail_interchange_fee_value = min_retail_interchange_fee_value; - } - - public Double getRetail_service_fee_value() { - return retail_service_fee_value; - } - - public void setRetail_service_fee_value(Double retail_service_fee_value) { - this.retail_service_fee_value = retail_service_fee_value; - } - - public Double getMin_retail_service_fee_value() { - return min_retail_service_fee_value; - } - - public void setMin_retail_service_fee_value(Double min_retail_service_fee_value) { - this.min_retail_service_fee_value = min_retail_service_fee_value; - } - - public Double getOnline_interchange_fee_value() { - return online_interchange_fee_value; - } - - public void setOnline_interchange_fee_value(Double online_interchange_fee_value) { - this.online_interchange_fee_value = online_interchange_fee_value; - } - - public Double getMin_online_interchange_fee_value() { - return min_online_interchange_fee_value; - } - - public void setMin_online_interchange_fee_value(Double min_online_interchange_fee_value) { - this.min_online_interchange_fee_value = min_online_interchange_fee_value; - } - - public Double getOnline_service_fee_value() { - return online_service_fee_value; - } - - public void setOnline_service_fee_value(Double online_service_fee_value) { - this.online_service_fee_value = online_service_fee_value; - } - - public Double getMin_online_service_fee_value() { - return min_online_service_fee_value; - } - - public void setMin_online_service_fee_value(Double min_online_service_fee_value) { - this.min_online_service_fee_value = min_online_service_fee_value; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/ProfileDesc.java b/src/main/java/au/com/royalpay/payment/manage/organizations/beans/ProfileDesc.java deleted file mode 100644 index ceef5b485..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/ProfileDesc.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.beans; - -import org.springframework.data.mongodb.core.mapping.Document; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Document -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.METHOD}) -public @interface ProfileDesc { - String value(); - - String detail() default ""; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/core/OrgClientProfileUtils.java b/src/main/java/au/com/royalpay/payment/manage/organizations/core/OrgClientProfileUtils.java deleted file mode 100644 index a52928e2f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/core/OrgClientProfileUtils.java +++ /dev/null @@ -1,30 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.core; - -import au.com.royalpay.payment.manage.organizations.beans.DefaultClientProfile; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; - -public final class OrgClientProfileUtils { - public static final String PROFILE_KEY = "default_client_profile"; - - private OrgClientProfileUtils() { - } - - public static DefaultClientProfile getOrgProfile(JSONObject org) { - String profile = org.getString(PROFILE_KEY); - if (profile == null) { - return new DefaultClientProfile(); - } - try { - return JSON.parseObject(profile).toJavaObject(DefaultClientProfile.class); - } catch (JSONException e) { - return new DefaultClientProfile(); - } - } - - public static void applyOrgClientDefaultProfile(JSONObject org, JSONObject client) { - DefaultClientProfile profile = getOrgProfile(org); - profile.applyToClientConfig(client); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/core/OrgManager.java b/src/main/java/au/com/royalpay/payment/manage/organizations/core/OrgManager.java deleted file mode 100644 index 8497b7857..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/core/OrgManager.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.core; - -import au.com.royalpay.payment.manage.organizations.beans.DefaultClientProfile; -import au.com.royalpay.payment.manage.organizations.beans.OrgInfo; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2016-10-18. - */ -public interface OrgManager { - List listOrgs(boolean detail); - - List listSeniorOrgs(); - - List listOrgsWithChid(JSONObject manager,OrgInfo orgInfo); - - List listOrgAndChild(JSONObject manager); - - JSONObject listAllOrgs(OrgInfo orgInfo,JSONObject manager); - - JSONObject getOrgDetail(int orgId,JSONObject manager); - - JSONObject saveNewOrg(OrgInfo org); - - void updateOrg(int orgId, OrgInfo org, JSONObject manager); - - void setPartnerPublicKeyConfig(int orgId, JSONObject manager, String ipWhitelistConfig); - - void refreshPlatformPublicKeyConfig(int orgId, JSONObject manager); - - List getReferrers(); - - JSONObject getCityPartnerPrizeInfoList(int page, int limit,int orgId, JSONObject manager); - - String refreshMerchantCode(int orgId, JSONObject manager); - - String initMerchantCode(); - - boolean getMerchantIsValid(String clientMoniker); - - void switchPermission(int orgId, String permissionName, boolean enabled); - - List listAllOrg(); - - JSONObject checkOrg(JSONObject manager, JSONObject params); - - JSONObject checkOrgIds(JSONObject manager, JSONObject params); - - void updateDefaultClientProfile(int orgId, JSONObject manager, DefaultClientProfile profile); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/core/impls/OrgManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/organizations/core/impls/OrgManagerImpl.java deleted file mode 100644 index 6ff7bec80..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/core/impls/OrgManagerImpl.java +++ /dev/null @@ -1,400 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.core.impls; - -import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgSignInfoMapper; -import au.com.royalpay.payment.manage.organizations.beans.DefaultClientProfile; -import au.com.royalpay.payment.manage.organizations.beans.OrgInfo; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.tools.codec.RSACrypt; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.security.KeyPair; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Created by yixian on 2016-10-18. - */ -@Service -public class OrgManagerImpl implements OrgManager { - @Resource - private OrgMapper orgMapper; - @Resource - private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; - @Resource - private OrgSignInfoMapper orgSignInfoMapper; - - @Override - public List listOrgs(boolean detail) { - PageBounds sort = new PageBounds(Order.formString("sort_no.asc")); - return orgMapper.listOrgs(0,sort); - } - - @Override - public List listSeniorOrgs() { - return orgMapper.listSeniorOrgs(); - } - - @Override - public List listOrgsWithChid(JSONObject manager,OrgInfo orgInfo) { - JSONObject params = new JSONObject(); - params.put("type",0); - List listOrgsByChild = orgMapper.listOrgsWithChid(params); - if(orgInfo.getOrg_id() != null){ - params.put("org_id", orgInfo.getOrg_id()); - }else { - if (manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - } - List listOrgs = orgMapper.listOrgsWithParent(params); - List orgs = new ArrayList<>(); - for(JSONObject org : listOrgs){ - org.put("type",org.getString("name")); - orgs.add(org); - for(JSONObject orgChild : listOrgsByChild){ - if(org.getIntValue("org_id") == orgChild.getIntValue("parent_org_id")){ - orgChild.put("type",org.getString("name")); - orgs.add(orgChild); - } - } - } - return orgs; - } - - @Override - public List listOrgAndChild(JSONObject manager) { - JSONObject params = new JSONObject(); - params.put("type",0); - List listOrgsByChild = orgMapper.listOrgsWithChid(params); - List listOrgs = orgMapper.listOrgsWithParent(params); - for(JSONObject org: listOrgs){ - List children = new ArrayList<>(); - for(JSONObject child:listOrgsByChild){ - if(child.getIntValue("parent_org_id") == org.getIntValue("org_id")){ - children.add(child); - } - } - if (!children.isEmpty()) { - org.put("children", children); - } - } - return listOrgs; - } - - @Override - public JSONObject listAllOrgs(OrgInfo orgInfo,JSONObject manager) { - /* PageBounds sort = new PageBounds(Order.formString("sort_no.asc")); - return orgMapper.listsOrgWithDetail(sort);*/ - JSONObject params = orgInfo.toJsonParam(); - PageList listOrg = orgMapper.listOrgWithPages(params,new PageBounds(orgInfo.getPage(),orgInfo.getLimit(),Order.formString("sort_no.asc"))); - return PageListUtils.buildPageListResult(listOrg); - } - - @Override - public JSONObject getOrgDetail(int orgId,JSONObject manager) { - JSONObject org = orgMapper.findOne(orgId); - JSONObject gatewayInfo = orgSignInfoMapper.findByOrgId(orgId); - if (gatewayInfo != null) { - gatewayInfo.remove("platform_private_key"); - org.putAll(gatewayInfo); - } - return org; - } - - @Override - public JSONObject saveNewOrg(OrgInfo org) { - JSONObject json = org.toJSON(); - checkOrgRate(json); - json.put("is_valid", 1); - json.put("sort_no", orgMapper.listAllOrgs().size()); - json.put("create_time",new Date()); - orgMapper.saveOrg(json); - initOrgGatewayInfo(json); - return json; - } - - @Override - public void updateOrg(int orgId, OrgInfo org, JSONObject manager) { - JSONObject json = org.toJSON(); - checkOrgRate(json); - json.put("org_id", orgId); - orgMapper.updateOrg(json); - } - - @Override - @Transactional - public void refreshPlatformPublicKeyConfig(int orgId, JSONObject manager) { - int managerOrgId = manager.getIntValue("org_id"); - if (managerOrgId != 0 && managerOrgId != 1 && managerOrgId != orgId) { - throw new ForbiddenException("You have no permission to setting the org"); - } - JSONObject org = orgMapper.findOne(orgId); - JSONObject gateway = orgSignInfoMapper.findByOrgId(orgId); - if (gateway == null) { - initOrgGatewayInfo(org); - }else { - JSONObject key = getRsaKey(); - gateway.put("platform_public_key", key.getString("public_key")); - gateway.put("platform_private_key", key.getString("private_key")); - gateway.put("last_update_by", manager.getString("manager_id")); - gateway.put("last_update_date", new Date()); - orgSignInfoMapper.update(gateway); - } - } - - @Override - public void setPartnerPublicKeyConfig(int orgId, JSONObject manager, String publicKey) { - int managerOrgId = manager.getIntValue("org_id"); - if (managerOrgId != 0 && managerOrgId != 1 && managerOrgId != orgId) { - throw new ForbiddenException("You have no permission to setting the org"); - } - JSONObject org = orgMapper.findOne(orgId); - JSONObject gateway = orgSignInfoMapper.findByOrgId(orgId); - if (gateway == null) { - org.put("mch_public_key", publicKey); - initOrgGatewayInfo(org); - }else { - gateway.put("mch_public_key", publicKey); - gateway.put("last_update_by", manager.getString("manager_id")); - gateway.put("last_update_date", new Date()); - orgSignInfoMapper.update(gateway); - } - } - - @Override - public List getReferrers() { - return orgMapper.listOrgs(1,new PageBounds()); - } - - @Override - public JSONObject getCityPartnerPrizeInfoList(int page, int limit,int orgId, JSONObject manager) { - if (orgId > 0) { - PageList clientExtractList = financialPartnerCommissionMapper.getClientExtractRecord(orgId, - new PageBounds(page, limit)); - return PageListUtils.buildPageListResult(clientExtractList); - } - return null; - } - - @Override - public String refreshMerchantCode(int orgId, JSONObject manager) { - String merchantCode = null; - int managerOrgId = manager.getIntValue("org_id"); - JSONObject org = orgMapper.findOne(orgId); - if (managerOrgId != 0 && managerOrgId != 1 && managerOrgId != orgId && managerOrgId != org.getIntValue("parent_org_id")) { - throw new ForbiddenException("You have no permission to setting the org"); - } - JSONObject gateway = orgSignInfoMapper.findByOrgId(orgId); - merchantCode = initMerchantCode(); - if (gateway == null) { - org.put("gateway_short_id", merchantCode); - initOrgGatewayInfo(org); - }else { - gateway.put("gateway_short_id", merchantCode); - gateway.put("last_update_by", manager.getString("manager_id")); - gateway.put("last_update_date", new Date()); - orgSignInfoMapper.update(gateway); - } - return merchantCode; - } - - @Override - public String initMerchantCode() { - String code = RandomStringUtils.randomAlphanumeric(10).toUpperCase(); - if (!getMerchantIsValid(code)) { - return initMerchantCode(); - } - return code; - } - - @Override - public boolean getMerchantIsValid(String clientMoniker) { - if (orgSignInfoMapper.getPartnercode(clientMoniker) > 0) { - return false; - } - return true; - } - - @Override - public void switchPermission(int orgId, String permissionName, boolean enabled) { - JSONObject org = new JSONObject(); - org.put("org_id", orgId); - org.put(permissionName, enabled); - orgMapper.updateOrg(org); - } - - @Override - public List listAllOrg() { - List listAllOrgs = orgMapper.listAllOrgs(); - for (JSONObject obj : listAllOrgs){ - if(obj.getIntValue("type") == 0){ - obj.put("org_type","合伙人"); - } - if(obj.getIntValue("type") == 1){ - obj.put("org_type","推荐人"); - } - } - return listAllOrgs; - } - - @Override - public JSONObject checkOrg(JSONObject manager, JSONObject params){ - if (params.getString("org_id")==null){ - if (manager.getInteger("org_id")!=null){ - List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - params.put("org_id",manager.getIntValue("org_id")); - if (orgs.size()>1){ - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - params.put("org_ids",orgIds); - }else { - params.put("org_id",manager.getIntValue("org_id")); - } - } - }else { - if (manager.getInteger("org_id")!=null){ - List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(params.getIntValue("org_id"))){ - throw new ForbiddenException("You have no permission to query the org"); - } - - } - - } - return params; - } - - @Override - public JSONObject checkOrgIds(JSONObject manager, JSONObject params) { - if(params.getString("org_id") != null){ - if(params.getString("org_id2") == null){ - orgIds(params,manager); - }else { - if (manager.getInteger("org_id")!=null){ - List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(params.getString("org_id2"))){ - throw new ForbiddenException("You have no permission to query the org"); - } - } - params.put("org_id",params.getString("org_id2")); - params.remove("org_id2"); - } - }else { - if(params.getString("org_id2") == null){ - if(manager.getIntValue("org_id") > 0){ - List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - if (orgs.size()>1){ - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - params.put("org_ids",orgIds); - }else { - params.put("org_id",manager.getIntValue("org_id")); - } - } - }else { - if (manager.getInteger("org_id")!=null){ - List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(params.getString("org_id2"))) { - throw new ForbiddenException("You have no permission to query the org"); - } - } - params.put("org_id", params.getString("org_id2")); - params.remove("org_id2"); - } - } - return params; - } - - @Override - public void updateDefaultClientProfile(int orgId, JSONObject manager, DefaultClientProfile profile) { - getOrgDetail(orgId, manager); - orgMapper.updateOrgClientProfile(orgId, JSON.toJSONString(profile)); - } - - private void orgIds(JSONObject params, JSONObject manager) { - List orgs = orgMapper.listOrgAndChild(Integer.parseInt(params.getString("org_id"))); - if (orgs.size() > 1) { - List orgIds = orgs.stream().map(org -> org.getIntValue("org_id")).collect(Collectors.toList()); - params.put("org_ids", orgIds); - params.remove("org_id"); - } else { - params.put("org_id", params.getString("org_id")); - } - } - private void checkOrgRate(JSONObject json){ - if(StringUtils.isNotEmpty(json.getString("parent_org_id"))&&json.getIntValue("commission_type")==1){ - JSONObject orgObject = orgMapper.findOne(json.getIntValue("parent_org_id")); - String rateNames = ""; - JSONArray rate1 = new JSONArray(); - JSONArray rate2 = new JSONArray(); - if(orgObject.getString("commission_type").equals(json.getString("commission_type"))){ - String[] rates = new String[]{"alipay_rate_value","wechat_rate_value","alipayonline_rate_value","cb_bankpay_rate_value"}; - for (String rateName: rates ){ - if(StringUtils.isEmpty(orgObject.getString(rateName))){ - rate1.add(rateName); - } - if (StringUtils.isEmpty(json.getString(rateName))) { - rate2.add(rateName); - } - if (StringUtils.isNotEmpty(orgObject.getString(rateName)) && StringUtils.isNotEmpty(json.getString(rateName))) { - if (orgObject.getDouble(rateName).compareTo(json.getDouble(rateName)) > 0) { - rateNames += rateName + ","; - } - } - } - } - if (!rate1.isEmpty()) { - throw new ForbiddenException("费率异常,请联系管理员"); - } - if (!rate2.isEmpty()) { - throw new ForbiddenException("费率输入不完整,请重新输入"); - } - if (!rateNames.equals("")) { - throw new ForbiddenException("二级组织" + rateNames + "费率参数应大于一级组织费率,请重新输入"); - } - } - } - private JSONObject getRsaKey() { - JSONObject key = new JSONObject(); - KeyPair keyPairGen = RSACrypt.generateKeyPairs(); - RSAPublicKey publicKey = (RSAPublicKey) keyPairGen.getPublic(); - RSAPrivateKey privateKey = (RSAPrivateKey) keyPairGen.getPrivate(); - key.put("public_key", Base64.encodeBase64String(publicKey.getEncoded())); - key.put("private_key", Base64.encodeBase64String(privateKey.getEncoded())); - return key; - } - - private void initOrgGatewayInfo(JSONObject org) { - JSONObject key = getRsaKey(); - String shortId = org.containsKey("gateway_short_id") ? org.getString("gateway_short_id") : initMerchantCode(); - String mchPublicKey = org.containsKey("mch_public_key") ? org.getString("mch_public_key") : null; - org.put("gateway_short_id", shortId); - org.put("mch_public_key", mchPublicKey); - org.put("platform_public_key", key.getString("public_key")); - org.put("platform_private_key", key.getString("private_key")); - org.put("is_valid", 1); - org.put("creation_by", "init"); - org.put("creation_date", new Date()); - orgSignInfoMapper.insert(org); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/package-info.java b/src/main/java/au/com/royalpay/payment/manage/organizations/package-info.java deleted file mode 100644 index c88745011..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 组织机构管理 - * Created by yixian on 2016-10-18. - */ -package au.com.royalpay.payment.manage.organizations; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/web/OrgManageController.java b/src/main/java/au/com/royalpay/payment/manage/organizations/web/OrgManageController.java deleted file mode 100644 index 4abd0da3d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/web/OrgManageController.java +++ /dev/null @@ -1,130 +0,0 @@ -package au.com.royalpay.payment.manage.organizations.web; - -import au.com.royalpay.payment.manage.organizations.beans.DefaultClientProfile; -import au.com.royalpay.payment.manage.organizations.beans.OrgInfo; -import au.com.royalpay.payment.manage.organizations.core.OrgClientProfileUtils; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.List; - -/** - * Created by yixian on 2016-10-18. - */ -@RestController -@RequestMapping("/sys/orgs") -public class OrgManageController { - @Resource - private OrgManager orgManager; - - @GetMapping - @RequireManager - public List listOrgs(@RequestParam(defaultValue = "false") boolean detail) { - return orgManager.listOrgs(detail); - } - - @GetMapping(value = "/senior") - @RequireManager - public List listSeniorOrgs() { - return orgManager.listSeniorOrgs(); - } - - @GetMapping(value = "/orgChild") - @RequireManager - public List listOrgsWithChid(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, OrgInfo orgInfo) { - return orgManager.listOrgsWithChid(manager, orgInfo); - } - - @GetMapping(value = "/child") - @RequireManager - public List listOrgAndChild(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, OrgInfo orgInfo) { - return orgManager.listOrgAndChild(manager); - } - - @GetMapping("/listsOrg") - @RequireManager - public JSONObject listsOrg(OrgInfo orgInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return orgManager.listAllOrgs(orgInfo, manager); - } - - @GetMapping("/list_all_Org") - @RequireManager - public List listAllOrg() { - return orgManager.listAllOrg(); - } - - @ManagerMapping(method = RequestMethod.POST, role = {ManagerRole.ADMIN}) - public JSONObject saveOrg(@RequestBody @Valid OrgInfo org, Errors errors) { - HttpUtils.handleValidErrors(errors); - return orgManager.saveNewOrg(org); - } - - @ManagerMapping(value = "/{orgId}", method = RequestMethod.GET, role = {ManagerRole.ADMIN}) - public JSONObject getOrgDetail(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject org = orgManager.getOrgDetail(orgId, manager); - org.remove(OrgClientProfileUtils.PROFILE_KEY); - return org; - } - - @ManagerMapping(value = "/{orgId}", method = RequestMethod.PUT) - public void updateOrg(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid OrgInfo org, Errors errors) { - HttpUtils.handleValidErrors(errors); - orgManager.updateOrg(orgId, org, manager); - } - - @ManagerMapping(value = "/{orgId}/default_client_profile", method = RequestMethod.GET, role = ManagerRole.ADMIN) - public List getOrgDefaultClientProfile(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject org = orgManager.getOrgDetail(orgId, manager); - return OrgClientProfileUtils.getOrgProfile(org).desc(); - } - - @ManagerMapping(value = "/{orgId}/default_client_profile", method = RequestMethod.PUT, role = ManagerRole.ADMIN) - public void updateOrgProfile(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid DefaultClientProfile profile, Errors errors) { - HttpUtils.handleValidErrors(errors); - orgManager.updateDefaultClientProfile(orgId, manager, profile); - } - - @ManagerMapping(value = "/{orgId}/partner_public_key", method = RequestMethod.PUT) - public void setPartnerPublicKeyConfig(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject config) { - orgManager.setPartnerPublicKeyConfig(orgId, manager, config.getString("partner_public_key")); - } - - @ManagerMapping(value = "/{orgId}/refresh_platform_public_key", method = RequestMethod.PUT) - public void refreshPlatformPublicKeyConfig(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - orgManager.refreshPlatformPublicKeyConfig(orgId, manager); - } - - @ManagerMapping(value = "/{orgId}/enable_change_rate", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) - public void switchEnableChangeRate(@PathVariable int orgId, @RequestBody JSONObject enable) { - boolean enabled = enable.getBooleanValue("enabled"); - orgManager.switchPermission(orgId, "rate_editable", enabled); - } - - @ManagerMapping(value = "/referrer", method = RequestMethod.GET) - public List getReferrers() { - return orgManager.getReferrers(); - } - - @ManagerMapping(value = "/{orgId}/extract/search", method = RequestMethod.GET) - public JSONObject getCityPartnerPrizeInfoAllList(@PathVariable int orgId, - @RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "20") int limit, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return orgManager.getCityPartnerPrizeInfoList(page, limit, orgId, manager); - } - - @RequestMapping(value = "/{orgId}/init/merchant_code", method = RequestMethod.GET, produces = "application/json") - public JSONObject initMerchantCode(@PathVariable int orgId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject result = new JSONObject(); - result.put("partner_code", orgManager.refreshMerchantCode(orgId, manager)); - return result; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/partnerinvoice/web/PartnerInvoiceController.java b/src/main/java/au/com/royalpay/payment/manage/partnerinvoice/web/PartnerInvoiceController.java deleted file mode 100644 index 0332dd1e4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/partnerinvoice/web/PartnerInvoiceController.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.partnerinvoice.web; - -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yuan on 2018/4/17. - */ -@RestController -@RequestMapping("/partner/invoice") -public class PartnerInvoiceController { - - @Resource - private TradeLogService tradeLogService; - - @Resource - private ClientManager clientManager; - - @PartnerMapping(value = "/trans_flow",method = RequestMethod.GET,roles = PartnerRole.ADMIN) - public JSONObject listTransFlow(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) throws Exception { - return tradeLogService.listPartnerTransFlowPage(query,partner); - } - - @PartnerMapping(value = "/trans_flow/pdf", method = RequestMethod.GET,roles = PartnerRole.ADMIN) - public void exportTransFlowPDF(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportTransFlow(query,getPartnerParams(partner,query.getClient_ids()[0]),httpResponse); - } - - private JSONObject getPartnerParams(JSONObject partner,String client_id){ - JSONObject client = clientManager.getClientInfo(Integer.parseInt(client_id)); - if(client==null){ - throw new NotFoundException("Client Not Exists"); - } - JSONObject params = new JSONObject(); - params.put("client_id",partner.getIntValue("client_id")); - params.put("client",client); - params.put("client_moniker",client.getString("client_moniker")); - return params; - } - - @GetMapping(value = "/trans_flow/pdf/{clientMoniker}") - public void exportTransFlowPDF(@PathVariable String clientMoniker,TradeLogQuery query,HttpServletResponse httpResponse) throws Exception { - JSONObject partner = new JSONObject(); - partner.put("client_moniker",clientMoniker); - tradeLogService.exportTransFlowApi(query,partner,httpResponse); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/ManagerMapping.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/ManagerMapping.java deleted file mode 100644 index be50de4f7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/ManagerMapping.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager; - -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import org.springframework.core.annotation.AliasFor; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.lang.annotation.*; - -/** - * Created by yixian on 2016-06-25. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.TYPE}) -@RequestMapping -@RequireManager -public @interface ManagerMapping { - @AliasFor(annotation = RequestMapping.class, value = "value") - String[] value() default {}; - - @AliasFor(annotation = RequestMapping.class, value = "method") - RequestMethod[] method() default {}; - - @AliasFor(annotation = RequireManager.class, value = "role") - ManagerRole[] role() default {}; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/ManagerUserInterceptor.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/ManagerUserInterceptor.java deleted file mode 100644 index ffa3b33aa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/ManagerUserInterceptor.java +++ /dev/null @@ -1,143 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager; - -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.stereotype.Component; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.lang.reflect.Method; - -/** - * Created by yixian on 2016-06-25. - */ -@Component -public class ManagerUserInterceptor extends HandlerInterceptorAdapter implements Ordered { - Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private PermissionManager permissionManager; - @Resource - private PermissionPartnerManager permissionPartnerManager; - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - if (handler instanceof HandlerMethod) { - Method method = ((HandlerMethod) handler).getMethod(); - return handleMethod(method, request, response) && super.preHandle(request, response, handler); - } else { - return super.preHandle(request, response, handler); - } - } - - private boolean handleMethod(Method method, HttpServletRequest request, HttpServletResponse response) { - RequireManager manager = null; - RequirePartner partner = null; - Class clazz = method.getDeclaringClass(); - if (AnnotatedElementUtils.isAnnotated(method, RequireManager.class)) { - manager = AnnotatedElementUtils.findMergedAnnotation(method, RequireManager.class); - } else if (AnnotatedElementUtils.isAnnotated(clazz, RequireManager.class)) { - manager = AnnotatedElementUtils.findMergedAnnotation(clazz, RequireManager.class); - } - if (AnnotatedElementUtils.isAnnotated(method, RequirePartner.class)) { - partner = AnnotatedElementUtils.findMergedAnnotation(method, RequirePartner.class); - } else if (AnnotatedElementUtils.isAnnotated(clazz, RequirePartner.class)) { - partner = AnnotatedElementUtils.findMergedAnnotation(clazz, RequirePartner.class); - } - if (manager == null && partner == null) { - return true; - } - String managerStatusKey = HttpUtils.getCookie(request, CommonConsts.MANAGER_STATUS); - String partnerStatusKey = HttpUtils.getCookie(request, CommonConsts.PARTNER_STATUS); - if (manager != null && partner != null) { - ForbiddenException ex = null; - try { - String funcId = clazz.getSimpleName() + "." + method.getName(); - checkManagerPermisson(request, funcId, managerStatusKey); - } catch (ForbiddenException e) { - ex = e; - } - if (ex != null) { - String funcId = clazz.getSimpleName() + "." + method.getName(); - checkPartnerPermission(request, partner, partnerStatusKey, managerStatusKey, funcId); - } - return true; - } - if (manager != null) { - String funcId = clazz.getSimpleName() + "." + method.getName(); - checkManagerPermisson(request, funcId, managerStatusKey); - return true; - } - String funcId = clazz.getSimpleName() + "." + method.getName(); - checkPartnerPermission(request, partner, partnerStatusKey, managerStatusKey, funcId); - return true; - } - - private void checkPartnerPermission(HttpServletRequest request, RequirePartner partner, String partnerStatusKey, String managerStatusKey, String funcId) { - if (StringUtils.isEmpty(partnerStatusKey) && StringUtils.isEmpty(managerStatusKey)) { - throw new ForbiddenException("error.permission.not_login"); - } - JSONObject loginUser = signInStatusManager.getCurrentClient(partnerStatusKey); - if (loginUser == null) { - loginUser = signInStatusManager.managerMockClient(managerStatusKey); - if (loginUser == null) { - throw new ForbiddenException("error.permission.not_login"); - } - } - PartnerRole role = PartnerRole.getRole(loginUser.getIntValue("role")); - if (partner.roles().length > 0) { - if (ArrayUtils.indexOf(partner.roles(), role) < 0) { - throw new ForbiddenException("error.permission.nopermission"); - } - } - - JSONObject func = permissionPartnerManager.getPartnerFuncById(funcId); - if (func != null && StringUtils.isNotEmpty(func.getString("module_id"))) { - JSONArray arr = loginUser.getJSONArray("available_module_ids"); - if (arr == null || !arr.contains(func.getString("module_id"))) { - logger.info(partner.toString()); - logger.info(partnerStatusKey); - logger.info(funcId); - throw new ForbiddenException("error.permission.nopermission"); - } - } - request.setAttribute(CommonConsts.PARTNER_STATUS, loginUser); - } - - private void checkManagerPermisson(HttpServletRequest request, String funcId, String managerStatusKey) { - if (StringUtils.isEmpty(managerStatusKey)) { - throw new ForbiddenException("error.permission.not_manager_login"); - } - JSONObject loginUser = signInStatusManager.getCurrentManager(managerStatusKey); - if (loginUser == null) { - throw new ForbiddenException("error.permission.login_again"); - } - JSONArray arr = loginUser.getJSONArray("available_func_ids"); - if (arr == null || !arr.contains(funcId)) { - throw new ForbiddenException("error.permission.nopermission"); - } - request.setAttribute(CommonConsts.MANAGER_STATUS, loginUser); - } - - @Override - public int getOrder() { - return 1; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/PartnerMapping.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/PartnerMapping.java deleted file mode 100644 index 042a6abb3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/PartnerMapping.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager; - -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import org.springframework.core.annotation.AliasFor; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.lang.annotation.*; - -/** - * Created by yixian on 2016-07-01. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.TYPE}) -@RequestMapping -@RequirePartner -public @interface PartnerMapping { - @AliasFor(annotation = RequestMapping.class, value = "value") - String[] value() default {}; - - @AliasFor(annotation = RequestMapping.class, value = "method") - RequestMethod[] method() default {}; - - @AliasFor(annotation = RequirePartner.class, value = "roles") - PartnerRole[] roles() default {}; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/RequireManager.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/RequireManager.java deleted file mode 100644 index 030fc135e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/RequireManager.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager; - -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import java.lang.annotation.*; - -/** - * annotate on requestMapping methods or classes - * to determine only which role can visit this url - * only managers can visit - *

    - * Created by yixian on 2016-06-25. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE, ElementType.METHOD}) -public @interface RequireManager { - ManagerRole[] role() default {}; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/RequirePartner.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/RequirePartner.java deleted file mode 100644 index a31b4ba45..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/RequirePartner.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager; - -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; - -import java.lang.annotation.*; - -/** - * Created by yixian on 2016-06-25. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.TYPE}) -public @interface RequirePartner { - PartnerRole[] roles() default {}; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/UserAdvise.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/UserAdvise.java deleted file mode 100644 index 31003f508..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/UserAdvise.java +++ /dev/null @@ -1,57 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager; - -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.ModelAttribute; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -/** - * Created by yixian on 2016-06-29. - */ -@ControllerAdvice -public class UserAdvise { - @Resource - private SignInStatusManager signInStatusManager; - - @ModelAttribute(CommonConsts.MANAGER_STATUS) - public JSONObject getManagerUser(@CookieValue(value = CommonConsts.MANAGER_STATUS, required = false) String key, HttpServletRequest request) { - JSONObject user = (JSONObject) request.getAttribute(CommonConsts.MANAGER_STATUS); - if (user != null) { - user.remove("available_func_ids"); - return user; - } - if (StringUtils.isNotEmpty(key)) { - try { - JSONObject manager = signInStatusManager.getCurrentManager(key); - if (manager != null) { - manager.remove("available_func_ids"); - return manager; - } - } catch (ForbiddenException ignored) { - } - } - return null; - } - - @ModelAttribute(CommonConsts.PARTNER_STATUS) - public JSONObject getPartnerUser(@CookieValue(value = CommonConsts.PARTNER_STATUS, required = false) String key, HttpServletRequest request) { - JSONObject account = (JSONObject) request.getAttribute(CommonConsts.PARTNER_STATUS); - if (account != null) { - return account; - } - if (StringUtils.isNotEmpty(key)) { - try { - return signInStatusManager.getCurrentClient(key); - }catch (ForbiddenException ignored){ - } - } - return null; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/ManagerPermissionScanner.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/ManagerPermissionScanner.java deleted file mode 100644 index 4ef782ded..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/ManagerPermissionScanner.java +++ /dev/null @@ -1,103 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager.scanner; - -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; -import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by yixian on 2017-02-28. - */ -@Component -public class ManagerPermissionScanner implements BeanPostProcessor, PermissionReader { - private Logger logger = LoggerFactory.getLogger(getClass()); - - private Map permissionNodes = new HashMap<>(); - - @Override - public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { - Class clazz = bean.getClass(); - if (AnnotatedElementUtils.isAnnotated(clazz, Controller.class)) { - - Method[] methods = clazz.getDeclaredMethods(); - RequestMapping clazzRequestMapping = AnnotatedElementUtils.findMergedAnnotation(clazz, RequestMapping.class); - RequireManager clazzPermission = AnnotatedElementUtils.findMergedAnnotation(clazz, RequireManager.class); - for (Method method : methods) { - if (AnnotatedElementUtils.isAnnotated(method, RequestMapping.class)) { - RequestMapping methodMapping = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class); - RequireManager methodPermission = AnnotatedElementUtils.findMergedAnnotation(method, RequireManager.class); - - if (clazzPermission != null || methodPermission != null) { - registerPermissionMapping(clazz, method, clazzRequestMapping, clazzPermission, methodMapping, methodPermission); - } - } - } - } - return bean; - } - - private void registerPermissionMapping(Class controller, Method method, RequestMapping clazzRequestMapping, RequireManager clazzPermission, RequestMapping methodMapping, RequireManager methodPermission) { - - //get request uri and methods - PermissionNode node = new PermissionNode(controller.getSimpleName(), method.getName()); - getRequestInfo(node, clazzRequestMapping, methodMapping); - node.setPermissions(clazzPermission, methodPermission); - logger.trace("register permission:{}:{}", node.getFuncName(), node.getRequestId()); - if (permissionNodes.containsKey(node.getFuncId())) { - throw new RuntimeException("Duplicated permission function ID:" + controller.getName() + "." + method.getName()); - } - permissionNodes.put(node.getFuncId(), node); - - } - - private void getRequestInfo(PermissionNode node, RequestMapping clazzRequestMapping, RequestMapping methodMapping) { - String uri = ""; - RequestMethod[] methods = {}; - if (clazzRequestMapping != null) { - if (clazzRequestMapping.value().length > 0) { - uri += clazzRequestMapping.value()[0]; - } - methods = clazzRequestMapping.method(); - } - if (!uri.startsWith("/")) { - uri = "/" + uri; - } - if (uri.endsWith("/")) { - uri = uri.substring(0, uri.length() - 1); - } - if (methodMapping.value().length > 0) { - String val = methodMapping.value()[0]; - if (val.startsWith("/")) { - val = val.substring(1); - } - uri += "/" + val; - } - if (methodMapping.method().length > 0) { - methods = methodMapping.method(); - } - node.setUri(uri); - node.setMethods(methods); - } - - @Override - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - return bean; - } - - @Override - public List listFunctions() { - return new ArrayList<>(permissionNodes.values()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PartnerPermissionScanner.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PartnerPermissionScanner.java deleted file mode 100644 index adfb62384..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PartnerPermissionScanner.java +++ /dev/null @@ -1,101 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager.scanner; - -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; -import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by yixian on 2017-02-28. - */ -@Component -public class PartnerPermissionScanner implements BeanPostProcessor, PermissionPartnerReader { - private Map permissionNodes = new HashMap<>(); - - @Override - public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { - Class clazz = bean.getClass(); - if (AnnotatedElementUtils.isAnnotated(clazz, Controller.class)) { - - Method[] methods = clazz.getDeclaredMethods(); - RequestMapping clazzRequestMapping = AnnotatedElementUtils.findMergedAnnotation(clazz, RequestMapping.class); - RequirePartner clazzPermission = AnnotatedElementUtils.findMergedAnnotation(clazz, RequirePartner.class); - for (Method method : methods) { - if (AnnotatedElementUtils.isAnnotated(method, RequestMapping.class)) { - RequestMapping methodMapping = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class); - RequirePartner methodPermission = AnnotatedElementUtils.findMergedAnnotation(method, RequirePartner.class); - - if (clazzPermission != null || methodPermission != null) { - registerPermissionMapping(clazz, method, clazzRequestMapping, clazzPermission, methodMapping, methodPermission); - } - } - } - } - return bean; - } - - private void registerPermissionMapping(Class controller, Method method, RequestMapping clazzRequestMapping, RequirePartner clazzPermission, RequestMapping methodMapping, RequirePartner methodPermission) { - - //get request uri and methods - PermissionNode node = new PermissionNode(controller.getSimpleName(), method.getName()); - getRequestInfo(node, clazzRequestMapping, methodMapping); - node.setPartnerPermissions(clazzPermission, methodPermission); - if (permissionNodes.containsKey(node.getFuncId())) { - throw new RuntimeException("Duplicated permission function ID:" + controller.getName() + "." + method.getName()); - } - permissionNodes.put(node.getFuncId(), node); - - } - - private void getRequestInfo(PermissionNode node, RequestMapping clazzRequestMapping, RequestMapping methodMapping) { - String uri = ""; - RequestMethod[] methods = {}; - if (clazzRequestMapping != null) { - if (clazzRequestMapping.value().length > 0) { - uri += clazzRequestMapping.value()[0]; - } - methods = clazzRequestMapping.method(); - } - if (!uri.startsWith("/")) { - uri = "/" + uri; - } - if (uri.endsWith("/")) { - uri = uri.substring(0, uri.length() - 1); - } - if (methodMapping.value().length > 0) { - String val = methodMapping.value()[0]; - if (val.startsWith("/")) { - val = val.substring(1); - } - uri += "/" + val; - } - if (methodMapping.method().length > 0) { - methods = methodMapping.method(); - } - node.setUri(uri); - node.setMethods(methods); - } - - @Override - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - return bean; - } - - @Override - public List listFunctions() { - return new ArrayList<>(permissionNodes.values()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionNode.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionNode.java deleted file mode 100644 index 26bab1124..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionNode.java +++ /dev/null @@ -1,119 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager.scanner; - -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.RequestMethod; - -/** - * Created by yixian on 2017-02-28. - */ -public class PermissionNode { - private String uri; - private String method; - private String className; - private RequestMethod[] methods; - private int roleMask; - - public PermissionNode(String className, String method) { - this.className = className; - this.method = method; - } - - public String getFuncId() { - return className + "." + method; - } - - public String getRequestId() { - return uri + "[" + StringUtils.join(methods, ",") + "]"; - } - - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - - public String getMethod() { - return method; - } - - public String getClassName() { - return className; - } - - public RequestMethod[] getMethods() { - return methods; - } - - public void setMethods(RequestMethod[] methods) { - this.methods = methods; - } - - public String getFuncName() { - return className + "." + method; - } - - public int getRoleMask() { - return roleMask; - } - - public JSONObject initFuncObject() { - JSONObject func = new JSONObject(); - func.put("func_id", getFuncId()); - func.put("class_name", getClassName()); - func.put("method_name", getMethod()); - func.put("uri", getUri()); - func.put("req_methods", StringUtils.join(methods, ",")); - func.put("role", getRoleMask()); - return func; - } - - public void setPermissions(RequireManager clazzPermission, RequireManager methodPermission) { - ManagerRole[] roles; - if (methodPermission != null) { - roles = methodPermission.role(); - } else { - if (clazzPermission == null) { - throw new RuntimeException("Permission not set:" + getRequestId()); - } - roles = clazzPermission.role(); - } - if (roles.length == 0) { - roles = ManagerRole.values(); - } - int mask = 0; - for (ManagerRole role : roles) { - mask |= role.getMask(); - } - this.roleMask = mask; - - } - - public void setPartnerPermissions(RequirePartner clazzPermission, RequirePartner methodPermission) { - PartnerRole[] roles; - if (methodPermission != null) { - roles = methodPermission.roles(); - } else { - if (clazzPermission == null) { - throw new RuntimeException("Permission not set:" + getRequestId()); - } - roles = clazzPermission.roles(); - } - if (roles.length == 0) { - roles = PartnerRole.values(); - } - int mask = 0; - for (PartnerRole role : roles) { - mask |= role.getCode(); - } - this.roleMask = mask; - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionPartnerReader.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionPartnerReader.java deleted file mode 100644 index 152a2235c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionPartnerReader.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager.scanner; - -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -public interface PermissionPartnerReader { - List listFunctions(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionReader.java b/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionReader.java deleted file mode 100644 index 444808089..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/manager/scanner/PermissionReader.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.permission.manager.scanner; - -import java.util.List; - -/** - * Created by yixian on 2017-02-28. - */ -public interface PermissionReader { - List listFunctions(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/utils/GeekLoginDESUtil.java b/src/main/java/au/com/royalpay/payment/manage/permission/utils/GeekLoginDESUtil.java deleted file mode 100644 index 019c16829..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/utils/GeekLoginDESUtil.java +++ /dev/null @@ -1,70 +0,0 @@ -package au.com.royalpay.payment.manage.permission.utils; - -import java.security.Key; -import java.security.SecureRandom; - -import javax.crypto.Cipher; -import javax.crypto.KeyGenerator; -import org.apache.commons.codec.binary.Base64; - -/** - * @Author DuLingLing - * @create 2019/11/27 0027 18:32 - */ -public class GeekLoginDESUtil { - - private static Key key; - //设置秘钥key - private static String KEY_STR="GEEKPAYMENT"; - private static String CHARSETNAME="UTF-8"; - private static String ALGORITHM="DES"; - - - static{ - try{ - KeyGenerator generator=KeyGenerator.getInstance(ALGORITHM); - SecureRandom secureRandom=SecureRandom.getInstance("SHA1PRNG"); - secureRandom.setSeed(KEY_STR.getBytes()); - generator.init(secureRandom); - key=generator.generateKey(); - generator=null; - }catch(Exception e){ - throw new RuntimeException(e); - } - } - - /** - * 获取加密的信息 - * @param str - * @return - */ - public static String getEncryptString(String str){ - try { - byte[] bytes = str.getBytes(CHARSETNAME); - Cipher cipher = Cipher.getInstance(ALGORITHM); - cipher.init(Cipher.ENCRYPT_MODE, key); - byte[] doFinal = cipher.doFinal(bytes); - return Base64.encodeBase64String(doFinal); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * 获取解密之后的信息 - * - * @param str - * @return - */ - public static String getDecryptString(String str) { - try { - byte[] bytes = Base64.decodeBase64(str); - Cipher cipher = Cipher.getInstance(ALGORITHM); - cipher.init(Cipher.DECRYPT_MODE, key); - byte[] doFinal = cipher.doFinal(bytes); - return new String(doFinal, CHARSETNAME); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/permission/utils/OrgCheckUtils.java b/src/main/java/au/com/royalpay/payment/manage/permission/utils/OrgCheckUtils.java deleted file mode 100644 index 4c9c90790..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/permission/utils/OrgCheckUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.permission.utils; - -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.util.Assert; - -/** - * Created by yixian on 2016-10-20. - */ -public class OrgCheckUtils { - public static void checkOrgPermission(JSONObject manager, JSONObject client) { - Assert.notNull(client, "client should not be null"); - if (manager != null && manager.getInteger("org_id") != null && manager.getIntValue("org_id") != client.getIntValue("org_id")) { - throw new ForbiddenException("This client was not belong to your organization"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java deleted file mode 100644 index c6878b994..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.pos.datasource; - -import com.zaxxer.hikari.HikariDataSource; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.jdbc.DataSourceBuilder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; -import org.springframework.transaction.annotation.EnableTransactionManagement; -import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; -import javax.sql.DataSource; -import java.util.HashMap; -import java.util.Map; - -/** - * 多数据源配置类 - * Created by Dulingling on 2019/8/7 - */ -@Configuration -@EnableTransactionManagement -public class DataSourceConfiguration { - - @Bean(name = "masterDataSource") - @ConfigurationProperties(prefix = "spring.datasource.master") - public DataSource masterDataSource() { - return DataSourceBuilder.create().type(HikariDataSource.class).build(); - } - - @Bean(name = "slaveDataSource") - @ConfigurationProperties(prefix = "spring.datasource.slave") - public DataSource slaveDataSource() { - return DataSourceBuilder.create().type(HikariDataSource.class).build(); - } - - - @Bean("routingDataSource") - @Primary - public AbstractRoutingDataSource roundRobinDataSouceProxy() { - ReadWriteSplitRoutingDataSource proxy = new ReadWriteSplitRoutingDataSource(); - Map targetDataResources = new HashMap<>(); - DataSource masterDataSource = masterDataSource(); - targetDataResources.put(DbContextHolder.DbType.MASTER, masterDataSource); - DataSource slaveDataSource = slaveDataSource(); - targetDataResources.put(DbContextHolder.DbType.SLAVE, slaveDataSource); - proxy.setDefaultTargetDataSource(masterDataSource);//默认源 - proxy.setTargetDataSources(targetDataResources); - return proxy; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DbContextHolder.java b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DbContextHolder.java deleted file mode 100644 index b00ca25fc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DbContextHolder.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.pos.datasource; - -/** - * Created by Dulingling on 2019/8/7 - */ -public class DbContextHolder { - - public enum DbType{ - MASTER,SLAVE - } - - private static final ThreadLocal contextHolder = new ThreadLocal<>(); - - public static void setDbType(DbType dbType){ - if(dbType==null)throw new NullPointerException(); - contextHolder.set(dbType); - } - - public static DbType getDbType(){ - DbType dbType = contextHolder.get(); - return dbType ==null? DbType.MASTER: dbType; - } - - public static void clearDbType(){ - contextHolder.remove(); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadOnlyConnection.java b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadOnlyConnection.java deleted file mode 100644 index d05f66489..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadOnlyConnection.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.pos.datasource; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * 该注解注释在service方法上,标注为链接slaves库 - * Created by Dulingling on 2019/8/7 - */ -@Target({ElementType.METHOD, ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ReadOnlyConnection { -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadOnlyConnectionInterceptor.java b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadOnlyConnectionInterceptor.java deleted file mode 100644 index 1ac0a8b4b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadOnlyConnectionInterceptor.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.pos.datasource; - -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.core.Ordered; -import org.springframework.stereotype.Component; - - -/** - * Created by Dulingling on 2019/8/7 - */ - -@Aspect -@Component -public class ReadOnlyConnectionInterceptor implements Ordered { - - @Around("@annotation(readOnlyConnection)") - public Object proceed(ProceedingJoinPoint proceedingJoinPoint, ReadOnlyConnection readOnlyConnection) throws Throwable { - try { - DbContextHolder.setDbType(DbContextHolder.DbType.SLAVE); - return proceedingJoinPoint.proceed(); - } finally { - DbContextHolder.clearDbType(); - } - } - - - @Override - public int getOrder() { - return 0; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadWriteSplitRoutingDataSource.java b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadWriteSplitRoutingDataSource.java deleted file mode 100644 index 180e7c967..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/ReadWriteSplitRoutingDataSource.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.com.royalpay.payment.manage.pos.datasource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; - -/** - * Created by Dulingling on 2019/8/7 - */ -public class ReadWriteSplitRoutingDataSource extends AbstractRoutingDataSource { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Override - public Object determineCurrentLookupKey() { - return DbContextHolder.getDbType(); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/beans/paySuccessCountBean.java b/src/main/java/au/com/royalpay/payment/manage/posters/beans/paySuccessCountBean.java deleted file mode 100644 index 2a01c8a18..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/beans/paySuccessCountBean.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.posters.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; - -/** - * created by todking at 2019-6-15 - */ -public class paySuccessCountBean { - - @JSONField(name = "in_time") - private String inTime; - - @JSONField(name = "count") - private int count; - - public String getInTime() { - return inTime; - } - - public void setInTime(String inTime) { - this.inTime = inTime; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } - - public JSONObject toJson() { - JSONObject jsons = new JSONObject(); - - jsons.put("inTime", inTime); - - jsons.put("count", count); - - return jsons; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/core/PaySuccessCountService.java b/src/main/java/au/com/royalpay/payment/manage/posters/core/PaySuccessCountService.java deleted file mode 100644 index 9f7d42b17..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/core/PaySuccessCountService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.posters.core; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -/** - * create by todking at 2019-6-3 - */ - -public interface PaySuccessCountService { - - //查询支付成功页面次数 - JSONObject selectCount(String time); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/core/PosterService.java b/src/main/java/au/com/royalpay/payment/manage/posters/core/PosterService.java deleted file mode 100644 index 7bc13aee4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/core/PosterService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.posters.core; - - -import com.alibaba.fastjson.JSONObject; - - -/** - * create by todking at 2019-6-3 - */ -public interface PosterService { - void updatePoster(String imgUrl); - - JSONObject getPoster(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/core/impls/PaySuccessCountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/posters/core/impls/PaySuccessCountServiceImpl.java deleted file mode 100644 index 28016fd43..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/core/impls/PaySuccessCountServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.posters.core.impls; - -import au.com.royalpay.payment.manage.mappers.payment.PaySuccessCountMapper; -import au.com.royalpay.payment.manage.posters.core.PaySuccessCountService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; - - -/** - * created by todking at 2019-6-15 - */ - -@Service -public class PaySuccessCountServiceImpl implements PaySuccessCountService { - - @Resource - private PaySuccessCountMapper paySuccessCountMapper; - - @Override - public JSONObject selectCount(String time) { - String gmt = time.replace("GMT", "").replaceAll("\\(.*\\)", ""); - SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z", Locale.ENGLISH); - Date dateTrans = null; - try { - dateTrans = format.parse(gmt); - } catch (ParseException e) { - e.printStackTrace(); - } - String s = new SimpleDateFormat("yyyy-MM-dd").format(dateTrans); - List object = paySuccessCountMapper.findCount(s); - if(object.size() != 0){ - return object.get(0); - }else { - return null; - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/core/impls/PosterServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/posters/core/impls/PosterServiceImpl.java deleted file mode 100644 index 8ff68653e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/core/impls/PosterServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.posters.core.impls; - -import au.com.royalpay.payment.manage.posters.core.PosterService; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.io.IOException; - - -/** - * create by todking at 2019-6-3 - */ - -@Service -public class PosterServiceImpl implements PosterService { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${app.cms.host}") - private String cmsHost; - - @Override - public void updatePoster(String imgUrl) { - String url = cmsHost + "/api/statistics/count"; - HttpRequestGenerator htg = new HttpRequestGenerator(url, RequestMethod.PUT); - HttpRequestResult result = htg.addQueryString("imgUrl", imgUrl).execute(); - if (result.isSuccess()) { - int statusCode = result.getStatusCode(); - if (statusCode == 200) { - logger.info("CMS request succeeded"); - } - } - } - - @Override - public JSONObject getPoster() { - String url = cmsHost + "/api/statistics/posters"; - HttpRequestGenerator htg = new HttpRequestGenerator(url, RequestMethod.GET); - try { - HttpRequestResult result = htg.execute(); - if(result.isSuccess()){ - int statusCode = result.getStatusCode(); - if (statusCode == 200) { - logger.info("Get posters succeeded"); - } - JSONObject obj = result.getResponseContentJSONObj(); -// final String s = result.getResponseContentString(); - return obj; - } - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/web/paySuccessCountController.java b/src/main/java/au/com/royalpay/payment/manage/posters/web/paySuccessCountController.java deleted file mode 100644 index 700e67a50..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/web/paySuccessCountController.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.posters.web; - - -import au.com.royalpay.payment.manage.posters.core.PaySuccessCountService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.text.ParseException; - - - -/** - * created by todking at 2019-6-15 - */ -@RestController -@RequestMapping(value = "/statistics/click") -public class paySuccessCountController { - - @Resource - private PaySuccessCountService paySuccessCountService; - - @RequestMapping(value = "/paySuccess_count/{time}",method = RequestMethod.GET) - public Long selectCount(@PathVariable String time) throws ParseException { - JSONObject jsonObject = paySuccessCountService.selectCount(time); - if(jsonObject == null){ - return 0L; - }else { - Long count = (Long) jsonObject.get("count"); - return count; - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/posters/web/posterController.java b/src/main/java/au/com/royalpay/payment/manage/posters/web/posterController.java deleted file mode 100644 index e39c1f8e1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/posters/web/posterController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.posters.web; - - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.posters.core.PosterService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * create by todking at 2019-6-3 - */ -@RestController -@RequestMapping(value = "/app/poster") -public class posterController { - - @Resource - private PosterService posterService; - - @RequestMapping(method = RequestMethod.PUT) - public void updatePoster(@RequestBody JSONObject img ){ - posterService.updatePoster(img.getString("imgUrl")); - } - - @RequestMapping(value = "/getPosters",method = RequestMethod.GET) - public JSONObject getPosters(){ - JSONObject posters = posterService.getPoster(); - return posters; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/processors/CtripCouponOnlyLogProcessor.java b/src/main/java/au/com/royalpay/payment/manage/processors/CtripCouponOnlyLogProcessor.java deleted file mode 100644 index 8ea9f3024..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/processors/CtripCouponOnlyLogProcessor.java +++ /dev/null @@ -1,197 +0,0 @@ -package au.com.royalpay.payment.manage.processors; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.beans.PreOrderRequest; -import au.com.royalpay.payment.core.beans.coupon.CouponInfo; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.core.events.RefundSendEvent; -import au.com.royalpay.payment.core.processors.PaymentProcessor; -import au.com.royalpay.payment.manage.mappers.log.CouponAccuessLogMapper; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.utils.Currency; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Date; -import java.util.List; - -@Service -public class CtripCouponOnlyLogProcessor implements PaymentProcessor { - - // todo 重构逻辑 - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - - - private static final String COUPON_ID = "CTRIP_COUPON_ONLY_LOG"; - - @Value("${app.customer.host}") - private String CUSTOMER_HOST; - - @Value("${customer.app.appid}") - private String CUSTOMER_APP_ID; - - @Value("${customer.app.auth-code}") - private String CUSTOMER_AUTH_CODE; - - @Resource - private MerchantInfoProvider merchantInfoProvider; - - @Resource - private SysConfigManager sysConfigManager; - - @Resource - private CouponAccuessLogMapper payCouponAccuessLogMapper; - @Resource - private PaymentApi paymentApi; - - @Override - public String processorId() { - return COUPON_ID + "_USE"; - } - - @Override - public void handleBeforeOrderSending(PreOrderRequest paymentInfo, JSONObject order) { - JSONObject tmpEle = paymentInfo.getTmpEle(); - if (tmpEle == null) { - return; - } - if (StringUtils.isEmpty(tmpEle.getString("ctrip_coupon_id"))) { - return; - } - if (!isOnlyLogMerchant(order.getIntValue("client_id"))) { - return; - } - JSONObject couponInfo = getPreOrderCoupon(tmpEle.getString("ctrip_coupon_id"), order.getIntValue("client_id")); - if (couponInfo == null) { - return; - } - BigDecimal payFee = paymentInfo.getTotalFee(); - BigDecimal exchange = paymentApi.channelApi(paymentInfo.getChannel()).queryExchangeRateDecimal(paymentInfo.getClientId()); - if (paymentInfo.getCurrency() == Currency.CNY) { - payFee = CurrencyAmountUtils.scale(payFee.divide(exchange, 2, RoundingMode.HALF_UP), PlatformEnvironment.getEnv().getForeignCurrency()); - } - BigDecimal couponCondition = couponInfo.getBigDecimal("condition") == null ? BigDecimal.ZERO - : couponInfo.getBigDecimal("condition"); - if (payFee.compareTo(couponCondition) < 0) { - return; - } - JSONObject couponAccuessLog = new JSONObject(); - couponAccuessLog.put("client_id", order.getIntValue("client_id")); - couponAccuessLog.put("customer_openid", "创建订单时无"); - couponAccuessLog.put("creation_date", new Date()); - couponAccuessLog.put("order_id", order.getString("order_id")); - couponAccuessLog.put("coupon_id", "CTRIP_" + tmpEle.getString("ctrip_coupon_id")); - //携程满减 - if (StringUtils.equals(couponInfo.getString("type"), "31")) { - BigDecimal actureAmount = couponInfo.getBigDecimal("acture_amount"); - if (paymentInfo.getCurrency() == Currency.CNY) { - actureAmount = CurrencyAmountUtils.scale(couponInfo.getBigDecimal("acture_amount").multiply(exchange), PlatformEnvironment.getEnv().getForeignCurrency()); - } - couponAccuessLog.put("coupon_deal_amount", actureAmount); - } - //携程折扣 - if (StringUtils.equals(couponInfo.getString("type"), "32")) { - BigDecimal couponDiscount = couponInfo.getBigDecimal("discount").divide(CommonConsts.HUNDRED, 4, RoundingMode.HALF_UP); - BigDecimal couponDealAmount = CurrencyAmountUtils.scale(couponDiscount.multiply(paymentInfo.getTotalFee()), PlatformEnvironment.getEnv().getForeignCurrency()); - couponAccuessLog.put("coupon_deal_amount", couponDealAmount); - } - couponAccuessLog.put("currency", order.getString("currency")); - couponAccuessLog.put("min_pay_amount", couponCondition); - payCouponAccuessLogMapper.save(couponAccuessLog); - } - - @Override - public void handleAfterOrderPaid(PaymentFinishedEvent finishedEvent) { - JSONObject order = finishedEvent.getOrder(); - String orderId = order.getString("order_id"); - List accuessCouponLogs = payCouponAccuessLogMapper.findAccuessLogByOrderId(orderId, new PageBounds(Order.formString("last_update_date.desc"))); - if (accuessCouponLogs != null && !accuessCouponLogs.isEmpty()) { - if (!isOnlyLogMerchant(order.getIntValue("client_id"))) { - return; - } - JSONObject accuessCouponLog = accuessCouponLogs.get(0); - String couponLogId = accuessCouponLog.getString("coupon_id"); - logger.info("订单 [" + orderId + "]成功使用Ctrip卡券=======>[" + couponLogId + "]"); - accuessCouponLog.put("is_valid", 1); - accuessCouponLog.put("last_update_date", new Date()); - accuessCouponLog.put("customer_openid", order.getString("customer_id")); - - payCouponAccuessLogMapper.update(accuessCouponLog); - } - } - - @Override - public void registerCoupon(JSONObject client, String customerOpenId, String channel, List coupons) { - return; - } - - @Override - public void handleAfterRefund(RefundSendEvent event) { - //do nothing - JSONObject refundOrder = event.getRefundOrder(); - String orderId = refundOrder.getString("order_id"); - List accuessCouponLogs = payCouponAccuessLogMapper.findUsedCouponByOrderIdList(orderId); - if (accuessCouponLogs != null && !accuessCouponLogs.isEmpty()) { - if (!isOnlyLogMerchant(refundOrder.getIntValue("client_id"))) { - return; - } - JSONObject accuessCouponLog = accuessCouponLogs.get(0); - accuessCouponLog.put("is_valid", 0); - accuessCouponLog.put("last_update_date", new Date()); - accuessCouponLog.put("refund_id", refundOrder.getString("refund_id")); - payCouponAccuessLogMapper.update(accuessCouponLog); - } - } - - @Override - public String registerBanner(JSONObject client, String channel) { - return null; - } - - // 使用券的信息 - private JSONObject getPreOrderCoupon(String couponLogId, int clientId) { - JSONObject client = merchantInfoProvider.getClientInfo(clientId); - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/" + couponLogId + "/couponLogInfo").queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp).queryParam("sign", sign).queryParam("client_moniker", client.getString("client_moniker")).toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - return result.getResponseContentJSONObj(); - } - } catch (Exception ignored) { - logger.error("积分商城优惠券 [" + couponLogId + "]使用失败"); - ignored.printStackTrace(); - } - return null; - } - - private boolean isOnlyLogMerchant(int clientId) { - JSONObject client = merchantInfoProvider.getClientInfo(clientId); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - if (sysConfig.getString("ctrip_coupon_only_log_merchant_list").contains(client.getString("client_moniker"))) { - return true; - } - return false; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/processors/CtripCouponProvideProcessor.java b/src/main/java/au/com/royalpay/payment/manage/processors/CtripCouponProvideProcessor.java deleted file mode 100644 index 4e3b26ac4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/processors/CtripCouponProvideProcessor.java +++ /dev/null @@ -1,271 +0,0 @@ -package au.com.royalpay.payment.manage.processors; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.beans.PaymentQueryResult; -import au.com.royalpay.payment.core.beans.PreOrderRequest; -import au.com.royalpay.payment.core.beans.coupon.CouponInfo; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.core.events.RefundSendEvent; -import au.com.royalpay.payment.core.mappers.PmtOrderMapper; -import au.com.royalpay.payment.core.processors.PaymentProcessor; -import au.com.royalpay.payment.manage.mappers.log.CouponAccuessLogMapper; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.defines.Money; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.merchants.beans.TransactionBizSubType; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.utils.Currency; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Date; -import java.util.List; - -@Service -public class CtripCouponProvideProcessor implements PaymentProcessor { - - // todo 重构逻辑 - private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); - - - private static final String COUPON_ID = "CTRIP_COUPON"; - - @Value("${app.customer.host}") - private String CUSTOMER_HOST; - - @Value("${customer.app.appid}") - private String CUSTOMER_APP_ID; - - @Value("${customer.app.auth-code}") - private String CUSTOMER_AUTH_CODE; - - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private CouponAccuessLogMapper payCouponAccuessLogMapper; - @Resource - private PaymentApi paymentApi; - @Resource - private PmtOrderMapper pmtOrderMapper; - @Resource - private TransactionService transactionService; - - @Override - public String processorId() { - return COUPON_ID + "_USE"; - } - - @Override - public void handleBeforeOrderSending(PreOrderRequest paymentInfo, JSONObject order) { - /*if (order.getIntValue("client_id") != 9) { - return; - }*/ - JSONObject tmpEle = paymentInfo.getTmpEle(); - if (tmpEle == null) { - return; - } - if (StringUtils.isEmpty(tmpEle.getString("ctrip_coupon_id"))) { - return; - } - logger.info("tmpEle:" + tmpEle.toJSONString()); - if (isOnlyLogMerchant(order.getIntValue("client_id"))) { - return; - } - JSONObject couponInfo = getPreOrderCoupon(tmpEle.getString("ctrip_coupon_id"), order.getIntValue("client_id")); - if (couponInfo == null) { - return; - } - BigDecimal payFee = paymentInfo.getTotalFee(); - BigDecimal exchange = paymentApi.channelApi(paymentInfo.getChannel()).queryExchangeRateDecimal(paymentInfo.getClientId()); - if (paymentInfo.getCurrency() == Currency.CNY) { - payFee = CurrencyAmountUtils.scale(payFee.divide(exchange, 2, RoundingMode.HALF_UP), PlatformEnvironment.getEnv().getForeignCurrency()); - } - BigDecimal couponCondition = couponInfo.getBigDecimal("condition") == null ? BigDecimal.ZERO - : couponInfo.getBigDecimal("condition"); - if (payFee.compareTo(couponCondition) < 0) { - return; - } - JSONObject couponAccuessLog = new JSONObject(); - couponAccuessLog.put("client_id", order.getIntValue("client_id")); - couponAccuessLog.put("customer_openid", "创建订单时无"); - couponAccuessLog.put("creation_date", new Date()); - couponAccuessLog.put("order_id", order.getString("order_id")); - couponAccuessLog.put("coupon_id", "CTRIP_" + tmpEle.getString("ctrip_coupon_id")); - BigDecimal currentDiscount = paymentInfo.getDiscount(); - //携程满减 - if (StringUtils.equals(couponInfo.getString("type"), "31")) { - BigDecimal actureAmount = couponInfo.getBigDecimal("acture_amount"); - if (paymentInfo.getCurrency() == Currency.CNY) { - actureAmount = CurrencyAmountUtils.scale(couponInfo.getBigDecimal("acture_amount").multiply(exchange), PlatformEnvironment.getEnv().getForeignCurrency()); - } - paymentInfo.setDiscount(currentDiscount.add(actureAmount)); - couponAccuessLog.put("coupon_deal_amount", actureAmount); - } - //携程折扣 - if (StringUtils.equals(couponInfo.getString("type"), "32")) { - BigDecimal couponDiscount = couponInfo.getBigDecimal("discount").divide(CommonConsts.HUNDRED, 4, RoundingMode.HALF_UP); - BigDecimal couponDealAmount = CurrencyAmountUtils.scale(couponDiscount.multiply(paymentInfo.getTotalFee()), PlatformEnvironment.getEnv().getForeignCurrency()); - paymentInfo.setDiscount(currentDiscount.add(couponDealAmount)); - couponAccuessLog.put("coupon_deal_amount", couponDealAmount); - } - couponAccuessLog.put("currency", order.getString("currency")); - couponAccuessLog.put("min_pay_amount", couponCondition); - payCouponAccuessLogMapper.save(couponAccuessLog); - - JSONObject updateOrder = new JSONObject(); - Money customerPay = paymentInfo.getUserPayAmount(); - updateOrder.put("customer_payment_amount", customerPay.getAmount()); - BigDecimal couponDiscount = paymentInfo.getDiscount(); - updateOrder.put("coupon_payment_amount", couponDiscount); - updateOrder.put("order_id", paymentInfo.getOrderId()); - - pmtOrderMapper.update(updateOrder); - - order.put("customer_payment_amount", customerPay.getAmount()); - order.put("coupon_payment_amount", couponDiscount); - } - - @Override - public void handleAfterOrderPaid(PaymentFinishedEvent finishedEvent) { - JSONObject order = finishedEvent.getOrder(); - /*if (order.getIntValue("client_id") != 9) { - return; - }*/ - String orderId = order.getString("order_id"); - List accuessCouponLogs = payCouponAccuessLogMapper.findAccuessLogByOrderId(orderId, new PageBounds(Order.formString("last_update_date.desc"))); - if (accuessCouponLogs != null && !accuessCouponLogs.isEmpty()) { - if (isOnlyLogMerchant(order.getIntValue("client_id"))) { - return; - } - JSONObject accuessCouponLog = accuessCouponLogs.get(0); - String couponLogId = accuessCouponLog.getString("coupon_id"); - logger.info("订单 [" + orderId + "]成功使用Ctrip卡券=======>[" + couponLogId + "]"); - - //传入流水 - JSONObject useCoupontrans = new JSONObject(); - useCoupontrans.put("org_id", order.getIntValue("org_id")); - useCoupontrans.put("system_transaction_id", accuessCouponLog.getString("accuess_id")); - useCoupontrans.put("order_id", order.getString("order_id")); - useCoupontrans.put("client_id", order.getIntValue("client_id")); - useCoupontrans.put("transaction_currency", order.getString("currency")); - if (StringUtils.equals(order.getString("currency"), "CNY")) { - useCoupontrans.put("cny_amount", accuessCouponLog.getBigDecimal("coupon_deal_amount")); - } - useCoupontrans.put("clearing_currency", PlatformEnvironment.getEnv().getForeignCurrency()); - useCoupontrans.put("clearing_amount", accuessCouponLog.getBigDecimal("coupon_deal_amount")); - useCoupontrans.put("transaction_amount", accuessCouponLog.getBigDecimal("coupon_deal_amount")); - useCoupontrans.put("exchange_rate", finishedEvent.getExchangeRate()); - useCoupontrans.put("channel", order.getString("channel")); - useCoupontrans.put("transaction_type", "Credit"); - PaymentQueryResult pay = finishedEvent.getPaymentQueryResult(); - useCoupontrans.put("transaction_time", pay.getPayTime()); - useCoupontrans.put("clearing_status", 0); - useCoupontrans.put("system_generate", 1); - useCoupontrans.put("remark", "Ctrip Coupon from Customer:" + couponLogId); - accuessCouponLog = payCouponAccuessLogMapper.findAccuessLogByOrderId(orderId, new PageBounds(Order.formString("last_update_date.desc"))).get(0); - if (accuessCouponLog != null) { - transactionService.saveTransaction(useCoupontrans, TransactionBizSubType.COUPON_PAY); - accuessCouponLog.put("is_valid", 1); - accuessCouponLog.put("last_update_date", new Date()); - accuessCouponLog.put("transaction_id", useCoupontrans.getString("transaction_id")); - accuessCouponLog.put("customer_openid", order.getString("customer_id")); - payCouponAccuessLogMapper.update(accuessCouponLog); - } - - } - } - - @Override - public void registerCoupon(JSONObject client, String customerOpenId, String channel, List coupons) { - return; - } - - @Override - public void handleAfterRefund(RefundSendEvent event) { - //do nothing - JSONObject refundOrder = event.getRefundOrder(); - /*if (refundOrder.getIntValue("client_id") != 9) { - return; - }*/ - logger.info("积分商城携程优惠券开始退款"); - String orderId = refundOrder.getString("order_id"); - List accuessCouponLogs = payCouponAccuessLogMapper.findUsedCouponByOrderIdList(orderId); - if (accuessCouponLogs != null && !accuessCouponLogs.isEmpty()) { - if (isOnlyLogMerchant(refundOrder.getIntValue("client_id"))) { - return; - } - JSONObject accuessCouponLog = accuessCouponLogs.get(0); - JSONObject trans = transactionService.findTransaction(accuessCouponLog.getString("transaction_id")); - if (trans != null) { - logger.info("正在退款的券的初始信息" + trans.toJSONString()); - trans.remove("transaction_id"); - trans.put("transaction_type", "Debit"); - String coupon_id = accuessCouponLog.getString("coupon_id"); - trans.put("refund_id", refundOrder.getString("refund_id")); - trans.put("transaction_time", new Date()); - trans.put("remark", "Refund for Customer Ctrip Coupon:" + coupon_id); - logger.info("正在退款的券的信息" + trans.toJSONString()); - transactionService.saveTransaction(trans, TransactionBizSubType.COUPON_REFUND); - logger.error("订单[" + orderId + "]发送全额退款,携程优惠券【" + coupon_id + "】转为Debit"); - accuessCouponLog.put("transaction_refund_id", trans.getString("transaction_id")); - accuessCouponLog.put("refund_id", refundOrder.getString("refund_id")); - accuessCouponLog.put("is_valid", 0); - accuessCouponLog.put("last_update_date", new Date()); - payCouponAccuessLogMapper.update(accuessCouponLog); - } - } - } - - @Override - public String registerBanner(JSONObject client, String channel) { - return null; - } - - // 使用券的信息 - private JSONObject getPreOrderCoupon(String couponLogId, int clientId) { - JSONObject client = merchantInfoProvider.getClientInfo(clientId); - String timestamp = System.currentTimeMillis() + ""; - String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; - String sign = DigestUtils.sha256Hex(base).toLowerCase(); - String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "coupon/" + couponLogId + "/couponLogInfo").queryParam("appid", CUSTOMER_APP_ID) - .queryParam("timestamp", timestamp).queryParam("sign", sign).queryParam("client_moniker", client.getString("client_moniker")).toUriString(); - HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); - try { - HttpRequestResult result = gen.execute(); - if (result.isSuccess()) { - return result.getResponseContentJSONObj(); - } - } catch (Exception ignored) { - logger.error("积分商城优惠券 [" + couponLogId + "]使用失败"); - ignored.printStackTrace(); - } - return null; - } - - private boolean isOnlyLogMerchant(int clientId) { - JSONObject client = merchantInfoProvider.getClientInfo(clientId); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - if (sysConfig.getString("ctrip_coupon_only_log_merchant_list").contains(client.getString("client_moniker"))) { - return true; - } - return false; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/product/beans/ProductBean.java b/src/main/java/au/com/royalpay/payment/manage/product/beans/ProductBean.java deleted file mode 100644 index c8237507a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/product/beans/ProductBean.java +++ /dev/null @@ -1,141 +0,0 @@ -package au.com.royalpay.payment.manage.product.beans; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yuan on 2017/11/24. - */ -public class ProductBean { - private String commodity_id; - private String name; - private String price; - private String industry; - private String hf_industry; - private String counts; - private String degree; - private String client_moniker; - private String search_text; - private int page = 1; - private int limit = 10; - - public JSONObject toJsonParam(){ - JSONObject param = new JSONObject(); - if (StringUtils.isNotBlank(commodity_id)) { - param.put("commodity_id", commodity_id); - } - if (StringUtils.isNotBlank(name)) { - param.put("name", name); - } - if (StringUtils.isNotBlank(price)) { - param.put("price", price); - } - if (StringUtils.isNotBlank(industry)) { - param.put("industry", industry); - } - if (StringUtils.isNotBlank(hf_industry)) { - param.put("hf_industry", hf_industry); - } - if (StringUtils.isNotBlank(counts)) { - param.put("counts", counts); - } - if (StringUtils.isNotBlank(degree)) { - param.put("degree", degree); - } - if (StringUtils.isNotBlank(client_moniker)) { - param.put("client_moniker", client_moniker); - } - if (StringUtils.isNotBlank(search_text)) { - param.put("search_text", search_text); - } - return param; - } - - public String getCommodity_id() { - return commodity_id; - } - - public void setCommodity_id(String commodity_id) { - this.commodity_id = commodity_id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getHf_industry() { - return hf_industry; - } - - public void setHf_industry(String hf_industry) { - this.hf_industry = hf_industry; - } - - public String getCounts() { - return counts; - } - - public void setCounts(String counts) { - this.counts = counts; - } - - public String getDegree() { - return degree; - } - - public void setDegree(String degree) { - this.degree = degree; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public String getSearch_text() { - return search_text; - } - - public void setSearch_text(String search_text) { - this.search_text = search_text; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java b/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java deleted file mode 100644 index 67bf34f6d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.product.core; - -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yuan on 2017/11/24. - */ -public interface ClientProduct { - JSONObject listAllProduct(JSONObject manager, ProductBean productBean); - - List listClientMcc(JSONObject manager, String clientMoniker); - - void saveProduct(JSONObject manager, ProductBean productBean); - - void updateProduct(JSONObject manager, ProductBean productBean); - - void updateMerchantMccInfo(JSONObject manager, JSONObject mccInfo); - - void deleteProduct(JSONObject manager, String commodity_id); - - void importExcelToDb(String client_id, JSONObject manager, String sourceFile); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java b/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java deleted file mode 100644 index f4af79d3b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -package au.com.royalpay.payment.manage.product.core.impls; - -import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper; -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import au.com.royalpay.payment.manage.product.core.ClientProduct; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; - - -/** - * Created by yuan on 2017/11/24. - */ -@Service -public class ClientProductImpl implements ClientProduct { - - private static final String EXCEL_XLS = "xls"; - private static final String EXCEL_XLSX = "xlsx"; - @Resource - private CommoditiesMapper commoditiesMapper; - @Resource - private PaymentChannelMccGoodMapper paymentChannelMccGoodMapper; - - @Resource - private ClientMapper clientMapper; - @Override - public JSONObject listAllProduct(JSONObject manager,ProductBean productBean) { - JSONObject param = productBean.toJsonParam(); - if(StringUtils.isNotBlank(param.getString("client_moniker"))){ - param = addClientId(param,manager); - } - PageList listProducts = commoditiesMapper.listProduct(param,new PageBounds(productBean.getPage(),productBean.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(listProducts); - } - - @Override - public List listClientMcc(JSONObject manager, String clientMoniker) { - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - Assert.notNull(client); - checkOrgPermission(manager, client); - return paymentChannelMccGoodMapper.findPaymentChannelMccByClientId(client.getIntValue("client_id")); - } - - @Override - public void saveProduct(JSONObject manager,ProductBean productBean) { - JSONObject param = productBean.toJsonParam(); - if(StringUtils.isNotBlank(param.getString("client_moniker"))){ - param = addClientId(param,manager); - } - param.put("create_time",new Date()); - param.put("create_id",manager.getString("manager_id")); - commoditiesMapper.saveProduct(param); - } - - @Override - public void updateProduct(JSONObject manager,ProductBean productBean) { - JSONObject param = productBean.toJsonParam(); - param.put("update_id",manager.getString("manager_id")); - param.put("create_time",new Date()); - commoditiesMapper.updateProduct(param); - } - - @Override - public void updateMerchantMccInfo(JSONObject manager, JSONObject mccInfo) { - JSONObject client = clientMapper.findClientByMoniker(mccInfo.getString("client_moniker")); - Assert.notNull(client); - checkOrgPermission(manager, client); - mccInfo.put("client_id", client.getIntValue("client_id")); - mccInfo.put("creation_date", new Date()); - mccInfo.put("creation_by", manager.getString("display_name")); - paymentChannelMccGoodMapper.update(mccInfo); - } - - @Override - public void deleteProduct(JSONObject manager,String commodity_id) { - JSONObject param = new JSONObject(); - param.put("update_id",manager.getString("manager_id")); - param.put("create_time",new Date()); - param.put("commodity_id",commodity_id); - param.put("is_valid",0); - commoditiesMapper.updateProduct(param); - } - - @Override - public void importExcelToDb(String client_moniker, JSONObject manager, String sourceFile) { - JSONObject client = new JSONObject(); - if(client_moniker != null){ - client = clientMapper.findClientByMoniker(client_moniker); - Assert.notNull(client); - checkOrgPermission(manager, client); - } - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); - try { - URL url = new URL(sourceFile); - if(!url.getPath().endsWith(EXCEL_XLS) && !url.getPath().endsWith(EXCEL_XLSX)){ - throw new BadRequestException("文件不是Excel"); - } - InputStream fis = url.openConnection().getInputStream(); - Workbook workbook = getWorkbok(fis, url); - Sheet sheet = workbook.getSheetAt(0); - int count = 0; - for (Row row : sheet) { - if (count == 0) { - count++; - continue; - } - if (row.getCell(0).toString().equals("")) { - return; - } - commoditiesMapper.saveProduct(excelToJason(excelToString(row,fmt),client,manager)); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - private String excelToString(Row row,SimpleDateFormat fmt){ - String rowValue = ""; - for (Cell cell : row) { - if (cell.toString() == null) { - continue; - } - int cellType = cell.getCellType(); - String cellValue = ""; - switch (cellType) { - case Cell.CELL_TYPE_STRING: - cellValue = cell.getRichStringCellValue().getString() + "#"; - break; - case Cell.CELL_TYPE_NUMERIC: - if (DateUtil.isCellDateFormatted(cell)) { - cellValue = fmt.format(cell.getDateCellValue()) + "#"; - } else { - cell.setCellType(Cell.CELL_TYPE_STRING); - cellValue = String.valueOf(cell.getRichStringCellValue().getString()) + "#"; - } - break; - case Cell.CELL_TYPE_BOOLEAN: - cellValue = String.valueOf(cell.getBooleanCellValue()) + "#"; - break; - case Cell.CELL_TYPE_BLANK: - cellValue = cell.getStringCellValue() + "#"; - break; - case Cell.CELL_TYPE_ERROR: - cellValue = "错误#"; - break; - case Cell.CELL_TYPE_FORMULA: - cell.setCellType(Cell.CELL_TYPE_STRING); - cellValue = String.valueOf(cell.getRichStringCellValue().getString()) + "#"; - break; - default: - cellValue = "#"; - } - rowValue += cellValue; - } - return rowValue; - } - private JSONObject excelToJason(String rowValue,JSONObject client,JSONObject manager) throws IOException { - String[] sqlValue = rowValue.split("#"); - JSONObject object = new JSONObject(); - object.put("name", sqlValue[0]); - object.put("price", sqlValue[1]); - object.put("industry", sqlValue[2]); - object.put("counts", sqlValue[3]); - object.put("degree", sqlValue[4]); - object.put("hf_industry", sqlValue[5]); - object.put("client_id", client.getString("client_id")); - object.put("create_id",manager.getString("manager_id")); - object.put("create_time",new Date()); - return object; - } - private Workbook getWorkbok(InputStream in, URL url) throws IOException { - Workbook wb = null; - if (url.getPath().endsWith(EXCEL_XLS)) { - wb = new HSSFWorkbook(in); - } else if (url.getPath().endsWith(EXCEL_XLSX)) { - wb = new XSSFWorkbook(in); - } - return wb; - } - - private JSONObject addClientId(JSONObject param,JSONObject manager){ - JSONObject client = clientMapper.findClientByMoniker(param.getString("client_moniker")); - Assert.notNull(client); - checkOrgPermission(manager, client); - param.put("client_id",client.getIntValue("client_id")); - param.remove("client_moniker"); - return param; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/product/package-info.java b/src/main/java/au/com/royalpay/payment/manage/product/package-info.java deleted file mode 100644 index e77f9b071..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/product/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Created by yuan on 2017/11/27. - */ -package au.com.royalpay.payment.manage.product; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java b/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java deleted file mode 100644 index d9ab44990..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.product.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import au.com.royalpay.payment.manage.product.core.ClientProduct; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.List; - -/** - * Created by yuan on 2017/11/24. - */ -@RestController -@RequestMapping("/sys/product") -public class ManagerProductController { - - @Resource - private ClientProduct clientProduct; - - @ManagerMapping(value = "/{clientMoniker}/list", method = RequestMethod.GET, role = ManagerRole.ADMIN) - public List listProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return clientProduct.listClientMcc(manager, clientMoniker); - } - - @ManagerMapping(value = "/list",method = RequestMethod.GET,role = ManagerRole.ADMIN) - public JSONObject listSysProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ProductBean productBean){ - return clientProduct.listAllProduct(manager,productBean); - } - - @ManagerMapping(value = "",method = RequestMethod.POST,role = ManagerRole.ADMIN) - public void saveProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ProductBean productBean, Errors errors){ - HttpUtils.handleValidErrors(errors); - clientProduct.saveProduct(manager,productBean); - } - - @ManagerMapping(value = "/update", method = RequestMethod.PUT, role = ManagerRole.ADMIN) - public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject mccInfo, Errors errors) { - HttpUtils.handleValidErrors(errors); - clientProduct.updateMerchantMccInfo(manager, mccInfo); - } - - @ManagerMapping(value = "/{commodity_id}/delete",method = RequestMethod.POST,role = ManagerRole.ADMIN) - public void deleteProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String commodity_id){ - clientProduct.deleteProduct(manager,commodity_id); - } - - @ManagerMapping(value = "/importExcel",method = RequestMethod.PUT,role = ManagerRole.ADMIN) - public void importExcelToDb(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject source){ - clientProduct.importExcelToDb(null,manager,source.getString("source_agree_file")); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/product/web/PartnerProductController.java b/src/main/java/au/com/royalpay/payment/manage/product/web/PartnerProductController.java deleted file mode 100644 index 987585296..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/product/web/PartnerProductController.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.product.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.product.beans.ProductBean; -import au.com.royalpay.payment.manage.product.core.ClientProduct; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Created by yuan on 2017/11/24. - */ -@Controller -@RequestMapping("/client/product") -public class PartnerProductController { - - @Resource - private ClientProduct clientProduct; - - @ManagerMapping(value = "/{client_moniker}/list",method = RequestMethod.GET,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.BD_USER}) - @ResponseBody - public JSONObject listProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_moniker, ProductBean productBean){ - productBean.setClient_moniker(client_moniker); - return clientProduct.listAllProduct(manager,productBean); - } - - @ManagerMapping(value = "/{client_moniker}",method = RequestMethod.POST,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.BD_USER}) - @ResponseBody - public void saveProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_moniker, @RequestBody @Valid ProductBean productBean, Errors errors){ - productBean.setClient_moniker(client_moniker); - HttpUtils.handleValidErrors(errors); - clientProduct.saveProduct(manager,productBean); - } - - @ManagerMapping(value = "",method = RequestMethod.PUT,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.BD_USER}) - @ResponseBody - public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ProductBean productBean, Errors errors){ - HttpUtils.handleValidErrors(errors); - clientProduct.updateProduct(manager,productBean); - } - - @ManagerMapping(value = "/{commodity_id}/delete",method = RequestMethod.POST,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.BD_USER}) - @ResponseBody - public void deleteProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String commodity_id){ - clientProduct.deleteProduct(manager,commodity_id); - } - - @ManagerMapping(value = "/{client_moniker}/importExcel",method = RequestMethod.PUT,role = {ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.BD_USER}) - @ResponseBody - public void importExcelToDb(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String client_moniker, @RequestBody JSONObject source){ - clientProduct.importExcelToDb(client_moniker,manager,source.getString("source_agree_file")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/promotion/package-info.java b/src/main/java/au/com/royalpay/payment/manage/promotion/package-info.java deleted file mode 100644 index d9087d042..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/promotion/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Created by wangning on 2017/12/21. - */ -package au.com.royalpay.payment.manage.promotion; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/promotion/web/PromotionRootController.java b/src/main/java/au/com/royalpay/payment/manage/promotion/web/PromotionRootController.java deleted file mode 100644 index f271b174c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/promotion/web/PromotionRootController.java +++ /dev/null @@ -1,70 +0,0 @@ -package au.com.royalpay.payment.manage.promotion.web; - -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.AliOauthType; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.permission.alipay.AlipayMapping; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import java.io.IOException; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -/** - * Created by yixian on 2016-12-16. - */ -@Controller -@RequestMapping("/promotions") -public class PromotionRootController { - @Resource - private ClientManager clientManager; - - @WechatMapping(value = "/clients/{clientMoniker}", method = RequestMethod.GET, oauthType = WxOauthType.USERINFO, addonMp = {RedpackWechatApiImpl.class}) - public ModelAndView clientPromotionRoot(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) { - ModelAndView model = new ModelAndView("promotion"); - model.addObject("clientMoniker", clientMoniker); - return model; - } - - @AlipayMapping(value = "/clients/{clientMoniker}/alipay",method = RequestMethod.GET,oauthType = AliOauthType.USERINFO) - public ModelAndView clientPromotionAlipay(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.ALIUSER) JSONObject aliUserInfo){ - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client Not Exists"); - } - - ModelAndView model = new ModelAndView("promotion_alipay"); - model.addObject("clientMoniker", clientMoniker); - return model; - } - - @GetMapping("/clients/{clientMoniker}/aggregate") - public void clientPromotionRoot(@PathVariable String clientMoniker, @RequestHeader("User-Agent") String userAgent, HttpServletResponse response) { - String url = null; - if (userAgent.toLowerCase().contains("alipayclient") ) { - url ="/promotions/clients/"+clientMoniker+"/alipay"; - - } - if(StringUtils.isEmpty(url)) { - throw new BadRequestException("请使用支付宝客户端扫描当前二维码"); - }else { - try { - response.sendRedirect(url); - } catch (IOException e) { - } - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java deleted file mode 100644 index fd8e7e733..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.pushMessage; - -import com.alibaba.fastjson.JSONObject; -import com.notnoop.apns.APNS; -import com.notnoop.apns.ApnsService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Created by wangning on 2018/1/3. - */ -@Service -public class APNSMessageHelper { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Value("${apple.message.apns.file:classpath:apple_message_cert_dev.p12}") - private Resource appleApnsFile; - @Value("${apple.message.apns.password}") - private String appleMessagePassword; - - public void sendAppleMessage(String title, String body, String token, JSONObject data, JSONObject type) throws IOException { - /**设置参数,发送数据**/ - try (InputStream keyIns = appleApnsFile.getInputStream()) { - ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); - String payload = APNS.newPayload().alertTitle(title).alertBody(body).badge(1).sound("default").customField("data", data).customField("type", type).build(); - service.push(token, payload); - logger.debug("推送信息已发送!"); - } - } - - public void sendAppleMessageDetail(String title, String body, String token, JSONObject data, JSONObject type) throws IOException { - /**设置参数,发送数据**/ - try (InputStream keyIns = appleApnsFile.getInputStream()) { - ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); - String payload = APNS.newPayload().alertTitle(title).alertBody(body).category("myNotificationCategory").badge(1).sound("default").customField("data", data).customField("type", type).build(); - service.push(token, payload); - logger.debug("推送信息已发送!"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/JpushMessageHelper.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/JpushMessageHelper.java deleted file mode 100644 index 337233c8e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/JpushMessageHelper.java +++ /dev/null @@ -1,97 +0,0 @@ -package au.com.royalpay.payment.manage.pushMessage; - -import au.com.royalpay.payment.manage.pushMessage.bean.JpushMessage; - -import com.alibaba.fastjson.JSONObject; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.util.Map; - -import cn.jiguang.common.resp.APIConnectionException; -import cn.jiguang.common.resp.APIRequestException; -import cn.jpush.api.JPushClient; -import cn.jpush.api.push.model.Options; -import cn.jpush.api.push.model.Platform; -import cn.jpush.api.push.model.PushPayload; -import cn.jpush.api.push.model.audience.Audience; -import cn.jpush.api.push.model.notification.AndroidNotification; -import cn.jpush.api.push.model.notification.Notification; - -/** - * Created by wangning on 2018/1/3. - */ -@Service -public class JpushMessageHelper { - Logger logger = LoggerFactory.getLogger(getClass()); - - // 推送文本最大长度 - private final Integer NOTIFICATION_MAX_LENGTH = 54; - private static JPushClient client = null; - - private JPushClient getPush() { - if (client == null) { - client = new JPushClient("c235e93f6b91abd72ca5d74e", "c235e93f6b91abd72ca5d74e"); - } - return client; - } - - public void sendAppleMessage(String title, String body, String token, JSONObject data, JSONObject type) throws IOException, APIConnectionException, APIRequestException { - JPushClient jPushClient= getPush(); - JpushMessage jpushMessage = new JpushMessage(); - jpushMessage.setTitle(title); - jpushMessage.setText(body); - JSONObject param = new JSONObject(); - param.put("data",data); - param.put("type",type); - jpushMessage.setParams(param); - PushPayload pushPayload = generateSinglePayload(token,jpushMessage); - jPushClient.sendPush(pushPayload); - } - - private PushPayload generateSinglePayload(String alias, JpushMessage pushMessage) { - Notification notify = getNotify(pushMessage); - return PushPayload.newBuilder().setPlatform(Platform.android()).setAudience(Audience.alias(alias)).setNotification(notify) - // 设置离线时长 - .setOptions(Options.newBuilder().setTimeToLive(60 * 60 * 4).build()).build(); - } - - private Notification getNotify(JpushMessage pushMessage) { - String alert = getText(pushMessage); - return Notification.newBuilder().addPlatformNotification( - AndroidNotification.newBuilder().setTitle(pushMessage.getTitle()).setAlert(alert).addExtras(getExtra(pushMessage)).build()).build(); - } - - private String getText(JpushMessage pushMessage) { - String text = pushMessage.getText(); - int length = text.length(); - int trueLength = 0; - String cutString = ""; - for (int i = 0; i < length; i++) { - char c = text.charAt(i); - - if (c < 0 || c > 128) { - // 汉字 3个字符 - trueLength += 3; - } else { - // 英文等 1个字符 - trueLength++; - } - - cutString += c; - if (trueLength >= NOTIFICATION_MAX_LENGTH) { - cutString += "..."; - break; - } - } - return cutString; - } - - private Map getExtra(JpushMessage message) { - Map map = message.getParams(); - return map; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/AppManagerMessageBuilder.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/AppManagerMessageBuilder.java deleted file mode 100644 index f008f7d6d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/AppManagerMessageBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.pushMessage.bean; - -import au.com.royalpay.payment.tools.device.message.AppMessage; -import au.com.royalpay.payment.tools.device.message.AppMessageBuilder; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by wangning on 08/01/2018. - */ -public class AppManagerMessageBuilder implements AppMessageBuilder { - private JSONObject managerMsg; - - public AppManagerMessageBuilder(JSONObject managerMsg) { - this.managerMsg = managerMsg; - } - - @Override - public AppMessage buildMessage() { - return new AppMessage(managerMsg.getString("msgType"), managerMsg.getString("title"), managerMsg.getString("body")).setTypeData(managerMsg.getJSONObject("type")).setData(managerMsg.getJSONObject("data")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/AppMessageType.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/AppMessageType.java deleted file mode 100644 index cb46702ba..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/AppMessageType.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.pushMessage.bean; - -/** - * Create by davep at 2019-10-23 17:11 - */ -public enum AppMessageType { - PAYMENT, - REFUND, - NOTICE, - RISK, - CLEAN, - CASHBACK, - DAILY_NOTICE, - ANNUAL_BILL, - MESSAGE -} diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/JpushMessage.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/JpushMessage.java deleted file mode 100644 index b74e8a993..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/bean/JpushMessage.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.pushMessage.bean; - -import com.alibaba.fastjson.JSONObject; - -public class JpushMessage implements java.io.Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 消息标题 - */ - private String title; - - /** - * 消息内容 - */ - private String text; - - private JSONObject params; - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public JSONObject getParams() { - return params; - } - - public void setParams(JSONObject params) { - this.params = params; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/ActBean.java b/src/main/java/au/com/royalpay/payment/manage/redpack/beans/ActBean.java deleted file mode 100644 index 7398d191a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/ActBean.java +++ /dev/null @@ -1,128 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -public class ActBean { - private String act_name; - private ActTypeEnum act_type = ActTypeEnum.partner; - private BigDecimal rule_order_total; - private double rule_order_rate; - private int rule_partner_max_num; - private int rule_share_num; - private int status=0; - private BigDecimal rule_max_lucky_money; - private int probability; - private BigDecimal rule_total_lucky_money; - private List prize_type_list; - private String blacklist; - - public JSONObject toJson(){ - JSONObject res = (JSONObject) JSON.toJSON(this); - res.put("act_type",act_type.toString()); - return res; - } - - - public String getAct_name() { - return act_name; - } - - public void setAct_name(String act_name) { - this.act_name = act_name; - } - - public BigDecimal getRule_order_total() { - return rule_order_total; - } - - public void setRule_order_total(BigDecimal rule_order_total) { - this.rule_order_total = rule_order_total; - } - - public double getRule_order_rate() { - return rule_order_rate; - } - - public void setRule_order_rate(double rule_order_rate) { - this.rule_order_rate = rule_order_rate; - } - - public int getRule_partner_max_num() { - return rule_partner_max_num; - } - - public void setRule_partner_max_num(int rule_partner_max_num) { - this.rule_partner_max_num = rule_partner_max_num; - } - - public int getRule_share_num() { - return rule_share_num; - } - - public void setRule_share_num(int rule_share_num) { - this.rule_share_num = rule_share_num; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public BigDecimal getRule_max_lucky_money() { - return rule_max_lucky_money; - } - - public void setRule_max_lucky_money(BigDecimal rule_max_lucky_money) { - this.rule_max_lucky_money = rule_max_lucky_money; - } - - public int getProbability() { - return probability; - } - - public void setProbability(int probability) { - this.probability = probability; - } - - public BigDecimal getRule_total_lucky_money() { - return rule_total_lucky_money; - } - - public void setRule_total_lucky_money(BigDecimal rule_total_lucky_money) { - this.rule_total_lucky_money = rule_total_lucky_money; - } - - public ActTypeEnum getAct_type() { - return act_type; - } - - public void setAct_type(ActTypeEnum act_type) { - this.act_type = act_type; - } - - public List getPrize_type_list() { - return prize_type_list; - } - - public void setPrize_type_list(List prize_type_list) { - this.prize_type_list = prize_type_list; - } - - public String getBlacklist() { - return blacklist; - } - - public void setBlacklist(String blacklist) { - this.blacklist = blacklist; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/ActTypeEnum.java b/src/main/java/au/com/royalpay/payment/manage/redpack/beans/ActTypeEnum.java deleted file mode 100644 index c6acdb1ab..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/ActTypeEnum.java +++ /dev/null @@ -1,8 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.beans; - -/** - * Created by yishuqian on 15/12/2016. - */ -public enum ActTypeEnum { - partner,redpack -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/CustomerRedpackActBean.java b/src/main/java/au/com/royalpay/payment/manage/redpack/beans/CustomerRedpackActBean.java deleted file mode 100644 index cf9b1a460..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/CustomerRedpackActBean.java +++ /dev/null @@ -1,71 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import java.math.BigDecimal; -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -public class CustomerRedpackActBean { - private String act_name; - private BigDecimal rule_order_total; - private int rule_max_num; - private int rule_max_num_limit; - private int status=0; - private List prize_type_list; - - public JSONObject toJson(){ - return (JSONObject) JSON.toJSON(this); - } - - public String getAct_name() { - return act_name; - } - - public void setAct_name(String act_name) { - this.act_name = act_name; - } - - public BigDecimal getRule_order_total() { - return rule_order_total; - } - - public void setRule_order_total(BigDecimal rule_order_total) { - this.rule_order_total = rule_order_total; - } - - public int getRule_max_num() { - return rule_max_num; - } - - public void setRule_max_num(int rule_max_num) { - this.rule_max_num = rule_max_num; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public List getPrize_type_list() { - return prize_type_list; - } - - public void setPrize_type_list(List prize_type_list) { - this.prize_type_list = prize_type_list; - } - - public int getRule_max_num_limit() { - return rule_max_num_limit; - } - - public void setRule_max_num_limit(int rule_max_num_limit) { - this.rule_max_num_limit = rule_max_num_limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/RedpackConfigBean.java b/src/main/java/au/com/royalpay/payment/manage/redpack/beans/RedpackConfigBean.java deleted file mode 100644 index 7ae29c907..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/RedpackConfigBean.java +++ /dev/null @@ -1,115 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.beans; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.Range; - -import javax.validation.constraints.NotEmpty; - -/** - * Created by davep on 2016-08-03. - */ -public class RedpackConfigBean { - @JSONField(name = "send_name") - @NotEmpty(message = "error.payment.valid.param_missing") - @Length(max = 32, message = "send name shall be no more than 32 characters") - private String sendName; - @JSONField(name = "act_name") - @NotEmpty(message = "error.payment.valid.param_missing") - @Length(max = 32, message = "activity name shall be no more than 32 characters") - private String actName; - @NotEmpty(message = "error.payment.valid.param_missing") - @Length(max = 128, message = "wishing shall be no more than 128 characters") - private String wishing; - @NotEmpty(message = "error.payment.valid.param_missing") - @Length(max = 256, message = "remark shall be no more than 256 characters") - private String remark; - @JSONField(name = "daily_limit") - private int dailyLimit = 99; - @JSONField(name = "min_payment") - private double minPayment = 0; - @JSONField(name = "min_amount") - @Range(max = 200, min = 1, message = "redpack amount shall between CNY 1 and CNY 200") - private double minAmount = 1; - @JSONField(name = "max_amount") - @Range(max = 200, min = 1, message = "redpack amount shall between CNY 1 and CNY 200") - private double maxAmount = 20000; - private boolean enabled = false; - - public String getSendName() { - return sendName; - } - - public void setSendName(String sendName) { - this.sendName = sendName; - } - - public String getActName() { - return actName; - } - - public void setActName(String actName) { - this.actName = actName; - } - - public String getWishing() { - return wishing; - } - - public void setWishing(String wishing) { - this.wishing = wishing; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public double getMinPayment() { - return minPayment; - } - - public void setMinPayment(double minPayment) { - this.minPayment = minPayment; - } - - public double getMinAmount() { - return minAmount; - } - - public void setMinAmount(double minAmount) { - this.minAmount = minAmount; - } - - public double getMaxAmount() { - return maxAmount; - } - - public void setMaxAmount(double maxAmount) { - this.maxAmount = maxAmount; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public int getDailyLimit() { - return dailyLimit; - } - - public void setDailyLimit(int dailyLimit) { - this.dailyLimit = dailyLimit; - } - - public JSONObject toJSON() { - return (JSONObject) JSONObject.toJSON(this); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/RedpackQuery.java b/src/main/java/au/com/royalpay/payment/manage/redpack/beans/RedpackQuery.java deleted file mode 100644 index bbad4bfb5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/beans/RedpackQuery.java +++ /dev/null @@ -1,150 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; -import java.util.Date; - -/** - * redpack query - * Created by davep on 2016-08-03. - */ -public class RedpackQuery { - private static final String[] DATE_PATTERNS = {"yyyyMMdd", "yyyy-MM-dd"}; - private String from; - private String to; - private String event_date; - private String short_name; - private String client_moniker; - private String nickname; - private String org_id; - private Integer bd; - private int page = 1; - private int limit = 20; - - public JSONObject params() { - JSONObject param = new JSONObject(); - if (from != null) { - try { - Date fromDate = DateUtils.parseDate(from, DATE_PATTERNS); - param.put("from", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("from", "error.payment.valid.invalid_date_format"); - } - } - if (to != null) { - try { - Date fromDate = DateUtils.addDays(DateUtils.parseDate(to, DATE_PATTERNS), 1); - param.put("to", fromDate); - } catch (ParseException e) { - throw new ParamInvalidException("to", "error.payment.valid.invalid_date_format"); - } - } - if (event_date != null){ - try { - Date eventDate = DateUtils.parseDate(event_date, DATE_PATTERNS); - param.put("event_date", eventDate); - } catch (ParseException e) { - throw new ParamInvalidException("event_date", "error.payment.valid.invalid_date_format"); - } - } - if (StringUtils.isNotEmpty(short_name)){ - param.put("short_name",short_name); - } - if (StringUtils.isNotEmpty(client_moniker)){ - param.put("client_moniker",client_moniker); - } - if (StringUtils.isNotEmpty(nickname)){ - param.put("nickname",nickname); - } - if (StringUtils.isNotEmpty(org_id)){ - param.put("org_id",org_id); - } - if (bd != null){ - param.put("bd_user", bd); - } - return param; - } - - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String getTo() { - return to; - } - - public void setTo(String to) { - this.to = to; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getEvent_date() { - return event_date; - } - - public void setEvent_date(String event_date) { - this.event_date = event_date; - } - - public String getNickname() { - return nickname; - } - - public void setNickname(String nickname) { - this.nickname = nickname; - } - - public String getShort_name() { - return short_name; - } - - public void setShort_name(String short_name) { - this.short_name = short_name; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public Integer getBd() { - return bd; - } - public void setBd(Integer bd) { - this.bd = bd; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/ActRedPackProcessor.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/ActRedPackProcessor.java deleted file mode 100644 index 99cc611a0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/ActRedPackProcessor.java +++ /dev/null @@ -1,67 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core; - -import au.com.royalpay.payment.core.beans.PreOrderRequest; -import au.com.royalpay.payment.core.beans.coupon.CouponInfo; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.core.events.RefundSendEvent; -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.core.processors.PaymentProcessor; -import com.alibaba.fastjson.JSONObject; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -@Service -public class ActRedPackProcessor implements PaymentProcessor { - private static final String COUPON_ID = "customer_redpack"; - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ActRedPackService actRedPackService; - - @Override - public String processorId() { - return COUPON_ID + "_USE"; - } - - @Override - public void handleBeforeOrderSending(PreOrderRequest paymentInfo, JSONObject order) { - - } - - @Override - public void handleAfterOrderPaid(PaymentFinishedEvent finishedEvent) { - JSONObject order = finishedEvent.getOrder(); - try { - actRedPackService.sendActRedPackets(order); - } catch (RedPackException e) { - logger.error("Failed to send ActRedPack:", e); - } - } - - @Override - public void registerCoupon(JSONObject client, String customerOpenId, String channel, List coupons) { - - } - - @Override - public void handleAfterRefund(RefundSendEvent event) { - - } - - @Override - public String registerBanner(JSONObject client, String channel) { - if ("Wechat".equals(channel)){ - if ("PBHO".equalsIgnoreCase(client.getString("client_moniker"))){ - return "https://file.royalpay.com.au/open/2017/08/11/1502449784207_Rou8wXBl4ygE4WQWLLiw9z42ZpKKJi.jpg"; - } - } - return null; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/ActRedPackService.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/ActRedPackService.java deleted file mode 100644 index f807f11f1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/ActRedPackService.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core; - -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -public interface ActRedPackService { - - JSONObject getById(String actId); - - void sendActRedPackets(JSONObject order) throws RedPackException; - - void doSendWechatActLuckyMoney(String open_id, String lock, String actName, String sendName, String wishing) throws RedPackException; - - void setRedpackConfg(String act_id, JSONObject config); - - void clearUnsend(String actId, String typeId); - - void receiveRedpackNotify(String redpackOrderId, JSONObject status, String sign, String timestamp); - - JSONObject listCustomerOrders(JSONObject params, int page, int limit); - - void resendFailed(); - - List getCustomerRedpackAnalysis(String act_id, RedpackQuery redpackQuery); - - JSONObject analysisCustomerLuckyMoney(JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/CustomerLMService.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/CustomerLMService.java deleted file mode 100644 index 785170ff4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/CustomerLMService.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by wangning on 08/12/2016. - */ -public interface CustomerLMService { - - JSONObject getActDetail(String act_id); - - void updateActivity(String act_id, JSONObject jsonObject) throws Exception; - - List getClientApplyWithDetail(String actId); - - void addClientApply(String act_id, String client_moniker, JSONObject params) throws Exception; - - void removeClientApply(String actId, String clientMoniker); - - JSONObject listActivities(int page, int limit); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/PartnerLMService.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/PartnerLMService.java deleted file mode 100644 index 4e92241f9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/PartnerLMService.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core; - -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -public interface PartnerLMService { - JSONObject addActivity(JSONObject jsonObject); - - void gengerateInvitationCode(String act_id); - - void updateActivity(String act_id, JSONObject jsonObject) throws Exception; - - JSONObject listActivities(JSONObject params, int page, int limit); - - List listActivitiesNoPage(); - - JSONObject getActDetail(String act_id); - - JSONObject listSendLogs(JSONObject params, int page, int limit); - - void addLuckMoneyList(String orderId, Double orderAmount, int client_id) throws RedPackException; - - String checkSignAndUpdateLuckyMoneyStatus(String timestamp, String sign, String redPacketId, JSONObject obj) throws Exception; - - void addPartnerAndWechatRelation(String act_id, String clientMoniker, JSONObject wechatInfo, String invitationCode) throws Exception; - - void addPartnerAndAlipayRelation(String act_id, String clientMoniker, JSONObject alipayInfo, String invitationCode) throws Exception; - - void deletePartnerRelation(String act_id, String customer_id, JSONObject partner, String channel); - - List getPartnerWechats(String act_id, String client_moniker); - - List listBindWechats(JSONObject params); - - JSONObject analysisLuckyMoney(JSONObject params); - - JSONObject checkBindStatus(String act_id, String clientMoniker, String customer_id, String channel); - - void exportInvitationCodesExcel(HttpServletResponse httpResponse, String act_id) throws IOException; - - String getInvitationCode(String actId, String clientMoniker); - - JSONObject getPartnersBinds(String act_id, RedpackQuery redpackQuery); - - JSONObject listActClients(JSONObject manager, PartnerQuery query, String act_id, String channel); - - List listBindsErrorClients(JSONObject manager, JSONObject params); - - List getSendLogsAnalysis(String act_id, RedpackQuery redpackQuery); - - JSONObject getClientsRedPackRanking(String act_id, RedpackQuery query); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/RedpackService.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/RedpackService.java deleted file mode 100644 index 6df749f8b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/RedpackService.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core; - -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.redpack.beans.RedpackConfigBean; -import com.alibaba.fastjson.JSONObject; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; - -/** - * Created by davep on 2016-08-03. - */ -public interface RedpackService { - - JSONObject getConfigDetail(String clientMoniker); - - @Transactional - void modifyRedpack(String clientMoniker, RedpackConfigBean config); - - @Transactional - void setConfigEnable(String clientMoniker, boolean enable); - - @Transactional - void checkAndSendRedpack(int clientId, String orderOpenId, String orderId, double paidAmount); - - JSONObject listRedpackLogs(String clientMoniker, JSONObject params, int page, int limit); - - void setRedpackConfg(String act_id, JSONObject config); - - void sendLuckyMoney(String orderId, BigDecimal orderAmount, int client_id) throws RedPackException; - - void sendAlipayLuckyMoney(String orderId, BigDecimal orderAmount, int client_id) throws RedPackException; - - void doSendLuckyMoney(String open_id, String lock, String actName) throws RedPackException; - - void doSendAlipayLuckyMoney(String alipayUserId, String lock, int count, BigDecimal rate) throws RedPackException; - - void updateRedPacketsStatus(String act_id); - - void updateAlipayRedPacketsStatus(String act_id); - - void clearUnsend(String actId, String typeId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java deleted file mode 100644 index 29a0c1170..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java +++ /dev/null @@ -1,325 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core.impls; - -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.mappers.redpack.ActClientApplyMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActPrizeTypeCustomerMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActRedPacketsCustomerMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActRedPacketsCustomerOrdersMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import au.com.royalpay.payment.manage.redpack.core.ActRedPackService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.RandomUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * Created by wangning on 2017/8/10. - */ -@Service -public class ActRedPackServiceImpl implements ActRedPackService { - private Logger logger = LoggerFactory.getLogger(getClass()); - private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - @Resource - private ActPrizeTypeCustomerMapper actPrizeTypeCustomerMapper; - @Resource - private ActRedPacketsCustomerOrdersMapper actRedPacketsCustomerOrdersMapper; - @Resource - private TransactionService transactionService; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private CustomerMapper customerMapper; - @Resource - private ActRedPacketsCustomerMapper actRedPacketsCustomerMapper; - @Resource - private ActClientApplyMapper actClientApplyMapper; - @Value("${app.mpsupport.appid}") - private String mpSupportAppId; - @Value("${app.mpsupport.auth_code}") - private String mpSupportAuthCode; - - private int getRedPacketsByOpenid(String openid, Date date, String actId) { - return actRedPacketsCustomerOrdersMapper.getRedPacketsByOpenid(openid, date, actId); - } - - @Override - public JSONObject getById(String actId) { - return actRedPacketsCustomerMapper.findOne(actId); - } - - @Override - public void sendActRedPackets(JSONObject order) throws RedPackException { - String orderId = order.getString("order_id"); - int clientId = order.getIntValue("client_id"); - String channel = order.getString("channel"); - String currency = order.getString("currency"); - List currentActivities = actRedPacketsCustomerMapper.findCurrentActivity(); - if (currentActivities.isEmpty()) { - logger.info("当前没有可用活动"); - return; - } - JSONObject redpackCustomerActivity = currentActivities.get(0); - String actId = redpackCustomerActivity.getString("act_id"); - String actName = redpackCustomerActivity.getString("act_name"); - JSONObject clientApply = actClientApplyMapper.findActivity(actId, clientId); - if (clientApply == null) { - logger.info("未检索到商户申请信息"); - return; - } - logger.info("<<<======== [{}]红包发送检查--商户[{}]--订单编号:{} ========>>>",actName,clientId,orderId); - String actChannel = redpackCustomerActivity.getString("channel"); - if (!StringUtils.isEmpty(actChannel)) { - if (!actChannel.equals(channel)) { - logger.info("与活动" + actName + "要求的支付方式不符"); - return; - } - } - String actCurrency = redpackCustomerActivity.getString("currency"); - if (!StringUtils.isEmpty(actCurrency)) { - if (!actCurrency.equals(currency)) { - logger.info("与活动" + actName + "要求的支付币种不符"); - return; - } - } - BigDecimal ruleOrderTotal = redpackCustomerActivity.getBigDecimal("rule_order_total"); - BigDecimal currencyAmount = order.getBigDecimal("customer_payment_amount"); - if ("CNY".equals(currency)) { - JSONObject income = transactionService.findIncomeByOrderId(orderId); - BigDecimal exchange = income.getBigDecimal("exchange_rate"); - currencyAmount = exchange.multiply(currencyAmount).setScale(2, RoundingMode.HALF_UP); - } - if (ruleOrderTotal != null) { - if (!(currencyAmount.compareTo(ruleOrderTotal) >= 0)) { - logger.info("订单金额不满足 [{}] 红包活动要求金额",actName); - return; - } - } - - String customerId = order.getString("customer_id"); - - int getTotalCounts = getRedPacketsByOpenid(customerId, new Date(), actId); - int ruleMaxNum = redpackCustomerActivity.getIntValue("rule_max_num"); - if (getTotalCounts >= ruleMaxNum) { - logger.debug("customerId:" + customerId + "已达到本次 [{}] 红包活动发送最大次数" + ruleMaxNum + "!跳过",actName); - return; - } - - int getDailyTotalCounts = getRedPacketsByOpenid(customerId, new Date(), actId); - int ruleMaxNumLimit = redpackCustomerActivity.getIntValue("rule_max_num_limit"); - if (getDailyTotalCounts >= ruleMaxNumLimit) { - logger.debug("customerId:" + customerId + "已达 [{}] 红包活动当日发送最大次数" + ruleMaxNumLimit + "!跳过",actName); - return; - } - - takeRedpack(actId, orderId, clientId, clientApply, currencyAmount, customerId,actName, 0); - - } - - private void takeRedpack(String actId, String orderId, int clientId, JSONObject clientApply, BigDecimal currencyAmount, String customerId, String actName, int tryTimes) - throws RedPackException { - if (tryTimes > 5) { - return; - } - int random = (int) (Math.random() * 100); - if (random > 80) { - logger.info("未达到 [{}] 红包活动触发概率,当前概率为:" + random, actName); - return; - } - - List prizeTypes = actPrizeTypeCustomerMapper.listAvailableTypes(actId); - Collections.shuffle(prizeTypes); - int totalWeight = 0; - for (JSONObject prizeType : prizeTypes) { - totalWeight += prizeType.getIntValue("weight"); - } - int ran = RandomUtils.nextInt(0, totalWeight); - - for (JSONObject prizeType : prizeTypes) { - ran -= prizeType.getIntValue("weight"); - if (ran < 0) { - String lock = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(5, true, true); - int lockedCount = actRedPacketsCustomerOrdersMapper.lockPrize(actId, lock, prizeType.getString("type_id"), customerId, clientId, orderId, - currencyAmount, new Date()); - if (lockedCount > 0) { - doSendWechatActLuckyMoney(customerId, lock, clientApply.getString("act_name"), clientApply.getString("send_name"), clientApply.getString("wishing")); - break; - } else { - takeRedpack(actId, orderId, clientId, clientApply, currencyAmount, customerId, actName, tryTimes + 1); - break; - } - } - } - } - - @Override - public void doSendWechatActLuckyMoney(String paymentOpenId, String lock, String actName, String sendName, String wishing) throws RedPackException { - logger.info("开始给支付用户 [{}] 发送 [{}--{}]红包", paymentOpenId, actName, lock); - JSONObject prizeDetail = actRedPacketsCustomerOrdersMapper.findLockedPrize(lock, paymentOpenId); - BigDecimal luckyMoeny = prizeDetail.getBigDecimal("red_packet_amount"); - String redPackOrderId = prizeDetail.getString("red_packet_order_id"); - String notifyUrl = PlatformEnvironment.getEnv().concatUrl("/sys/lucky_money/customer/redpacks/" + redPackOrderId + "/notify"); - JSONObject customerRelation = customerMapper.findCustomerByOpenId(paymentOpenId); - if (customerRelation == null) { - customerRelation = customerMapper.findCustomerGlobalpayByOpenId(paymentOpenId); - if (customerRelation == null) { - throw new NotFoundException("Customer openid for redpack not available!"); - } - } - MpWechatApi redpackApi = mpWechatApiProvider.getApi("redpack"); - if (customerRelation.getString(redpackApi.getOpenIdKey()) == null) { - throw new RedPackException("Server Error", "Red envelope service temporarily unavailable!"); - } - String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); - WechatRedpack wechatRedpack = new WechatRedpack(); - wechatRedpack.setActName(actName); - wechatRedpack.setAmount(luckyMoeny); - wechatRedpack.setNotifyUrl(notifyUrl); - wechatRedpack.setOpenId(rpOpenId); - wechatRedpack.setSendName(sendName); - wechatRedpack.setWishing(wishing); - wechatRedpack.setRemark(sendName); - logger.info("==============Send RedPacket Service:" + wechatRedpack.toString() + "========="); - String redPacketId = redpackApi.sendRedpack(wechatRedpack).getString("out_biz_no"); - prizeDetail.put("red_packet_id", redPacketId); - prizeDetail.put("status", 1); - actRedPacketsCustomerOrdersMapper.update(prizeDetail); - logger.info("支付用户 [{}] 发送 [{}--{}] 红包结束", paymentOpenId, actName, lock); - } - - @Override - public void setRedpackConfg(String actId, JSONObject config) { - Date prizeDate = new Date(); - List prizeTypeList = (List) config.get("prize_type_list"); - JSONObject act = actRedPacketsCustomerMapper.findOne(actId); - Assert.notNull(act); - config.put("act_id", actId); - actRedPacketsCustomerMapper.update(config); - - for (JSONObject prizeType : prizeTypeList) { - actPrizeTypeCustomerMapper.update(prizeType); - String typeId = prizeType.getString("type_id"); - BigDecimal amountFrom = prizeType.getBigDecimal("price_value_from"); - BigDecimal amountTo = prizeType.getBigDecimal("price_value_to"); - int redpackCounts = prizeType.getIntValue("redpack_counts"); - if (redpackCounts > 0) { - for (int i = 0; i < redpackCounts; i++) { - BigDecimal amount = amountFrom.equals(amountTo) ? amountFrom - : amountFrom.add(BigDecimal.valueOf(RandomUtils.nextInt(0, amountTo.subtract(amountFrom).multiply(CommonConsts.HUNDRED).intValue())) - .divide(CommonConsts.HUNDRED, 2, RoundingMode.DOWN)); - JSONObject prize = new JSONObject(); - String prefix = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS"); - String redpackOrderId = prefix + RandomStringUtils.random(28 - prefix.length(), true, true); - prize.put("red_packet_customer_order_id", redpackOrderId); - prize.put("act_id", actId); - prize.put("red_packet_amount", amount); - prize.put("red_pack_type_id", typeId); - prize.put("create_time", prizeDate); - actRedPacketsCustomerOrdersMapper.saveLog(prize); - } - } - } - - } - - @Override - public void clearUnsend(String actId, String typeId) { - actRedPacketsCustomerOrdersMapper.clearUnsendRedpacks(actId, typeId); - } - - @Override - public void receiveRedpackNotify(String redpackOrderId, JSONObject status, String sign, String timestamp) { - String signBase = mpSupportAppId + "/sys/lucky_money/customer/redpacks/" + redpackOrderId + "/notify" + timestamp + mpSupportAuthCode; - - if (!DigestUtils.sha256Hex(signBase).toLowerCase().equals(sign)) { - throw new ForbiddenException("Sign Error"); - } - - JSONObject redpackOrder = actRedPacketsCustomerOrdersMapper.findByRedpackOrderId(redpackOrderId); - if (redpackOrder == null) { - throw new NotFoundException(); - } - - redpackOrder.put("status", status.getIntValue("status")); - actRedPacketsCustomerOrdersMapper.update(redpackOrder); - - JSONObject clientApply = actClientApplyMapper.findActivity(redpackOrder.getString("act_id"), redpackOrder.getIntValue("client_id'")); - if (clientApply == null) { - logger.error("红包回调时未找到商户申请信息"); - return; - } - } - - @Override - public JSONObject listCustomerOrders(JSONObject params, int page, int limit) { - PageList activities = actRedPacketsCustomerOrdersMapper.listOrders(params, new PageBounds(page, limit)); - return PageListUtils.buildPageListResult(activities); - } - - @Override - - public void resendFailed() { - List currentActivities = actRedPacketsCustomerMapper.findCurrentActivity(); - if (currentActivities.isEmpty()) { - logger.info("当前没有可用活动"); - return; - } - for (JSONObject act : currentActivities) { - final String actId = act.getString("act_id"); - List unsend = actRedPacketsCustomerOrdersMapper.listUnsend(actId, DateUtils.addMinutes(new Date(), -5)); - for (final JSONObject redpack : unsend) { - pool.execute(() -> { - JSONObject clientApply = actClientApplyMapper.findActivity(actId, redpack.getIntValue("client_id")); - try { - doSendWechatActLuckyMoney(redpack.getString("open_id"), redpack.getString("lock_key"), clientApply.getString("act_name"), - clientApply.getString("send_name"), clientApply.getString("wishing")); - } catch (RedPackException e) { - e.printStackTrace(); - } - }); - } - } - } - - @Override - public List getCustomerRedpackAnalysis(String actId, RedpackQuery redpackQuery) { - JSONObject params = redpackQuery.params(); - params.put("act_id", actId); - return actRedPacketsCustomerOrdersMapper.getCustomerRedpackAnalysis(params); - } - - @Override - public JSONObject analysisCustomerLuckyMoney(JSONObject params) { - return actRedPacketsCustomerOrdersMapper.analysisCustomerLuckyMoney(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/CustomerLMServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/CustomerLMServiceImpl.java deleted file mode 100644 index 9e8147c21..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/CustomerLMServiceImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core.impls; - -import au.com.royalpay.payment.manage.mappers.redpack.ActClientApplyMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActPrizeTypeCustomerMapper; -import au.com.royalpay.payment.manage.mappers.redpack.ActRedPacketsCustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.redpack.core.ActRedPackService; -import au.com.royalpay.payment.manage.redpack.core.CustomerLMService; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by wangning on 08/12/2016. - */ -@Service -public class CustomerLMServiceImpl implements CustomerLMService { - - @Resource - private ActRedPacketsCustomerMapper actRedPacketsCustomerMapper; - - @Resource - private ClientManager clientManager; - - @Resource - private ActPrizeTypeCustomerMapper actPrizeTypeCustomerMapper; - - @Resource - private ActRedPackService actRedPackService; - - @Resource - private ActClientApplyMapper actClientApplyMapper; - - @Resource - private ClientMapper clientMapper; - - @Value("${app.mpsupport.appid}") - private String mpSupportAppId; - @Value("${app.mpsupport.auth_code}") - private String mpSupportAuthCode; - - @Override - public JSONObject getActDetail(String actId) { - JSONObject res = actRedPacketsCustomerMapper.findOne(actId); - if (res == null) { - throw new NotFoundException("Activity Not Found"); - } - List priceTypes = actPrizeTypeCustomerMapper.listPrizeTypes(actId); - res.put("prize_type_list", priceTypes); - return res; - } - - @Override - @Transactional - public void updateActivity(String actId, JSONObject act) throws Exception { - JSONObject actInfo = actRedPacketsCustomerMapper.findOne(actId); - Assert.notNull(actInfo); - actRedPackService.setRedpackConfg(actId, act); - } - - @Override - public List getClientApplyWithDetail(String actId) { - return actClientApplyMapper.listAttendClients(actId); - } - - @Override - public void addClientApply(String actId, String clientMoniker, JSONObject params) throws Exception { - JSONObject actRedpacket = actRedPackService.getById(actId); - if (actRedpacket == null) { - throw new NotFoundException("Please check the activity information"); - } - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Please check the partner information"); - } - JSONObject actClientApply = actClientApplyMapper.findActivity(actId, client.getIntValue("client_id")); - JSONObject record = new JSONObject(); - if (actClientApply != null) { - record.put("id", actClientApply.getString("id")); - } - record.put("client_id", client.getString("client_id")); - record.put("act_id", actId); - record.put("send_name", params.getString("send_name")); - record.put("act_name", params.getString("act_name")); - record.put("wishing", params.getString("wishing")); - if (record.containsKey("id")) { - actClientApplyMapper.update(record); - } else { - actClientApplyMapper.save(record); - } - } - - @Override - public void removeClientApply(String actId, String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("client not exists"); - } - actClientApplyMapper.remove(actId, client.getIntValue("client_id")); - } - - @Override - public JSONObject listActivities(int page, int limit) { - PageList activities = actRedPacketsCustomerMapper.listActivities(new JSONObject(), new PageBounds(page, limit)); - return PageListUtils.buildPageListResult(activities); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java deleted file mode 100644 index 4959a6a49..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java +++ /dev/null @@ -1,611 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core.impls; - -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.mappers.redpack.*; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.redpack.beans.ActTypeEnum; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import au.com.royalpay.payment.manage.redpack.core.PartnerLMService; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; -import java.util.Random; - -import static java.math.RoundingMode.DOWN; - -/** - * Created by yishuqian on 08/12/2016. - */ -@Service -public class PartnerLMServiceImp implements PartnerLMService { - - @Resource - private ActPartnerLMMapper actPartnerLMMapper; - - @Resource - private ActPartnerLMLogMapper actPartnerLMLogMapper; - - @Resource - private ClientManager clientManager; - - @Resource - private ClientMapper clientMapper; - - @Resource - private ActPartnerWechatRelationMapper actPartnerWechatRelationMapper; - - @Resource - private ActPrizeTypeMapper actPrizeTypeMapper; - - @Resource - private ActBlackListMapper actBlackListMapper; - - @Resource - private RedpackService redpackService; - - @Resource - private ActClientInvitationCodeMapper actClientInvitationCodeMapper; - - @Resource - private MpPaymentApi mpPaymentApi; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private CustomerMapper customerMapper; - - @Value("${app.mpsupport.appid}") - private String mpSupportAppId; - @Value("${app.mpsupport.auth_code}") - private String mpSupportAuthCode; - - - @Override - public JSONObject addActivity(JSONObject act) { - act.put("create_time", new Date()); - //只能有一个商户返现红包活动在被开启状态 - if (act.getString("act_type").equals(ActTypeEnum.partner.toString()) && act.getIntValue("status") == 1) { - actPartnerLMMapper.closePartnerActivities(); - } - actPartnerLMMapper.save(act); - gengerateInvitationCode(act.getString("act_id")); - return act; - } - - @Transactional - @Override - public void gengerateInvitationCode(String act_id) { - JSONObject act = actPartnerLMMapper.findOne(act_id); - Assert.notNull(act); - List clients = clientMapper.listClients(); - actClientInvitationCodeMapper.deleteInvitaionCode(act_id); - for (JSONObject client : clients) { - client.put("act_id", act_id); - client.put("invitation_code", RandomStringUtils.random(6, true, true).toUpperCase()); - actClientInvitationCodeMapper.save(client); - } - } - - - @Override - @Transactional - public void updateActivity(String act_id, JSONObject act) throws Exception { - JSONObject actInfo = actPartnerLMMapper.findOne(act_id); - Assert.notNull(actInfo); - if (act.containsKey("blacklist") && act.getString("blacklist") != null) { - actBlackListMapper.delete(act_id); - String[] bs = act.getString("blacklist").split(","); - for (String b : bs) { - JSONObject client = clientManager.getClientInfoByMoniker(b); - if (client != null) { - JSONObject bl = new JSONObject(); - bl.put("act_id", act_id); - bl.put("client_id", client.getIntValue("client_id")); - bl.put("short_name", client.getString("short_name")); - bl.put("partner_code", b); - actBlackListMapper.save(bl); - } - } - } - if (act.getString("act_type").equals(ActTypeEnum.partner.toString())) { - if (act.getIntValue("status") == 1 && actInfo.getIntValue("status") == 0) { - JSONObject params = new JSONObject(); - params.put("status", 1); - params.put("act_type", ActTypeEnum.partner.toString()); - List openList = actPartnerLMMapper.actList(params); - if (!openList.isEmpty()) { - throw new Exception("存在已经开启的红包返现活动,请先关闭旧的活动再开启新的活动"); - } - } - - act.put("act_id", act_id); - actPartnerLMMapper.update(act); - } else if (act.getString("act_type").equals(ActTypeEnum.redpack.toString())) { - redpackService.setRedpackConfg(act_id, act); - } - - - } - - @Override - public JSONObject listActivities(JSONObject params, int page, int limit) { - PageList list = actPartnerLMMapper.listActivities(params, new PageBounds(page, limit, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public List listActivitiesNoPage() { - return actPartnerLMMapper.listActivitiesNoPage(); - } - - @Override - public JSONObject getActDetail(String act_id) { - JSONObject res = actPartnerLMMapper.findOne(act_id); - if (res.getString("act_type").equals(ActTypeEnum.redpack.toString())) { - List prize_type_list = actPrizeTypeMapper.listPrizeTypes(act_id, new PageBounds(Order.formString("rate.desc ,weight.asc"))); - if (!prize_type_list.isEmpty()) { - for (JSONObject prize_type : prize_type_list) { - JSONObject params = new JSONObject(); - params.put("red_pack_type_id", prize_type.getString("type_id")); - params.put("act_id", act_id); - prize_type.putAll(analysisLuckyMoney(params)); - } - res.put("prize_type_list", prize_type_list); - } - } - List blackList = actBlackListMapper.listByActId(act_id); - if (blackList != null && !blackList.isEmpty()) { - String partnerCodes = ""; - for (JSONObject b : blackList) { - partnerCodes += b.getString("partner_code") + ","; - } - res.put("blacklist", partnerCodes.substring(0, partnerCodes.length() - 1)); - } - return res; - } - - @Override - public JSONObject listSendLogs(JSONObject params, int page, int limit) { - PageList list = actPartnerLMLogMapper.listSendLogs(params, new PageBounds(page, limit, Order.formString("event_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public void addLuckMoneyList(String orderId, Double orderAmount, int client_id) throws RedPackException { - JSONObject params = new JSONObject(); - params.put("act_type", ActTypeEnum.partner.toString()); - params.put("status", 1); - List actList = actPartnerLMMapper.actList(params); - if (!actList.isEmpty()) { - JSONObject act = actList.get(0); - String act_id = act.getString("act_id"); - BigDecimal rule_order_total = act.getBigDecimal("rule_order_total"); - BigDecimal rule_max_lucky_money = act.getBigDecimal("rule_max_lucky_money"); - int rule_partner_max_num = act.getIntValue("rule_partner_max_num"); - int probability = act.getIntValue("probability"); - Double rule_order_rate = act.getDouble("rule_order_rate"); - BigDecimal rule_total_lucky_money = act.getBigDecimal("rule_total_lucky_money"); - if (new BigDecimal(orderAmount).compareTo(rule_order_total) < 0) { - return; - } - //int random = new Random().nextInt(100); - int random = new Random().nextInt(100); - if (random > probability) { - return; - } - JSONObject logParam = new JSONObject(); - logParam.put("act_id", act_id); - logParam.put("client_id", client_id); - int lmCount = actPartnerLMLogMapper.count(logParam); - if (lmCount >= rule_partner_max_num) { - return; - } - Double max = new BigDecimal(orderAmount).multiply(new BigDecimal(rule_order_rate)).compareTo(rule_max_lucky_money) > 0 ? - rule_max_lucky_money.setScale(2, DOWN).doubleValue() : - new BigDecimal(orderAmount).multiply(new BigDecimal(rule_order_rate)).setScale(2, DOWN).doubleValue(); - - Double luckyMoney = max > 1 ? Math.random() * (max - 1) + 1 : 1; - BigDecimal nowTotal = actPartnerLMLogMapper.getTotalLuckyMoney(act_id); - Double total = nowTotal.add(new BigDecimal(luckyMoney)).doubleValue(); - if (total > rule_total_lucky_money.doubleValue()) { - return; - } - - JSONObject relationParams = new JSONObject(); - relationParams.put("act_id", act_id); - relationParams.put("client_id", client_id); - relationParams.put("channel", "Wechat"); - List relationList = actPartnerWechatRelationMapper.relationList(relationParams); - if (!relationList.isEmpty()) { - int accountSize = relationList.size(); - int randomAccount = new Random().nextInt(accountSize); - String open_id = relationList.get(randomAccount).getString("customer_id"); - JSONObject send = new JSONObject(); - send.put("act_id", act_id); - send.put("client_id", client_id); - send.put("red_packet_amount", luckyMoney); - send.put("open_id", open_id); - send.put("order_id", orderId); - send.put("order_amount", orderAmount); - send.put("create_time", new Date()); - String prefix = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS"); - String red_packet_order_id = prefix + RandomStringUtils.random(28 - prefix.length(), true, true); - send.put("red_packet_order_id", red_packet_order_id); - send.put("act_name", act.getString("act_name")); - - String sendName = "RoyalPay"; - String actName = act.getString("act_name"); - String wishing = "恭喜获得ROYALPAY红包奖励"; - String notifyUrl = PlatformEnvironment.getEnv().concatUrl("/sys/lucky_money/partner/" + red_packet_order_id + "notify"); - - WechatRedpack wechatRedpack = new WechatRedpack(); - JSONObject customerRelation = customerMapper.findCustomerByOpenId(open_id); - MpWechatApi redpackApi = mpWechatApiProvider.getApi("Redpack"); - if (customerRelation == null || customerRelation.getString(redpackApi.getOpenIdKey()) == null) { - throw new RedPackException("ServerError", "Customer openid for redpack not available!"); - } - String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); - wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(actName) - .setRemark("商家激励计划").setAmount(new BigDecimal(luckyMoney).setScale(2, DOWN)).setWishing(wishing).setNotifyUrl(notifyUrl); - String redPacketId = redpackApi.sendRedpack(wechatRedpack).getString("out_biz_no"); - send.put("red_packet_id", redPacketId); - actPartnerLMLogMapper.saveLog(send); - } - } - } - - - @Override - public String checkSignAndUpdateLuckyMoneyStatus(String timestamp, String sign, String redPacketId, JSONObject obj) throws Exception { - String signBase = mpSupportAppId + "/sys/lucky_money/partner/" + redPacketId + "/notify" + timestamp + mpSupportAuthCode; - - if (!DigestUtils.sha256Hex(signBase).toLowerCase().equals(sign)) { - throw new Exception("Sign Error"); - } - - JSONObject send = actPartnerLMLogMapper.findOne(redPacketId); - Assert.notNull(send); - JSONObject updateObj = new JSONObject(); - updateObj.put("red_packet_order_id", send.getString("red_packet_order_id")); - updateObj.put("status", obj.getString("status")); - int count = actPartnerLMLogMapper.update(updateObj); - if (count == 1) { - return "200"; - } else { - throw new Exception("update failure"); - } - } - - - @Override - public void addPartnerAndWechatRelation(String actId, String clientMoniker, JSONObject wechatInfo, String invitationCode) throws Exception { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client); - - String sys_invitation_code = actClientInvitationCodeMapper.getInvitationCode(actId, clientMoniker).getString("invitation_code"); - if (!sys_invitation_code.trim().equals(invitationCode.trim().toUpperCase())) { - throw new Exception("Invitation Code is error"); - } - - JSONObject act = actPartnerLMMapper.findOne(actId); - Assert.notNull(act); - String open_id = wechatInfo.getString("openid"); - - JSONObject params = new JSONObject(); - params.put("act_id", actId); - params.put("customer_id", open_id); - params.put("channel", "Wechat"); - List relList = actPartnerWechatRelationMapper.relationList(params); - params.remove("customer_id"); - params.put("client_id", client.getIntValue("client_id")); - List partnerBinds = actPartnerWechatRelationMapper.relationList(params); - if (!relList.isEmpty()) { - throw new Exception("You have bind your wechat account !"); - } - if (!partnerBinds.isEmpty()) { - throw new Exception("The merchant has been bind by other wechat!"); - } -// JSONObject updateObj = new JSONObject(); -// updateObj.put("client_id",client.getIntValue("client_id")); -// updateObj.put("act_id",actId); -// actPartnerWechatRelationMapper.deleteBindWehcat(updateObj); - - JSONObject relation = new JSONObject(); - relation.put("act_id", actId); - relation.put("client_id", client.getIntValue("client_id")); - relation.put("customer_id", wechatInfo.getString("openid")); - relation.put("nickname", wechatInfo.getString("nickname")); - relation.put("headimgurl", wechatInfo.getString("headimgurl")); - relation.put("channel", "Wechat"); - relation.put("create_time", new Date()); - actPartnerWechatRelationMapper.save(relation); - } - - @Override - public void addPartnerAndAlipayRelation(String actId, String clientMoniker, JSONObject alipayInfo, String invitationCode) throws Exception { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - Assert.notNull(client); - - String sys_invitation_code = actClientInvitationCodeMapper.getInvitationCode(actId, clientMoniker).getString("invitation_code"); - if (!sys_invitation_code.trim().equals(invitationCode.trim().toUpperCase())) { - throw new Exception("Invitation Code is error"); - } - - JSONObject act = actPartnerLMMapper.findOne(actId); - Assert.notNull(act); - String open_id = alipayInfo.getString("user_id"); - - JSONObject params = new JSONObject(); - params.put("act_id", actId); - params.put("customer_id", open_id); - params.put("channel", "Alipay"); - List relList = actPartnerWechatRelationMapper.relationList(params); - params.remove("customer_id"); - params.put("client_id", client.getIntValue("client_id")); - List partnerBinds = actPartnerWechatRelationMapper.relationList(params); - if (!relList.isEmpty()) { - throw new Exception("You have bind your alipay account !"); - } - if (!partnerBinds.isEmpty()) { - throw new Exception("The merchant has been bind by other alipay!"); - } - JSONObject relation = new JSONObject(); - relation.put("act_id", actId); - relation.put("client_id", client.getIntValue("client_id")); - relation.put("customer_id", alipayInfo.getString("user_id")); - relation.put("nickname", alipayInfo.getString("nick_name")); - relation.put("headimgurl", alipayInfo.getString("avatar")); - relation.put("channel", "Alipay"); - relation.put("create_time", new Date()); - actPartnerWechatRelationMapper.save(relation); - } - - @Override - public void deletePartnerRelation(String act_id, String customer_id, JSONObject partner, String channel) { - JSONObject updateObj = new JSONObject(); - updateObj.put("client_id", partner.getIntValue("client_id")); - updateObj.put("customer_id", customer_id); - updateObj.put("update_id", partner.getString("account_id")); - updateObj.put("act_id", act_id); - updateObj.put("channel", channel); - actPartnerWechatRelationMapper.deleteBindWehcat(updateObj); - } - - @Override - public List getPartnerWechats(String act_id, String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); - Assert.notNull(client); - JSONObject relationParams = new JSONObject(); - relationParams.put("act_id", act_id); - relationParams.put("client_id", client.getIntValue("client_id")); - relationParams.put("channel", null); - return actPartnerWechatRelationMapper.relationList(relationParams); - } - - @Override - public List listBindWechats(JSONObject params) { - params.put("channel", "Wechat"); - return actPartnerWechatRelationMapper.relationList(params); - } - - @Override - public JSONObject analysisLuckyMoney(JSONObject params) { - return actPartnerLMLogMapper.analysisLuckyMoney(params); - } - - /** - * @param act_id - * @param clientMoniker - * @param customerId - * @return {"status":"","bindInfo":{}} - * "status"-0:商户未被绑定,微信未参加过活动;1:商户已被绑定,存在bindInfo;2:商户未被绑定,但此微信已参加过活动;3:商户已被此微信绑定; - */ - @Override - public JSONObject checkBindStatus(String act_id, String clientMoniker, String customerId, String channel) { - JSONObject res = new JSONObject(); - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - res.put("client_name", client.getString("short_name")); - Assert.notNull(client); - JSONObject relationParams = new JSONObject(); - relationParams.put("act_id", act_id); - relationParams.put("client_id", client.getIntValue("client_id")); - relationParams.put("channel", channel); - List partnerBinds = actPartnerWechatRelationMapper.relationList(relationParams); - JSONObject params = new JSONObject(); - params.put("act_id", act_id); - params.put("customer_id", customerId); - params.put("channel", channel); - List wechatBinds = actPartnerWechatRelationMapper.relationList(params); - if (!partnerBinds.isEmpty()) { - JSONObject partnerBind = partnerBinds.get(0); - if (partnerBinds.get(0).getString("customer_id").equals(customerId)) { - res.put("status", 3); - } else { - res.put("status", 1); - res.put("bindInfo", partnerBind); - } - } else { - res.put("status", 0); - if (!wechatBinds.isEmpty()) { - res.put("status", 2); - } - } - return res; - } - - @Override - public void exportInvitationCodesExcel(HttpServletResponse httpResponse, String act_id) throws IOException { - httpResponse.setContentType("application/vnd.ms-excel"); - httpResponse.setHeader("Content-Disposition", "attachment;filename=activity_invitation_code.xls"); - - HSSFWorkbook workbook = new HSSFWorkbook(); - - OutputStream outputStream = httpResponse.getOutputStream(); - - HSSFSheet sheet = workbook.createSheet("activity_invitation_code"); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth((short) 15); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style.setBorderRight(HSSFCellStyle.BORDER_THIN); - style.setBorderTop(HSSFCellStyle.BORDER_THIN); - style.setAlignment(HSSFCellStyle.ALIGN_CENTER); - // 生成一个字体 - HSSFFont font = workbook.createFont(); -// font.setColor(HSSFColor.VIOLET.index); - font.setFontHeightInPoints((short) 12); - font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); - // 把字体应用到当前的样式 - style.setFont(font); - // 生成并设置另一个样式 - HSSFCellStyle style2 = workbook.createCellStyle(); - style2.setFillForegroundColor(HSSFColor.LIGHT_YELLOW.index); - style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style2.setBorderRight(HSSFCellStyle.BORDER_THIN); - style2.setBorderTop(HSSFCellStyle.BORDER_THIN); - style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); - style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); - // 生成另一个字体 - HSSFFont font2 = workbook.createFont(); - font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - HSSFRow row0 = sheet.createRow(0); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell02 = row0.createCell(2); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell02.setCellStyle(style); - - HSSFRichTextString text00 = new HSSFRichTextString("Partner Name"); - HSSFRichTextString text01 = new HSSFRichTextString("Partner Code"); - HSSFRichTextString text02 = new HSSFRichTextString("Invitation Code"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell02.setCellValue(text02); - List invitationCodes = actClientInvitationCodeMapper.getInvitationCodes(act_id); - for (int i = 0; i < invitationCodes.size(); i++) { - HSSFRow row = sheet.createRow(i + 1); - HSSFCell cell0 = row.createCell(0); - HSSFCell cell1 = row.createCell(1); - HSSFCell cell2 = row.createCell(2); - cell0.setCellStyle(style); - cell1.setCellStyle(style); - cell2.setCellStyle(style); - HSSFRichTextString text0 = new HSSFRichTextString(invitationCodes.get(i).getString("short_name")); - HSSFRichTextString text1 = new HSSFRichTextString(invitationCodes.get(i).getString("client_moniker")); - HSSFRichTextString text2 = new HSSFRichTextString(invitationCodes.get(i).getString("invitation_code")); - cell0.setCellValue(text0); - cell1.setCellValue(text1); - cell2.setCellValue(text2); - } - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { - - e.printStackTrace(); - } - } - - @Override - public String getInvitationCode(String actId, String clientMoniker) { - JSONObject invitation = actClientInvitationCodeMapper.getInvitationCode(actId, clientMoniker); - if (invitation == null || invitation.isEmpty()) { - invitation = new JSONObject(); - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - Assert.notNull(client); - invitation.put("client_id", client.getIntValue("client_id")); - invitation.put("client_moniker", clientMoniker.toUpperCase()); - invitation.put("act_id", actId); - invitation.put("invitation_code", RandomStringUtils.random(6, true, true).toUpperCase()); - actClientInvitationCodeMapper.save(invitation); - } - return invitation.getString("invitation_code"); - } - - @Override - public JSONObject getPartnersBinds(String actId, RedpackQuery query) { - JSONObject params = query.params(); - params.put("act_id", actId); - PageList list = actPartnerWechatRelationMapper.getPartnersWechatBinds(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(list); - } - - @Override - public JSONObject listActClients(JSONObject manager, PartnerQuery query, String act_id, String channel) { - JSONObject params = query.toJsonParam(); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - if (query.getOnlyMe()) { - params.put("bd_user", manager.getString("manager_id")); - } - } - int orgId = manager.getIntValue("org_id"); - if (orgId > 0) { - params.put("org_id", orgId); - } - params.put("act_id", act_id); - params.put("channel", channel); - PageList partners = actPartnerWechatRelationMapper.listActPartners(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("act_status.desc,create_time.desc"))); - return PageListUtils.buildPageListResult(partners); - } - - @Override - public List listBindsErrorClients(JSONObject manager, JSONObject params) { - return actPartnerWechatRelationMapper.listBindErrorClients(params); - } - - - @Override - public List getSendLogsAnalysis(String act_id, RedpackQuery query) { - JSONObject params = query.params(); - params.put("act_id", act_id); - return actPartnerLMLogMapper.getSendLogsAnalysis(params); - } - - @Override - public JSONObject getClientsRedPackRanking(String act_id, RedpackQuery query) { - JSONObject params = query.params(); - params.put("act_id", act_id); - PageList partners = actPartnerLMLogMapper.getTopSendCounts(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("counts.desc"))); - return PageListUtils.buildPageListResult(partners); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java deleted file mode 100644 index cdc343024..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java +++ /dev/null @@ -1,522 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.core.impls; - -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.mappers.redpack.*; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.redpack.beans.ActTypeEnum; -import au.com.royalpay.payment.manage.redpack.beans.RedpackConfigBean; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.MpAlipayRedpackApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.AlipayRedpack; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.RandomUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-08-03. - */ -@Service -public class RedpackServiceImpl implements RedpackService { - @Resource - private RedPackConfigMapper redPackConfigMapper; - @Resource - private RedPackLogMapper redPackLogMapper; - @Resource - private ClientManager clientManager; - @Resource - private ActPartnerLMMapper actPartnerLMMapper; - @Resource - private ActPrizeTypeMapper actPrizeTypeMapper; - @Resource - private ActPartnerLMLogMapper actPartnerLMLogMapper; - @Resource - private ActPartnerWechatRelationMapper actPartnerWechatRelationMapper; - @Resource - private ActClientInvitationCodeMapper actClientInvitationCodeMapper; - @Resource - private ActBlackListMapper actBlackListMapper; - @Resource - private MpAlipayRedpackApi mpAlipayRedpackApi; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private CustomerMapper customerMapper; - - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public JSONObject getConfigDetail(String clientMoniker) { - JSONObject client = getClientByMoniker(clientMoniker); - JSONObject config = redPackConfigMapper.findRedpackConfig(client.getIntValue("client_id")); - return config == null ? new JSONObject() : config; - } - - private JSONObject getClientByMoniker(String shortId) { - JSONObject partner = clientManager.getClientInfoByMoniker(shortId); - if (partner == null) { - throw new BadRequestException("Partner not exists"); - } - return partner; - } - - @Override - public void modifyRedpack(String clientMoniker, RedpackConfigBean config) { - if (config.getMaxAmount() < config.getMinAmount()) { - throw new BadRequestException("max amount is less than min amount!"); - } - JSONObject client = getClientByMoniker(clientMoniker); - int client_id = client.getIntValue("client_id"); - redPackConfigMapper.removeConfig(client_id); - JSONObject cfg = config.toJSON(); - cfg.put("client_id", client_id); - redPackConfigMapper.saveConfig(cfg); - } - - @Override - public void setConfigEnable(String clientMoniker, boolean enable) { - JSONObject config = getConfigDetail(clientMoniker); - if (config.isEmpty()) { - throw new BadRequestException("Please configure redpack first"); - } - config.put("enabled", enable); - redPackConfigMapper.updateConfig(config); - } - - @Override - public void checkAndSendRedpack(int clientId, String orderOpenId, String orderId, double paidAmount) { - JSONObject partner = clientManager.getClientInfo(clientId); - if (partner == null) { - logger.error("商户不存在,跳过"); - return; - } - JSONObject config = redPackConfigMapper.findRedpackConfig(clientId); - if (config == null || !config.getBooleanValue("enabled")) { - logger.info("未配置红包或未启用,跳过"); - return; - } - if (config.getDoubleValue("min_payment") > paidAmount) { - logger.info("金额不足,跳过"); - return; - } - int sendCount = redPackLogMapper.countSendedToUser(clientId, orderOpenId); - if (sendCount >= config.getIntValue("daily_limit")) { - logger.info("当日发红包次数超限,跳过"); - return; - } - try { - WechatRedpack redpack = newRedpack(config, orderOpenId); - String redpackId = mpWechatApiProvider.getApi("Redpack").sendRedpack(redpack).getString("out_biz_no"); - JSONObject obj = redpack.toJSON(); - obj.put("redpack_id", redpackId); - obj.put("create_time", new Date()); - obj.put("status", 0); - obj.put("order_id", orderId); - obj.put("client_id", clientId); - redPackLogMapper.saveLog(obj); - } catch (RedPackException e) { - e.printStackTrace(); - } - } - - @Override - public JSONObject listRedpackLogs(String clientMoniker, JSONObject params, int page, int limit) { - JSONObject client = getClientByMoniker(clientMoniker); - params.put("client_id", client.getIntValue("client_id")); - PageList logs = redPackLogMapper.sendLogs(params, new PageBounds(page, limit, Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - private WechatRedpack newRedpack(JSONObject config, String openId) throws RedPackException { - - int min = CurrencyAmountUtils.toCent(config.getBigDecimal("min_amount"), "CNY"); - int max = CurrencyAmountUtils.toCent(config.getBigDecimal("max_amount"), "CNY"); - int amount = min == max ? min : RandomUtils.nextInt(0, max - min) + min; - WechatRedpack wechatRedpack = new WechatRedpack(); - JSONObject customerRelation = customerMapper.findCustomerByOpenId(openId); - MpWechatApi redpackApi = mpWechatApiProvider.getApi("Redpack"); - if (customerRelation == null || customerRelation.getString(redpackApi.getOpenIdKey()) == null) { - throw new RedPackException("ServerError", "Customer openid for redpack not available!"); - } - String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); - wechatRedpack.setSendName(config.getString("send_name")).setOpenId(rpOpenId).setActName(config.getString("act_name")) - .setRemark(config.getString("remark")).setAmountInCent(amount).setWishing(config.getString("wishing")).setNotifyUrl(null); - return wechatRedpack; - } - - @Override - public void setRedpackConfg(String act_id, JSONObject config) { - Date prizeDate = new Date(); - List prize_type_list = (List) config.get("prize_type_list"); - JSONObject act = actPartnerLMMapper.findOne(act_id); - Assert.notNull(act); - config.put("act_id", act_id); - actPartnerLMMapper.update(config); - - for (JSONObject prize_type : prize_type_list) { - prize_type.put("act_id", act_id); - actPrizeTypeMapper.update(prize_type); - String type_id = prize_type.getString("type_id"); - BigDecimal amountFrom = prize_type.getBigDecimal("price_value_from"); - BigDecimal amountTo = prize_type.getBigDecimal("price_value_to"); - BigDecimal hundred = BigDecimal.valueOf(100); - int redpack_counts = prize_type.getIntValue("redpack_counts"); - if (redpack_counts > 0) { - for (int i = 0; i < redpack_counts; i++) { - BigDecimal amount = amountFrom.equals(amountTo) ? amountFrom - : amountFrom.add(BigDecimal.valueOf(RandomUtils.nextInt(0, amountTo.subtract(amountFrom).multiply(hundred).intValue())).divide(hundred, - 2, RoundingMode.DOWN)); - JSONObject prize = new JSONObject(); - String prefix = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS"); - String red_packet_order_id = prefix + RandomStringUtils.random(28 - prefix.length(), true, true); - prize.put("red_packet_order_id", red_packet_order_id); - prize.put("act_id", act_id); - prize.put("red_packet_amount", amount); - prize.put("act_name", act.getString("act_name")); - prize.put("red_pack_type_id", type_id); - prize.put("create_time", prizeDate); - actPartnerLMLogMapper.saveLog(prize); - } - } - } - - } - - private int getRedPacketsByOpenid(String openid, Date date) { - return actPartnerLMLogMapper.getRedPacketsByOpenid(openid, date); - } - - @Override - public void sendLuckyMoney(String orderId, BigDecimal orderAmount, int client_id) throws RedPackException { - logger.info("======================sendLuckyMoney===================="); - logger.info("======================orderId:" + orderId + ";orderAmount:" + orderAmount + ";client_id:" + client_id + "===================="); - JSONObject params = new JSONObject(); - params.put("act_type", ActTypeEnum.redpack.toString()); - params.put("status", 1); - List actList = actPartnerLMMapper.actList(params); - if (!actList.isEmpty()) { - JSONObject act = actList.get(0); - String act_id = act.getString("act_id"); - - JSONObject blackListParams = new JSONObject(); - blackListParams.put("act_id", act_id); - blackListParams.put("client_id", client_id); - List blackList = actBlackListMapper.list(blackListParams); - if (blackList != null && !blackList.isEmpty()) { - logger.error("client_id:" + client_id + ",在活动" + act_id + "的黑名单下"); - return; - } - BigDecimal rule_order_total = act.getBigDecimal("rule_order_total"); - int probability = act.getIntValue("probability"); - if (orderAmount.compareTo(rule_order_total) < 0) { - logger.error("订单不满足金额{},跳过", rule_order_total); - return; - } - // int random = new Random().nextInt(100); - int random = (int) (Math.random() * 100); - if (random > probability) { - logger.error("没中!跳过"); - return; - } - - JSONObject relationParams = new JSONObject(); - relationParams.put("act_id", act_id); - relationParams.put("client_id", client_id); - relationParams.put("channel", "Wechat"); - List relationList = actPartnerWechatRelationMapper.relationList(relationParams); - if (relationList.isEmpty()) { - logger.error("client_id:{};没有绑定的wechat!跳过", client_id); - return; - } - - String open_id = relationList.get(0).getString("customer_id"); - - // add 每天只能得到100个红包的限制 - int getTotalCounts = getRedPacketsByOpenid(open_id, new Date()); - if (getTotalCounts >= 100) { - logger.error("open_id:{}当日红包发送数量已到达100!跳过", open_id); - return; - } - List prizeTypes = actPrizeTypeMapper.listAvailableTypes(BigDecimal.ONE, act_id); - int totalWeight = 0; - for (JSONObject prizeType : prizeTypes) { - totalWeight += prizeType.getIntValue("weight"); - } - int ran = RandomUtils.nextInt(0, totalWeight); - - for (JSONObject prizeType : prizeTypes) { - ran -= prizeType.getIntValue("weight"); - if (ran < 0) { - String lock = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(5, true, true); - int lockedCount = actPartnerLMLogMapper.lockPrize(act_id, lock, prizeType.getString("type_id"), open_id, client_id, orderId, - orderAmount.doubleValue(), new Date()); - if (lockedCount > 0) { - JSONObject invitationClient = actClientInvitationCodeMapper.getInvitationClient(act_id, client_id); - if (invitationClient != null && invitationClient.getBoolean("auto_send")) { - doSendLuckyMoney(open_id, lock, act.getString("act_name")); - } else { - - BigDecimal redPackAmount = actPartnerLMLogMapper.getUnSendRedPackAmount(act_id, client_id); - if (redPackAmount.compareTo(CommonConsts.HUNDRED) > 0) { - BigDecimal totalAmount = BigDecimal.ZERO; - List redPacks = actPartnerLMLogMapper.getUnSendRedPackLog(act_id, client_id); - List reallySend = new ArrayList<>(); - for (JSONObject redpack : redPacks) { - totalAmount = totalAmount.add(redpack.getBigDecimal("red_packet_amount")); - if (totalAmount.compareTo(CommonConsts.HUNDRED) < 0) { - reallySend.add(redpack); - } else { - totalAmount = totalAmount.subtract(redpack.getBigDecimal("red_packet_amount")); - break; - } - } - String wishing = "恭喜获得ROYALPAY店长福利红包"; - String sendName = "RoyalPay皇家支付"; - - WechatRedpack wechatRedpack = new WechatRedpack(); - JSONObject customerRelation = customerMapper.findCustomerByOpenId(open_id); - MpWechatApi redpackApi = mpWechatApiProvider.getApi("Redpack"); - if (customerRelation == null || customerRelation.getString(redpackApi.getOpenIdKey()) == null) { - throw new RedPackException("ServerError", "Customer openid for redpack not available!"); - } - String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); - wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(act.getString("act_name")).setRemark("店长激励计划") - .setAmount(totalAmount).setWishing(wishing).setNotifyUrl(null); - String redPacketId = mpWechatApiProvider.getApi("Redpack").sendRedpack(wechatRedpack).getString("out_biz_no"); - - for (JSONObject prizeDetail : reallySend) { - prizeDetail.put("red_packet_id", redPacketId); - prizeDetail.put("status", 1); - actPartnerLMLogMapper.update(prizeDetail); - } - - } - - } - break; - } - } - } - } - } - - @Override - public void sendAlipayLuckyMoney(String orderId, BigDecimal orderAmount, int client_id) throws RedPackException { - logger.info("======================sendAlipayLuckyMoney===================="); - logger.info("======================orderId:{};orderAmount:{};client_id:{}====================", orderId, orderAmount, client_id); - JSONObject params = new JSONObject(); - params.put("act_type", ActTypeEnum.redpack.toString()); - params.put("status", 1); - List actList = actPartnerLMMapper.actList(params); - - if (!actList.isEmpty()) { - JSONObject act = actList.get(0); - if (orderAmount.compareTo(act.getBigDecimal("rule_order_total")) < 0) { - logger.info("支付金额不足{}跳过", act.getDouble("rule_order_total")); - return; - } - - String act_id = act.getString("act_id"); - - JSONObject blackListParams = new JSONObject(); - blackListParams.put("act_id", act_id); - blackListParams.put("client_id", client_id); - List blackList = actBlackListMapper.list(blackListParams); - if (blackList != null && !blackList.isEmpty()) { - logger.error("client_id:{},在活动{}的黑名单下", client_id, act_id); - return; - } - JSONObject actPartnerParams = new JSONObject(); - actPartnerParams.put("act_id", act_id); - actPartnerParams.put("client_id", client_id); - actPartnerParams.put("today", new Date()); - int count = actPartnerLMLogMapper.sendCount(actPartnerParams); - BigDecimal rate = BigDecimal.ONE; - switch (count) { - case 29: - rate = BigDecimal.valueOf(2); - break; - case 59: - rate = BigDecimal.valueOf(3); - break; - case 99: - rate = BigDecimal.valueOf(5); - break; - default: - break; - } - - JSONObject relationParams = new JSONObject(); - relationParams.put("act_id", act_id); - relationParams.put("client_id", client_id); - relationParams.put("channel", "Alipay"); - List relationList = actPartnerWechatRelationMapper.relationList(relationParams); - if (relationList.isEmpty()) { - logger.error("client_id:{};没有绑定的Alipay!跳过", client_id); - return; - } - - String open_id = relationList.get(0).getString("customer_id"); - List prizeTypes = actPrizeTypeMapper.listAvailableTypes(rate, act_id); - int totalWeight = 0; - for (JSONObject prizeType : prizeTypes) { - totalWeight += prizeType.getIntValue("weight"); - } - int ran = RandomUtils.nextInt(0, totalWeight); - - for (JSONObject prizeType : prizeTypes) { - ran -= prizeType.getIntValue("weight"); - if (ran < 0) { - String lock = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(5, true, true); - int lockedCount = actPartnerLMLogMapper.lockPrize(act_id, lock, prizeType.getString("type_id"), open_id, client_id, orderId, - orderAmount.doubleValue(), new Date()); - if (lockedCount > 0) { - JSONObject invitationClient = actClientInvitationCodeMapper.getInvitationClient(act_id, client_id); - if (invitationClient != null && invitationClient.getBoolean("auto_send")) { - doSendAlipayLuckyMoney(open_id, lock, count, rate); - } - break; - } - } - } - } - } - - @Override - public void doSendLuckyMoney(String open_id, String lock, String actName) throws RedPackException { - JSONObject prizeDetail = actPartnerLMLogMapper.findLockedPrize(lock, open_id); - BigDecimal luckyMoeny = prizeDetail.getBigDecimal("red_packet_amount"); - String red_packet_order_id = prizeDetail.getString("red_packet_order_id"); - String sendName = "RoyalPay皇家支付"; - String wishing = "恭喜获得ROYALPAY店长福利红包"; - String notifyUrl = PlatformEnvironment.getEnv().concatUrl("/sys/lucky_money/partner/" + red_packet_order_id + "notify"); - - WechatRedpack wechatRedpack = new WechatRedpack(); - JSONObject customerRelation = customerMapper.findCustomerByOpenId(open_id); - MpWechatApi redpackApi = mpWechatApiProvider.getApi("Redpack"); - if (customerRelation == null || customerRelation.getString(redpackApi.getOpenIdKey()) == null) { - throw new RedPackException("ServerError", "Customer openid for redpack not available!"); - } - String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); - wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(actName).setRemark("店长激励计划").setAmount(luckyMoeny).setWishing(wishing) - .setNotifyUrl(notifyUrl); - String redPacketId = mpWechatApiProvider.getApi("Redpack").sendRedpack(wechatRedpack).getString("out_biz_no"); - prizeDetail.put("red_packet_id", redPacketId); - prizeDetail.put("status", 1); - actPartnerLMLogMapper.update(prizeDetail); - } - - @Override - public void doSendAlipayLuckyMoney(String alipayUserId, String lock, int count, BigDecimal rate) throws RedPackException { - JSONObject prizeDetail = actPartnerLMLogMapper.findLockedPrize(lock, alipayUserId); - String specialDocuments = ""; - switch (count) { - case 24: - specialDocuments = "(" + "再有5笔就能获得" + rate.intValue() + "倍奖励哦~" + ")"; - break; - case 54: - specialDocuments = "(" + "再有5笔就能获得" + rate.intValue() + "倍奖励哦~" + ")"; - break; - case 94: - specialDocuments = "(" + "再有5笔就能获得" + rate.intValue() + "倍奖励哦~" + ")"; - break; - default: - break; - } - AlipayRedpack alipayRedpack = new AlipayRedpack(); - alipayRedpack.setPayeeAccount(alipayUserId).setAmount(prizeDetail.getBigDecimal("red_packet_amount")).setPayerShowName("RoyalPay福利社") - .setRemark("RoyalPay店长活动-" + (rate.intValue() > 1 ? rate.intValue() + "倍" : "") + "红包奖励" + specialDocuments); - JSONObject mpAlipayJson = mpAlipayRedpackApi.sendRedpack(alipayRedpack); - String redPacketId = mpAlipayJson.getString("out_biz_no"); - prizeDetail.put("red_packet_id", redPacketId); - prizeDetail.put("status", 5); - actPartnerLMLogMapper.update(prizeDetail); - } - - @Override - public void updateAlipayRedPacketsStatus(String act_id) { - JSONObject params = new JSONObject(); - params.put("act_id", act_id); - List redPacketOrders = actPartnerLMLogMapper.sendList(params); - for (JSONObject redPack : redPacketOrders) { - JSONObject supportRedPack = mpAlipayRedpackApi.redpackStatus(redPack.getString("red_packet_id")); - if (supportRedPack != null && !supportRedPack.isEmpty()) { - switch (supportRedPack.getString("status")) { - case "0": - redPack.put("status", 0); - break; - case "1": - redPack.put("status", 3); - break; - case "2": - redPack.put("status", 2); - break; - case "3": - redPack.put("status", 5); - break; - default: - continue; - } - actPartnerLMLogMapper.update(redPack); - } - } - - } - - @Override - public void updateRedPacketsStatus(String act_id) { - JSONObject params = new JSONObject(); - params.put("act_id", act_id); - List redPacketOrders = actPartnerLMLogMapper.sendList(params); - for (JSONObject redPack : redPacketOrders) { - // String url = "https://mp.royalpay.com.au/api/mp_accounts/redpack/redpacks/" + - // redPack.getString("red_packet_id"); - // HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute(); - // if (result.isSuccess()) { - // try { - // JSONObject res = result.getResponseContentJSONObj(); - // redPack.put("status",res.getString("status")); - // actPartnerLMLogMapper.update(redPack); - // } catch (IOException e) { - // e.printStackTrace(); - // } - // } - - JSONObject supportRedPack = mpWechatApiProvider.getApi("Redpack").redpackStatus(redPack.getString("red_packet_id")); - if (supportRedPack != null && !supportRedPack.isEmpty()) { - redPack.put("status", supportRedPack.getString("status")); - actPartnerLMLogMapper.update(redPack); - } - - } - - } - - @Override - public void clearUnsend(String actId, String typeId) { - actPartnerLMLogMapper.clearUnsendRedpacks(actId, typeId); - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/listeners/SendAlipayRedPackListener.java b/src/main/java/au/com/royalpay/payment/manage/redpack/listeners/SendAlipayRedPackListener.java deleted file mode 100644 index 1e52b0328..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/listeners/SendAlipayRedPackListener.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.listeners; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.core.Ordered; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * Created by davep on 2016-08-03. - */ -@Service -public class SendAlipayRedPackListener implements ApplicationListener, Ordered { - @Resource - private RedpackService redpackService; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public void onApplicationEvent(AfterPaymentFinishEvent evt) { - PaymentFinishedEvent paymentFinishedEvent = evt.getFinishedEvent(); - if (paymentFinishedEvent.isDebug()) { - return; - } - JSONObject order = paymentFinishedEvent.getOrder(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - try { - if (new Date().compareTo(sdf.parse("2017-12-31")) > 0) { - return; - } - if (new Date().compareTo(sdf.parse("2017-10-20")) < 0) { - return; - } - } catch (ParseException e) { - } - - if (!"Alipay".equals(order.getString("channel"))) { - return; - } - - try { - redpackService.sendAlipayLuckyMoney(order.getString("order_id"), paymentFinishedEvent.getAudFee(), order.getIntValue("client_id")); - } catch (Exception e) { - logger.error("Failed to transfer alipay redpack:", e); - } - } - - @Override - public int getOrder() { - return 4; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/listeners/SendRedPackListener.java b/src/main/java/au/com/royalpay/payment/manage/redpack/listeners/SendRedPackListener.java deleted file mode 100644 index d478ce40b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/listeners/SendRedPackListener.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.listeners; - -import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; -import au.com.royalpay.payment.core.events.PaymentFinishedEvent; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; -import com.alibaba.fastjson.JSONObject; -import org.dom4j.Element; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.core.Ordered; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * Created by davep on 2016-08-03. - */ -@Service -public class SendRedPackListener implements ApplicationListener, Ordered { - @Resource - private RedpackService redpackService; - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public void onApplicationEvent(AfterPaymentFinishEvent evt) { - PaymentFinishedEvent paymentFinishedEvent = evt.getFinishedEvent(); - if (paymentFinishedEvent.isDebug()) { - return; - } - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - try { - if (new Date().compareTo(sdf.parse("2017-08-12"))>0){ - return; - } - } catch (ParseException e) { - e.printStackTrace(); - } - JSONObject order = paymentFinishedEvent.getOrder(); - BigDecimal orderAmount = paymentFinishedEvent.getAudFee(); -// try { -// redpackService.checkAndSendRedpack(order.getIntValue("client_id"), order.getString("customer_id"), order.getString("order_id"), paymentFinishedEvent.getAudFee()); -// } catch (Exception e) { -// logger.error("Failed to send redpack:", e); -// } - try { - redpackService.sendLuckyMoney(order.getString("order_id"), orderAmount, order.getIntValue("client_id")); - } catch (Exception e) { - logger.error("Failed to send redpack:", e); - } - } - - @Override - public int getOrder() { - return 3; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/package-info.java b/src/main/java/au/com/royalpay/payment/manage/redpack/package-info.java deleted file mode 100644 index de58be1d9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 微信红包 - * Created by davep on 2016-08-03. - */ -package au.com.royalpay.payment.manage.redpack; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActCustomerLMController.java b/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActCustomerLMController.java deleted file mode 100644 index ad3ffdb48..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActCustomerLMController.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.redpack.beans.CustomerRedpackActBean; -import au.com.royalpay.payment.manage.redpack.core.CustomerLMService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by wangning on 08/12/2016. - */ -@RestController -@ManagerMapping(value = "/sys/lucky_money/customer", role = ManagerRole.ADMIN) -public class ActCustomerLMController { - - @Resource - private CustomerLMService customerLMService; - - @GetMapping("/acts") - public JSONObject listActivities(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) { - return customerLMService.listActivities(page, limit); - } - -// @RequestMapping(value = "/act", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) -// public JSONObject addActivity(@RequestBody ActBean actBean){ -// return customerLMService.addActivity(actBean.toJson()); -// } - - - @GetMapping("/acts/{act_id}") - public JSONObject getActDetail(@PathVariable String act_id) { - return customerLMService.getActDetail(act_id); - } - - @PutMapping("/acts/{act_id}") - public void updateActivity(@PathVariable String act_id, @RequestBody CustomerRedpackActBean actBean) throws Exception { - customerLMService.updateActivity(act_id, actBean.toJson()); - } - - @GetMapping("/acts/{actId}/partners") - public List getClientApplyWithDetail(@PathVariable String actId) throws Exception { - return customerLMService.getClientApplyWithDetail(actId); - } - - @PostMapping("/acts/{act_id}/partners/{client_moniker}") - public void addClientApply(@PathVariable String act_id, @PathVariable String client_moniker, @RequestBody JSONObject params) throws Exception { - customerLMService.addClientApply(act_id, client_moniker,params); - } - - @DeleteMapping("/acts/{actId}/partners/{clientMoniker}") - public void removeClientApply(@PathVariable String actId, @PathVariable String clientMoniker) throws Exception { - customerLMService.removeClientApply(actId, clientMoniker); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActPartnerLMController.java b/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActPartnerLMController.java deleted file mode 100644 index 0dc0e3f4d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActPartnerLMController.java +++ /dev/null @@ -1,161 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.web; - -import au.com.royalpay.payment.core.exceptions.RedPackException; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.redpack.beans.ActBean; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import au.com.royalpay.payment.manage.redpack.core.PartnerLMService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yishuqian on 08/12/2016. - */ -@RestController -@RequestMapping("/sys/lucky_money/partner") -public class ActPartnerLMController { - - @Resource - private PartnerLMService partnerLMService; - - @ManagerMapping(value = "/act", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public JSONObject addActivity(@RequestBody ActBean actBean){ - return partnerLMService.addActivity(actBean.toJson()); - } - - @ManagerMapping(value = "/act/{act_id}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) - public void updateActivity(@PathVariable String act_id, @RequestBody ActBean actBean) throws Exception { - partnerLMService.updateActivity(act_id,actBean.toJson()); - } - - @ManagerMapping(value = "/act",method = RequestMethod.GET) - public JSONObject listActivities(RedpackQuery query){ - return partnerLMService.listActivities(query.params(),query.getPage(),query.getLimit()); - } - - @ManagerMapping(value = "/acts/list",method = RequestMethod.GET) - public List listActivitiesNoPage(){ - return partnerLMService.listActivitiesNoPage(); - } - - @ManagerMapping(value = "/act/{act_id}",method = RequestMethod.GET) - public JSONObject getActDetail(@PathVariable String act_id){ - return partnerLMService.getActDetail(act_id); - } - - - @ManagerMapping(value = "/act/{act_id}/logs",method = RequestMethod.GET) - public JSONObject sendLMLogs(@PathVariable String act_id, RedpackQuery query){ - JSONObject params= query.params(); - params.put("act_id",act_id); - return partnerLMService.listSendLogs(params,query.getPage(),query.getLimit()); - } - - @ManagerMapping(value = "/act/{act_id}/analysis",method = RequestMethod.GET) - public JSONObject luckyMoenyAnalysis(@PathVariable String act_id, RedpackQuery query){ - JSONObject params= query.params(); - params.put("act_id",act_id); - return partnerLMService.analysisLuckyMoney(params); - } - - - @RequestMapping(value = "/{red_packet_id}/notify",method = RequestMethod.POST) - public String updateLuckyMoneyStatus(@PathVariable String red_packet_id, @RequestBody JSONObject status, - @RequestHeader(name = "sign") String sign, - @RequestHeader(name = "timestamp") String timestamp) throws Exception { - if (!status.containsKey("status")){ - throw new Exception("missing status"); - } - return partnerLMService.checkSignAndUpdateLuckyMoneyStatus(timestamp,sign,red_packet_id,status); - } - - @ManagerMapping(value = "/test",method = RequestMethod.POST) - public void sendLuckyMoeny(@RequestBody JSONObject jsonObject) throws RedPackException { - if (!jsonObject.getString("key").equals("11231123")){ - throw new ForbiddenException(); - } - String orderId = jsonObject.getString("orderId"); - Double orderAmount = jsonObject.getDouble("orderAmount"); - int client_id = jsonObject.getIntValue("client_id"); - partnerLMService.addLuckMoneyList(orderId,orderAmount,client_id); - } - -// -// @WechatMapping(value = "/{clientMoniker:[0-9A-Za-z]+}/wechat",method = RequestMethod.GET,oauthType = WxOauthType.USERINFO,addonMp = WechatMpAccount.REDPACK) -// public ModelAndView ScanAddPartnerAndWechatRelation(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatInfo) throws Exception { -// partnerLMService.addPartnerAndWechatRelation("1",clientMoniker,wechatInfo); -// return new ModelAndView("manager_bind_success"); -// } - - @RequestMapping(value = "/wechat/{clientMoniker:[0-9A-Za-z]+}/{act_id}",method = RequestMethod.POST) - public void addPartnerAndWechatRelation(@PathVariable String clientMoniker, @PathVariable String act_id, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatInfo, @RequestBody JSONObject data) throws Exception { - if (wechatInfo.isEmpty()){ - throw new ForbiddenException("wechat is not exist"); - } - String invitationCode = data.getString("invitationCode"); - if (invitationCode ==null && invitationCode.isEmpty()){ - throw new ForbiddenException("invitationCode is not exist"); - } - - partnerLMService.addPartnerAndWechatRelation(act_id,clientMoniker,wechatInfo,invitationCode); - } - - @RequestMapping(value = "/alipay/{clientMoniker:[0-9A-Za-z]+}/{act_id}",method = RequestMethod.POST) - public void addPartnerAndAlipayRelation(@PathVariable String clientMoniker, @PathVariable String act_id, @ModelAttribute(CommonConsts.ALIUSER) JSONObject alipayInfo, @RequestBody JSONObject data) throws Exception { - if (alipayInfo.isEmpty()){ - throw new ForbiddenException("alipay is not exist"); - } - String invitationCode = data.getString("invitationCode"); - if (invitationCode ==null && invitationCode.isEmpty()){ - throw new ForbiddenException("invitationCode is not exist"); - } - partnerLMService.addPartnerAndAlipayRelation(act_id,clientMoniker,alipayInfo,invitationCode); - } - - @ManagerMapping("invitation_code/{act_id}/excel") - public void exportExcel(@PathVariable String act_id, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - partnerLMService.exportInvitationCodesExcel(httpResponse,act_id); - } - - @ManagerMapping(value = "/{act_id}/invitation_code",method = RequestMethod.GET) - public void generateInvitationCode(@PathVariable String act_id){ - partnerLMService.gengerateInvitationCode(act_id); - } - - @ManagerMapping(value = "/{act_id}/binds",method = RequestMethod.GET) - public JSONObject getActBinds(@PathVariable String act_id, RedpackQuery query){ - return partnerLMService.getPartnersBinds(act_id,query); - } - - @ManagerMapping(value = "/acts/partners",method = RequestMethod.GET) - public JSONObject listActClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query, @RequestParam(value = "act_id",required = false) String act_id) { - return partnerLMService.listActClients(manager, query,act_id,null); - } - - @ManagerMapping(value = "/{act_id}/partners/bind_error",method = RequestMethod.GET) - public List listErrorBinds(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id) { - JSONObject params = new JSONObject(); - params.put("channel","Wechat"); - params.put("act_id",act_id); - return partnerLMService.listBindsErrorClients(manager,params); - } - - @ManagerMapping(value = "/{act_id}/sendLogs/analysis",method = RequestMethod.GET) - public List getSendLogsAnalysis(@PathVariable String act_id, RedpackQuery query){ - return partnerLMService.getSendLogsAnalysis(act_id,query); - } - - @ManagerMapping(value = "/{act_id}/ranking/analysis",method = RequestMethod.GET) - public JSONObject getRedPackRanking(@PathVariable String act_id, RedpackQuery query){ - return partnerLMService.getClientsRedPackRanking(act_id,query); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActRedpackConfigController.java b/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActRedpackConfigController.java deleted file mode 100644 index 2c25f1b04..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActRedpackConfigController.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.redpack.core.ActRedPackService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by wangning on 2017/8/10. - */ -@RestController -@ManagerMapping(value = "/sys/redpack/customer",role = ManagerRole.ADMIN) -public class ActRedpackConfigController { - - @Resource - ActRedPackService actRedPackService; - - - @RequestMapping(value = "/act/{act_id}",method = RequestMethod.PUT) - public void setRedpackConfig(@PathVariable String act_id, @RequestBody JSONObject config){ - actRedPackService.setRedpackConfg(act_id,config); - } - - @RequestMapping(value = "/config/{actId}/prize_types/{typeId}/clear_unsend",method = RequestMethod.DELETE) - public void clearUnsendPrizes(@PathVariable String actId, @PathVariable String typeId){ - actRedPackService.clearUnsend(actId,typeId); - } - - @RequestMapping(value = "/act/{act_id}",method = RequestMethod.GET) - private JSONObject listCustomerOrders(@PathVariable String act_id, RedpackQuery redpackQuery){ - JSONObject params = redpackQuery.params(); - params.put("actId",act_id); - return actRedPackService.listCustomerOrders(params,redpackQuery.getPage(),redpackQuery.getLimit()); - } - - @ManagerMapping(value = "/{act_id}/sendLogs/analysis",method = RequestMethod.GET) - public List getCustomerRedpackAnalysis(@PathVariable String act_id, RedpackQuery query){ - return actRedPackService.getCustomerRedpackAnalysis(act_id,query); - } - - @ManagerMapping(value = "/act/{act_id}/analysis",method = RequestMethod.GET) - public JSONObject customerLuckyMoneyAnalysis(@PathVariable String act_id, RedpackQuery query){ - JSONObject params= query.params(); - params.put("act_id",act_id); - return actRedPackService.analysisCustomerLuckyMoney(params); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActRedpackCustomerCallbackController.java b/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActRedpackCustomerCallbackController.java deleted file mode 100644 index 4b2c1a87a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/web/ActRedpackCustomerCallbackController.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.web; - -import au.com.royalpay.payment.manage.redpack.core.ActRedPackService; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@RequestMapping("/sys/lucky_money/customer") -public class ActRedpackCustomerCallbackController { - @Resource - private ActRedPackService actRedPackService; - - - @RequestMapping(value = "/redpacks/{redpackOrderId}/notify",method = RequestMethod.POST) - public void receiveRedpackNotify(@PathVariable String redpackOrderId, @RequestBody JSONObject status, - @RequestHeader(name = "sign") String sign, - @RequestHeader(name = "timestamp") String timestamp){ - if (!status.containsKey("status")){ - throw new BadRequestException("missing status"); - } - actRedPackService.receiveRedpackNotify(redpackOrderId,status,sign,timestamp); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/web/PartnerLMController.java b/src/main/java/au/com/royalpay/payment/manage/redpack/web/PartnerLMController.java deleted file mode 100644 index f07df40f5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/web/PartnerLMController.java +++ /dev/null @@ -1,108 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.web; - -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import au.com.royalpay.payment.manage.redpack.core.PartnerLMService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.alipay.AlipayMapping; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 15/12/2016. - */ -@RestController -@RequestMapping("/partner/lucky_money") -public class PartnerLMController { - @Resource - private PartnerLMService partnerLMService; - @PartnerMapping(value = "/{act_id}/wechats/{wechat_openid}",method = RequestMethod.PUT,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - public void deleteWechatPartnerWechatRelation(@PathVariable String act_id, @PathVariable String wechat_openid, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner){ - partnerLMService.deletePartnerRelation(act_id,wechat_openid,partner,"Wechat"); - } - @PartnerMapping(value = "/{act_id}/alipay/{customer_id}",method = RequestMethod.PUT,roles = {PartnerRole.ADMIN,PartnerRole.MANAGER}) - public void deleteAlipayPartnerWechatRelation(@PathVariable("act_id") String act_id, @PathVariable("customer_id") String customer_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner){ - partnerLMService.deletePartnerRelation(act_id,customer_id,partner,"Alipay"); - } - - @RequestMapping(value = "/{act_id}/{client_moniker}/wechats",method = RequestMethod.GET) - public List getPartnerWechats(@PathVariable String act_id, @PathVariable String client_moniker){ - return partnerLMService.getPartnerWechats(act_id,client_moniker); - } - - @PartnerMapping(value = "/{act_id}/logs",method = RequestMethod.GET) - public JSONObject getLuckyMoneyLogs(@PathVariable String act_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, RedpackQuery query){ - JSONObject params= query.params(); - params.put("client_id",partner.getIntValue("client_id")); - params.put("partner_status",1); - params.put("act_id",act_id);//act:lucky money back - return partnerLMService.listSendLogs(params,query.getPage(),query.getLimit()); - } - - @PartnerMapping(value = "/{act_id}/activity_qrcode",method = RequestMethod.GET) - public JSONObject getQrcode(@PathVariable String act_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner){ - final String bindPartnerLuckyMoneyWehatUrl = PlatformEnvironment.getEnv().concatUrl("/promotions/clients/"+partner.getString("client_moniker")); - String invitationCode = partnerLMService.getInvitationCode(act_id,partner.getString("client_moniker")); - JSONObject res = new JSONObject(); - res.put("invitation_code",invitationCode); - res.put("qrcode", QRCodeUtils.qrcodeImageCode(bindPartnerLuckyMoneyWehatUrl, 250,false)); - return res; - } - - @PartnerMapping(value = "/{act_id}/activity_qrcode/alipay",method = RequestMethod.GET) - public JSONObject getAlipayQrcode(@PathVariable String act_id, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner){ - final String bindPartnerLuckyMoneyWehatUrl =PlatformEnvironment.getEnv().concatUrl("/promotions/clients/"+partner.getString("client_moniker")+"/alipay"); - String invitationCode = partnerLMService.getInvitationCode(act_id,partner.getString("client_moniker")); - JSONObject res = new JSONObject(); - res.put("invitation_code",invitationCode); - res.put("qrcode",QRCodeUtils.qrcodeImageCode(bindPartnerLuckyMoneyWehatUrl, 250,false)); - return res; - } - - - @RequestMapping(value = "/{act_id}/{client_moniker}/partner_wechats",method = RequestMethod.GET) - public JSONObject getBindWechats(@PathVariable String act_id, @PathVariable String client_moniker, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatInfo){ - if (wechatInfo.isEmpty()){ - throw new ForbiddenException("wechat is not exist"); - } - return partnerLMService.checkBindStatus(act_id,client_moniker,wechatInfo.getString("openid"),"Wechat"); - - } - - @RequestMapping(value = "/{act_id}/logs/wechat",method = RequestMethod.GET) - public JSONObject getLuckyMoneyLogsByWechat(@PathVariable String act_id, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatInfo, RedpackQuery query){ - JSONObject params= query.params(); - params.put("open_id",wechatInfo.getString("openid")); - params.put("partner_status",1); -// params.put("act_id",act_id);//act:lucky money back - params.put("channel","Wechat"); - return partnerLMService.listSendLogs(params,query.getPage(),query.getLimit()); - } - - @RequestMapping(value = "/{act_id}/logs/alipay",method = RequestMethod.GET) - public JSONObject getLuckyMoneyLogsByAlipay(@PathVariable String act_id, @ModelAttribute(CommonConsts.ALIUSER) JSONObject alipayInfo, RedpackQuery query){ - JSONObject params= query.params(); - params.put("open_id",alipayInfo.getString("openid")); - params.put("partner_status",1); - params.put("act_id",act_id);//act:lucky money back - params.put("channel","Alipay"); - return partnerLMService.listSendLogs(params,query.getPage(),query.getLimit()); - } - - @AlipayMapping(value = "/{act_id}/{client_moniker}/partner_alipay",method = RequestMethod.GET) - public JSONObject getBindAlipay(@PathVariable String act_id, @PathVariable String client_moniker, @ModelAttribute(CommonConsts.ALIUSER) JSONObject alipayInfo){ - if (alipayInfo.isEmpty()){ - throw new ForbiddenException("alipay is not exist"); - } - return partnerLMService.checkBindStatus(act_id,client_moniker,alipayInfo.getString("user_id"),"Alipay"); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/web/RedpackConfigController.java b/src/main/java/au/com/royalpay/payment/manage/redpack/web/RedpackConfigController.java deleted file mode 100644 index 682f7ff50..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/web/RedpackConfigController.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.redpack.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.redpack.beans.RedpackConfigBean; -import au.com.royalpay.payment.manage.redpack.beans.RedpackQuery; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; -import au.com.royalpay.payment.tools.http.HttpUtils; -import com.alibaba.fastjson.JSONObject; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Created by davep on 2016-08-03. - */ -@RestController -@RequestMapping("/sys/redpack") -public class RedpackConfigController { - @Resource - private RedpackService redpackService; - - @ManagerMapping(value = "/partners/{clientMoniker}", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) - public JSONObject getRedpackConfig(@PathVariable String clientMoniker) { - return redpackService.getConfigDetail(clientMoniker); - } - - @ManagerMapping(value = "/partners/{clientMoniker}", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void configRedpack(@PathVariable String clientMoniker, - @RequestBody @Valid RedpackConfigBean config, Errors errors) { - HttpUtils.handleValidErrors(errors); - redpackService.modifyRedpack(clientMoniker, config); - } - - @ManagerMapping(value = "/partners/{clientMoniker}/enable", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public void setConfigEnable(@PathVariable String clientMoniker, @RequestBody JSONObject enable) { - redpackService.setConfigEnable(clientMoniker, enable.getBooleanValue("enable")); - } - - @ManagerMapping(value = "/partners/{clientMoniker}/logs", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) - public JSONObject listSendLog(@PathVariable String clientMoniker, RedpackQuery query) { - return redpackService.listRedpackLogs(clientMoniker, query.params(), query.getPage(), query.getLimit()); - } - - @ManagerMapping(value = "/config/{act_id}",method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void setRedpackConfig(@PathVariable String act_id, @RequestBody JSONObject config){ - redpackService.setRedpackConfg(act_id,config); - } - - @ManagerMapping(value = "/config/{actId}/prize_types/{typeId}/clear_unsend",method = RequestMethod.DELETE,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) - public void clearUnsendPrizes(@PathVariable String actId, @PathVariable String typeId){ - redpackService.clearUnsend(actId,typeId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/AddRiskDetailLog.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/AddRiskDetailLog.java deleted file mode 100644 index 2f787efd4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/AddRiskDetailLog.java +++ /dev/null @@ -1,69 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.alibaba.fastjson.JSONObject; -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.apache.commons.lang3.StringUtils; - -public class AddRiskDetailLog { - - @JsonProperty("record_id") - private String record_id; - - @JsonProperty("files") - private String files; - - @JsonProperty("operation") - private String operation; - - @JsonProperty("remark") - private String remark; - - public JSONObject params() { - JSONObject params = new JSONObject(); - params.put("record_id", this.record_id); - if (StringUtils.isNotEmpty(this.files)) { - params.put("files", this.files); - } - if (StringUtils.isNotEmpty(this.operation)) { - params.put("operation", this.operation); - } - if (StringUtils.isNotEmpty(this.remark)) { - params.put("remark", this.remark); - } - return params; - - } - - public String getRecord_id() { - return record_id; - } - - public void setRecord_id(String record_id) { - this.record_id = record_id; - } - - public String getFiles() { - return files; - } - - public void setFiles(String files) { - this.files = files; - } - - public String getOperation() { - return operation; - } - - public void setOperation(String operation) { - this.operation = operation; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/DealRiskRecord.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/DealRiskRecord.java deleted file mode 100644 index a1976e3f6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/DealRiskRecord.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.math.BigDecimal; - -public class DealRiskRecord { - -private String recordId; - private BigDecimal limitAmount; - @JsonProperty(defaultValue = "false") - private boolean disableMerchat; - - public String getRecordId() { - return recordId; - } - - public void setRecordId(String recordId) { - this.recordId = recordId; - } - - public BigDecimal getLimitAmount() { - return limitAmount; - } - - public void setLimitAmount(BigDecimal limitAmount) { - this.limitAmount = limitAmount; - } - - public Boolean getDisableMerchat() { - return disableMerchat; - } - - public void setDisableMerchat(Boolean disableMerchat) { - this.disableMerchat = disableMerchat; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryAttentionMerchants.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryAttentionMerchants.java deleted file mode 100644 index 231803ee5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryAttentionMerchants.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yuan on 2018/7/13. - */ -public class QueryAttentionMerchants { - private String client_moniker; - - private int page = 1; - private int limit = 10; - - - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(client_moniker)){ - params.put("client_moniker", this.client_moniker); - } - params.put("is_valid", 1); - return params; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryBlackListCustomer.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryBlackListCustomer.java deleted file mode 100644 index fd3de0de7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryBlackListCustomer.java +++ /dev/null @@ -1,46 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -public class QueryBlackListCustomer { - private String openid; - - private int page = 1; - private int limit = 10; - - - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(openid)){ - params.put("openid", this.openid); - } - params.put("is_valid", 1); - return params; - } - - public String getOpenid() { - return openid; - } - - public void setOpenid(String openid) { - this.openid = openid; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskDetail.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskDetail.java deleted file mode 100644 index 1e4c07d57..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskDetail.java +++ /dev/null @@ -1,70 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; - -public class QueryRiskDetail { - - private String record_id; - private String c_end_time; - private int client_id; - - private int limit = 20; - private int page; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - params.put("record_id", this.record_id); - params.put("client_id", this.client_id); - try { - if (c_end_time != null) { - params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" })); - } - } catch (ParseException e) { - } - return params; - } - - public String getRecord_id() { - return record_id; - } - - public void setRecord_id(String record_id) { - this.record_id = record_id; - } - - public String getC_end_time() { - return c_end_time; - } - - public void setC_end_time(String c_end_time) { - this.c_end_time = c_end_time; - } - - public int getClient_id() { - return client_id; - } - - public void setClient_id(int client_id) { - this.client_id = client_id; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskOrder.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskOrder.java deleted file mode 100644 index 96a9ecfab..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskOrder.java +++ /dev/null @@ -1,69 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; - -public class QueryRiskOrder { - - private String record_id; - private String c_end_time; - private int client_id; - private int limit = 20; - private int page; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - params.put("record_id", this.record_id); - params.put("client_id", this.client_id); - try { - if (c_end_time != null) { - params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" })); - } - } catch (ParseException e) { - } - return params; - } - - public String getRecord_id() { - return record_id; - } - - public void setRecord_id(String record_id) { - this.record_id = record_id; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public String getC_end_time() { - return c_end_time; - } - - public void setC_end_time(String c_end_time) { - this.c_end_time = c_end_time; - } - - public int getClient_id() { - return client_id; - } - - public void setClient_id(int client_id) { - this.client_id = client_id; - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskRecord.java b/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskRecord.java deleted file mode 100644 index 16ab92af8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/bean/QueryRiskRecord.java +++ /dev/null @@ -1,100 +0,0 @@ -package au.com.royalpay.payment.manage.risk.bean; - -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.ParseException; - -public class QueryRiskRecord { - - private String status; - private String client_moniker; - private String record_id; - private String c_end_time; - private int client_id; - - private int limit = 20; - private int page; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(status)){ - params.put("status", this.status); - } - if(StringUtils.isNotEmpty(client_moniker)){ - params.put("client_moniker", this.client_moniker); - } - if(StringUtils.isNotEmpty(record_id)){ - params.put("record_id", this.record_id); - } - if(StringUtils.isNotEmpty(String.valueOf(client_id))){ - params.put("client_id", this.client_id); - } - try { - if (c_end_time != null) { - params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" })); - } - } catch (ParseException e) { - } - return params; - - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRecord_id() { - return record_id; - } - - public void setRecord_id(String record_id) { - this.record_id = record_id; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public String getC_end_time() { - return c_end_time; - } - - public void setC_end_time(String c_end_time) { - this.c_end_time = c_end_time; - } - - public int getClient_id() { - return client_id; - } - - public void setClient_id(int client_id) { - this.client_id = client_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java b/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java deleted file mode 100644 index d0eb061ad..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.risk.core; - -import au.com.royalpay.payment.manage.risk.bean.*; - -import com.alibaba.fastjson.JSONObject; - -public interface RiskMerchantService { - - void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account); - - void dropOrderRiskRecord(JSONObject account, String recordId); - - void noopRiskRecord(JSONObject account, String recordId); - - void dealRiskRecord(JSONObject account, DealRiskRecord dealRiskRecord); - - void dealRiskRecordDirectly(JSONObject account, String clientMoniker); - - JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder); - - JSONObject getRiskRecords(QueryRiskRecord queryRiskRecord); - - void addWhiteList(String clientMoniker); - - void disableWhiteList(String clientMoniker); - - JSONObject getRecordById(String recordId); - - JSONObject getRiskDetails(QueryRiskDetail queryRiskDetail); - - JSONObject listAttentionMerchants(JSONObject manager, QueryAttentionMerchants queryAttention); - - void addAttentionMerchant(JSONObject manager, String clientMoniker, JSONObject params); - - void disableAttentionMerchant(JSONObject manager, String clientMoniker); - - JSONObject customerBlackList(JSONObject manager, QueryBlackListCustomer queryBlackListCustomer); - - void disableBlackListCustomer(JSONObject manager, String openid); - - void updateAttentionMerchant(JSONObject manager, String clientMoniker, JSONObject attention); - - void addBlackListCustomer(JSONObject manager, String openid, String remark); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java deleted file mode 100644 index 3fda9e882..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java +++ /dev/null @@ -1,365 +0,0 @@ -package au.com.royalpay.payment.manage.risk.core.impl; - -import au.com.royalpay.payment.manage.mappers.risk.*; -import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.risk.bean.*; -import au.com.royalpay.payment.manage.risk.core.RiskMerchantService; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -@Service -public class RiskMerchantServiceImpl implements RiskMerchantService { - - @Resource - private RiskMerchantRecordMapper riskMerchantRecordMapper; - @Resource - private RiskMerchantDetailLogMapper riskMerchantDetailLogMapper; - @Resource - private RiskTransactionLogMapper riskTransactionLogMapper; - @Resource - private RiskWhiteListMapper riskWhiteListMapper; - @Resource - private ClientManager clientManager; - @Resource - private RiskAttentionMerchantsMapper riskAttentionMerchantsAMapper; - @Resource - private ClientBankAccountMapper clientBankAccountMapper; - @Resource - private RiskCustomerBlackListMapper riskCustomerBlackListMapper; - @Resource - private CustomerMapper customerMapper; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - - @Override - @Transactional - public void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account) { - JSONObject record = riskMerchantRecordMapper.findById(addRiskDetailLog.getRecord_id()); - if (record == null) { - throw new NotFoundException("Risk Record Not Found Please Check"); - } - JSONObject detail = addRiskDetailLog.params(); - detail.put("auditor", account.getString("display_name")); - detail.put("client_id", record.getIntValue("client_id")); - detail.put("auditor_id", account.getString("manager_id")); - detail.put("create_time", new Date()); - riskMerchantDetailLogMapper.save(detail); - record.put("status",2); - riskMerchantRecordMapper.update(record); - } - - @Override - @Transactional - public void dropOrderRiskRecord(JSONObject account, String recordId) { - JSONObject riskRecord = riskMerchantRecordMapper.findById(recordId); - if (riskRecord == null) { - throw new NotFoundException("Risk Record Not Found"); - } - if (riskRecord.getIntValue("status") != 0) { - throw new BadRequestException("The Record Has Been Handled"); - } - JSONObject record = new JSONObject(); - record.put("id", recordId); - record.put("status", "1"); - riskMerchantRecordMapper.update(record); - JSONObject detail = new JSONObject(); - detail.put("record_id", recordId); - detail.put("client_id", riskRecord.getIntValue("client_id")); - detail.put("auditor", account.getString("display_name")); - detail.put("auditor_id", account.getString("manager_id")); - detail.put("remark", "进行掉单处理"); - detail.put("create_time", new Date()); - riskMerchantDetailLogMapper.save(detail); - } - - @Override - @Transactional - public void noopRiskRecord(JSONObject account, String recordId) { - JSONObject riskRecord = riskMerchantRecordMapper.findById(recordId); - if (riskRecord == null) { - throw new NotFoundException("Risk Record Not Found"); - } - if (riskRecord.getIntValue("status") != 0) { - throw new BadRequestException("The Record Has Been Handled"); - } - JSONObject record = new JSONObject(); - record.put("id", recordId); - record.put("status", "2"); - riskMerchantRecordMapper.update(record); - JSONObject detail = new JSONObject(); - detail.put("record_id", recordId); - detail.put("client_id", riskRecord.getIntValue("client_id")); - detail.put("auditor", account.getString("display_name")); - detail.put("remark", "不做处理"); - detail.put("create_time", new Date()); - riskMerchantDetailLogMapper.save(detail); - } - - @Override - @Transactional - public void dealRiskRecord(JSONObject account, DealRiskRecord dealRiskRecord) { - JSONObject record = riskMerchantRecordMapper.findById(dealRiskRecord.getRecordId()); - if (record == null) { - throw new NotFoundException("Risk Record Not Found Please Check"); - } - if (record.getIntValue("status") != 0) { - throw new BadRequestException("The Record Has Been Handled"); - } - String remark = ""; - if (dealRiskRecord.getLimitAmount() != null) { - clientManager.setMaxOrderAmount(account,record.getString("client_moniker"), dealRiskRecord.getLimitAmount()); - remark = remark + "限额" + dealRiskRecord.getLimitAmount(); - - } - if (dealRiskRecord.getDisableMerchat()) { - clientManager.switchChannelPermission(account, record.getString("client_moniker"), "Wechat", false); - clientManager.switchChannelPermission(account, record.getString("client_moniker"), "Alipay", false); - remark = remark + " 关闭支付通道"; - } - JSONObject detail = new JSONObject(); - detail.put("record_id", dealRiskRecord.getRecordId()); - detail.put("client_id", record.getIntValue("client_id")); - detail.put("auditor", account.getString("display_name")); - detail.put("remark", StringUtils.isEmpty(remark) ? null : (remark = "处理结果:" + remark)); - detail.put("create_time", new Date()); - riskMerchantDetailLogMapper.save(detail); - record.put("status", 2); - riskMerchantRecordMapper.update(record); - } - - @Override - @Transactional - public void dealRiskRecordDirectly(JSONObject account, String record_id) { - JSONObject record = riskMerchantRecordMapper.findById(record_id); - if (record == null) { - throw new NotFoundException("Risk Record Not Found Please Check"); - } - if (record.getIntValue("status") != 0) { - throw new BadRequestException("The Record Has Been Handled"); - } - JSONObject detail = new JSONObject(); - detail.put("record_id", record_id); - detail.put("client_id", record.getIntValue("client_id")); - detail.put("auditor", account.getString("display_name")); - detail.put("auditor_id", account.getString("manager_id")); - detail.put("remark", "结停"); - detail.put("create_time", new Date()); - riskMerchantDetailLogMapper.save(detail); - JSONObject recordUpdate = new JSONObject(); - recordUpdate.put("id",record_id); - recordUpdate.put("status", 1); - riskMerchantRecordMapper.update(recordUpdate); - } - - @Override - public JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder) { - return PageListUtils.buildPageListResult( - riskTransactionLogMapper.query(queryRiskOrder.toParams(), new PageBounds(queryRiskOrder.getPage(), queryRiskOrder.getLimit()))); - - } - - @Override - public JSONObject getRiskRecords(QueryRiskRecord queryRiskRecord) { - return PageListUtils.buildPageListResult( - riskMerchantRecordMapper.query(queryRiskRecord.toParams(), new PageBounds(queryRiskRecord.getPage(), queryRiskRecord.getLimit()))); - } - - @Override - public void addWhiteList(String clientMoniker) { - JSONObject white = riskWhiteListMapper.findByClientMoniker(clientMoniker); - if (white != null) { - white.put("is_valid", true); - riskWhiteListMapper.update(white); - return; - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Merchant Not Found Please Check"); - } - JSONObject record = new JSONObject(); - record.put("client_id", client.getIntValue("client_id")); - record.put("client_moniker", client.getString("client_moinker")); - record.put("create_time", new Date()); - riskWhiteListMapper.save(record); - } - - @Override - public void disableWhiteList(String clientMoniker) { - JSONObject white = riskWhiteListMapper.findByClientMoniker(clientMoniker); - if (white == null) { - throw new NotFoundException("White List Not Found Please Check"); - } - white.put("is_valid", false); - riskWhiteListMapper.update(white); - } - - @Override - public JSONObject getRecordById(String recordId) { - return riskMerchantRecordMapper.findById(recordId); - } - - @Override - public JSONObject getRiskDetails(QueryRiskDetail queryRiskDetail) { - return PageListUtils.buildPageListResult( - riskMerchantDetailLogMapper.query(queryRiskDetail.toParams(), new PageBounds(queryRiskDetail.getPage(), queryRiskDetail.getLimit()))); - - } - - @Override - public JSONObject listAttentionMerchants(JSONObject manager, QueryAttentionMerchants queryAttention) { - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - return PageListUtils.buildPageListResult( - riskAttentionMerchantsAMapper.query(queryAttention.toParams(), new PageBounds(queryAttention.getPage(), queryAttention.getLimit(), Order.formString("last_update_date.desc")))); - } - - @Override - public void addAttentionMerchant(JSONObject manager, String clientMoniker, JSONObject params) { - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("The Merchant does not exist"); - } - int clientId = client.getIntValue("client_id"); - List bankAccount = clientBankAccountMapper.clientBankAccounts(clientId); - JSONObject attention = new JSONObject(); - attention.put("client_id", clientId); - attention.put("client_moniker", clientMoniker); - attention.put("abn", client.getString("abn")); - attention.put("acn", client.getString("acn")); - attention.put("contact_person", client.getString("contact_person")); - attention.put("contact_phone", client.getString("contact_phone")); - attention.put("bank_account_no", bankAccount == null || bankAccount.size() <= 0 ? "" : bankAccount.get(0).getString("account_no")); - attention.put("is_valid", 1); - attention.put("enjoin_wechat", params.getBoolean("enjoin_wechat")== null ? true : params.getBoolean("enjoin_wechat")); - attention.put("enjoin_alipay", params.getBoolean("enjoin_alipay")== null ? true : params.getBoolean("enjoin_alipay")); - attention.put("creation_date", params.getDate("creation_date")==null ? new Date() : params.getDate("creation_date")); - attention.put("creation_by", manager.getString("manager_id")); - attention.put("remark", params.getString("remark")); - attention.put("last_update_date", new Date()); - attention.put("last_update_by", manager.getString("manager_id")); - - JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(clientMoniker); - if (attentionMerchant != null) { - if (attentionMerchant.getBoolean("is_valid")) { - throw new BadRequestException("The client has already existed"); - } - attention.remove("creation_date"); - attention.remove("creation_by"); - riskAttentionMerchantsAMapper.update(attention); - return; - } - riskAttentionMerchantsAMapper.save(attention); - } - - @Override - public void disableAttentionMerchant(JSONObject manager, String clientMoniker) { - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(clientMoniker); - if (attentionMerchant == null) { - throw new BadRequestException("The client does not exist"); - } - attentionMerchant.put("is_valid", 0); - attentionMerchant.put("last_update_date", new Date()); - attentionMerchant.put("last_update_by", manager.getString("manager_id")); - riskAttentionMerchantsAMapper.update(attentionMerchant); - } - - @Override - public JSONObject customerBlackList(JSONObject manager, QueryBlackListCustomer queryBlackListCustomer) { - JSONObject params = queryBlackListCustomer.toParams(); - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - PageList customerList = riskCustomerBlackListMapper.query(params, new PageBounds(queryBlackListCustomer.getPage(), queryBlackListCustomer.getLimit())); - JSONObject customer = new JSONObject(); - JSONObject customerAlipay = new JSONObject(); - for(JSONObject cus : customerList ){ - if (cus.getString("openid").startsWith("olH")) { - customer = customerMapper.findCustomerGlobalpayByOpenId(cus.getString("openid")); - } else { - customer = customerMapper.findCustomerByOpenId(cus.getString("openid")); - } - if (customer != null && !customer.isEmpty()) { - cus.put("headimg", customer.getString("headimg")); - cus.put("nickname", customer.getString("nickname")); - continue; - } - customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(cus.getString("openid")); - if (customerAlipay != null) { - cus.put("headimg", customerAlipay.getString("headimg")); - cus.put("nickname", customerAlipay.getString("nickname")); - } - } - return PageListUtils.buildPageListResult(customerList); - } - - @Override - public void disableBlackListCustomer(JSONObject manager, String openid) { - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - JSONObject customerBlackList = riskCustomerBlackListMapper.findByOpenid(openid); - if (customerBlackList == null) { - throw new BadRequestException("The customer does not exist"); - } - customerBlackList.put("is_valid", 0); - customerBlackList.put("last_update_date", new Date()); - customerBlackList.put("last_update_by", manager.getString("manager_id")); - riskCustomerBlackListMapper.update(customerBlackList); - } - - @Override - public void updateAttentionMerchant(JSONObject manager, String clientMoniker, JSONObject attention) { - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(clientMoniker); - if (attentionMerchant == null) { - throw new BadRequestException("The client does not exist"); - } - attentionMerchant.put("enjoin_wechat", attention.getBoolean("enjoin_wechat")); - attentionMerchant.put("enjoin_alipay", attention.getBoolean("enjoin_alipay")); - attentionMerchant.put("last_update_date", new Date()); - attentionMerchant.put("last_update_by", manager.getString("manager_id")); - riskAttentionMerchantsAMapper.update(attentionMerchant); - } - - @Override - public void addBlackListCustomer(JSONObject manager, String openid, String remark) { - if (manager == null) { - throw new BadRequestException("登录状态已过期,请清新登录再试"); - } - JSONObject customer = new JSONObject(); - customer.put("openid", openid); - customer.put("remark", remark); - customer.put("creation_date", new Date()); - customer.put("creation_by", manager.getString("manager_id")); - customer.put("last_update_date", new Date()); - customer.put("last_update_by", manager.getString("manager_id")); - riskCustomerBlackListMapper.save(customer); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java b/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java deleted file mode 100644 index 517becf17..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java +++ /dev/null @@ -1,118 +0,0 @@ -package au.com.royalpay.payment.manage.risk.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.risk.bean.*; -import au.com.royalpay.payment.manage.risk.core.RiskMerchantService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by wangning on 08/12/2016. - */ -@RestController -@ManagerMapping(value = "/sys/risk", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) -public class RiskController { - - @Resource - private RiskMerchantService riskMerchantService; - - @GetMapping("/records") - public JSONObject list(QueryRiskRecord recordQuery) { - return riskMerchantService.getRiskRecords(recordQuery); - } - - @GetMapping("/records/{record_id}") - public JSONObject getById(@PathVariable String record_id) { - return riskMerchantService.getRecordById(record_id); - } - - @PutMapping("/records/{record_id}/dropOrder") - public void dropOrder(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id) { - riskMerchantService.dropOrderRiskRecord(manager, record_id); - } - - @PutMapping("/records/{record_id}/noop") - public void noop(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id) { - riskMerchantService.noopRiskRecord(manager, record_id); - } - - @PutMapping("/records/{record_id}/directly") - public void directly(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id) { - riskMerchantService.dealRiskRecordDirectly(manager, record_id); - } - - @PutMapping("/records/{record_id}/deal") - public void dealRecord(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id, @RequestBody DealRiskRecord dealRiskRecord) { - dealRiskRecord.setRecordId(record_id); - riskMerchantService.dealRiskRecord(manager, dealRiskRecord); - } - - @GetMapping("/orders") - public JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder) { - return riskMerchantService.getRiskOrders(queryRiskOrder); - } - - @PostMapping("/white/{clientMoniker}") - public void addWhiteList(@PathVariable String clientMoniker) { - riskMerchantService.addWhiteList(clientMoniker); - } - - @PutMapping("/white/{clientMoniker}/disable") - public void disableWhiteList(@PathVariable String clientMoniker) { - riskMerchantService.disableWhiteList(clientMoniker); - } - - @PostMapping("/records/uploadFiles") - public void addRecordLog(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AddRiskDetailLog addRiskDetailLog) { -// riskMerchantService.addDetailLog(addRiskDetailLog,manager); - } - - @GetMapping("/details") - public JSONObject listDetails(QueryRiskDetail queryRiskDetail) { - return riskMerchantService.getRiskDetails(queryRiskDetail); - } - - @PostMapping("/details/remark") - public void addDetailRemark(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AddRiskDetailLog addRiskDetailLog) { - riskMerchantService.addDetailLog(addRiskDetailLog, manager); - } - - @GetMapping("/attention") - public JSONObject listMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QueryAttentionMerchants queryAttention) { - return riskMerchantService.listAttentionMerchants(manager, queryAttention); - } - - @PostMapping("/attention/{clientMoniker}") - public void addMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject params) { - riskMerchantService.addAttentionMerchant(manager, clientMoniker, params); - } - - @PutMapping("/attention/{clientMoniker}") - public void disableRiskMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - riskMerchantService.disableAttentionMerchant(manager, clientMoniker); - } - - @ManagerMapping(value = "/customer/blacklist", role = ManagerRole.RISK_MANAGER, method = RequestMethod.GET) - public JSONObject blackListCustomer(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QueryBlackListCustomer queryBlackListCustomer) { - return riskMerchantService.customerBlackList(manager, queryBlackListCustomer); - } - - @ManagerMapping(value = "/customer/blacklist/{openid}", role = ManagerRole.RISK_MANAGER, method = RequestMethod.PUT) - public void disableRiskCustomer(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String openid) { - riskMerchantService.disableBlackListCustomer(manager, openid); - } - - @ManagerMapping(value = "/attention/{clientMoniker}/detail", role = ManagerRole.RISK_MANAGER, method = RequestMethod.PUT) - public void updateRiskMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject attention) { - riskMerchantService.updateAttentionMerchant(manager, clientMoniker, attention); - } - - @ManagerMapping(value = "/customer/{openid}/blacklist", role = ManagerRole.RISK_MANAGER, method = RequestMethod.POST) - public void saveRiskCustomer(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String openid, @RequestBody JSONObject remark) { - riskMerchantService.addBlackListCustomer(manager, openid, remark.getString("remark")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java deleted file mode 100644 index 53d5e7246..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java +++ /dev/null @@ -1,257 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.bean; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * @Author lvjian - * @Date 2018/10/10 11:27 - */ -public class RiskEventQuery { - - // 调单类型 - private Integer orderType; - - // 商户编码 - private String clientMoniker; - - // 子商户号 - private String subMerchantId; - - // 订单号(多个,以逗号分隔) - private String orderIds; - - // 邮件发送状态 - private Integer emailStatus; - - // 行业 - private String industry; - - // 处理结果 - private Integer resultType; - - // 收到调单邮件日期 - private String receiveEmailDate; - - private String receiveEmailDateBegin; - - private String receiveEmailDateEnd; - - // 邮件回复截止日期 - private String replyEmailDate; - - private String replyEmailDateBegin; - - private String replyEmailDateEnd; - - private Integer page = 1; - - // 金额区间 - private String startAmount; - private String endAmount; - - public String getStartAmount() { - return startAmount; - } - - public void setStartAmount(String startAmount) { - this.startAmount = startAmount; - } - - public String getEndAmount() { - return endAmount; - } - - public void setEndAmount(String endAmount) { - this.endAmount = endAmount; - } - - public Integer getOrderType() { - return orderType; - } - - public void setOrderType(Integer orderType) { - this.orderType = orderType; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getSubMerchantId() { - return subMerchantId; - } - - public void setSubMerchantId(String subMerchantId) { - this.subMerchantId = subMerchantId; - } - - public String getOrderIds() { - return orderIds; - } - - public void setOrderIds(String orderIds) { - this.orderIds = orderIds; - } - - public Integer getEmailStatus() { - return emailStatus; - } - - public void setEmailStatus(Integer emailStatus) { - this.emailStatus = emailStatus; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public Integer getResultType() { - return resultType; - } - - public void setResultType(Integer resultType) { - this.resultType = resultType; - } - - public String getReceiveEmailDate() { - return receiveEmailDate; - } - - public void setReceiveEmailDate(String receiveEmailDate) { - this.receiveEmailDate = receiveEmailDate; - } - - public String getReplyEmailDate() { - return replyEmailDate; - } - - public void setReplyEmailDate(String replyEmailDate) { - this.replyEmailDate = replyEmailDate; - } - - public String getReceiveEmailDateBegin() { - return receiveEmailDateBegin; - } - - public void setReceiveEmailDateBegin(String receiveEmailDateBegin) { - this.receiveEmailDateBegin = receiveEmailDateBegin; - } - - public String getReceiveEmailDateEnd() { - return receiveEmailDateEnd; - } - - public void setReceiveEmailDateEnd(String receiveEmailDateEnd) { - this.receiveEmailDateEnd = receiveEmailDateEnd; - } - - public String getReplyEmailDateBegin() { - return replyEmailDateBegin; - } - - public void setReplyEmailDateBegin(String replyEmailDateBegin) { - this.replyEmailDateBegin = replyEmailDateBegin; - } - - public String getReplyEmailDateEnd() { - return replyEmailDateEnd; - } - - public void setReplyEmailDateEnd(String replyEmailDateEnd) { - this.replyEmailDateEnd = replyEmailDateEnd; - } - - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public JSONObject toJSON() { - - JSONObject params = new JSONObject(); - - if (orderType != null && orderType >= 1) { - params.put("order_type", orderType); - } - - if (StringUtils.isNotBlank(clientMoniker)) { - params.put("client_moniker", clientMoniker); - } - - if (StringUtils.isNotBlank(subMerchantId)) { - params.put("sub_merchant_id", subMerchantId); - } - - if (StringUtils.isNotBlank(orderIds)) { - orderIds = orderIds.trim().replace(",", ","); - params.put("order_ids", orderIds); - } - - if (emailStatus != null && emailStatus >= 0) { - params.put("email_status", emailStatus); - } - - if (resultType != null && resultType >= 0) { - params.put("result_type", resultType); - } - - if (StringUtils.isNotBlank(industry)) { - params.put("industry", industry); - } - - if (receiveEmailDate != null) { - params.put("receive_email_date", receiveEmailDate); - } - - if (replyEmailDate != null) { - params.put("reply_email_date", replyEmailDate); - } - - if (receiveEmailDateBegin != null) { - params.put("receive_email_date_begin", receiveEmailDateBegin); - } - - if (receiveEmailDateEnd != null) { - params.put("receive_email_date_end", receiveEmailDateEnd); - } - - if (replyEmailDateBegin != null) { - params.put("reply_email_date_begin", replyEmailDateBegin); - } - - if (replyEmailDateEnd != null) { - params.put("reply_email_date_end", replyEmailDateEnd); - } - - if (page != null && page > 0) { - params.put("page", page); - } - - if (StringUtils.isNotBlank(startAmount)) { - params.put("start_amount", startAmount); - } - - if (StringUtils.isNotBlank(endAmount)) { - params.put("end_amount", endAmount); - } - - return params; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java deleted file mode 100644 index aaff5b3f6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java +++ /dev/null @@ -1,157 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core; - -import au.com.royalpay.payment.core.beans.ChargebackStatus; -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @Author lvjian - * @Date 2018/10/10 10:29 - */ -public interface RiskBusinessService { - - /** - * 风险事件列表 - * @param params - * @return - */ - List getRiskEvents(JSONObject params); - - /** - * 分页查询风险事件 - * @param params - * @return - */ - JSONObject getRiskEventsByPage(JSONObject params, JSONObject manager); - - /** - * 风险事件按行业分析 - * @param params - * @return - */ - List analysisByIndustry(JSONObject params, JSONObject manager); - - /** - * 风险事件列表按金额分析 - * @param params - * @return - */ - List analysisByAmount(JSONObject params, JSONObject manager); - - /** - * 风险事件详情 - * @param riskId - * @return - */ - JSONObject getRiskEventDetail(String riskId); - - /** - * 获取风险事件的调单信息 - * @param riskEvent - * @return - */ - List getRiskEventOrderList(JSONObject riskEvent); - - /** - * 新增风险事件 - * @param params - */ - void addRiskEvent(JSONObject params, JSONObject manager); - - /** - * 更新事件 - * @param params - */ - void updateRiskEvent(JSONObject params,JSONObject manager); - - /** - * 发送微信模板消息 - * @param params - * @param channel - */ - void sendWxMess(JSONObject params, String channel, int result_type); - - /** - * 下载审核材料(zip) - * @param riskId - */ - void downloadAuditMaterialZiP(String riskId, HttpServletResponse response); - - /** - * 发送上传材料的邮件 - * @param riskId - */ - void sendUploadEmail(String riskId) throws IOException; - - /** - * 发送拒绝邮件 - * @param riskId - * @param refuseDescription - * @throws IOException - */ - void sendRefuseEmail(String riskId, String refuseDescription) throws IOException; - - /** - * 发送提醒邮件 - * @param riskId - */ - void sendUrgeEmail(String riskId) throws IOException; - - - /** - * 获取最新上传的审核材料 - * @param param - * @return - */ - JSONObject getRiskMaterial(JSONObject param); - - /** - * 补全历史数据的real_order_ids - */ - void completeEventRealOrderIds(); - - /** - * 删除事件 - * @param riskId - */ - void deleteRiskEvent(String riskId); - - /** - * 商户端获取通知信息 - * @param clientId - * @return - */ - JSONObject getNoticeInfo(int clientId); - - /** - * 获取风控事件所需上传的材料说明 - * @param riskId - * @return - */ - JSONObject getRiskEventMaterialsRemark(String riskId); - - void banRiskEvent(String riskId); - - void commitWaitRiskStatus(String riskId, String codeKey, JSONObject manager); - - JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager); - - JSONObject updateIsSendClient(String riskId); - - void completeOrderAmount(); - - void updateRiskEventRemark(String riskId, String remark); - - void markChargebackStatus(String riskId, JSONObject manager, ChargebackStatus status); - - /** - * 获取邮件截图 - * @param riskId - * @return - */ - JSONObject getEmailScreenshot(String riskId); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskMaterialService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskMaterialService.java deleted file mode 100644 index 1265e6540..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskMaterialService.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core; - -/** - * @Description: - * @Author: lujian - * @Date: 2018/11/19 19:40 - */ - -public interface RiskMaterialService { - - /** - * 更新最新一次提交的材料 - * @param riskId - * @param description - */ - void updateRiskMaterial(String riskId, String description); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskProcessLogService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskProcessLogService.java deleted file mode 100644 index 2050feeb2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskProcessLogService.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -/** - * @Description: - * @Author: lujian - * @Date: 2018/11/22 15:40 - */ -public interface RiskProcessLogService { - - /** - * 获取事件处理流程 - * @param riskId - * @return - */ - PageList getRiskProcessLogs(String riskId); - - /** - * 新增处理流程 - * @param log - */ - void addRiskProcessLog(JSONObject log); - - void addRiskProcessLog(String riskId, String operatorId, String operator, String remark, int resultTypeFrom, int resultTypeTo); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskUploadService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskUploadService.java deleted file mode 100644 index 75b697ed4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskUploadService.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core; - -import com.alibaba.fastjson.JSONObject; - -public interface RiskUploadService { - /** - * 上传材料 - * @param material - */ - void submitMaterial(JSONObject material); - /** - * 上传 邮件材料 - * @param material - */ - void submitEmailCertificate(JSONObject material); - - /** - * 删除缓存 - * @param codeKey - */ - void deleteUploadMailKey(String codeKey); - - /** - * - * @param codeKey - * @param risk_id - */ - void checkUploadMailKey(String codeKey,String risk_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java deleted file mode 100644 index bcf04c06c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ /dev/null @@ -1,1506 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core.impl; - -import au.com.royalpay.payment.core.CardSecureService; -import au.com.royalpay.payment.core.beans.ChargebackStatus; -import au.com.royalpay.payment.core.exceptions.EmailException; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.exceptions.OrderNotMatchException; -import au.com.royalpay.payment.core.utils.ExtParamsUtils; -import au.com.royalpay.payment.manage.mappers.log.AppMessageLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper; -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper; -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskOrdersMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskMaterialService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskEmailStatusEnum; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskOrderTypeEnum; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; -import au.com.royalpay.payment.manage.signin.beans.TodoNotice; -import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException; -import au.com.royalpay.payment.tools.device.message.AppMessage; -import au.com.royalpay.payment.tools.device.message.AppMsgSender; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.exceptions.event.WechatExceptionEvent; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.mappers.CommonRiskEventMapper; -import au.com.royalpay.payment.tools.mappers.RiskEventDAO; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.risk.RiskEvent; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.text.ParseException; -import java.util.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -/** - * @Author lvjian - * @Date 2018/10/10 10:30 - */ -@Service -public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodoNoticeProvider, ApplicationEventPublisherAware { - public static final int RISK_ORDER_TYPE_WX = 1; - public static final int RISK_ORDER_TYPE_ALIPAY = 2; - public static final int RISK_ORDER_TYPE_RP = 3; - public static final int RISK_ORDER_TYPE_WARN = 4; - public static final int RISK_ORDER_TYPE_COMMON_MID = 5; - public static final int RISK_ORDER_TYPE_CHARGEBACK = 6; - - private Logger logger = LoggerFactory.getLogger(RiskBusinessServiceImpl.class); - - @Resource - private RiskEventMapper riskEventMapper; - @Resource - private CommonRiskEventMapper commonRiskEventMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private OrderMapper orderMapper; - @Resource - private TransactionMapper transactionMapper; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private MailService mailService; - @Resource - private TradeLogService tradeLogService; - @Resource - private RiskUploadService riskUploadService; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL"; - - @Resource - private RiskProcessLogService riskProcessLogService; - - @Resource - private RiskMaterialMapper riskMaterialMapper; - @Resource - private RiskMaterialService riskMaterialService; - @Resource - private RiskFileMapper riskFileMapper; - @Resource - private RiskOrdersMapper riskOrdersMapper; - @Resource - private ClientDeviceTokenMapper clientDeviceTokenMapper; - @Resource - private AppMessageLogMapper appMessageLogMapper; - - private final Map senderMap = new HashMap<>(); - - @Resource - private CardSecureService cardSecureService; - @Resource - private ManagerMapper managerMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - private ApplicationEventPublisher publisher; - - @Resource - private SysConfigManager sysConfigManager; - - - @Resource - public void setAppMsgSenders(AppMsgSender[] senders) { - Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender)); - } - - private final ThreadPoolExecutor sendingAppleMsgPool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - @Override - public List getRiskEvents(JSONObject params) { - return riskEventMapper.findAll(params); - } - - @Override - public JSONObject getRiskEventsByPage(JSONObject params, JSONObject manager) { - - // 如果登录的角色是BD,添加查询条件result_type为1,2,3,4,order_type为1或者2 - if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - params.put("bd_id", manager.getString("manager_id")); - List orderTypes = Arrays.asList(RiskOrderTypeEnum.WECHAT_ORDER.getOrderType(), - RiskOrderTypeEnum.ALIPAY_ORDER.getOrderType(), RiskOrderTypeEnum.ROYALPAY_ORDER.getOrderType()); - params.put("order_types", orderTypes); - - List resultTypes = Arrays.asList(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType(), - RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType(), - RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType(), - RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - params.put("result_types", resultTypes); - } - - PageList riskEvents = riskEventMapper.listRisksByPage(params, new PageBounds(params.getInteger("page"), 10, Order.formString("create_time.desc"))); - - /** - * 以下为判断调单事件是否过期 - * 微信调单、支付宝调单、royalpay调单 - * 未处理、已发送、待审核、打回 - */ - Date currentDate = new Date(); - Date replyDate; - Integer resultType; - Integer orderType; - boolean isPassTimeout = false; - for (JSONObject riskEvent : riskEvents) { - try { - replyDate = DateUtils.parseDate(riskEvent.getString("reply_email_date"), "yyyy-MM-dd"); - } catch (ParseException e) { - replyDate = currentDate; - e.printStackTrace(); - } - resultType = riskEvent.getInteger("result_type"); - orderType = riskEvent.getInteger("order_type"); - isPassTimeout = (currentDate.after(replyDate)) && - (!resultType.equals(RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType())) && - (!resultType.equals(RiskResultTypeEnum.ALREADY_HANDLED.getResultType())) && - (!orderType.equals(RiskOrderTypeEnum.WARNING_ORDER.getOrderType())) && - (!orderType.equals(RiskOrderTypeEnum.GENERAL_ORDER.getOrderType())); - riskEvent.put("pass_timeout", isPassTimeout); - // 材料拒绝说明 - List materialList = riskMaterialMapper.findAllMaterials(riskEvent.getString("risk_id")); - if (!materialList.isEmpty()) { - riskEvent.put("refuse_description", materialList.get(0).getString("refuse_description")); - } - } - return PageListUtils.buildPageListResult(riskEvents); - } - - @Override - public List analysisByIndustry(JSONObject params, JSONObject manager) { - List industryAnalysis = riskEventMapper.analysisByIndustry(params); - for (JSONObject industry : industryAnalysis) { - if (StringUtils.isBlank(industry.getString("industry"))) { - industry.put("industry", "未知行业"); - } - } - return industryAnalysis; - } - - private List industryArray() { - List industryArray = new ArrayList<>(); - industryArray.add("鞋包服饰"); - industryArray.add("机票行业"); - industryArray.add("软件服务"); - industryArray.add("旅游票务"); - industryArray.add("国际租车"); - industryArray.add("医疗服务(出国)"); - industryArray.add("医疗服务(不出国)"); - industryArray.add("留学教育(网络教育)"); - industryArray.add("留学教育(一年及以下)"); - industryArray.add("其它货物贸易行业"); - industryArray.add("文具/办公用品"); - industryArray.add("综合商城"); - industryArray.add("酒店行业"); - industryArray.add("教育行业"); - industryArray.add("国际物流"); - industryArray.add("数码电器"); - industryArray.add("母婴"); - industryArray.add("化妆品"); - industryArray.add("食品"); - industryArray.add("留学教育(一年以上)"); - industryArray.add("其它服务行业"); - industryArray.add("未知行业"); - return industryArray; - } - - @Override - public List analysisByAmount(JSONObject params, JSONObject manager) { - return riskEventMapper.analysisByAmount(params); - } - - @Override - public JSONObject getRiskEventDetail(String riskId) { - - JSONObject riskEventDetail = riskEventMapper.findById(riskId); - // 获取商户信息 - JSONObject client = null; - String clientMoniker = riskEventDetail.getString("client_moniker"); - if (clientMoniker != null) { - client = clientMapper.findClientByMonikerAll(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - } - riskEventDetail.put("clientInfo", client); - return riskEventDetail; - } - - @Override - public List getRiskEventOrderList(JSONObject riskEvent) { - //String orderIds = riskEvent.getString("order_ids"); - String realOrderIds = riskEvent.getString("real_order_ids"); - JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker")); - List tradeLogs = new ArrayList<>(); - // 通用号调单会有client为空的情况,所以无法查到订单信息 - if (client != null && StringUtils.isNotBlank(realOrderIds)) { - String[] orderIdArray = realOrderIds.trim().split(","); - JSONObject orderInfo = new JSONObject(); - /** - * 获取订单信息 - * 通用号调单与其他类型的调单,订单格式不一样,所以区分 - */ - if (riskEvent.getIntValue("order_type") == 3) { - for (String orderId : orderIdArray) { - orderInfo = tradeLogService.getOrderDetail(new JSONObject(), riskEvent.getString("client_moniker"), orderId, null); - tradeLogs.add(orderInfo); - } - } else { - for (String orderId : orderIdArray) { - orderInfo = orderMapper.findOrderById(orderId, client.getIntValue("client_id")); - tradeLogs.add(orderInfo); - } - } - } - return tradeLogs; - } - - private JSONObject getEvent(JSONObject params) { - // 通用号调单不需要填写client_moniker - JSONObject client = null; - String clientMoniker = params.getString("client_moniker"); - if (clientMoniker != null) { - client = clientMapper.findClientByMonikerAll(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - } - - String orderIds = params.getString("order_ids"); - if (StringUtils.isNotBlank(orderIds)) { - // 去除所有空格与中文逗号',' - orderIds = orderIds.replace(",", ","); - orderIds = orderIds.replace(" ", ""); - params.put("order_ids", orderIds); - String[] orderIdArray = orderIds.split(","); - List orderAmountList = new ArrayList<>(); - List realOrderIdList = new ArrayList<>(); - /** - * 通用号调单的时候,是不用填写client_moniker的,但是系统需要client_id关联查询订单信息, - * 所以当client为空的时候,就不去校验订单的信息了,从而order_amounts字段为空 - * 带来的影响是前台根据金额字段查询对该风控事件就不起作用了。 - */ - if (client != null) { - for (int i = 0; i < orderIdArray.length; i++) { - PageList transactionList = transactionMapper.findByClientIdAndSystemTransactionId(client.getIntValue("client_id"), orderIdArray[i], new PageBounds(Order.formString("transaction_time.desc"))); - // 判断该笔订单是否存在,是否属于该商户 - // 由于查询订单时已经关联商户了,所以只会抛出订单不匹配的异常 - if (transactionList == null || transactionList.isEmpty()) - throw new OrderNotMatchException(); - /* - else { - if (!clientMoniker.equals(orderInfo.getString("client_moniker"))) { - throw new OrderNotMatchException(); - } - orderAmountList.add(orderInfo.getString("total_amount")); - } - */ - - // 将订单order_id存入数据库方便后面快速查询 - JSONObject orderInfo = transactionList.get(0); - realOrderIdList.add(orderInfo.getString("order_id")); - orderAmountList.add(orderInfo.getString("clearing_amount")); - } - params.put("order_amounts", StringUtils.join(orderAmountList, ",")); - params.put("real_order_ids", StringUtils.join(realOrderIdList, ",")); - } - } - return params; - } - - /** - * 添加风控事件 - * 更新risk_orders表 - * 记录风控日志 - * - * @param params - * @param manager - */ - @Override - public void addRiskEvent(JSONObject params, JSONObject manager) { - params = getEvent(params); - riskEventMapper.save(params); - setRiskOrders(params); - params = riskEventMapper.findAll(params).get(0); - riskProcessLogService.addRiskProcessLog(params.getString("risk_id"), - params.getString("fillin_id"), - params.getString("fillin_person"), - RiskResultTypeEnum.NOT_HANDLED.getRemark(), - RiskResultTypeEnum.NOT_HANDLED.getResultType(), - RiskResultTypeEnum.NOT_HANDLED.getResultType()); - int orderType = params.getIntValue("order_type"); - if (orderType == RISK_ORDER_TYPE_CHARGEBACK) { - logger.info("Chargeback event"); - RiskEvent evt = getRiskEvent(params.getString("risk_id")); - if (evt == null) { - return; - } - JSONObject order = orderMapper.find(evt.getOrders().get(0).getRealOrderId()); - if (order == null) { - throw new BadRequestException("Order Not found"); - } - if (ExtParamsUtils.getExtParamsBooleanValue(order, "chargeback_mark")) { - throw new BadRequestException("Duplicated chargeback on same order"); - } - cardSecureService.submitChargeBackReport(evt); - JSONObject update = new JSONObject(); - update.put("order_id", order.getString("order_id")); - update.put(ExtParamsUtils.EXT_PARAMS, order.getString(ExtParamsUtils.EXT_PARAMS)); - ExtParamsUtils.putExtParam(update, "chargeback_mark", true); - orderMapper.update(update); - } - } - - private RiskEvent getRiskEvent(String riskId) { - return Optional.ofNullable(commonRiskEventMapper.findById(riskId)).map(RiskEventDAO::convert).orElse(null); - } - - private void setRiskOrders(JSONObject params) { - if (StringUtils.isNotBlank(params.getString("real_order_ids"))) { - String riskId = params.getString("risk_id"); - String orderIds = params.getString("real_order_ids"); - for (String orderId : orderIds.split(",")) { - JSONObject order = transactionMapper.findByOrderId(orderId); - JSONObject riskOrder = new JSONObject(); - riskOrder.put("risk_id", riskId); - riskOrder.put("order_id", orderId); - riskOrder.put("clearing_amount", order.getString("clearing_amount")); - riskOrdersMapper.save(riskOrder); - } - } - } - - @Override - public void updateRiskEvent(JSONObject params, JSONObject manager) { - if (StringUtils.isNotBlank(params.getString("channel_result"))) { - JSONObject risk = riskEventMapper.findById(params.getString("risk_id")); - //填写渠道处理结果时候,支付宝、微信和内部调单在材料审核通过前无法填写渠道处理结果 - if (params.getIntValue("result_type") < RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType() && params.getIntValue("order_type") < RiskOrderTypeEnum.WARNING_ORDER.getOrderType()) { - throw new BadRequestException("请先提交渠道方材料进行审核!"); - } - //渠道处理结果不一样,才会记录操作并更改事件单状态为渠道方处理结果 - if (risk.getString("channel_result") == null || !risk.getString("channel_result").equals(params.getString("channel_result"))) { - params.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - riskProcessLogService.addRiskProcessLog(params.getString("risk_id"), - manager.getString("manager_id"), - manager.getString("display_name"), - RiskResultTypeEnum.ALREADY_HANDLED.getRemark() + ":" + params.getString("channel_result"), - params.getIntValue("result_type"), - RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - } - } - params = getEvent(params); - riskEventMapper.update(params); - riskOrdersMapper.clearOrders(params.getString("risk_id")); - setRiskOrders(params); - - } - - @Override - public void sendWxMess(JSONObject params, String channel, int result_type) { - String type = "禁用"; - if (params.get("temporary_close_merchant") != null) { - if (params.getBooleanValue("temporary_close_merchant")) { - type = "临时禁用"; - } - } - if (params.get("temporary_close_channel") != null) { - if (params.getBooleanValue("temporary_close_channel")) { - type = "临时禁用"; - } - } - String clientMoniker = params.getString("client_moniker"); - if (clientMoniker == null) { - return; - } - JSONObject client = clientMapper.findClientByMonikerAll(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - client.put("close_type", type); - client.put("result_type", result_type); - client.put("channel", channel); - - String bd_id = client.getString("bd_user"); - String[] bdIdArray = bd_id.split(","); - for (String bdId : bdIdArray) { - JSONObject bd = managerMapper.findById(bdId); - if (bd != null) { - if (bd.get("wx_openid") != null) { - if (StringUtils.isNotBlank(bd.getString("wx_openid"))) { - try { - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendBDCloseChannelAndPartnerTemplate(bd.getString("wx_openid"), paymentApi.getTemplateId("risk-forbidden-channelAndPartner"), client); - paymentApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,风控关闭通道{}", e.getMessage()); - publisher.publishEvent(new WechatExceptionEvent(this, e, "风控关闭通道")); - } - } - } - } - } - - List accounts = clientAccountMapper.listRiskNoticeAccounts(client.getIntValue("client_id")); - if (accounts != null) { - for (JSONObject account : accounts) { - if (account.get("wechat_openid") != null) { - if (StringUtils.isNotBlank(account.getString("wechat_openid"))) { - try { - MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendPartnerCloseChannelAndPartnerTemplate(account.getString("wechat_openid"), paymentApi.getTemplateId("risk-forbidden-channelAndPartner"), client); - paymentApi.sendTemplateMessage(msg); - } catch (WechatException e) { - logger.error("Wechat Message Error,风控关闭通道,{}", e.getMessage()); - publisher.publishEvent(new WechatExceptionEvent(this, e, "风控关闭通道")); - } - } - } - } - } - - - } - - private TemplateMessage initSendBDCloseChannelAndPartnerTemplate(String wxopenid, String templateId, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, null); - //1:关闭渠道;2:关闭商户 - if (client.getIntValue("result_type") == 1) { - msg.put("first", "您的商户(" + client.getString("client_moniker") + ")" + client.getString("channel") + "支付渠道已" + client.getString("close_type"), "#000000"); - } else { - msg.put("first", "您的商户(" + client.getString("client_moniker") + ")已" + client.getString("close_type"), "#000000"); - } - msg.put("keyword1", client.getString("channel") + "风控调单", "#0000ff"); - msg.put("keyword2", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"), "#000000"); - msg.put("remark", "请联系商户尽快配合风控部门上传相应资料,以免影响支付", "#0000FF"); - return msg; - } - - private TemplateMessage initSendPartnerCloseChannelAndPartnerTemplate(String wxopenid, String templateId, JSONObject client) { - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, null); - //1:关闭渠道;2:关闭商户 - if (client.getIntValue("result_type") == 1) { - msg.put("first", "您的商户" + client.getString("channel") + "支付渠道已" + client.getString("close_type"), "#000000"); - } else { - msg.put("first", "您的商户(" + client.getString("client_moniker") + ")已" + client.getString("close_type"), "#000000"); - } - msg.put("keyword1", client.getString("channel") + "风控调单", "#0000ff"); - msg.put("keyword2", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"), "#000000"); - msg.put("remark", "请尽快配合风控部门上传相应资料,以免影响支付", "#0000FF"); - return msg; - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - /** - * 下载审核材料 - * - * @param riskId - * @param response - */ - @Override - public void downloadAuditMaterialZiP(String riskId, HttpServletResponse response) { - - JSONObject riskEvent = riskEventMapper.findById(riskId); - String clientMoniker = riskEvent.getString("client_moniker"); - JSONObject param = new JSONObject(); - param.put("risk_id", riskId); - param.put("orderby_type", "update_time"); - JSONObject riskMaterial = getRiskMaterial(param); - try { - String downloadFilename = clientMoniker + "_audit_materials_" + DateFormatUtils.format(new Date(), "dd/MM/yyyy HH:mm:ss").toString() + ".zip"; - response.setContentType("application/octet-stream"); - response.setHeader("Content-Disposition", "attachment;filename="+downloadFilename); - ZipOutputStream zos = new ZipOutputStream(response.getOutputStream()); - for (int i = 1; i <= 6; i++) { - if (riskMaterial.containsKey("file" + i)) { - List fileList = (List) riskMaterial.get("file" + i); - for (String fileUrl : fileList) { - zos.putNextEntry(new ZipEntry("file" + i +"/"+System.currentTimeMillis()+"_"+fileUrl.substring(fileUrl.lastIndexOf("/")+1))); - InputStream inputStream = new URL(fileUrl).openConnection().getInputStream(); - byte[] buffer = new byte[1024]; - int result = 0; - while ((result = inputStream.read(buffer)) != -1) { - zos.write(buffer, 0, result); - } - inputStream.close(); - } - } - } - zos.flush(); - zos.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * 发送邮件 - * 更新事件信息 - * 记录风控日志 - * App推送消息 - * - * @param riskId - * @throws IOException - */ - @Override - public void sendUploadEmail(String riskId) throws IOException { - JSONObject event = getRiskEventDetail(riskId); - Context ctx = getMailContext(event); - final List emailsTos = (List) ctx.getVariable("emailsTos"); - final List emailsCcs = ctx.getVariable("emailsCcs") == null ? new ArrayList<>() : (List) ctx.getVariable("emailsCcs"); - final List emailsBccs = ctx.getVariable("emailsBccs") == null ? new ArrayList<>() : (List) ctx.getVariable("emailsBccs"); - final String title = (String) ctx.getVariable("title"); - final String content = thymeleaf.process("mail/risk_upload_mail.html", ctx); - final String uploadUrl = (String) ctx.getVariable("uploadUrl"); - royalThreadPoolExecutor.execute(() -> { - try { - String emailId = mailService.sendRiskEmail(title, - emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), - emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), - emailsBccs.isEmpty() ? "" : StringUtils.join(emailsBccs, ","), - content, null, event.getIntValue("order_type")); - event.put("email_status", RiskEmailStatusEnum.ALREADY_SEND.getEmailStatus()); - event.put("result_type", RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()); - event.put("submit_url", uploadUrl); - Integer orderType = event.getInteger("order_type"); - if (orderType.equals(RiskOrderTypeEnum.WARNING_ORDER.getOrderType())) { - event.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - } - riskEventMapper.update(event); - riskProcessLogService.addRiskProcessLog(event.getString("risk_id"), - event.getString("fillin_id"), - event.getString("fillin_person"), - RiskResultTypeEnum.SEND_EMAIL_TO_BD.getRemark(), - RiskResultTypeEnum.NOT_HANDLED.getResultType(), - RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()); - if (event.getIntValue("is_send_client") == 1) { - sendAppRiskMessage(event); - } - } catch (Exception e) { - logger.error("Risk Email sending failed", e); - throw new EmailException("Email Sending Failed", e); - } - }); - } - - /** - * App推送消息 - * 推送类型risk - * - * @param event - */ - private void sendAppRiskMessage(JSONObject event) { - JSONObject client = clientMapper.findClientByMoniker(event.getString("client_moniker")); - logger.debug("sendRiskAppMessage-{}-risk_id:{}", client.getString("client_moniker"), event.getString("risk_id")); - List tokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id")); - for (JSONObject devToken : tokens) { - Runnable task = () -> { - String token = devToken.getString("token"); - if (token == null || devToken.getString("client_type") == null) { - return; - } - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), devToken.getIntValue("client_id"), "risk" + devToken.getString("client_type"), token, - event.getString("risk_id")); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "risk"); - type.put("id", event.getString("risk_id")); -// apnsMessageHelper.sendAppleMessageDetail( -// LocaleSupport.localeMessage("app.message.title.risk"), LocaleSupport.localeMessage("app.message.body.risk"), -// token, event, type); - AppMsgSender sender = senderMap.get(devToken.getString("client_type")); - if (StringUtils.isBlank(token) || sender == null) { - return; - } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.risk")); - managerMsg.put("body", - LocaleSupport.localeMessage("app.message.body.risk")); - managerMsg.put("type", type); - managerMsg.put("data", new JSONObject()); - managerMsg.put("msgType", "risk"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:{}", e.getMessage()); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed" + ",token" + token, e); - } - }; - sendingAppleMsgPool.execute(task); - } - } - - /** - * 记录消息推送日志 - * - * @param dev_id - * @param client_id - * @param messageType - * @param dev_token - * @param remark - * @return - */ - private JSONObject saveAppMessageLog(String dev_id, int client_id, String messageType, String dev_token, String remark) { - JSONObject log = new JSONObject(); - log.put("dev_id", dev_id); - log.put("client_id", client_id); - log.put("msg_type", messageType); - log.put("dev_token", dev_token); - log.put("remark", remark); - log.put("send_time", new Date()); - appMessageLogMapper.save(log); - return log; - - } - - /** - * 发送拒绝邮件 - * 判断当前事件处理状态是否合理 - * 更新事件 - * 记录风控日志 - * - * @param riskId - * @param refuseDescription 拒绝说明 - * @throws IOException - */ - @Transactional - @Override - public void sendRefuseEmail(String riskId, String refuseDescription) throws IOException { - JSONObject event = getRiskEventDetail(riskId); - int resultType = event.getIntValue("result_type"); - if (RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType().intValue() == resultType) { - throw new BadRequestException("Refused Already!"); - } else if (RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType().intValue() == resultType) { - throw new BadRequestException("Passed Already!"); - } else if (RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType().intValue() != resultType) { - throw new BadRequestException(); - } - riskMaterialService.updateRiskMaterial(riskId, refuseDescription); - Context ctx = getMailContext(event); - ctx.setVariable("refuse", true); - List findAllMaterials = riskMaterialMapper.findAllMaterials(riskId); - if (findAllMaterials == null || findAllMaterials.isEmpty()) { - ctx.setVariable("refuse_description", ""); - } else { - ctx.setVariable("refuse_description", findAllMaterials.get(0).getString("refuse_description")); - } - final List emailsTos = (List) ctx.getVariable("emailsTos"); - final List emailsCcs = ctx.getVariable("emailsCcs") == null ? new ArrayList<>() : (List) ctx.getVariable("emailsCcs"); - final String uploadUrl = (String) ctx.getVariable("uploadUrl"); - final String content = thymeleaf.process("mail/risk_upload_mail.html", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - String emailId = mailService.sendRiskEmail("You need to resubmit risk materials", emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), - emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), "", content, null, event.getIntValue("order_type")); - event.put("email_status", RiskEmailStatusEnum.BACK_AND_SEND.getEmailStatus()); - event.put("result_type", RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); - event.put("submit_url", uploadUrl); - riskEventMapper.update(event); - riskProcessLogService.addRiskProcessLog(riskId, - event.getString("fillin_id"), - event.getString("fillin_person"), - RiskResultTypeEnum.MATERIAL_NOT_PASS.getRemark(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType(), - RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - }); - } - - /** - * 发送催促邮件 - * - * @param riskId - * @throws IOException - */ - @Override - public void sendUrgeEmail(String riskId) throws IOException { - JSONObject event = getRiskEventDetail(riskId); - Context ctx = getMailContext(event); - final List emailsTos = (List) ctx.getVariable("emailsTos"); - final List emailsCcs = ctx.getVariable("emailsCcs") == null ? new ArrayList<>() : (List) ctx.getVariable("emailsCcs"); - final String content = thymeleaf.process("mail/risk_urge_mail.html", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - String emailId = mailService.sendRiskEmail("Please submit risk materials as soon as possible", emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), - emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), "", content, null, event.getIntValue("order_type")); - event.put("email_status", 3); - riskEventMapper.update(event); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - }); - } - - private Context getMailContext(JSONObject event) { - String clientMoniker = event.getString("client_moniker"); - JSONObject client = clientMapper.findClientByMonikerAll(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String codeKey = RandomStringUtils.random(20, true, true); - while (stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).get() != null) { - codeKey = RandomStringUtils.random(20, true, true); - } - String codeKeyValue = RandomStringUtils.random(10, true, true); - // 原来设定的过期时间是7天 - String expireDay = "3650"; - stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).set(codeKeyValue, Long.parseLong(expireDay), TimeUnit.DAYS); - String uploadUrl = PlatformEnvironment.getEnv().concatUrl("/risk/upload/") + event.getString("risk_id") + "/" + codeKey; - int orderType = event.getIntValue("order_type"); - if (orderType == 1 || orderType == 2) - uploadUrl = PlatformEnvironment.getEnv().concatUrl("/manage.html#/analysis/monitoring/") + event.getString("risk_id") + "/bd/detail?codeKey=" + codeKey; - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - List bdNames = new ArrayList<>(); - List bdEmails = new ArrayList<>(); - for (JSONObject bd : bds) { - String bdName = bd.getString("display_name"); - if (StringUtils.isNotEmpty(bdName)) { - bdNames.add(bdName); - } - String email = bd.getString("email"); - if (StringUtils.isNotEmpty(email)) { - bdEmails.add(email); - } - } - List clientEmails = new ArrayList<>(); - clientEmails.add(client.getString("contact_email")); - client.put("is_resend", new Date().compareTo(event.getDate("reply_email_date"))); - String bdNamesStr = bdNames.isEmpty() ? "" : StringUtils.join(bdNames, ","); - String reply_date = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"), -1), "yyyy年MM月dd日"); - String reply_date_english = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"), -1), "dd/MM/yyyy"); - GregorianCalendar gregorianCalendar = new GregorianCalendar(); - String hello = gregorianCalendar.get(GregorianCalendar.AM_PM) == 0 ? "上午好" : "下午好"; - Context ctx = new Context(); - ctx.setVariable("hello", hello); - ctx.setVariable("order_type", event.getIntValue("order_type")); - ctx.setVariable("bdNamesStr", bdNamesStr); - ctx.setVariable("reply_date", reply_date); - ctx.setVariable("reply_date_english", reply_date_english); - ctx.setVariable("client", client); - ctx.setVariable("uploadUrl", uploadUrl); - ctx.setVariable("royalpay_order_type", event.getIntValue("royalpay_order_type")); - ctx.setVariable("warning_order_type", event.getIntValue("warning_order_type")); - ctx.setVariable("description", event.getString("description")); - ctx.setVariable("is_send_client", event.getIntValue("is_send_client")); - ctx.setVariable("mail_template", event.get("mail_template") == null ? 0 : event.getIntValue("mail_template")); - ctx.setVariable("send_clean_days", event.getIntValue("send_clean_days")); - String realOrderIdsStr = event.getString("real_order_ids"); - String[] realOrderIds = {}; - if (StringUtils.isNotBlank(realOrderIdsStr)) { - realOrderIds = event.getString("real_order_ids").split(","); - } - List orders = new ArrayList(); - int isSendClient = event.getIntValue("is_send_client"); - ctx.setVariable("emailsTos", bdEmails); - - // 内部调单需要密送的人 - List emailsBccs = new ArrayList<>(Arrays.asList( - "locky@royalpay.com.au ", "leo.huang@royalpay.com.au", - "mona.zhang@royalpay.com.au", "weixinfengkong@royalpay.com.au", "thomas.li@royalpay.com.au" - )); - - /** - * 如果发送给商户,则商户为收件人 - * 如果不是内部调单,抄送bd; - * 如果是内部调单,密送bd与上面定义的‘emailsBccs’ - * 如果没有勾选发送商户 - * 如果不是内部调单,直接发送商户; - * 如果是内部调单,则自定义sys_configs配置中KEY为"rick_interior_send_email"为收件人,密送同上 - * - * Arrays.asList(自定义sys_configs配置中KEY为"rick_interior_send_email")为本地debug模式的测试邮箱 - */ - if (isSendClient == 1) { - ctx.setVariable("emailsTos", clientEmails); - ctx.setVariable("emailsCcs", bdEmails); - if (orderType == RiskOrderTypeEnum.ROYALPAY_ORDER.getOrderType().intValue()) { - ctx.setVariable("emailsCcs", null); - if (PlatformEnvironment.getEnv().isDebug()) { - emailsBccs = new ArrayList<>(Arrays.asList( - sysConfigManager.getSysConfig().getString("rick_interior_send_email"), - sysConfigManager.getSysConfig().getString("rick_interior_send_email") - )); - } - emailsBccs.addAll(bdEmails); - ctx.setVariable("emailsBccs", emailsBccs); - } - } else { - if (orderType == RiskOrderTypeEnum.ROYALPAY_ORDER.getOrderType().intValue()) { - if (PlatformEnvironment.getEnv().isDebug()) { - emailsBccs = new ArrayList<>(Arrays.asList( - sysConfigManager.getSysConfig().getString("rick_interior_send_email"), - sysConfigManager.getSysConfig().getString("rick_interior_send_email") - )); - } - emailsBccs.addAll(bdEmails); - ctx.setVariable("emailsBccs", emailsBccs); - ctx.setVariable("emailsTos", Arrays.asList( - sysConfigManager.getSysConfig().getString("rick_interior_send_email") - )); - } - } - - switch (event.getIntValue("order_type")) { - case RISK_ORDER_TYPE_WX: - case RISK_ORDER_TYPE_ALIPAY: - for (String orderId : realOrderIds) { - JSONObject order = orderMapper.findOrderById(orderId, client.getIntValue("client_id")); - if (order == null) { - throw new BadRequestException("Order: " + orderId + " not exists"); - } - orders.add(order); - } - ctx.setVariable("orders", orders); - ctx.setVariable("title", "Your merchants needs to submit risk materials"); - break; - case RISK_ORDER_TYPE_RP: - for (String orderId : realOrderIds) { - JSONObject order = tradeLogService.getOrderDetail(new JSONObject(), clientMoniker, orderId, null); - if (order == null) { - throw new BadRequestException("Order: " + orderId + " not exists"); - } - order.put("order_description", StringUtils.defaultString(order.getString("order_description"))); - order.put("gateway", getGateWay(order.getIntValue("gateway"))); - order.put("status", getStatus(order.getIntValue("status"))); - order.put("order_detail", StringUtils.defaultString(order.getString("order_detail"))); - order.put("total_amount", order.getString("currency") + " " + order.getString("total_amount")); - order.put("display_amount", order.getString("currency") + " " + order.getString("display_amount")); - order.put("customer_payment_amount", order.getString("currency") + " " + order.getString("customer_payment_amount")); - order.put("clearing_amount", "AUD " + order.getString("clearing_amount")); - orders.add(order); - } - ctx.setVariable("orders", orders); - case RISK_ORDER_TYPE_WARN: - ctx.setVariable("title", "RoyalPay风控调查 — " + client.getString("short_name")); - break; - case RISK_ORDER_TYPE_CHARGEBACK: - Assert.isTrue(realOrderIds.length == 1, "Invalid risk event"); - String orderId = realOrderIds[0]; - JSONObject order = orderMapper.findOrderById(orderId, client.getIntValue("client_id")); - if (order == null) { - throw new BadRequestException("Order: " + orderId + " not exists"); - } - order.put("pay_time", DateFormatUtils.format(order.getDate("pay_time"), "yyyy-MM-dd HH:mm:ss")); - - order.put(ExtParamsUtils.EXT_PARAMS, ExtParamsUtils.getExtParams(order)); - ctx.setVariable("orderInfo", order); - ctx.setVariable("title", "Chargeback Notification from UPay"); - break; - } - return ctx; - } - - private String getRiskUploadKey(String codeKey) { - return UPLOAD_MAIL_PREFIX + codeKey; - } - - /** - * 获取风控事件上传的材料 - * - * @param param - * @return - */ - @Override - public JSONObject getRiskMaterial(JSONObject param) { - List riskMaterialList = riskMaterialMapper.findAllMaterials(param.getString("risk_id")); - if (riskMaterialList != null && !riskMaterialList.isEmpty()) { - JSONObject fileNew = riskMaterialList.get(0); - List files = riskFileMapper.findAllFiles(fileNew.getString("material_id")); - for (JSONObject file : files) { - int fileType = file.getIntValue("file_type"); - if (!fileNew.containsKey("file" + fileType)) { - List fileList = new ArrayList<>(); - fileList.add(file.getString("file_url")); - fileNew.put("file" + fileType, fileList); - } else { - List fileList = (List) fileNew.get("file" + fileType); - fileList.add(file.getString("file_url")); - fileNew.put("file" + fileType, fileList); - } - } - return fileNew; - } - - return null; - } - - /** - * 由于之前误把system_transaction_id当做order_id, - * 所以新增real_order_id作为order_id, - * 对已经建立的风控事件,补全real_order_id字段 - * 后面查找订单时会根据client_id与real_order_id查找 - */ - @Override - @Transactional - public void completeEventRealOrderIds() { - List riskEventList = getRiskEvents(null); - if (riskEventList != null && !riskEventList.isEmpty()) { - for (JSONObject riskEvent : riskEventList) { - String clientMoniker = riskEvent.getString("client_moniker"); - JSONObject client = clientMapper.findClientByMonikerAll(clientMoniker); - String systemTransactionIds = riskEvent.getString("order_ids"); - if (StringUtils.isBlank(systemTransactionIds)) - continue; - String[] systemTransactionIdArr = riskEvent.getString("order_ids").split(","); - List realOrderIds = new ArrayList<>(); - if (client == null) - continue; - for (int i = 0; i < systemTransactionIdArr.length; i++) { - PageList transactionList = transactionMapper.findByClientIdAndSystemTransactionId( - client.getIntValue("client_id"), - systemTransactionIdArr[i], - new PageBounds(Order.formString("transaction_time.desc"))); - if (transactionList != null && !transactionList.isEmpty()) - realOrderIds.add(transactionList.get(0).getString("order_id")); - } - riskEvent.put("real_order_ids", StringUtils.join(realOrderIds, ",")); - //updateRiskEvent(riskEvent); - riskEventMapper.update(riskEvent); - } - } - } - - - private byte[] generateRiskOrders(JSONObject event) throws IOException { - String[] orderIds = event.getString("order_ids").split(","); - JSONObject client = clientMapper.findClientByMonikerAll(event.getString("client_moniker")); - Workbook wb = new XSSFWorkbook(); - for (String orderId : orderIds) { - JSONObject orderDetail = tradeLogService.getOrderDetail(new JSONObject(), event.getString("client_moniker"), orderId, null); - Sheet sheet = wb.createSheet(orderId); - sheet.setDefaultColumnWidth((short) 40); - Row row0 = sheet.createRow(0); - Row row1 = sheet.createRow(1); - Row row2 = sheet.createRow(2); - Row row3 = sheet.createRow(3); - Row row4 = sheet.createRow(4); - Row row5 = sheet.createRow(5); - Row row6 = sheet.createRow(6); - Row row7 = sheet.createRow(7); - Row row8 = sheet.createRow(8); - Row row9 = sheet.createRow(9); - Row row10 = sheet.createRow(10); - Row row11 = sheet.createRow(11); - Row row12 = sheet.createRow(12); - Row row13 = sheet.createRow(13); - Row row14 = sheet.createRow(14); - Row row15 = sheet.createRow(15); - row0.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Partner"); - row0.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getJSONObject("client").getString("short_name") + "(" + orderDetail.getJSONObject("client").getString("client_moniker") + ")"); - row1.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Order ID"); - row1.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("order_id")); - row2.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Platform Transaction ID"); - row2.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("system_transaction_id")); - row3.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Order Description"); - row3.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(StringUtils.defaultString(orderDetail.getString("order_description"))); - row4.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Customer ID"); - row4.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("customer_id")); - row5.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("IP"); - row5.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("customer_ip")); - row6.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Total Amount"); - row6.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("currency") + " " + orderDetail.getString("total_amount")); - row7.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Input Amount"); - row7.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("currency") + " " + orderDetail.getString("display_amount")); - row8.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Pay Amount"); - row8.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("currency") + " " + orderDetail.getString("customer_payment_amount")); - row9.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Exchange Rate"); - row9.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("exchange_rate")); - row10.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Clearing Amount"); - row10.createCell(1, Cell.CELL_TYPE_STRING).setCellValue("AUD " + orderDetail.getString("clearing_amount")); - row11.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Gateway"); - row11.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(getGateWay(orderDetail.getIntValue("gateway"))); - row12.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Create Time"); - row12.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("create_time")); - row13.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Status"); - row13.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(getStatus(orderDetail.getIntValue("status"))); - row14.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Pay Time"); - row14.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(orderDetail.getString("transaction_time")); - row15.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Order Detail"); - row15.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(StringUtils.defaultString(orderDetail.getString("order_detail"))); - } - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - wb.write(bos); - bos.flush(); - return bos.toByteArray(); - } - - private String getGateWay(int gateWay) { - switch (gateWay) { - case 0: - return "线下扫码"; - case 1: - return "线下扫码"; - case 2: - return "商户静态码"; - case 3: - return "线上网关"; - case 4: - return "JSAPI网关"; - case 5: - return "线下网关"; - case 6: - return "线下网关"; - case 7: - return "商户静态码"; - case 8: - return "Mobile H5"; - case 9: - return "第三方网关"; - case 10: - return "APP网关"; - case 11: - return "账单码"; - case 12: - return "小程序"; - case 13: - return "原生二维码"; - case 14: - return "账单链接"; - } - return ""; - } - - private String getStatus(int status) { - switch (status) { - case 0: - return "Creating"; - case 1: - return "Failed Create Order"; - case 2: - return "Wait For Payment"; - case 3: - return "Closed"; - case 4: - return "Payment Failed"; - case 5: - return "Payment Success"; - case 6: - return "Partial Refund"; - case 7: - return "Full Refund"; - } - return ""; - } - - /** - * 检查是否有需要的调单事件待处理,由前端弹框提醒 - * - * @param manager - * @param notices - */ - @Override - public void checkTodo(JSONObject manager, List notices) { - /** - * 1、判断登录的角色是不是BD - * 2、列出BD管理的商户 - * 3、遍历商户,如果有调单事件退出循环,noticeFlag设为true - */ - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - JSONObject params = new JSONObject(); - params.put("bd_id", manager.getString("manager_id")); - params.put("date", new Date()); - List riskClientList = clientBDMapper.listBDClientInfo(params); - boolean noticeFlag = false; - for (JSONObject client : riskClientList) { - if (!noticeFlag) { - params.put("client_moniker", client.getString("client_moniker")); - List riskEventList = riskEventMapper.findAll(params); - for (JSONObject event : riskEventList) { - Integer resultType = event.getIntValue("result_type"); - Integer orderType = event.getIntValue("order_type"); - // Integer是对象,所以用equals方法比较 - if ((resultType.equals(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()) || resultType.equals(RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType())) && (orderType.equals(RiskOrderTypeEnum.WECHAT_ORDER.getOrderType()) || orderType.equals(RiskOrderTypeEnum.ALIPAY_ORDER.getOrderType()))) { - noticeFlag = true; - break; - } - } - } else { - break; - } - } - if (noticeFlag) { - String msg = LocaleSupport.localeMessage("todo.bd.order"); - notices.add(new TodoNotice("riskBusiness", msg, "#/analysis/monitoring/risk_business_bd")); - } - } - } - - @Override - public void deleteRiskEvent(String riskId) { - riskEventMapper.deleteRiskEvent(riskId); - } - - /** - * 某个商户是否存在调单事件 - * - * @param clientId - * @return - */ - @Override - public JSONObject getNoticeInfo(int clientId) { - - JSONObject client = clientMapper.findClient(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject params = new JSONObject(); - params.put("client_moniker", client.getString("client_moniker")); - params.put("is_send_client", 1); - List resultTypes = Arrays.asList(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); - params.put("result_types", resultTypes); - PageList riskEventList = riskEventMapper.listRisksByPage(params, new PageBounds(Order.formString("create_time.desc"))); - - JSONObject result = new JSONObject(); - result.put("notice_flag", false); - if (riskEventList != null && !riskEventList.isEmpty()) { - result.put("notice_flag", true); - } - return result; - } - - /** - * 调单事件需要上传的材料说明 - * 微信调单与内部调单是固定的 - * 支付宝调单由风控人员录入 - * - * @param riskId - * @return - */ - @Override - public JSONObject getRiskEventMaterialsRemark(String riskId) { - JSONObject riskEvent = riskEventMapper.findById(riskId); - Integer orderType = riskEvent.getInteger("order_type"); - List materialItemList = new ArrayList<>(); - - List materialsRemark = new ArrayList<>(); - if (orderType.equals(RiskOrderTypeEnum.WECHAT_ORDER.getOrderType())) { - materialsRemark = Arrays.asList( - "1、物流公司发货单据照片 要求:每笔交易对应的物流单必须提供,且单据必须清晰可见\n" + - "Photos of logistics companies’ goods-delivery documents Requirement: The logistics order record corresponding to each transaction must be provided, and details of records should be clearly visible. ", - "2、用户购买虚拟物品需要提供聊天记录、订单信息、发货凭证截图、 虚拟物品最终消费场景(例如何种游戏、软件)、提供消费场景网址/下载链接 要求:每笔交易对应的截图必须清晰可见\n" + - "Users need to provide chat records, order information, screenshots of delivery documents, final consumption scenarios of virtual goods (such as games, software); provide consumer scene URL / download link. Requirement: The screenshot corresponding to each transaction must be clearly visible. ", - "3、购物小票/发票存根照片 照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称 购物金额等\n" + - "Photos of shopping receipts/ invoice stubs Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc. ", - "4、显示商户门牌号码和店头名称的照片 要求:清晰可见,至少一张\n" + - "Photos of Merchant Street number & Merchant name Requirement: At least one visible photo ", - "5、显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片 要求:照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张\n" + - "Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: The photos (at least three) showing merchant activities including actual selling-goods or services obviously ", - "6、其他图片\n" + - "Other pictures " - ); - } else if (orderType.equals(RiskOrderTypeEnum.ALIPAY_ORDER.getOrderType())) { - String alipayMaterials = riskEvent.getString("alipay_materials"); - if (StringUtils.isNotBlank(alipayMaterials)) { - List alipayMaterialRemarkList = JSONObject.parseArray(alipayMaterials, JSONObject.class); - if (alipayMaterialRemarkList != null && !alipayMaterialRemarkList.isEmpty()) { - for (int i = 0; i < alipayMaterialRemarkList.size(); i++) { - materialsRemark.add(alipayMaterialRemarkList.get(i).getString("question" + (i + 1))); - } - } - } - } else if (orderType.equals(RiskOrderTypeEnum.ROYALPAY_ORDER.getOrderType())) { - materialsRemark = Arrays.asList( - "1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;\n" + - "Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc;", - "2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);\n" + - "Provide related shopping lists, invoices. (Please provide the invoices, amount of which matches that of the abnormal transaction);", - "3.提供相应的发货证明,报关单(若有消费者在国内购买,请提供物流单据或报关单);\n" + - "Relative proof of delivery, customs declaration (If the consumer purchased from China, please provide shipping receipt or customs declaration);", - "4.提供您的门店照片(门店照及店铺内的照片各一张, 一张可以看到商户名的门头照,一张可以看到相关商品或服务的店内照片);\n" + - "Photos of the store ( one of each front-store and in-store);", - "5.其他可以还原交易背景的资料,如和消费者的聊天记录等,来佐证被查单号交易的真实性;\n" + - "Other materials that can verify the payment scenario, for example, chatting history, to prove the truth of the transactions;", - "6、其他图片\n" + - "Other pictures" - ); - } - if (riskEvent.get("mail_template") != null) { - switch (riskEvent.getIntValue("mail_template")) { - case 1: - materialsRemark = getShopTemplate(); - break; - case 2: - materialsRemark = getTicketTemplate(); - break; - case 3: - materialsRemark = getStudyTemplate(); - break; - case 4: - materialsRemark = getChargebackTemplate(); - break; - default: - break; - } - } - - JSONObject material = getRiskMaterial(riskEvent); - for (int i = 0; i < materialsRemark.size(); i++) { - JSONObject materialItem = new JSONObject(); - materialItem.put("question", materialsRemark.get(i)); - if (material != null) - materialItem.put("file", material.getJSONArray("file" + (i + 1))); - materialItemList.add(materialItem); - } - JSONObject result = new JSONObject(); - result.put("material", materialItemList); - if (material != null && material.containsKey("description")) { - result.put("description", material.getString("description")); - } - if (material != null && material.containsKey("refuse_description")) { - result.put("refuse_description", material.getString("refuse_description")); - } - return result; - } - - @Override - public void banRiskEvent(String riskId) { - JSONObject params = new JSONObject(); - params.put("risk_id", riskId); - params.put("is_valid", 0); - riskEventMapper.update(params); - } - - @Override - public void commitWaitRiskStatus(String riskId, String codeKey, JSONObject manager) { - JSONObject event = riskEventMapper.findById(riskId); - if (event.getIntValue("result_type") != RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType() && event.getIntValue("result_type") != RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()) { - throw new BadRequestException("风控调单不存在或资料已补全"); - } - if (event.getIntValue("result_type") != RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()) { - event.put("result_type", RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - riskEventMapper.update(event); - } - riskProcessLogService.addRiskProcessLog(riskId, - manager.getString("manager_id"), - manager.getString("display_name"), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getRemark(), - RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - riskUploadService.deleteUploadMailKey(codeKey); - } - - @Transactional - @Override - public JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager) { - Integer resultType = params.getInteger("result_type"); - //有些商户会直接回复邮件,未通过平台渠道 - if (!resultType.equals(RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()) && !resultType.equals(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType())) { - throw new BadRequestException("Can't Pass"); - } - params.put("result_type", RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()); - riskEventMapper.update(params); - riskProcessLogService.addRiskProcessLog(params.getString("risk_id"), - manager.getString("manager_id"), - manager.getString("display_name"), - RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getRemark(), - params.getIntValue("result_type"), - RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()); - return params; - } - - @Override - public JSONObject updateIsSendClient(String riskId) { - JSONObject event = riskEventMapper.findById(riskId); - event.put("is_send_client", 1); - riskEventMapper.update(event); - event = riskEventMapper.findById(riskId); - return event; - } - - /** - * risk_orders表补全数据 - */ - @Override - public void completeOrderAmount() { - List riskEventList = getRiskEvents(null); - for (JSONObject riskEvent : riskEventList) { - if (riskEvent.getIntValue("order_type") == 4 || StringUtils.isBlank(riskEvent.getString("real_order_ids"))) { - continue; - } - String[] orderIds = riskEvent.getString("real_order_ids").split(","); - for (String orderId : orderIds) { - JSONObject transaction = transactionMapper.findByOrderId(orderId); - JSONObject riskOrder = new JSONObject(); - riskOrder.put("risk_id", riskEvent.getString("risk_id")); - riskOrder.put("order_id", transaction.getString("order_id")); - riskOrder.put("clearing_amount", transaction.getString("clearing_amount")); - riskOrdersMapper.save(riskOrder); - } - } - } - - @Override - public void updateRiskEventRemark(String riskId, String remark) { - JSONObject event = riskEventMapper.findById(riskId); - event.put("remark", remark); - riskEventMapper.update(event); - } - - @Override - @Transactional - public void markChargebackStatus(String riskId, JSONObject manager, ChargebackStatus status) { - RiskEvent risk = getRiskEvent(riskId); - if (risk == null) { - throw new NotFoundException("Risk Event not found"); - } - if (risk.getOrderType() != RISK_ORDER_TYPE_CHARGEBACK) { - throw new BadRequestException("Not Chargeback event"); - } - if (status == null || status == ChargebackStatus.PROCESSING) { - throw new BadRequestException("Invalid status"); - } - if (risk.getResultType() < 5) { - riskProcessLogService.addRiskProcessLog(riskId, - manager.getString("manager_id"), - manager.getString("display_name"), - RiskResultTypeEnum.ALREADY_HANDLED.getRemark(), - RiskResultTypeEnum.ALREADY_HANDLED.getResultType(), - RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - cardSecureService.changeChargebackReportStatus(riskId, status); - JSONObject evt = new JSONObject(); - evt.put("risk_id", risk.getRiskId()); - evt.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - riskEventMapper.update(evt); - } - } - - @Override - public JSONObject getEmailScreenshot(String riskId) { - JSONObject riskEvent = riskEventMapper.findById(riskId); - JSONObject result = new JSONObject(); - if (riskEvent == null || riskEvent.isEmpty()) return result; - - List riskMaterialList = riskMaterialMapper.findAllMaterials(riskEvent.getString("risk_id")); - if (riskMaterialList != null && !riskMaterialList.isEmpty()) { - JSONObject fileNew = riskMaterialList.get(0); - List files = riskFileMapper.findEmailScreenshot(fileNew.getString("material_id"),"0"); - logger.info("====>files:"+files); - for (JSONObject file : files) { -// int fileType = file.getIntValue("file_type"); - result.put("fileUrl" , file.getString("file_url")); - - } - result.put("description", fileNew.getString("description")); - } - - return result; - } - - private List getShopTemplate() { - return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" + - "Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;", - "2.购买物品如邮寄至国内,需提供物流公司发货单据,并提供对应物流公司的查询网址;澳洲本地销售则不需要提供物流单据 要求:每笔交易对应的物流单必须提供,且单据必须清晰可见;\n" + - "Photos of logistics companies’goods-delivery documents if trading across borders with Logistics company inquiry website for verifying; no need for local sales Requirement: The logistics order record corresponding to each transaction must be provided, and details of records should be clearly visible;", - "3.线上用户购买虚拟物品需要提供聊天记录、订单信息、发货凭证截图、 虚拟物品最终消费场景(例如何种游戏、软件)、提供消费场景网址/下载链接(公司官网、公众号等) 要求:每笔交易对应的截图必须清晰可见;\n" + - "Users need to provide chat records, order information, screenshots of delivery documents, final consumption scenarios of virtual goods (such as games, software); provide consumer scene URL / download link(official website/official accounts/other official platforms). Requirement: The screenshot corresponding to each transaction must be clearly visible;", - "4.商户线下门店提供显示商户门牌号码和店头名称的照片;显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片 要求:照片清晰,外景至少一张,内景能清楚显示商户实际售卖物品或服务,至少三张Photos of Merchant Street number & Merchant name;\n" + - "Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: At least one visible photo of store location; The photos (at least three) showing merchant activities including actual selling-goods or services obviously;", - "5.其它补充材料包含调单任务描述中要求提供的商户后台入驻材料等;商户的经营业务模式说明:介绍售卖的主要物品种类或是提供的服务内容、客单价均值、营业时间等);\n" + - "Other materials including onboarding materials as task description required;Explanation of business model for your merchant including actual selling-goods or services, per customer transaction, business hours, etc;" - ); - } - - private List getTicketTemplate() { - return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" + - "Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;", - "2.与调查交易相对应的客户旅游行程明细(包含行程单、机票、酒店预订信息等),线上用户购买行程/机票等的聊天记录、订单信息、购买凭证截图、提供消费场景网址/下载链接(公司官网、公众号等) 要求:每笔交易对应的截图必须清晰可见;\n" + - "Users need to provide travel itinerary, hotel reservation Information and journey times of customers about the orders, provide records of investigated orders, provide consumer scene URL / download link(official website/official accounts/other official platforms). Requirement: The screenshot corresponding to each transaction must be clearly visible;", - "3.商户线下门店提供显示商户门牌号码和店头名称的照片(清晰可见,至少一张);显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片(照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张 );\n" + - "Photos of Merchant Street number & Merchant name; Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: At least one visible photo of store location; The photos (at least three) showing merchant activities including actual selling-goods or services obviously;", - "4.其它补充材料包含调单任务描述中要求提供的商户后台入驻材料等;商户的经营业务模式说明:介绍售卖的主要物品种类或是提供的服务内容、客单价均值、营业时间等);\n" + - "Other materials including onboarding materials as task description required;Explanation of business model for your merchant including actual selling-goods or services, per customer transaction, business hours, etc;" - ); - } - - private List getStudyTemplate() { - return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" + - "Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;", - "2.与调查交易相对应的客户支付购买的课程明细、教育服务(签证、咨询等)明细,单价,数量,具体购买服务内容,线上用户购买的聊天记录、购买凭证截图、提供消费场景网址/下载链接(公司官网、公众号等) 要求:每笔交易对应的截图必须清晰可见;\n" + - "Users need to provide the details of purchased courses/education services(visa services/consulting/others) including price, quantity, service details, chat records online, order information, screenshots of system ordered details; provide consumer scene URL / download link(official website/official accounts/other official platforms). Requirement: The screenshot corresponding to each transaction must be clearly visible;", - "3.商户线下门店提供显示商户门牌号码和店头名称的照片(清晰可见,至少一张);显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片(照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张 );\n" + - "Photos of Merchant Street number & Merchant name; Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: At least one visible photo of store location; The photos (at least three) showing merchant activities including actual selling-goods or services obviously;", - "4.其它补充材料包含调单任务描述中要求提供的商户后台入驻材料等;商户的经营业务模式说明:介绍售卖的主要物品种类或是提供的服务内容、客单价均值、营业时间等);\n" + - "Other materials including onboarding materials as task description required;Explanation of business model for your merchant including actual selling-goods or services, per customer transaction, business hours, etc;" - ); - } - - private List getChargebackTemplate() { - return Arrays.asList("1.A legible copy of the signed authority and/or receipts from the Cardholder. \n" + - "持卡人签名授权书和/或收据的清晰副本。", - "2.Copy of any tax invoice/s and/or signed disclosure of cancellation policy. \n" + - "任何税务发票和/或签署的披露取消政策的副本。", - "3.Any transaction Information relating to the sale of any digital goods purchased online.\n" + - "与在线购买的任何数字商品的销售有关的任何交易信息。", - "4.Description of the goods/services supplied and/or proof of delivery/collection of goods.\n" + - "提供的商品/服务的说明和/或交付/收货的证明。(消费者买了什么,商家卖了什么,消费者收没收到货,如何收到的)", - "5.Copy of Mail Order/telephone order transaction receipt.\n" + - "邮件订单/电话订单交易收据的副本。", - "6.Cardholder identification or any form of communication with the Cardholder, including email correspondence. \n" + - "持卡人身份或与持卡人的任何形式的通信,包括电子邮件通信。"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskMaterialServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskMaterialServiceImpl.java deleted file mode 100644 index 06efa92a1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskMaterialServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core.impl; - -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskMaterialService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @Description: - * @Author: lujian - * @Date: 2018/11/19 19:45 - */ -@Service -public class RiskMaterialServiceImpl implements RiskMaterialService { - - @Resource - private RiskMaterialMapper riskMaterialMapper; - - @Override - public void updateRiskMaterial(String riskId, String description) { - List materialList = riskMaterialMapper.findAllMaterials(riskId); - if (!materialList.isEmpty()){ - JSONObject material = materialList.get(0); - material.put("refuse_description", description); - riskMaterialMapper.update(material); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskProcessLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskProcessLogServiceImpl.java deleted file mode 100644 index 2743fd4bd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskProcessLogServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core.impl; - -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskProcessLogMapper; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * @Description: - * @Author: lujian - * @Date: 2018/11/22 15:46 - */ -@Service -public class RiskProcessLogServiceImpl implements RiskProcessLogService { - - @Resource - private RiskProcessLogMapper riskProcessLogMapper; - - @Override - public PageList getRiskProcessLogs(String riskId) { - return riskProcessLogMapper.getRiskProcessLogs(riskId, new PageBounds(Order.formString("create_time"))); - } - - @Override - public void addRiskProcessLog(JSONObject log) { - riskProcessLogMapper.addRiskProcessLog(log); - } - - @Override - public void addRiskProcessLog(String riskId, String operatorId, String operator, String remark, int resultTypeFrom, int resultTypeTo) { - JSONObject log = new JSONObject(); - log.put("risk_id", riskId); - log.put("operator_id", operatorId); - log.put("operator", operator); - log.put("remark", remark); - log.put("result_type_from", resultTypeFrom); - log.put("result_type_to", resultTypeTo); - riskProcessLogMapper.addRiskProcessLog(log); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java deleted file mode 100644 index c368cabfa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java +++ /dev/null @@ -1,133 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.core.impl; - -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper; -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper; -import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Date; - -@Service -public class RiskUploadServiceIpml implements RiskUploadService { - @Resource - private RiskMaterialMapper riskMaterialMapper; - @Resource - private RiskFileMapper riskFileMapper; - @Resource - private RiskEventMapper riskEventMapper; - @Resource - private RiskProcessLogService riskProcessLogService; - @Resource - private StringRedisTemplate stringRedisTemplate; - private final String UPLOAD_MAIL_PREFIX = "UPLOAD_MAIL"; - - @Transactional - @Override - public void submitMaterial(JSONObject material) { - String riskId = material.getString("risk_id"); - JSONObject event = riskEventMapper.findById(riskId); - Integer resultType = event.getInteger("result_type"); - if (!resultType.equals(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()) && !resultType.equals(RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()) && !resultType.equals(RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType())) { - throw new BadRequestException("Committed Already"); - } - material.put("update_time", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); - riskMaterialMapper.save(material); - material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id")); - for(int i=1;i<=10;i++){ - if(material.containsKey("file"+i+"_url")){ - JSONArray urls = material.getJSONArray("file" + i + "_url"); - if (urls == null || urls.isEmpty()) - continue; - for(Object url:urls){ - JSONObject file = new JSONObject(); - file.put("file_url",url.toString()); - file.put("file_type",i); - file.put("material_id",material.getString("material_id")); - riskFileMapper.save(file); - } - } - } - if(event.getIntValue("result_type")!= RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()){ - event.put("result_type", RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - riskEventMapper.update(event); - } - //材料审核通过的保持原状态 -// if(event.getIntValue("result_type")== RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()){ -// event.put("result_type", RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()); -// riskEventMapper.update(event); -// } - } - - @Override - public void submitEmailCertificate(JSONObject material) { - String riskId = material.getString("risk_id"); - JSONObject event = riskEventMapper.findById(riskId); - Integer resultType = event.getInteger("result_type"); - if (!resultType.equals(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()) && !resultType.equals(RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()) && !resultType.equals(RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType())) { - throw new BadRequestException("Committed Already"); - } - material.put("update_time", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); - riskMaterialMapper.save(material); - material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id")); - if(material.containsKey("file0_url")){ - JSONArray urls = material.getJSONArray("file0_url"); - if (urls == null || urls.isEmpty()) - throw new BadRequestException("Picture cannot be empty"); - - for(Object url:urls){ - JSONObject file = new JSONObject(); - file.put("file_url",url.toString()); - file.put("file_type",0); - file.put("material_id",material.getString("material_id")); - riskFileMapper.save(file); - } - } - - if(event.getIntValue("result_type")!= RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType()){ - event.put("result_type", RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - riskEventMapper.update(event); - } - } - - @Override - public void deleteUploadMailKey(String codeKey) { - stringRedisTemplate.delete(getRiskUploadKey(codeKey)); - } - - @Override - public void checkUploadMailKey(String codeKey,String risk_id) { - JSONObject event = riskEventMapper.findById(risk_id); - - //到期日前一天的下午6点前url可用 -// try { -// String reply = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"),-1),"yyyy-MM-dd 18:00:00"); -// if(new Date().after( DateUtils.parseDate(reply,new String[]{"yyyy-MM-dd HH:mm:ss"}))){ -// deleteUploadMailKey(codeKey); -// throw new BadRequestException("Url expired"); -// } -// } catch (ParseException e) { -// e.printStackTrace(); -// } - - if (StringUtils.isNotEmpty(codeKey)) { - String redisUpload = stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).get(); - if (redisUpload == null) { - throw new BadRequestException("Url expired"); - } - } - } - private String getRiskUploadKey(String codeKey){ - return UPLOAD_MAIL_PREFIX + codeKey; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskEmailStatusEnum.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskEmailStatusEnum.java deleted file mode 100644 index 7f9f2e570..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskEmailStatusEnum.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.enums; - -/** - * @Author lvjian - * @Date 2018/10/16 22:22 - */ -public enum RiskEmailStatusEnum { - NOT_SEND(0), - ALREADY_SEND(1), - BACK_AND_SEND(2), - SEND_EMAIL_AGAIN(3), - ; - - private Integer emailStatus; - - RiskEmailStatusEnum(Integer emailStatus) { - this.emailStatus = emailStatus; - } - - public Integer getEmailStatus() { - return emailStatus; - } - - public void setEmailStatus(Integer emailStatus) { - this.emailStatus = emailStatus; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java deleted file mode 100644 index d0d5604ff..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.enums; - -/** - * @Author lvjian - * @Date 2018/10/16 20:18 - */ -public enum RiskOrderTypeEnum { - - WECHAT_ORDER(1), - ALIPAY_ORDER(2), - ROYALPAY_ORDER(3), - WARNING_ORDER(4), - GENERAL_ORDER(5) - ; - - private Integer orderType; - - public Integer getOrderType() { - return orderType; - } - - public void setOrderType(Integer orderType) { - this.orderType = orderType; - } - - RiskOrderTypeEnum(Integer orderType) { - this.orderType = orderType; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java deleted file mode 100644 index 0b2630a8c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.enums; - -/** - * @Author lvjian - * @Date 2018/10/16 20:40 - */ -public enum RiskResultTypeEnum { - - NOT_HANDLED(0), - SEND_EMAIL_TO_BD(1), - WAIT_FOR_AUDIT(2), - MATERIAL_AUDIT_PASS(3), - MATERIAL_NOT_PASS(4), - ALREADY_HANDLED(5); - - private Integer resultType; - - private static final String[] REMARK_ARR = { - "风控事件已创建", - "已发送邮件,资料完善中", - "资料已提交,等待审核", - "风控初审完成,渠道方审核中", - "材料打回", - "渠道方处理结果" - }; - - RiskResultTypeEnum(Integer resultType) { - this.resultType = resultType; - } - - public Integer getResultType() { - return resultType; - } - - public void setResultType(Integer resultType) { - this.resultType = resultType; - } - - public String getRemark() { - return REMARK_ARR[resultType]; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java deleted file mode 100644 index de35da3c3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java +++ /dev/null @@ -1,226 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.web; - -import au.com.royalpay.payment.core.CardSecureService; -import au.com.royalpay.payment.core.beans.ChargebackStatus; -import au.com.royalpay.payment.core.beans.ChargebackTransaction; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskMaterialService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * 风控业务 - * - * @Author lvjian - * @Date 2018/10/10 1:12 - */ -@RestController -@ManagerMapping(value = "/risk/business/", role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.RISK_MANAGER}) -public class RiskBusinessController { - - @Autowired - private RiskBusinessService riskBusinessService; - - @Autowired - private RiskMaterialService riskMaterialService; - @Resource - private CardSecureService cardSecureService; - @Autowired - private ClientManager clientManager; - - @Autowired - private RiskProcessLogService riskProcessLogService; - - - @GetMapping(value = "events") - public JSONObject getRiskEvents(RiskEventQuery riskEventQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = riskEventQuery.toJSON(); - return riskBusinessService.getRiskEventsByPage(params, manager); - } - - @GetMapping(value = "events/analysis/industry") - public List analysisByIndustry(RiskEventQuery riskEventQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = riskEventQuery.toJSON(); - return riskBusinessService.analysisByIndustry(params, manager); - } - - @GetMapping(value = "events/analysis/amount") - public List analysisByAmount(RiskEventQuery riskEventQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = riskEventQuery.toJSON(); - return riskBusinessService.analysisByAmount(params, manager); - } - - @GetMapping(value = "events/{risk_id}") - public JSONObject getRiskEventDetail(@PathVariable("risk_id") String riskId, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject riskEvent = riskBusinessService.getRiskEventDetail(riskId); - List tradeLogs = riskBusinessService.getRiskEventOrderList(riskEvent); - riskEvent.put("tradeLogs", tradeLogs); - riskEvent.put("process_logs", riskProcessLogService.getRiskProcessLogs(riskId)); - return riskEvent; - } - - @GetMapping(value = "events/{risk_id}/detail") - public JSONObject getRiskEventDetailWithoutTradelogs(@PathVariable("risk_id") String riskId, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return riskBusinessService.getRiskEventDetail(riskId); - } - - - @GetMapping("/chargeback_orders") - public List searchForChargeback(@RequestParam("channel_order_id") String channelOrderId) { - return cardSecureService.queryOrdersForChargeBack(channelOrderId); - } - - @PostMapping(value = "events") - public void registerRiskEvent(@RequestBody JSONObject params, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - params.put("fillin_id", manager.getString("manager_id")); - params.put("fillin_person", manager.getString("display_name")); - riskBusinessService.addRiskEvent(params, manager); - } - - @PutMapping(value = "events") - public void updateRiskEvent(@RequestBody JSONObject params, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - riskBusinessService.updateRiskEvent(params, manager); - } - - @PutMapping(value = "events/pass") - public void riskEventMaterialPass(@RequestBody JSONObject params, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - riskBusinessService.riskEventMaterialPass(params, manager); - } - - @GetMapping(value = "/{risk_id}/download/materialsAsZIP") - public void downloadComplianceZip(@PathVariable("risk_id") String riskId, HttpServletResponse response) { - riskBusinessService.downloadAuditMaterialZiP(riskId, response); - } - - - @PutMapping("/{risk_id}/upload_mail") - public void uploadEmail(@PathVariable String risk_id) throws IOException { - riskBusinessService.sendUploadEmail(risk_id); - } - - @PutMapping("/{risk_id}/refuse") - public void refuseEmail(@PathVariable("risk_id") String riskId, @RequestBody JSONObject otherParams) throws IOException { - riskBusinessService.sendRefuseEmail(riskId, otherParams.getString("refuse_description")); - } - - @GetMapping("/{risk_id}/material") - public JSONObject getRiskMaterial(@PathVariable("risk_id") String riskId) { - JSONObject param = new JSONObject(); - param.put("risk_id", riskId); - return riskBusinessService.getRiskMaterial(param); - } - - @GetMapping("/{risk_id}/all_material_info") - public JSONObject getRiskAlMaterialInfo(@PathVariable("risk_id") String riskId) { - return riskBusinessService.getRiskEventMaterialsRemark(riskId); - } - - @PutMapping("/channel/{channel}/permission/{channelFlag}") - public void updateMerchantChannel(@RequestBody JSONObject params, - @PathVariable("channelFlag") Boolean channelFlag, - @PathVariable("channel") String channel, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.switchChannelPermission(manager, params.getString("client_moniker"), channel, channelFlag); - - if (channelFlag) { - params.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - } else { - //1:禁用渠道;2:禁用商户 - riskBusinessService.sendWxMess(params, channel, 1); - } - riskBusinessService.updateRiskEvent(params, manager); - } - - @PutMapping("/partner/{isValid}") - public void updateMerchantValid(@RequestBody JSONObject params, - @PathVariable("isValid") Boolean isValid, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - String clientMoniker = params.getString("client_moniker"); - if (isValid) { - clientManager.disableClient(clientMoniker, manager); - riskBusinessService.sendWxMess(params, "-", 2); - Integer temporaryCloseMerchant = params.getInteger("temporary_close_merchant"); - if (temporaryCloseMerchant != 1) { - params.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - } - } else { - clientManager.revertClient(clientMoniker, manager); - params.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); - } - riskBusinessService.updateRiskEvent(params, manager); - } - - @PutMapping("/{risk_id}/urge") - public void urgeEmail(@PathVariable String risk_id) throws IOException { - riskBusinessService.sendUrgeEmail(risk_id); - } - - @PutMapping("/chargebacks/{riskId}/mark_status") - public void markChargebackStatus(@PathVariable String riskId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestBody JSONObject status) { - riskBusinessService.markChargebackStatus(riskId, manager, status.getObject("status", ChargebackStatus.class)); - } - - @DeleteMapping("/ban/{risk_id}") - public void banEvent(@PathVariable String risk_id) { - riskBusinessService.banRiskEvent(risk_id); - } - - @PutMapping("/commitWaitRiskStatus/{risk_id}/{codeKey}") - public void commitWaitRiskStatus(@PathVariable String risk_id, @PathVariable String codeKey, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - riskBusinessService.commitWaitRiskStatus(risk_id, codeKey, manager); - } - - @GetMapping(value = "/partners") - public List getPartners(PartnerQuery partnerQuery) { - JSONObject param = partnerQuery.toJsonParam(); - return clientManager.getClientBySimpleQuery(param); - } - - // 更新库中的orderIds - @GetMapping("/complete/real_order_id") - public void completeEventRealOrderIds() { - riskBusinessService.completeEventRealOrderIds(); - } - - @GetMapping("/delete/event") - public void deleteRiskEvent(@RequestParam("risk_id") String riskId) { - riskBusinessService.deleteRiskEvent(riskId); - } - - @GetMapping("/update/event/is_send_client") - public JSONObject updateRiskEventIsSendClient(@RequestParam("risk_id") String riskId) { - return riskBusinessService.updateIsSendClient(riskId); - } - - @GetMapping("/complete/event/order_amount") - public String completeOrderAmount() { - riskBusinessService.completeOrderAmount(); - return "SUCCESS"; - } - - @PutMapping("{risk_id}/remark") - @ResponseBody - public void updateRiskEventRemark(@PathVariable("risk_id") String riskId, @RequestBody JSONObject remark) { - riskBusinessService.updateRiskEventRemark(riskId, remark.getString("remark")); - } -} - diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java deleted file mode 100644 index c80e40488..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java +++ /dev/null @@ -1,68 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.web; - -import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; -import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; - -@RestController -@RequestMapping("/risk/upload") -public class RiskFileUploadController { - @Resource - private RiskUploadService riskUploadService; - @Resource - private RiskBusinessService riskBusinessService; - @Resource - private RiskProcessLogService riskProcessLogService; - - /** - * 上传材料的链接 - * @param codeKey - * @param risk_id - * @return - */ - @GetMapping("/{risk_id}/{codeKey}") - public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String risk_id) { - //检查codekey是否有效 -// riskUploadService.checkUploadMailKey(codeKey,risk_id); - JSONObject event = riskBusinessService.getRiskEventDetail(risk_id); - ModelAndView view = new ModelAndView("mail/risk_upload"); - view.addObject("codeKey", codeKey); - view.addObject("risk_id",risk_id); - view.addObject("order_type",event.getIntValue("order_type")); - view.addObject("short_name",event.getJSONObject("clientInfo").getString("short_name")); - return view; - } - - /** - * 上传调单材料 - * @param codeKey - * @param material - */ - @PostMapping("/{codeKey}") - public void upload(@PathVariable String codeKey, - @RequestBody JSONObject material, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { -// riskUploadService.checkUploadMailKey(codeKey, material.getString("risk_id")); - riskUploadService.submitMaterial(material); - JSONObject event = riskBusinessService.getRiskEventDetail(material.getString("risk_id")); - //材料可以重新提交 - if(event.getIntValue("result_type")==3){ - return; - } - riskProcessLogService.addRiskProcessLog(material.getString("risk_id"), - manager.getString("manager_id"), - manager.getString("display_name"), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getRemark(), - RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), - RiskResultTypeEnum.WAIT_FOR_AUDIT.getResultType()); - riskUploadService.deleteUploadMailKey(codeKey); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskProcessLogController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskProcessLogController.java deleted file mode 100644 index d4bac6c77..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskProcessLogController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.riskbusiness.web; - -import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @Description: - * @Author: lujian - * @Date: 2018/11/22 15:52 - */ -@RestController -@RequestMapping(value = "/risk/business/process/logs") -public class RiskProcessLogController { - - @Resource - private RiskProcessLogService riskProcessLogService; - - @GetMapping(value = "/{risk_id}") - public List getRiskProcessLogs(@PathVariable("risk_id") String riskId) { - return riskProcessLogService.getRiskProcessLogs(riskId); - } - - @PostMapping - public void addRiskProcessLog(@RequestBody JSONObject log) { - riskProcessLogService.addRiskProcessLog(log); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/rservices/bean/RServicesApplyQuery.java b/src/main/java/au/com/royalpay/payment/manage/rservices/bean/RServicesApplyQuery.java deleted file mode 100644 index c53647952..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/rservices/bean/RServicesApplyQuery.java +++ /dev/null @@ -1,70 +0,0 @@ -package au.com.royalpay.payment.manage.rservices.bean; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - - -/** - * Created by yixian on 2016-07-01. - */ -public class RServicesApplyQuery { - private int limit = 10; - private int page = 1; - private String clientMoniker; - private String serviceName; - private String status; - - public JSONObject toJson(){ - JSONObject json = new JSONObject(); - if(StringUtils.isNotEmpty(clientMoniker)){ - json.put("client_moniker",clientMoniker); - } - if(StringUtils.isNotEmpty(serviceName)){ - json.put("service_name",serviceName); - } - if(StringUtils.isNotEmpty(status)){ - json.put("status",status); - } - return json; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/rservices/core/RServicesApplyService.java b/src/main/java/au/com/royalpay/payment/manage/rservices/core/RServicesApplyService.java deleted file mode 100644 index f9a30854d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/rservices/core/RServicesApplyService.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.rservices.core; - -import au.com.royalpay.payment.manage.rservices.bean.RServicesApplyQuery; -import com.alibaba.fastjson.JSONObject; - -public interface RServicesApplyService { - - JSONObject getServicesApply(RServicesApplyQuery applyQuery); - - void passServicesApply(String applyId, JSONObject manager); - - void refuseServicesApply(String applyId, JSONObject manager); - - void saveDebitDetail(JSONObject applyInfo, JSONObject client); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java deleted file mode 100644 index 22bb7d81b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java +++ /dev/null @@ -1,246 +0,0 @@ -package au.com.royalpay.payment.manage.rservices.core.impl; - -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.mappers.PmtOrderMapper; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientIncrementalMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientServicesApplyMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.rservices.bean.RServicesApplyQuery; -import au.com.royalpay.payment.manage.rservices.core.RServicesApplyService; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.mappers.CommonIncrementalChannelMapper; -import au.com.royalpay.payment.tools.merchants.beans.TransactionBizSubType; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.Date; -import java.util.UUID; - -@Service -public class RServicesApplyServiceImpl implements RServicesApplyService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientServicesApplyMapper clientServicesApplyMapper; - @Resource - private TransactionService transactionService; - @Resource - private RetailAppService retailAppService; - @Resource - private Locker locker; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private CommonIncrementalChannelMapper commonIncrementalChannelMapper; - @Resource - private MailService mailService; - @Resource - private ClientIncrementalMapper clientIncrementalMapper; - @Resource - private PmtOrderMapper pmtOrderMapper; - - @Override - public JSONObject getServicesApply(RServicesApplyQuery applyQuery) { - JSONObject params = applyQuery.toJson(); - PageList apply = clientServicesApplyMapper.listServicesApply(params, new PageBounds(applyQuery.getPage(), applyQuery.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(apply); - } - - @Override - public void passServicesApply(String applyId, JSONObject manager) { - JSONObject applyInfo = clientServicesApplyMapper.findApplyByApplyId(applyId); - if (applyInfo == null) { - throw new BadRequestException("签约服务申请不存在"); - } - String lockKey = applyInfo.getIntValue("client_id") + "_processing_RServices_" + applyInfo.getString("service_code"); - if (!locker.lock(lockKey, 120_000)) { - throw new ServerErrorException("Processing task, wait for a moment"); - } - try { - applyInfo.put("operator", manager.getString("manager_id")); - applyInfo.put("operator_time", new Date()); - applyInfo.put("status", 1); - clientServicesApplyMapper.update(applyInfo); - JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code")); - JSONObject clientServices = clientIncrementalMapper.findByClinetIdAndChannel(applyInfo.getIntValue("client_id"), increment.getString("channel")); - JSONObject serviceInfo = new JSONObject(); - if (applyInfo.getBigDecimal("surcharge_rate").compareTo(BigDecimal.ZERO)>0) { - serviceInfo.put("incremental_mode", 1); - serviceInfo.put("incremental_rate_value", applyInfo.getBigDecimal("surcharge_rate")); - }else { - serviceInfo.put("incremental_mode", 2); - serviceInfo.put("incremental_rate_value", 0); - } - serviceInfo.put("title", applyInfo.getString("title")); - if (clientServices == null) { - serviceInfo.put("incremental_id", UUID.randomUUID().toString()); - serviceInfo.put("client_id", applyInfo.getIntValue("client_id")); - serviceInfo.put("channel", increment.getString("channel")); - serviceInfo.put("total_incremental_amount", applyInfo.getBigDecimal("amount")); - serviceInfo.put("create_time", applyInfo.getDate("create_time")); - serviceInfo.put("update_time", applyInfo.getDate("operator_time")); - serviceInfo.put("operator", applyInfo.getString("operator")); - serviceInfo.put("is_valid", 1); - clientIncrementalMapper.save(serviceInfo); - }else { - clientServices.putAll(serviceInfo); - clientServices.put("total_incremental_amount", applyInfo.getBigDecimal("amount")); - clientServices.put("create_time", applyInfo.getDate("create_time")); - clientServices.put("update_time", applyInfo.getDate("operator_time")); - clientServices.put("operator", applyInfo.getString("operator")); - clientServices.put("is_valid", 1); - clientIncrementalMapper.update(clientServices); - } - if (applyInfo.getBigDecimal("amount").compareTo(BigDecimal.ZERO) > 0) { - afterPassProcessingApply(applyInfo); - } - } finally { - locker.unlock(lockKey); - } - } - - @Override - public void refuseServicesApply(String applyId, JSONObject manager) { - JSONObject applyInfo = clientServicesApplyMapper.findApplyByApplyId(applyId); - if (applyInfo == null) { - throw new BadRequestException("签约服务申请不存在"); - } - applyInfo.put("operator", manager.getString("manager_id")); - applyInfo.put("operator_time", new Date()); - applyInfo.put("status", 2); - clientServicesApplyMapper.update(applyInfo); - } - - private void afterPassProcessingApply(JSONObject applyInfo) { - JSONObject client = clientManager.getClientInfo(applyInfo.getIntValue("client_id")); - saveDebitDetail(applyInfo, client); - sendNotify(applyInfo, client); - } - - @Override - public void saveDebitDetail(JSONObject applyInfo, JSONObject client) { - String orderId = "R-" + client.getString("client_moniker") + "-" + applyInfo.getString("service_code") + "-" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS") + "-" + RandomStringUtils.random(3, true, false).toUpperCase(); - JSONObject transaction = new JSONObject(); - transaction.put("org_id", client.getIntValue("org_id")); - transaction.put("system_transaction_id", orderId); - transaction.put("order_id", orderId); - transaction.put("client_id", applyInfo.getIntValue("client_id")); - transaction.put("currency", PlatformEnvironment.getEnv().getForeignCurrency()); - transaction.put("transaction_currency", PlatformEnvironment.getEnv().getForeignCurrency()); - transaction.put("transaction_amount", applyInfo.getBigDecimal("amount")); - transaction.put("clearing_currency", PlatformEnvironment.getEnv().getForeignCurrency()); - transaction.put("clearing_amount", applyInfo.getBigDecimal("amount")); - transaction.put("exchange_rate", 1); - transaction.put("channel", "System"); - transaction.put("transaction_type", "Debit"); - transaction.put("transaction_time", new Date()); - transaction.put("clearing_status", 0); - transaction.put("remark", applyInfo.getString("service_code") + ":" + applyInfo.getString("title")); - transaction.put("system_generate", 1); - transactionService.saveTransaction(transaction, TransactionBizSubType.OTHER); - JSONObject order = new JSONObject(); - order.put("order_id", orderId); - order.put("org_id", client.getIntValue("org_id")); - order.put("client_id", applyInfo.getIntValue("client_id")); - order.put("transaction_date", new Date()); - order.put("order_description", applyInfo.getString("title")); - order.put("order_detail", applyInfo.getString("title")); - order.put("currency", "AUD"); - order.put("display_amount", applyInfo.getBigDecimal("amount")); - order.put("total_amount", applyInfo.getBigDecimal("amount")); - order.put("coupon_payment_amount", 0); - order.put("customer_payment_amount", applyInfo.getBigDecimal("amount")); - order.put("refund_amount", applyInfo.getBigDecimal("amount")); - order.put("customer_ip", "0.0.0.0"); - order.put("surcharge_rate", "0"); - order.put("create_time", new Date()); - order.put("expire_time", new Date()); - order.put("confirm_time", new Date()); - order.put("gateway", 0); - order.put("status", 7); - order.put("channel", "System"); - pmtOrderMapper.save(order); - } - - private void sendNotify(JSONObject applyInfo, JSONObject client) { -// try { -// retailAppService.sendRServicesApplyMessage(applyInfo, client); -// } catch (Exception e) { -// logger.error("R-services-{}付费成功app推送发送失败 - {}",client.getIntValue("client_id"), e); -// } - JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code")); - JSONObject account = clientAccountMapper.findByUsernameForDuplicate(applyInfo.getString("apply_username")); - if (increment == null || account == null) { - return; - } - if (StringUtils.isNotBlank(account.getString("contact_email"))) { - Context ctx = new Context(); - ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png")); - ctx.setVariable("name", account.getString("display_name")); - ctx.setVariable("service_name", increment.getString("channel")); - ctx.setVariable("title", applyInfo.getString("title")); - ctx.setVariable("currency", "AUD"); - ctx.setVariable("amount", applyInfo.getBigDecimal("amount").toPlainString()); - ctx.setVariable("create_time", DateFormatUtils.format(applyInfo.getDate("create_time"),"yyyy-MM-dd HH:mm:ss")); - final String content = thymeleaf.process("mail/rservices_email_notice", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - mailService.sendEmail("[RoyalPay]" + increment.getString("channel") + "付费成功通知", account.getString("contact_email"), "", content); - } catch (Exception e) { - logger.error("R-services-{}付费成功邮件发送失败 - {}",client.getIntValue("client_id"),account.getString("contact_email"), e); - } - }); - } - if (StringUtils.isNotBlank(account.getString("wechat_openid"))) { - try { - MpWechatApi mpWechatApi = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid")); - if (mpWechatApi == null) { - return; - } - String templateId = mpWechatApi.getTemplateId("payment-success-cashier"); - if (templateId == null) { - return; - } - TemplateMessage message = new TemplateMessage(account.getString("wechat_openid"), templateId, null); - message.put("first", "[RoyalPay]" + increment.getString("channel") + "付费成功通知", "#ff0000"); - message.put("keyword1", "- $" + applyInfo.getString("amount"), "#ff0000"); - message.put("keyword2", "签约时间" + DateFormatUtils.format(applyInfo.getDate("create_time"),"yyyy-MM-dd HH:mm:ss"), "#000000"); - message.put("keyword3", applyInfo.getString("title"), "#0000ff"); - message.put("remark", "感谢您的使用,如有疑问或需帮助,请拨打我们的客服电话:1300 107 750或添加RoyalPay官方客服号:royalpay_1详询.", "#ff0000"); - mpWechatApi.sendTemplateMessage(message); - } catch (Exception e) { - logger.error("R-services-{}付费成功微信模版发送失败 - {}",client.getIntValue("client_id"),account.getString("wechat_openid"), e); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/rservices/web/RServicesApplyController.java b/src/main/java/au/com/royalpay/payment/manage/rservices/web/RServicesApplyController.java deleted file mode 100644 index f8a91879c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/rservices/web/RServicesApplyController.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.rservices.web; - - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.rservices.bean.RServicesApplyQuery; -import au.com.royalpay.payment.manage.rservices.core.RServicesApplyService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@RequestMapping(value = "/sys/rservices") -public class RServicesApplyController { - @Resource - private RServicesApplyService rServicesApplyService; - - @ManagerMapping(value = "/apply", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.DIRECTOR}) - @GetMapping(value = "/apply") - public JSONObject getServicesApply(RServicesApplyQuery applyQuery) { - return rServicesApplyService.getServicesApply(applyQuery); - } - - @ManagerMapping(value = "/apply/{applyId}/pass", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void passServicesApply(@PathVariable String applyId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - rServicesApplyService.passServicesApply(applyId, manager); - } - - @ManagerMapping(value = "/apply/{applyId}/refuse", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void refuseServicesApply(@PathVariable String applyId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - rServicesApplyService.refuseServicesApply(applyId, manager); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java b/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java deleted file mode 100644 index db76cd0ae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.settlement.core; - -import com.alibaba.fastjson.JSONObject; - -import java.util.Date; - -/** - * Create by yixian at 2018-03-20 17:42 - */ -public interface ManualSettleSupport { - - JSONObject requestManualSettle(Date settleTo, String accountId); - - JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData); - - JSONObject listWithClearInfo(int page); - - JSONObject getWithManualSettleAnalysis(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java deleted file mode 100644 index 594fd6e01..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -package au.com.royalpay.payment.manage.settlement.core.impls; - -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.HolidayDAO; -import au.com.royalpay.payment.manage.mappers.system.HolidayMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeConstants; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * Create by yixian at 2018-03-20 17:44 - */ -@Service -public class ManualSettleSupportImpl implements ManualSettleSupport { - - @Resource - private TransactionMapper transactionMapper; - @Resource - private TaskManualSettleMapper taskManualSettleMapper; - @Resource - private ClearingLogMapper clearingLogMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private HolidayMapper holidayMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientAnalysisMapper clientAnalysisMapper; - - @Override - public JSONObject requestManualSettle(Date settleTo, String accountId) { - JSONObject account = clientAccountMapper.findById(accountId); - if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) { - throw new ForbiddenException(); - } - int clientId = account.getIntValue("client_id"); - if (DateUtils.isSameDay(new Date(), settleTo)) { - throw new BadRequestException("Cannot settle today's transactions"); - } - JSONObject currentTask = findCurrentSettle(clientId, false); - if (currentTask.getBooleanValue("locked")) { - throw new BadRequestException("You cannot do this at the moment"); - } - String taskId = currentTask.getString("task_id"); - currentTask.put("request_time", new Date()); - currentTask.put("client_id", clientId); - currentTask.put("applier_id", account.getString("account_id")); - currentTask.put("applier_name", account.getString("display_name")); - currentTask.put("settle_to", settleTo); - currentTask.put("disable_flag", 0); - currentTask.put("disable_time", null); - currentTask.put("disable_remark", null); - if (taskId != null) { - taskManualSettleMapper.update(currentTask); - } else { - taskManualSettleMapper.save(currentTask); - } - return currentTask; - } - - @Override - public JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData) { - JSONObject client = clientManager.getWithConfig(clientId); - if (!client.getBooleanValue("manual_settle")) { - throw new ForbiddenException("Manual Settlement Not Enabled"); - } - if (client.getBooleanValue("skip_clearing")) { - throw new ForbiddenException("Manual Settlement Not Enabled"); - } - List unsettleRequests = taskManualSettleMapper.listActiveTasks(clientId); - JSONObject todayTask = unsettleRequests.isEmpty() ? null : unsettleRequests.get(0); - if (!unsettleRequests.isEmpty()) { - todayTask.put("settle_to", DateFormatUtils.format(todayTask.getDate("settle_to"), "yyyy-MM-dd")); - } else { - todayTask = new JSONObject(); - } - HolidayDAO holiday = holidayMapper.findDefine(DateTime.now().toString("yyyy-MM-dd")); - boolean locked = holiday != null; - //今天是清算日 - if (locked) { - List settleLogs = clearingLogMapper.findByDate(new Date()); - //清算日但无清算记录 - locked = settleLogs.isEmpty(); - } - //今天未清算则锁定 - todayTask.put("locked", locked); - if (includingUnsettleData) { - Date end = findSettleTo(client.getIntValue("clean_days"), new Date(), client); - List unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId, end); - unsettleReports.parallelStream().forEach(report -> { - report.put("clearing_amount", CurrencyAmountUtils.scalePlatformCurrency(report.getBigDecimal("clearing_amount"))); - BigDecimal settleAmount = report.getBigDecimal("settle_amount"); - report.put("settle_amount", CurrencyAmountUtils.scalePlatformCurrency(settleAmount == null ? BigDecimal.ZERO : settleAmount)); - report.put("settle_amount2", report.getBigDecimal("settle_amount").toString()); - report.put("date_str", DateFormatUtils.format(report.getDate("trans_date"), "yyyy-MM-dd")); - }); - todayTask.put("unsettle", unsettleReports); - BigDecimal totalClearing = unsettleReports.stream().map(report -> report.getBigDecimal("clearing_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - todayTask.put("total_clearing_amount", CurrencyAmountUtils.scalePlatformCurrency(totalClearing)); - BigDecimal totalSettle = unsettleReports.stream().map(report -> report.getBigDecimal("settle_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - todayTask.put("total_settle_amount", CurrencyAmountUtils.scalePlatformCurrency(totalSettle)); - todayTask.put("desc", LocaleSupport.localeMessage("manual_settle.notice")); - } - return todayTask; - } - - - private Date findSettleTo(int cleanDays, Date settleDate, JSONObject client) { - Date end = findPreviousWorkDay(settleDate, true); - for (int d = 0; d < cleanDays; d++) { - end = findPreviousWorkDay(end, false); - end = DateUtils.addDays(end, -1); - } - - if (client.getBooleanValue("weekend_delay") && cleanDays == 1 && new DateTime(settleDate).dayOfWeek().get() == DateTimeConstants.MONDAY) {// 周一 - end = findPreviousWorkDay(end, false); - } - end = DateUtils.truncate(end, Calendar.DATE); - return end; - } - - private Date findPreviousWorkDay(Date end, boolean testHoliday) { - while (isWeekend(new DateTime(end)) || (testHoliday && isHoliday(end))) { - end = DateUtils.addDays(end, -1); - } - return end; - } - - - private boolean isHoliday(Date date) { - HolidayDAO define = holidayMapper.findDefine(new DateTime(date).toString("yyyy-MM-dd")); - if (define == null) { - return false; - } - return !define.toHolidayDefine().canSettle(BalanceGroup.NORMAL_CROSS_BORDER); - } - - public static boolean isWeekend(DateTime date) { - int day = date.dayOfWeek().get(); - return day == DateTimeConstants.SATURDAY || day == DateTimeConstants.SUNDAY; - } - - - @Override - public JSONObject listWithClearInfo(int page) { - PageList manuals = taskManualSettleMapper.getEveryLatestRecord( - new PageBounds(page, 20, Order.formString("unsettle.desc"))); - return PageListUtils.buildPageListResult(manuals); - } - - @Override - public JSONObject getWithManualSettleAnalysis() { - JSONObject params = new JSONObject(); - params.put("end", new Date()); - JSONObject analysis = taskManualSettleMapper.getManualSettleAnalysis(); - analysis.put("total_partners", clientAnalysisMapper.countClientsAll(params)); - return analysis; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/package-info.java b/src/main/java/au/com/royalpay/payment/manage/settlement/package-info.java deleted file mode 100644 index 51ea13c08..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 清算相关 - * Create by yixian at 2018-03-20 17:42 - */ -package au.com.royalpay.payment.manage.settlement; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/web/ClientManualSettleController.java b/src/main/java/au/com/royalpay/payment/manage/settlement/web/ClientManualSettleController.java deleted file mode 100644 index 3a4ada1ea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/web/ClientManualSettleController.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.settlement.web; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.util.Date; - -/** - * Create by yixian at 2018-03-20 20:30 - */ -@RequestMapping("/client/manual_settle") -@RestController -public class ClientManualSettleController { - @Resource - private ManualSettleSupport manualSettleSupport; - - @PartnerMapping(value = "/today", method = RequestMethod.GET, roles = {PartnerRole.ADMIN}) - @ReadOnlyConnection - public JSONObject checkRequestInToday(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return manualSettleSupport.findCurrentSettle(account.getIntValue("client_id"), true); - } - - @PartnerMapping(value = "/today", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN}) - public JSONObject requestManualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject data) { - String settleToStr = data.getString("settle_to"); - if (settleToStr == null) { - throw new ParamInvalidException("settle_to", "error.payment.valid.param_missing"); - } - try { - Date setteTo = DateUtils.parseDate(settleToStr, "yyyy-MM-dd"); - return manualSettleSupport.requestManualSettle(setteTo, account.getString("account_id")); - } catch (ParseException e) { - throw new ParamInvalidException("settle_to", "error.payment.valid.invalid_time"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java deleted file mode 100644 index df0ec94ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java +++ /dev/null @@ -1,131 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.domain.application; - -import au.com.royalpay.payment.manage.shopify.auth.domain.graphqlclient.PaymentsAppConfigureClient; -import au.com.royalpay.payment.manage.shopify.auth.web.command.ShopifyPermissionRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchant; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchantAccount; -import au.com.royalpay.payment.manage.shopify.store.domain.service.MerchantAccountService; -import au.com.royalpay.payment.manage.shopify.store.domain.service.MerchantService; -import au.com.royalpay.payment.manage.shopify.store.domain.service.ShopifyStoreService; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.shopify.config.ShopifyAuthProvider; -import au.com.royalpay.shopify.entity.ShopifyAccessToken; -import au.com.royalpay.shopify.entity.ShopifyPermissionURL; -import au.com.royalpay.shopify.service.ShopifyAuthService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.util.Date; - -@Slf4j -@Component -public class ShopifyMerchantAuthApplication { - - @Value("${shopify.version:2022-01}") - private String apiVersion; - - @Autowired - private ShopifyAuthProvider authProvider; - private static final String PAYMENT_SETTING_URL = "https://%s/services/payments_partners/gateways/%s/settings"; - - @Autowired - private ShopifyAuthService shopifyAuthService; - - @Autowired - private ShopifyStoreService shopifyStoreService; - - @Autowired - private SignInStatusManager signInStatusManager; - - @Autowired - private MerchantAccountService merchantAccountService; - - @Autowired - private MerchantService merchantService; - - @Autowired - private PaymentsAppConfigureClient paymentsAppConfigureClient; - - /** - * 获取shopify店铺授权url - * @param shopifyStoreHost - * @return - */ - public ShopifyPermissionURL getShopifyPermissionUrl(String shopifyStoreHost) { - ShopifyPermissionURL shopifyPermissionURL = shopifyAuthService.shopifyPermission(shopifyStoreHost); - return shopifyPermissionURL; - } - - /** - * 绑定安装shopify店铺 - * - * @param request 店铺信息 - * @return - */ - public ShopifyAccessToken install(ShopifyPermissionRequest request) { - LoginInfo loginInfo = new LoginInfo(); - loginInfo.setLoginId(request.getLoginId()); - loginInfo.setPassword(request.getPassword()); - signInStatusManager.partnerSignIn(loginInfo); - - String shop = request.getShop(); - SimpleMerchantAccount simpleMerchantAccount = merchantAccountService.getByUsername(request.getLoginId()); - SimpleMerchant simpleMerchant = merchantService.getByClientId(simpleMerchantAccount.getClientId()); - - ShopifyStore shopifyShop = shopifyStoreService.getByShopifyShop(shop); - ShopifyAccessToken accessToken = shopifyAuthService.getAccessToken(shop, request.getCode()); - if (shopifyShop == null) { - shopifyStoreService.createShopifyStore(ShopifyStore.instanceOf(simpleMerchantAccount, simpleMerchant, shop, accessToken)); - return getShopifyPaymentAppConfigUrl(shop, accessToken); - } - - shopifyStoreService.modifyShopifyStore(shopifyShop - .setClientId(simpleMerchantAccount.getClientId()) - .setClientMoniker(simpleMerchant.getClientMoniker()) - .setModifyTime(new Date()) - .setAccessToken(accessToken.getAccess_token()) - .setScope(accessToken.getScope()) - .setModifier(shop)); - - return getShopifyPaymentAppConfigUrl(shop, accessToken); - } - - private ShopifyAccessToken getShopifyPaymentAppConfigUrl(String shop, ShopifyAccessToken accessToken) { - try { - paymentsAppConfigureClient.paymentsAppConfigure(shop, true, apiVersion); - } catch (IOException e) { - log.error(String.format("Shopify store [%s] payment app setting error: %s", shop, e.getMessage())); - throw new BadRequestException("Payment app setting error"); - } - - String redirectUrl = String.format(PAYMENT_SETTING_URL, shop, authProvider.getNewestAuthConfig().getClientId()); - return accessToken.setRedirectUrl(redirectUrl); - } - - /** - * shopify商户授权 - * - * @param shop shopify商户标识 - * @param code 授权code - * @return - */ - @Deprecated - public ShopifyAccessToken merchantOnboard(String shop, String code) { - ShopifyAccessToken accessToken = shopifyAuthService.getAccessToken(shop, code); - ShopifyStore shopifyStore = shopifyStoreService.getByShopifyShop(shop); - if (shopifyStore == null) { - throw new BadRequestException("Get access token error"); - } - shopifyStoreService.modifyShopifyStore(shopifyStore.setAccessToken(accessToken.getAccess_token()).setScope(accessToken.getScope())); - - return getShopifyPaymentAppConfigUrl(shop, accessToken); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/exception/ShopifyRequestVerifyException.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/exception/ShopifyRequestVerifyException.java deleted file mode 100644 index 6aa717dcb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/exception/ShopifyRequestVerifyException.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.domain.exception; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ResponseStatus; - -@ResponseStatus(HttpStatus.UNAUTHORIZED) -public class ShopifyRequestVerifyException extends RuntimeException{ - public ShopifyRequestVerifyException(String message) { - super(message); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/GraphqlRequestBody.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/GraphqlRequestBody.java deleted file mode 100644 index b96930786..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/GraphqlRequestBody.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.domain.graphqlclient; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class GraphqlRequestBody { - private String query; - private Object variables; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/PaymentsAppConfigureClient.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/PaymentsAppConfigureClient.java deleted file mode 100644 index 4acff1ac1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/PaymentsAppConfigureClient.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.domain.graphqlclient; - -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; -import au.com.royalpay.payment.manage.shopify.store.domain.service.ShopifyStoreService; -import au.com.royalpay.shopify.support.GraphqlSchemaReaderUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.client.WebClient; - -import java.io.IOException; - -@Slf4j -@Component -public class PaymentsAppConfigureClient { - - private static final String url = "https://%s/payments_apps/api/%s/graphql.json"; - - @Autowired - private ShopifyStoreService shopifyStoreService; - - public void paymentsAppConfigure(String shopDomain, Boolean ready, String apiVersion) throws IOException { - - WebClient webClient = WebClient.builder().build(); - - GraphqlRequestBody graphQLRequestBody = new GraphqlRequestBody(); - - final String query = GraphqlSchemaReaderUtil.getSchemaFromFileName("paymentsAppConfigure"); - - graphQLRequestBody.setQuery(query); - PaymentsAppConfigureRequestBody requestBody = new PaymentsAppConfigureRequestBody(shopDomain, ready); - graphQLRequestBody.setVariables(requestBody); - - ShopifyStore shopifyStore = shopifyStoreService.getByShopifyShop(shopDomain); - JSONObject result = webClient - .post() - .uri(String.format(url, shopDomain, apiVersion)) - .header("X-Shopify-Access-Token", shopifyStore.getAccessToken()) - .bodyValue(graphQLRequestBody) - .retrieve() - .bodyToMono(JSONObject.class) - .block(); - - log.info(String.format("retrieve: [%s]", result.toString())); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/PaymentsAppConfigureRequestBody.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/PaymentsAppConfigureRequestBody.java deleted file mode 100644 index a9ce7c90d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/graphqlclient/PaymentsAppConfigureRequestBody.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.domain.graphqlclient; - -import lombok.Data; - -@Data -public class PaymentsAppConfigureRequestBody { - - private String externalHandle; - - private boolean ready; - - public PaymentsAppConfigureRequestBody(String shopDomain, Boolean ready) { - this.externalHandle = shopDomain; - this.ready = ready; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/manage/ShopifyManageService.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/manage/ShopifyManageService.java deleted file mode 100644 index 66d70d98d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/manage/ShopifyManageService.java +++ /dev/null @@ -1,51 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.domain.manage; - -import au.com.royalpay.payment.manage.mappers.shopify.ShopifyStoreMapper; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; -import au.com.royalpay.shopify.config.ShopifyAuthProvider; -import au.com.royalpay.shopify.entity.ShopifyAccessToken; -import au.com.royalpay.shopify.service.ShopifyAuthService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -@Service -public class ShopifyManageService { - - private final ShopifyAuthProvider shopifyAuthProvider; - private final ShopifyAuthService shopifyAuthService; - private final ShopifyStoreMapper shopifyStoreMapper; - - public ShopifyManageService(ShopifyAuthProvider shopifyAuthProvider, ShopifyAuthService shopifyAuthService, ShopifyStoreMapper shopifyStoreMapper) { - this.shopifyAuthProvider = shopifyAuthProvider; - this.shopifyAuthService = shopifyAuthService; - this.shopifyStoreMapper = shopifyStoreMapper; - } - - public List rotateAccessToken(String newSecret, String refreshToken) { - shopifyAuthProvider.addSecret(newSecret); - List failedStore = shopifyStoreMapper.listAvailableStores().parallelStream().filter(store -> !store.getTokenSecret().equalsIgnoreCase(newSecret)) - .map(store -> rotateStoreAccessToken(store, refreshToken)) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - if (failedStore.isEmpty()) { - shopifyAuthProvider.activateSecret(newSecret); - } - return failedStore; - } - - private JSONObject rotateStoreAccessToken(ShopifyStore store, String refreshToken) { - try { - ShopifyAccessToken newToken = shopifyAuthService.rotateAccessToken(store.storeName(), refreshToken, store.getAccessToken()); - shopifyStoreMapper.update(ShopifyStore.builder().id(store.getId()).accessToken(newToken.getAccess_token()).tokenSecret(newToken.getSecret()).build()); - return null; - } catch (Exception e) { - return new JSONObject(Map.of("shop", store.getShopifyShop(), "client_moniker", store.getClientMoniker(), "message", e.getMessage())); - } - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthController.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthController.java deleted file mode 100644 index 572be4987..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthController.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.web; - -import au.com.royalpay.payment.manage.shopify.auth.domain.application.ShopifyMerchantAuthApplication; -import au.com.royalpay.payment.manage.shopify.auth.web.command.ShopifyPermissionRequest; -import au.com.royalpay.shopify.entity.ShopifyAccessToken; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; - -/** - * shopify认证授权资源 - */ -@RestController -@RequestMapping(value = "/shopify/auth") -public class ShopifyAuthController { - - @Autowired - private ShopifyMerchantAuthApplication shopifyMerchantAuthApplication; - - /** - * 获取shopify店铺授权URL - * - * @param request 店铺信息 - * @return - */ - @PostMapping("/install") - public ShopifyAccessToken shopifyStoreInstall(@RequestBody @Valid ShopifyPermissionRequest request) { - ShopifyAccessToken shopifyAccessToken = shopifyMerchantAuthApplication.install(request); - return shopifyAccessToken; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java deleted file mode 100644 index 1d6fd77bc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java +++ /dev/null @@ -1,108 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.web; - -import au.com.royalpay.payment.manage.shopify.auth.domain.application.ShopifyMerchantAuthApplication; -import au.com.royalpay.payment.manage.shopify.auth.domain.exception.ShopifyRequestVerifyException; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.shopify.entity.ShopifyCommonParameter; -import au.com.royalpay.shopify.entity.ShopifyPermissionURL; -import au.com.royalpay.shopify.service.ShopifyRequestValidator; -import au.com.royalpay.shopify.support.ShopifyEndpoint; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.http.server.ServletServerHttpRequest; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.servlet.http.HttpServletRequest; -import java.util.regex.Pattern; - -@Controller -@RequestMapping(value = "/shopify") -public class ShopifyAuthTemplateController { - - @Autowired - private ShopifyMerchantAuthApplication shopifyMerchantAuthApplication; - - @Autowired - private ShopifyRequestValidator shopifyRequestValidator; - - @Autowired - private StringRedisTemplate stringRedisTemplate; - - /** - * shopify店铺安装入口 - * - * @param shop - * @param hmac - * @return - */ - @GetMapping("/auth") - @ShopifyEndpoint - public String shopifyStorePermission(@RequestParam(value = "shop", required = false) String shop, - @RequestParam(value = "hmac", required = false) String hmac, HttpServletRequest request) { - if (StringUtils.isAnyEmpty(shop, hmac)) { - throw new BadRequestException("Parameter shop&hmac are required"); - } - if (!Pattern.matches("^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", shop)) { - throw new BadRequestException("Parameter shop is invalid."); - } - String queryStr = UriComponentsBuilder.fromHttpRequest(new ServletServerHttpRequest(request)) - .replaceQueryParam("hmac").build().getQuery(); - if (!shopifyRequestValidator.verifyPermission(queryStr, hmac)) { - throw new ShopifyRequestVerifyException("This request parameters is invalid"); - } - ShopifyPermissionURL shopifyPermissionURL = shopifyMerchantAuthApplication.getShopifyPermissionUrl(shop); - return "redirect:" + shopifyPermissionURL.getUrl(); - } - - /** - * shopify店铺授权后回调URL - * - * @param code - * @param hmac - * @param host - * @param state - * @param shop - * @param timestamp - * @return - */ - @GetMapping("/auth/back") - @ShopifyEndpoint - public String shopifyStoreAuthRedirect(@RequestParam(value = "code", required = false) String code, - @RequestParam(value = "hmac", required = false) String hmac, - @RequestParam(value = "host", required = false) String host, - @RequestParam(value = "state", required = false) String state, - @RequestParam(value = "shop", required = false) String shop, - @RequestParam(value = "timestamp", required = false) String timestamp) { - if (StringUtils.isAnyEmpty(shop, hmac, host, state, shop, timestamp)) { - throw new BadRequestException("Parameter shop,hmac,host,state,shop,timestamp are required"); - } - if (!Pattern.matches("^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", shop)) { - throw new ShopifyRequestVerifyException("Parameter shop is invalid."); - } - - String preState = stringRedisTemplate.boundValueOps("shopifyAuthState:" + shop).get(); - if (!state.equals(preState)) { - throw new ShopifyRequestVerifyException("This request parameters is invalid"); - } - stringRedisTemplate.delete("shopifyAuthState:" + shop); - ShopifyCommonParameter shopifyCommonParameter = ShopifyCommonParameter.builder() - .code(code) - .hmac(hmac) - .host(host) - .state(state) - .shop(shop) - .timestamp(timestamp) - .build(); - if (Boolean.FALSE.equals(shopifyRequestValidator.valid(shopifyCommonParameter))) { - throw new ShopifyRequestVerifyException("This request parameters is invalid"); - } - - String redirectUri = PlatformEnvironment.getEnv().concatUrl("/auth.html#/shopify/login?code=" + code + "&hmac=" + hmac + "&host=" + host + "&state=" + state + "&shop=" + shop + "×tamp=" + timestamp); - return "redirect:" + redirectUri; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/command/ShopifyPermissionRequest.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/command/ShopifyPermissionRequest.java deleted file mode 100644 index ef2526d07..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/command/ShopifyPermissionRequest.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.web.command; - -import au.com.royalpay.payment.manage.shopify.store.web.command.CreateShopifyMerchantCommand; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ShopifyPermissionRequest { - - @NotBlank(message = "Login Id can not blank") - private String loginId; - - @NotBlank(message = "Password can not blank") - private String password; - - @NotBlank(message = "Code can not blank") - private String code; - - @NotBlank(message = "Shop can not blank") - @Pattern(regexp = "^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", message = "Shop hostname is invalid") - private String shop; - - public static ShopifyPermissionRequest instanceOf(CreateShopifyMerchantCommand command) { - return ShopifyPermissionRequest.builder() - .loginId(command.getPaymentAccount().getLoginId()) - .password(command.getPaymentAccount().getPassword()) - .code(command.getCode()) - .shop(command.getShopifyShop()) - .build(); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/command/ShopifyVerifyRequest.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/command/ShopifyVerifyRequest.java deleted file mode 100644 index fc7a8fb02..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/command/ShopifyVerifyRequest.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.auth.web.command; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; - -@Data -public class ShopifyVerifyRequest { - - @NotBlank(message = "Code can not blank") - private String code; - - @NotBlank(message = "hmac can not blank") - private String hmac; - - @NotBlank(message = "host can not blank") - private String host; - - @NotBlank(message = "Shop can not blank") - @Pattern(regexp = "^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", message = "Shop hostname is invalid") - private String shop; - - @NotBlank(message = "state can not blank") - private String state; - - @NotBlank(message = "timestamp can not blank") - private String timestamp; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java deleted file mode 100644 index e5a6bfc65..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java +++ /dev/null @@ -1,86 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.hooks; - -import au.com.royalpay.payment.manage.shopify.auth.domain.exception.ShopifyRequestVerifyException; -import au.com.royalpay.payment.manage.shopify.hooks.command.ShopifyCustomerRedactCommand; -import au.com.royalpay.payment.manage.shopify.hooks.command.ShopifyCustomerRequestCommand; -import au.com.royalpay.payment.manage.shopify.hooks.command.ShopifyShopRedactCommand; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; -import au.com.royalpay.payment.manage.shopify.store.domain.service.ShopifyStoreService; -import au.com.royalpay.shopify.service.ShopifyRequestValidator; -import au.com.royalpay.shopify.support.ShopifyEndpoint; -import au.com.royalpay.shopify.support.ShopifyHttpUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@Slf4j -@RestController -@RequestMapping(value = "/shopify") -public class ShopifyWebhooksController { - - @Autowired - private ShopifyStoreService shopifyStoreService; - - @Autowired - private ShopifyRequestValidator shopifyRequestValidator; - - /** - * 推送顾客信息查询请求 - * - */ - @PostMapping("/customer/request") - @ShopifyEndpoint - public void customerRequest(@RequestHeader("X-Shopify-Hmac-SHA256") String hmac, - HttpServletRequest request, - HttpServletResponse response) { - String requestBody = ShopifyHttpUtils.getRequestBody(request); - if (!shopifyRequestValidator.verify(requestBody, hmac)) { - throw new ShopifyRequestVerifyException("Unauthorized"); - } - ShopifyCustomerRequestCommand shopifyCustomerRequestCommand = JSONObject.parseObject(requestBody, ShopifyCustomerRequestCommand.class); - } - - /** - * 擦除顾客信息消息通知 - * - */ - @PostMapping("/customer/erasure") - @ShopifyEndpoint - public void customerRedact(@RequestHeader("X-Shopify-Hmac-SHA256") String hmac, - HttpServletRequest request, - HttpServletResponse response) { - String requestBody = ShopifyHttpUtils.getRequestBody(request); - if (!shopifyRequestValidator.verify(requestBody, hmac)) { - throw new ShopifyRequestVerifyException("Unauthorized"); - } - - ShopifyCustomerRedactCommand shopifyCustomerRedactCommand = JSONObject.parseObject(requestBody, ShopifyCustomerRedactCommand.class); - } - - /** - * shopify店铺卸载payment app事件 - * - */ - @PostMapping("/shop/erasure") - @ShopifyEndpoint - public void shopRedact(@RequestHeader("X-Shopify-Hmac-SHA256") String hmac, - HttpServletRequest request, - HttpServletResponse response) { - String requestBody = ShopifyHttpUtils.getRequestBody(request); - if (!shopifyRequestValidator.verify(requestBody, hmac)) { - throw new ShopifyRequestVerifyException("Unauthorized"); - } - - ShopifyShopRedactCommand shopifyShopRedactCommand = JSON.parseObject(requestBody, ShopifyShopRedactCommand.class); - ShopifyStore shopifyShop = shopifyStoreService.getByShopifyShop(shopifyShopRedactCommand.getShop_domain()); - if (shopifyShop == null) { - return; - } - shopifyStoreService.modifyShopifyStore(shopifyShop.setStatus(0)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomer.java b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomer.java deleted file mode 100644 index 5ad3d045b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomer.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.hooks.command; - -import lombok.Data; - -@Data -public class ShopifyCustomer { - private String id; - private String email; - private String phone; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomerRedactCommand.java b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomerRedactCommand.java deleted file mode 100644 index 8cea05276..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomerRedactCommand.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.hooks.command; - -import lombok.Data; - -import java.util.List; - -@Data -public class ShopifyCustomerRedactCommand { - private String shop_id; - private String shop_domain; - private ShopifyCustomer customer; - private List orders_to_redact; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomerRequestCommand.java b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomerRequestCommand.java deleted file mode 100644 index 37ae86c1c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyCustomerRequestCommand.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.hooks.command; - -import lombok.Data; - -import java.util.List; - -@Data -public class ShopifyCustomerRequestCommand { - private String shop_id; - private String shop_domain; - private List orders_requested; - private ShopifyCustomer customer; - private DataRequest data_request; - - @Data - public class DataRequest{ - private String id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyShopRedactCommand.java b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyShopRedactCommand.java deleted file mode 100644 index a8e551094..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/command/ShopifyShopRedactCommand.java +++ /dev/null @@ -1,9 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.hooks.command; - -import lombok.Data; - -@Data -public class ShopifyShopRedactCommand { - private String shop_id; - private String shop_domain; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/application/ShopifyStoreApplication.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/application/ShopifyStoreApplication.java deleted file mode 100644 index 5a21426c5..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/application/ShopifyStoreApplication.java +++ /dev/null @@ -1,75 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.application; - -import au.com.royalpay.payment.manage.shopify.auth.domain.application.ShopifyMerchantAuthApplication; -import au.com.royalpay.payment.manage.shopify.auth.web.command.ShopifyPermissionRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.context.MerchantCreateContext; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantAccountRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchant; -import au.com.royalpay.payment.manage.shopify.store.domain.event.ShopifyStoreCreatedEvent; -import au.com.royalpay.payment.manage.shopify.store.domain.service.MerchantAccountService; -import au.com.royalpay.payment.manage.shopify.store.domain.service.MerchantService; -import au.com.royalpay.payment.manage.shopify.store.web.command.CreateShopifyMerchantCommand; -import au.com.royalpay.payment.manage.shopify.support.PlatformMerchantProvider; -import au.com.royalpay.shopify.entity.ShopifyAccessToken; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class ShopifyStoreApplication implements ApplicationEventPublisherAware { - - @Autowired - private MerchantService merchantservice; - - @Autowired - private MerchantAccountService merchantAccountService; - - @Autowired - private PlatformMerchantProvider platformMerchantProvider; - - @Autowired - private ShopifyMerchantAuthApplication shopifyMerchantAuthApplication; - - private ApplicationEventPublisher eventPublisher; - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.eventPublisher = applicationEventPublisher; - } - - /** - * 检查partnerCode的商户是否存在 - * - * @param partnerCode 商户用户标识 - * @return - */ - public Boolean existMerchant(String partnerCode) { - return merchantservice.existMerchant(partnerCode); - } - - /** - * shopify店铺报备、获取shopify店铺授权 - * - * @param command 报备信息 - * @return 授权链接 - */ - @Transactional - public ShopifyAccessToken register(CreateShopifyMerchantCommand command) { - - MerchantCreateContext merchantCreateContext = new MerchantCreateContext(platformMerchantProvider, command); - SimpleMerchant simpleMerchant = merchantservice.createMerchant(merchantCreateContext); - - MerchantAccountRequest accountRequest = MerchantAccountRequest.instanceOf(command, simpleMerchant); - merchantAccountService.createAccount(accountRequest); - - ShopifyAccessToken shopifyAccessToken = shopifyMerchantAuthApplication.install(ShopifyPermissionRequest.instanceOf(command)); - - this.eventPublisher.publishEvent(new ShopifyStoreCreatedEvent(this, simpleMerchant, command, accountRequest)); - - return shopifyAccessToken; - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/context/MerchantCreateContext.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/context/MerchantCreateContext.java deleted file mode 100644 index 03077d564..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/context/MerchantCreateContext.java +++ /dev/null @@ -1,53 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.context; - -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantRequest; -import au.com.royalpay.payment.manage.shopify.store.web.command.PaymentAccountCommand; -import au.com.royalpay.payment.manage.shopify.support.PlatformMerchantProvider; -import au.com.royalpay.payment.manage.shopify.store.web.command.CreateShopifyMerchantCommand; -import au.com.royalpay.payment.manage.shopify.store.web.command.PaymentMerchantCommand; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; - -import java.util.Date; - -public class MerchantCreateContext { - - private PlatformMerchantProvider platformMerchantProvider; - - private CreateShopifyMerchantCommand command; - - public MerchantCreateContext(PlatformMerchantProvider platformMerchantProvider, CreateShopifyMerchantCommand command) { - this.platformMerchantProvider = platformMerchantProvider; - this.command = command; - } - - public String contactPhone() { - return command.getPaymentMerchant().getContactPhone(); - } - - public MerchantRequest genRequest() { - PaymentAccountCommand paymentAccount = command.getPaymentAccount(); - if (!paymentAccount.getPassword().equals(paymentAccount.getConfirmPassword())) { - throw new BadRequestException("Inconsistent passwords"); - } - PaymentMerchantCommand paymentMerchant = command.getPaymentMerchant(); - return MerchantRequest.builder() - .clientMoniker(platformMerchantProvider.generateClientMoniker()) - .companyName(paymentMerchant.getCompanyName()) - .shortName(paymentMerchant.getCompanyName()) - .industry("331") - .address(paymentMerchant.getAddress()) - .suburb(paymentMerchant.getSuburb()) - .postcode(paymentMerchant.getPostcode()) - .state(paymentMerchant.getState()) - .country("AUS") - .contactPerson(paymentMerchant.getContactPerson()) - .companyPhone(paymentMerchant.getContactPhone()) - .contactPhone(paymentMerchant.getContactPhone()) - .contactEmail(paymentMerchant.getContactEmail()) - .creator("shopify store") - .createTime(new Date()) - .approveResult(1) - .approveTime(new Date()) - .build(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/MerchantAccountRequest.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/MerchantAccountRequest.java deleted file mode 100644 index af8a8e8b9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/MerchantAccountRequest.java +++ /dev/null @@ -1,58 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.entity; - -import au.com.royalpay.payment.manage.shopify.store.web.command.CreateShopifyMerchantCommand; -import au.com.royalpay.payment.manage.shopify.store.web.command.PaymentAccountCommand; -import au.com.royalpay.payment.manage.shopify.store.web.command.PaymentMerchantCommand; -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import lombok.Builder; -import lombok.Data; - -import java.util.Date; -import java.util.UUID; - -@Data -@Builder -public class MerchantAccountRequest { - - private String accountId; - - private Integer clientId; - - private String username; - - private String passwordHash; - - private String salt; - - private String passwordAes; - - private String contactPhone; - - private String contactEmail; - - private String displayName; - - private String creator; - - private Date createTime; - - public static MerchantAccountRequest instanceOf(CreateShopifyMerchantCommand command, SimpleMerchant simpleMerchant) { - PaymentMerchantCommand paymentMerchant = command.getPaymentMerchant(); - PaymentAccountCommand paymentAccount = command.getPaymentAccount(); - String salt = PasswordUtils.newSalt(); - String hashPwd = PasswordUtils.hashPwd(paymentAccount.getPassword(), salt); - return MerchantAccountRequest.builder() - .accountId(UUID.randomUUID().toString()) - .clientId(simpleMerchant.getClientId()) - .username(paymentAccount.getLoginId()) - .salt(salt) - .passwordHash(hashPwd) - .passwordAes(PasswordUtils.encryptAESPwd(paymentAccount.getPassword())) - .contactPhone(paymentMerchant.getContactPhone()) - .contactEmail(paymentMerchant.getContactEmail()) - .displayName(paymentAccount.getLoginId()) - .creator("shopify store") - .createTime(new Date()) - .build(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/MerchantRequest.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/MerchantRequest.java deleted file mode 100644 index 96703a394..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/MerchantRequest.java +++ /dev/null @@ -1,48 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.entity; - -import lombok.Builder; -import lombok.Data; - -import java.util.Date; - -@Data -@Builder -public class MerchantRequest { - - private Integer clientId; - - private String clientMoniker; - - private String companyName; - - private String shortName; - - private String industry; - - private String address; - - private String suburb; - - private String postcode; - - private String state; - - private String country; - - private String contactPerson; - - private String companyPhone; - - private String contactPhone; - - private String contactEmail; - - private String creator; - - private Date createTime; - - private Integer approveResult; - - private Date approveTime; - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/ShopifyMerchantApplyInfo.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/ShopifyMerchantApplyInfo.java deleted file mode 100644 index 965202243..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/ShopifyMerchantApplyInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.entity; - -import lombok.Builder; -import lombok.Data; - -@Data -@Builder -public class ShopifyMerchantApplyInfo { - - private int clientId; - - private String clientMoniker; - - private String shopifyShop; - - private String contactPerson; - - private String contactPhone; - - private String contactEmail; - - private String displayName; - - private String companyName; - - private String address; - - private String suburb; - - private String postcode; - - private String state; - - private String country; - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/ShopifyStore.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/ShopifyStore.java deleted file mode 100644 index 0969060d0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/ShopifyStore.java +++ /dev/null @@ -1,69 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.entity; - -import au.com.royalpay.shopify.entity.ShopifyAccessToken; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public class ShopifyStore { - - private String id; - - private Integer clientId; - - private String clientMoniker; - - private String shopifyShop; - - private Date createTime; - - private String creator; - - private Date modifyTime; - - private String modifier; - - private String accessToken; - - private String tokenSecret; - - private String scope; - - private int status; - - public static ShopifyStore instanceOf(SimpleMerchantAccount merchantAccount, SimpleMerchant simpleMerchant, String shop, ShopifyAccessToken accessToken) { - return ShopifyStore.builder() - .id(UUID.randomUUID().toString()) - .clientId(merchantAccount.getClientId()) - .clientMoniker(simpleMerchant.getClientMoniker()) - .shopifyShop(shop) - .createTime(new Date()) - .creator("shopify store") - .accessToken(accessToken.getAccess_token()) - .tokenSecret(accessToken.getSecret()) - .scope(accessToken.getScope()) - .modifyTime(new Date()) - .status(1).build(); - } - - public String storeName(){ - Pattern pattern = Pattern.compile("(^[a-zA-Z0-9][a-zA-Z0-9\\-]*)\\.myshopify\\.com"); - Matcher matcher = pattern.matcher(shopifyShop); - if (matcher.matches()){ - return matcher.group(1); - } - return shopifyShop; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/SimpleMerchant.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/SimpleMerchant.java deleted file mode 100644 index 8c6c4b101..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/SimpleMerchant.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class SimpleMerchant { - private Integer clientId; - private String clientMoniker; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/SimpleMerchantAccount.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/SimpleMerchantAccount.java deleted file mode 100644 index a017a0876..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/entity/SimpleMerchantAccount.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SimpleMerchantAccount { - - private String username; - - private Integer clientId; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/event/ShopifyStoreCreatedEvent.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/event/ShopifyStoreCreatedEvent.java deleted file mode 100644 index e3d83a12e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/event/ShopifyStoreCreatedEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.event; - -import au.com.royalpay.payment.manage.shopify.store.domain.application.ShopifyStoreApplication; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantAccountRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchant; -import au.com.royalpay.payment.manage.shopify.store.web.command.CreateShopifyMerchantCommand; -import org.springframework.context.ApplicationEvent; - -public class ShopifyStoreCreatedEvent extends ApplicationEvent { - - private SimpleMerchant simpleMerchant; - - private CreateShopifyMerchantCommand command; - - private MerchantAccountRequest accountRequest; - - public ShopifyStoreCreatedEvent(ShopifyStoreApplication source, SimpleMerchant simpleMerchant, CreateShopifyMerchantCommand command, MerchantAccountRequest accountRequest) { - super(source); - this.simpleMerchant = simpleMerchant; - this.command = command; - this.accountRequest = accountRequest; - } - - public SimpleMerchant getSimpleMerchant() { - return simpleMerchant; - } - - public CreateShopifyMerchantCommand getCommand() { - return command; - } - - public MerchantAccountRequest getAccountRequest() { - return accountRequest; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/listener/ShopifyStoreCreatedListener.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/listener/ShopifyStoreCreatedListener.java deleted file mode 100644 index 0a089972a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/listener/ShopifyStoreCreatedListener.java +++ /dev/null @@ -1,66 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.listener; - -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyMerchantApplyInfo; -import au.com.royalpay.payment.manage.shopify.store.domain.event.ShopifyStoreCreatedEvent; -import au.com.royalpay.payment.manage.shopify.store.web.command.PaymentMerchantCommand; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.event.EventListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.Resource; -import java.io.IOException; -import java.net.URISyntaxException; - -@Slf4j -@Component -public class ShopifyStoreCreatedListener { - - @Resource - private MailService mailService; - - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private SysConfigManager sysConfigManager; - - - @Async - @EventListener - public void onShopifyStoreCreated(ShopifyStoreCreatedEvent event) { - PaymentMerchantCommand paymentMerchant = event.getCommand().getPaymentMerchant(); - ShopifyMerchantApplyInfo applyInfo = ShopifyMerchantApplyInfo.builder() - .clientId(event.getSimpleMerchant().getClientId()) - .clientMoniker(event.getSimpleMerchant().getClientMoniker()) - .contactEmail(event.getAccountRequest().getContactEmail()) - .contactPhone(event.getAccountRequest().getContactPhone()) - .contactPerson(paymentMerchant.getContactPerson()) - .address(paymentMerchant.getAddress()) - .shopifyShop(event.getCommand().getShopifyShop()) - .displayName(event.getAccountRequest().getDisplayName()) - .companyName(paymentMerchant.getCompanyName()) - .suburb(paymentMerchant.getSuburb()) - .state(paymentMerchant.getState()) - .country(paymentMerchant.getCountry()) - .postcode(paymentMerchant.getPostcode()) - .build(); - Context ctx = new Context(); - ctx.setVariable("applyInfo", applyInfo); - - final String content = thymeleaf.process("mail/shopify_merchant_application.html", ctx); - try { - String consignee = sysConfigManager.getConfig("shopify.email.merchant-register", "info@royalpay.com.au,compliance@royalpay.com.au"); - mailService.sendEmail("Shopify merchant application", consignee, "", content); - } catch (URISyntaxException e) { - log.error(e.getMessage()); - e.printStackTrace(); - } catch (IOException e) { - log.error(e.getMessage()); - e.printStackTrace(); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/MerchantAccountService.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/MerchantAccountService.java deleted file mode 100644 index d88fd5d3d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/MerchantAccountService.java +++ /dev/null @@ -1,22 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.service; - -import au.com.royalpay.payment.manage.mappers.shopify.MerchantAccountMapper; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantAccountRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchantAccount; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class MerchantAccountService { - - @Autowired - private MerchantAccountMapper merchantAccountMapper; - - public void createAccount(MerchantAccountRequest accountRequest) { - merchantAccountMapper.insert(accountRequest); - } - - public SimpleMerchantAccount getByUsername(String username) { - return merchantAccountMapper.selectByUsername(username); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/MerchantService.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/MerchantService.java deleted file mode 100644 index 17f1c2e40..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/MerchantService.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.service; - -import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; -import au.com.royalpay.payment.manage.mappers.shopify.MerchantMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.shopify.store.domain.context.MerchantCreateContext; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.MerchantRequest; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.SimpleMerchant; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class MerchantService { - - @Autowired - private ClientAccountMapper clientAccountMapper; - - @Autowired - private MerchantMapper merchantMapper; - - @Autowired - private PermissionPartnerManagerImpl permissionPartnerManager; - - @Autowired - private ClientManager clientManager; - - public Boolean existMerchant(String partnerCode) { - JSONObject clientInfo = clientManager.getClientInfoByMoniker(partnerCode); - if (clientInfo == null) { - return false; - } - return true; - } - - public SimpleMerchant createMerchant(MerchantCreateContext merchantCreateContext) { - List account = clientAccountMapper.findByPhone(merchantCreateContext.contactPhone(), "+61"); - if (account != null && !account.isEmpty()) { - throw new ForbiddenException("The user name has been registered"); - } - - MerchantRequest merchantRequest = merchantCreateContext.genRequest(); - merchantMapper.insert(merchantRequest); - SimpleMerchant simpleMerchant = merchantMapper.selectByMoniker(merchantRequest.getClientMoniker()); - permissionPartnerManager.permissionClientModuleSave(simpleMerchant.getClientId(), simpleMerchant.getClientMoniker()); - return simpleMerchant; - } - - public SimpleMerchant getByClientId(Integer clientId) { - return merchantMapper.selectByClientId(clientId); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/ShopifyStoreService.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/ShopifyStoreService.java deleted file mode 100644 index 320f7dc6b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/ShopifyStoreService.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.service; - -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; - -public interface ShopifyStoreService { - - /** - * 关联shopify店铺 - * - * @param shopifyStore 店铺信息 - */ - void createShopifyStore(ShopifyStore shopifyStore); - - /** - * 根据shop获取shopify store - * - * @param shop 店铺标识 - * @return - */ - ShopifyStore getByShopifyShop(String shop); - - /** - * 变更shopify商户信息 - * - * @param shopifyStore 店铺信息 - */ - void modifyShopifyStore(ShopifyStore shopifyStore); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/impl/ShopifyStoreServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/impl/ShopifyStoreServiceImpl.java deleted file mode 100644 index 15c68b7fc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/domain/service/impl/ShopifyStoreServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.domain.service.impl; - -import au.com.royalpay.payment.manage.mappers.shopify.ShopifyStoreMapper; -import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; -import au.com.royalpay.payment.manage.shopify.store.domain.service.ShopifyStoreService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ShopifyStoreServiceImpl implements ShopifyStoreService { - - @Autowired - private ShopifyStoreMapper shopifyStoreMapper; - - @Override - public void createShopifyStore(ShopifyStore shopifyStore) { - shopifyStoreMapper.insert(shopifyStore); - } - - @Override - public ShopifyStore getByShopifyShop(String shop) { - return shopifyStoreMapper.selectByShop(shop); - } - - @Override - public void modifyShopifyStore(ShopifyStore shopifyStore) { - shopifyStoreMapper.update(shopifyStore); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/ShopifyStoreController.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/ShopifyStoreController.java deleted file mode 100644 index e12817847..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/ShopifyStoreController.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.web; - -import au.com.royalpay.payment.manage.shopify.store.domain.application.ShopifyStoreApplication; -import au.com.royalpay.payment.manage.shopify.store.web.command.CreateShopifyMerchantCommand; -import au.com.royalpay.shopify.entity.ShopifyAccessToken; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * shopify店铺资源 - */ -@RestController -@RequestMapping(value = "/shopify/store") -public class ShopifyStoreController { - - @Autowired - private ShopifyStoreApplication shopifyStoreApplication; - - /** - * 检查loginId的商户是否存在 - * - * @param partnerCode 商户标识 - */ - @Deprecated - @GetMapping("/exist") - public Boolean validPaymentAppMerchant(@RequestParam("partnerCode") String partnerCode) { - return shopifyStoreApplication.existMerchant(partnerCode); - } - - /** - * shopify店铺报备 - * - * @param command 商户信息 - * @Return 店铺授权链接 - */ - @PostMapping("/register") - public ShopifyAccessToken createMerchantWithShopify(@RequestBody @Valid CreateShopifyMerchantCommand command) { - return shopifyStoreApplication.register(command); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/CreateShopifyMerchantCommand.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/CreateShopifyMerchantCommand.java deleted file mode 100644 index 8bad7393b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/CreateShopifyMerchantCommand.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.web.command; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; - -@Data -@Accessors(chain = true) -public class CreateShopifyMerchantCommand { - - private PaymentMerchantCommand paymentMerchant; - - private PaymentAccountCommand paymentAccount; - - @NotBlank(message = "Auth code can not blank") - private String code; - - @NotBlank(message = "Shop can not blank") - @Pattern(regexp = "^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", message = "Shop hostname is invalid") - private String shopifyShop; - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/PaymentAccountCommand.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/PaymentAccountCommand.java deleted file mode 100644 index 1c729cebe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/PaymentAccountCommand.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.web.command; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; - -@Data -@Accessors(chain = true) -public class PaymentAccountCommand { - - @NotBlank(message = "LoginId can not blank") - private String loginId; - - @NotBlank(message = "Password can not blank") - private String password; - - @NotBlank(message = "Confirm password can not blank") - private String confirmPassword; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/PaymentMerchantCommand.java b/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/PaymentMerchantCommand.java deleted file mode 100644 index 5a1134914..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/store/web/command/PaymentMerchantCommand.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.store.web.command; - -import lombok.Data; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -public class PaymentMerchantCommand { - - private String companyName; - - private String address; - - private String suburb; - - private String postcode; - - private String state; - - private String country; - - private String contactPerson; - - private String contactPhone; - - private String contactEmail; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/support/PlatformMerchantProvider.java b/src/main/java/au/com/royalpay/payment/manage/shopify/support/PlatformMerchantProvider.java deleted file mode 100644 index c5b03a888..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/support/PlatformMerchantProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.shopify.support; - -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component -public class PlatformMerchantProvider { - - @Resource - private ClientMapper clientMapper; - - public String generateClientMoniker() { - String clientMoniker = RandomStringUtils.random(4, true, true).toUpperCase(); - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client != null) { - generateClientMoniker(); - } - return clientMoniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/ChangePwdBean.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/ChangePwdBean.java deleted file mode 100644 index bd7f9c01f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/ChangePwdBean.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.signin.beans; - -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-06-29. - */ -public class ChangePwdBean { - @NotEmpty - private String oldpwd; - @NotEmpty - private String pwd; - - public String getOldpwd() { - return oldpwd; - } - - public void setOldpwd(String oldpwd) { - this.oldpwd = oldpwd; - } - - public String getPwd() { - return pwd; - } - - public void setPwd(String pwd) { - this.pwd = pwd; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/FindPwdBean.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/FindPwdBean.java deleted file mode 100644 index c2752eba0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/FindPwdBean.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.signin.beans; - -import javax.validation.constraints.NotEmpty; - -/** - * Created by yishuqian on 14/02/2017. - */ -public class FindPwdBean { - private String partner_code; - private String contact_email; - @NotEmpty(message = "error.payment.valid.param_missing") - private String verifyCode; - private String newPassword; - private String login_id; - - public String getContact_email() { - return contact_email; - } - - public void setContact_email(String contact_email) { - this.contact_email = contact_email; - } - - public String getVerifyCode() { - return verifyCode; - } - - public void setVerifyCode(String verifyCode) { - this.verifyCode = verifyCode; - } - - public String getPartner_code() { - return partner_code; - } - - public void setPartner_code(String partner_code) { - this.partner_code = partner_code; - } - - public String getNewPassword() { - return newPassword; - } - - public void setNewPassword(String newPassword) { - this.newPassword = newPassword; - } - - public String getLogin_id() { - return login_id; - } - - public void setLogin_id(String login_id) { - this.login_id = login_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/LoginInfo.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/LoginInfo.java deleted file mode 100644 index dd18a1ac0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/LoginInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.signin.beans; - -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yixian on 2016-06-29. - */ -public class LoginInfo { - @NotEmpty(message = "error.payment.valid.param_missing") - private String loginId; - @NotEmpty(message = "error.payment.valid.param_missing") - private String password; - @NotEmpty(message = "error.payment.valid.param_missing") - private String verifyCode; - - - public String getPasswordHashed(String salt) { - return PasswordUtils.hashPwd(password, salt); - } - - public String getLoginId() { - return loginId.toLowerCase(); - } - - public void setLoginId(String loginId) { - this.loginId = loginId; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getVerifyCode() { - return verifyCode; - } - - public void setVerifyCode(String verifyCode) { - this.verifyCode = verifyCode; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java deleted file mode 100644 index 09707b259..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java +++ /dev/null @@ -1,311 +0,0 @@ -package au.com.royalpay.payment.manage.signin.beans; - -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.StringUtils; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotEmpty; - -import java.util.Date; - -/** - * Created by yixian on 2016-07-05. - */ -public class ManagerInfo { - @NotEmpty(message = "error.payment.valid.param_missing") - private String username; - @NotEmpty(message = "error.payment.valid.param_missing") - @JSONField(name = "display_name") - private String displayName; - @NotEmpty(message = "error.payment.valid.param_missing") - private String password; - @Email - private String email; - private String phone; - @JSONField(name = "nation_code") - private String nationCode; - private String wechat; - private boolean admin; - private boolean operator; - private boolean bd; - private boolean finacial; - private boolean servant; - private boolean accountmanager; - private boolean director; - private boolean sitemanager; - private boolean developer; - private boolean bdleader; - private boolean riskmanager; - private boolean guest; - private boolean orgmanager; - private boolean salesmanager; - private boolean datacontent; - @JSONField(name = "org_id") - private Integer orgId; - - public JSONObject accountJson(boolean insert) { - JSONObject account = new JSONObject(); - if (StringUtils.isNotEmpty(displayName)) { - account.put("display_name", displayName); - } - if (StringUtils.isNotEmpty(password)) { - final String salt = PasswordUtils.newSalt(); - account.put("salt", salt); - account.put("password_hash", PasswordUtils.hashPwd(password, salt)); - } - if (insert) { - account.put("create_time", new Date()); - } - account.put("email", email); - account.put("phone", phone); - account.put("nation_code", "+"+nationCode); - account.put("wechat", wechat); - int role = 0; - if (admin) { - role |= ManagerRole.ADMIN.getMask(); - bd = false; - //servant = false; - accountmanager = false; - orgId = null; - } - if (operator) { - role |= ManagerRole.OPERATOR.getMask(); - bd = false; - //servant = false; - accountmanager = false; - orgId = null; - } - if (sitemanager) { - role |= ManagerRole.SITE_MANAGER.getMask(); - } - if (bd) { - role |= ManagerRole.BD_USER.getMask(); - } - if (finacial) { - role |= ManagerRole.FINANCIAL_STAFF.getMask(); - } - if (servant) { - role |= ManagerRole.SERVANT.getMask(); - } - if (accountmanager) { - role |= ManagerRole.ACCOUNT_MANAGER.getMask(); - } - if (director) { - role |= ManagerRole.DIRECTOR.getMask(); - } - if (developer) { - role |= ManagerRole.DEVELOPER.getMask(); - } - if (bdleader){ - role |= ManagerRole.BD_LEADER.getMask(); - } - if (riskmanager){ - role |= ManagerRole.RISK_MANAGER.getMask(); - } - if (guest){ - role |= ManagerRole.GUEST.getMask(); - } - if (orgmanager){ - role |= ManagerRole.ORG_MANAGER.getMask(); - } - if (salesmanager) { - role |= ManagerRole.SALES_MANAGER.getMask(); - } - if (datacontent) { - role |= ManagerRole.DATA_CONTENT.getMask(); - } - account.put("role", role); - if (insert) { - account.put("username", getUsername()); - } - account.put("org_id", orgId); - return account; - } - - public String getUsername() { - return username.toLowerCase(); - } - - public void setUsername(String username) { - this.username = username; - } - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getWechat() { - return wechat; - } - - public void setWechat(String wechat) { - this.wechat = wechat; - } - - public boolean isAdmin() { - return admin; - } - - public void setAdmin(boolean admin) { - this.admin = admin; - } - - public boolean isOperator() { - return operator; - } - - public void setOperator(boolean operator) { - this.operator = operator; - } - - public boolean isBd() { - return bd; - } - - public void setBd(boolean bd) { - this.bd = bd; - } - - public boolean isFinacial() { - return finacial; - } - - public void setFinacial(boolean finacial) { - this.finacial = finacial; - } - - public boolean isServant() { - return servant; - } - - public void setServant(boolean servant) { - this.servant = servant; - } - - public boolean isAccountmanager() { - return accountmanager; - } - - public void setAccountmanager(boolean accountmanager) { - this.accountmanager = accountmanager; - } - - public boolean isDirector() { - return director; - } - - public void setDirector(boolean director) { - this.director = director; - } - - public boolean isSitemanager() { - return sitemanager; - } - - public void setSitemanager(boolean sitemanager) { - this.sitemanager = sitemanager; - } - - public boolean isDeveloper() { - return developer; - } - - public void setDeveloper(boolean developer) { - this.developer = developer; - } - - public Integer getOrgId() { - return orgId; - } - - public void setOrgId(Integer orgId) { - this.orgId = orgId; - } - - public void setBdleader(boolean bdleader) { - this.bdleader = bdleader; - } - - public boolean isRiskmanager() { - return riskmanager; - } - - public void setRiskmanager(boolean riskmanager) { - this.riskmanager = riskmanager; - } - - public boolean isBdleader() { - return bdleader; - } - - public boolean isGuest() { - return guest; - } - - public void setGuest(boolean guest) { - this.guest = guest; - } - - public boolean isOrgmanager() { - return orgmanager; - } - - public void setOrgmanager(boolean orgmanager) { - this.orgmanager = orgmanager; - } - - public boolean isDatacontent() { - return datacontent; - } - - public boolean isSalesmanager() { - return salesmanager; - } - - public void setDatacontent(boolean datacontent) { - this.datacontent = datacontent; - } - - public void setSalesmanager(boolean salesmanager) { - this.salesmanager = salesmanager; - } - - public String getNationCode() { - return nationCode; - } - - public void setNationCode(String nationCode) { - this.nationCode = nationCode; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/QueryManagerBean.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/QueryManagerBean.java deleted file mode 100644 index 50d3a0a45..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/QueryManagerBean.java +++ /dev/null @@ -1,133 +0,0 @@ -package au.com.royalpay.payment.manage.signin.beans; - -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -/** - * Created by yuan on 2018/7/13. - */ -public class QueryManagerBean { - private String org_id; - private String org_id2; - private String role; - private String username; - - private int page = 1; - private int limit = 10; - - public JSONObject toJson(){ - JSONObject params = new JSONObject(); - if (StringUtils.isNotEmpty(org_id)){ - params.put("org_id",org_id); - } - if (StringUtils.isNotEmpty(org_id2)){ - params.put("org_id2",org_id2); - } - if (StringUtils.isNotEmpty(role)){ - int mask = 0; - if(role.equals("1")){ - mask = ManagerRole.ADMIN.getMask(); - } - if(role.equals("10")){ - mask = ManagerRole.OPERATOR.getMask(); - } - if(role.equals("100")){ - mask = ManagerRole.BD_USER.getMask(); - } - if(role.equals("1000")){ - mask = ManagerRole.FINANCIAL_STAFF.getMask(); - } - if(role.equals("10000")){ - mask = ManagerRole.SERVANT.getMask(); - } -// if(role.equals("100000")){ -// mask = ManagerRole.ACCOUNT_MANAGER.getMask(); -// } - if(role.equals("1000000")){ - mask = ManagerRole.DIRECTOR.getMask(); - } - if(role.equals("10000000")){ - mask = ManagerRole.SITE_MANAGER.getMask(); - } - if(role.equals("100000000")){ - mask = ManagerRole.DEVELOPER.getMask(); - } - if(role.equals("1000000000")){ - mask = ManagerRole.BD_LEADER.getMask(); - } - if(role.equals("10000000000")){ - mask = ManagerRole.RISK_MANAGER.getMask(); - } - if(role.equals("100000000000")){ - mask = ManagerRole.GUEST.getMask(); - } - if(role.equals("1000000000000")){ - mask = ManagerRole.ORG_MANAGER.getMask(); - } - if(role.equals("10000000000000")){ - mask = ManagerRole.SALES_MANAGER.getMask(); - } -// if(role.equals("100000000000000")){ -// mask = ManagerRole.DATA_CONTENT.getMask(); -// } - if(mask != 0){ - params.put("mask",mask); - } - } - if (StringUtils.isNotEmpty(username)){ - params.put("username",username); - } - params.put("page",page); - params.put("limit",10); - return params; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public String getOrg_id2() { - return org_id2; - } - - public void setOrg_id2(String org_id2) { - this.org_id2 = org_id2; - } - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/TodoNotice.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/TodoNotice.java deleted file mode 100644 index e320bb603..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/TodoNotice.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.signin.beans; - -/** - * 待办事项 - * Created by yixian on 2017-01-13. - */ -public class TodoNotice { - private final String module; - private final String text; - private final String url; - - public TodoNotice(String module, String text, String url) { - this.module = module; - this.text = text; - this.url = url; - } - - public String getModule() { - return module; - } - - public String getText() { - return text; - } - - public String getUrl() { - return url; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/ClientLoginLogRepository.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/ClientLoginLogRepository.java deleted file mode 100644 index c31434d39..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/ClientLoginLogRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-10-14. - */ -public interface ClientLoginLogRepository extends LoginLogRepository { - JSONObject listClientLoginLogs(String clientMoniker, int page, int limit); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/LoginLogRepository.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/LoginLogRepository.java deleted file mode 100644 index c7d1e1a1f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/LoginLogRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-10-14. - */ -public interface LoginLogRepository { - JSONObject listLoginLogOfAccount(String accountId, int page, int limit); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerAccountsService.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerAccountsService.java deleted file mode 100644 index 1a61042f1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerAccountsService.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import au.com.royalpay.payment.manage.signin.beans.ManagerInfo; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import java.util.List; - -/** - * Created by yixian on 2016-07-05. - */ -public interface ManagerAccountsService { - PageList listManagers(JSONObject loginManager, JSONObject params); - - void saveManager(ManagerInfo manager, JSONObject loginManager); - - void modify(String userId, ManagerInfo manager, JSONObject loginManager); - - void disable(String userId, JSONObject loginManager); - - List listBDUsers(JSONObject loginManager); - - List listBDLeaders(JSONObject loginManager); - - List listGroupBds(JSONObject loginManager); - - JSONObject getBDConfig(String bd_id); - - List listServants(JSONObject loginManager); - - void resetPwd(JSONObject account,String password); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerLoginLogRepository.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerLoginLogRepository.java deleted file mode 100644 index 6b02d9b3c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerLoginLogRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-10-14. - */ -public interface ManagerLoginLogRepository extends LoginLogRepository { - - JSONObject listManagerLoginLogs(int page, int limit); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerTodoNoticeProvider.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerTodoNoticeProvider.java deleted file mode 100644 index 1791f0849..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerTodoNoticeProvider.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import au.com.royalpay.payment.manage.signin.beans.TodoNotice; -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * Created by yixian on 2017-01-13. - */ -public interface ManagerTodoNoticeProvider { - - void checkTodo(JSONObject manager, List notices); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerWechatBindService.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerWechatBindService.java deleted file mode 100644 index d767c8fda..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/ManagerWechatBindService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-11-03. - */ -public interface ManagerWechatBindService { - JSONObject newBindRequest(String managerId); - - void bindWechatUser(String bindId, String openid); - - JSONObject removeBindWechat(String managerId); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java deleted file mode 100644 index 5cc63f8a7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java +++ /dev/null @@ -1,77 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yixian on 2016-06-29. - */ -public interface SignInAccountService { - - JSONObject getManager(String accountId); - - void clearManager(String accountId); - - JSONObject getClient(String accountId); - - JSONObject getClientByUsername(String username); - - JSONObject getManagerByUsername(String username); - - void clearAccountCache(String accountId); - - JSONObject managerLoginCheck(LoginInfo loginInfo); - - JSONObject accountCheck(LoginInfo loginInfo); - - JSONObject clientLoginCheck(LoginInfo loginInfo); - - JSONObject clientAccountCheck(LoginInfo loginInfo); - - void changeManagerPassword(JSONObject manager, ChangePwdBean change); - - void changeAccountPassword(JSONObject partnerStatus, ChangePwdBean change); - - JSONObject mockClient(String moniker); - - JSONObject managerOpenIdSignIn(String openid); - - JSONObject clientWechatSignIn(String openid); - - /** - * 获取绑定微信最新的账号 - * @param unionId - * @return - */ - JSONObject clientWechatOneSignIn(String unionId); - - JSONObject clientWechatAppSignIn(String openId); - - JSONObject clientAppleSignIn(String appleUserId); - - JSONObject clientWechatAppSignInByUnionId(String unionId); - - String ForgetPassword(String partner_code) throws Exception; - - void changePasswordByEmail(String codeValue, String login_id, String newPassword); - - void getClientResetPwdCode(JSONObject account,String type); - - void getManagerResetPwdCode(JSONObject account,String type); - - void verifyClientCaptcha(JSONObject account, String captcha); - - void verifyManagerCaptcha(JSONObject account, String captcha); - - void deleteClientCodeKey(String codekey); - - void deleteManagerCodeKey(String codekey); - - JSONObject checkAuthFileStatus(JSONObject client); - - JSONObject checkKycFileStatus(JSONObject client,JSONObject account, String sourceType); - - JSONObject checkKycFileStatusForApp(JSONObject client,JSONObject account); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java deleted file mode 100644 index b6ef0c88e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java +++ /dev/null @@ -1,110 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core; - -import au.com.royalpay.payment.manage.appclient.beans.AppleLoginBean; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.servlet.ModelAndView; - -/** - * Created by yixian on 2016-06-29. - */ -public interface SignInStatusManager { - JSONObject getCurrentManager(String statusKey); - - JSONObject getCurrentClient(String statusKey); - - String partnerSignIn(LoginInfo loginInfo); - - String managerSignIn(LoginInfo loginInfo); - - void managerSignOut(String statusKey); - - void partnerSignOut(String statusKey); - - void managerAuthToClient(String managerStatusKey, String clientMoniker); - - JSONObject managerMockClient(String managerStatusKey); - - String addVerifyCode(String code); - - String addChangepasswordVerifyCode(String code); - - String getVerifyCode(String codeKey); - - String getChangePasswordVerifyCode(String codeKey); - - void deleteVerifyCodeKey(String codeKey); - - void deleteChangepasswordVerifyCodeKey(String codeKey); - - JSONObject newManagerWechatSignInQRCode(); - - void managerQRCodeSignIn(String codeId, String openid); - - String managerQRCodeSignInStatus(String codeId); - - String managerWechatSignIn(String openid); - - void clientQRCodeSignIn(String codeId, String openid, ModelAndView view); - - String checkQRCodeClientLoginStatus(String codeId); - - JSONObject partnerWechatAppSignIn(String code); - - JSONObject mchAppleSignIn(AppleLoginBean appleLoginBean); - - String clientWechatSignIn(String openid); - - JSONObject newClientWechatSignInQRCode(); - - JSONObject newClientAppSignInQRCode(); - - void clientQRCodeAppSignIn(JSONObject device, String codeId, String source); - - void clientQRCodeWechatSignIn(JSONObject wxUser, String codeId); - - JSONObject appQRCodeSignInStatus(String codeId); - - JSONObject customerQRCode(); - - void scanCustomerQrcode(String codeId, String openid); - - String getWechatCustomerId(String codeId); - - /** - * 商户端App微信授权 - * @param code - * @return - */ - JSONObject clientAppWechatSignIn(String code); - - /** - * 手机号登录 - * @param phone - * @param nationCode - * @return - */ - String getClientInfoByPhoneStatusKey(String phone,String nationCode); - - /** - * 登录绑定校验用户名密码 - * @param loginInfo - * @return - */ - String verifyClientAccountLogin(LoginInfo loginInfo,String verfiyType); - - /** - * 微信openId是否有申请绑定 - * @param codeId - * @return - */ - JSONObject verifyClientLoginWechatBindCode (String codeId); - - /** - * 微信手机号是否有申请绑定 - * @param phone - * @param nationCode - * @return - */ - void verifyClientLoginPhoneBindCode (String phone,String nationCode); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ClientLoginLogRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ClientLoginLogRepositoryImpl.java deleted file mode 100644 index f7669d1e7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ClientLoginLogRepositoryImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core.impls; - -import au.com.royalpay.payment.manage.mappers.log.ClientLoginLogMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.signin.core.ClientLoginLogRepository; -import au.com.royalpay.payment.manage.signin.events.ClientLoginEvent; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-10-14. - */ -@Service -public class ClientLoginLogRepositoryImpl implements ClientLoginLogRepository, ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientLoginLogMapper clientLoginLogMapper; - @Resource - private ClientManager clientManager; - - @Override - public JSONObject listLoginLogOfAccount(String accountId, int page, int limit) { - PageList logs = clientLoginLogMapper.listAccountLog(accountId, new PageBounds(page, limit, Order.formString("login_time.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public JSONObject listClientLoginLogs(String clientMoniker, int page, int limit) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new BadRequestException("client not exists"); - } - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - PageList logs = clientLoginLogMapper.listClientLog(params, new PageBounds(page, limit, Order.formString("login_time.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public void onApplicationEvent(ClientLoginEvent clientLoginEvent) { - JSONObject log = clientLoginEvent.toLog(); - try { - clientLoginLogMapper.saveLog(log); - } catch (Exception e) { - logger.error("saving manager login log error", e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java deleted file mode 100644 index e59925e25..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core.impls; - -import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.manage.signin.beans.ManagerInfo; -import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.stream.Collectors; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-07-06. - */ -@Service -public class ManagerAccountServiceImpl implements ManagerAccountsService { - @Resource - private ManagerMapper managerMapper; - - @Resource - private OrgMapper orgMapper; - @Resource - private FinancialBDConfigMapper financialBDConfigMapper; - - @Resource - private OrgManager orgManager; - @Resource - private SignInAccountService signInAccountService; - - @Override - public PageList listManagers(JSONObject loginManager,JSONObject params) { - /* if (loginManager.getInteger("org_id") != null) { - params.put("org_id", loginManager.getIntValue("org_id")); - }*/ - orgManager.checkOrgIds(loginManager,params); - PageList managers = managerMapper.listAvailable(params, new PageBounds(params.getIntValue("page"),params.getIntValue("limit"),Order.formString("create_time.desc"))); - for (JSONObject manager : managers) { - int role = manager.getIntValue("role"); - manager.put("admin", ManagerRole.ADMIN.hasRole(role)); - manager.put("operator", ManagerRole.OPERATOR.hasRole(role)); - manager.put("bd", ManagerRole.BD_USER.hasRole(role)); - manager.put("finacial", ManagerRole.FINANCIAL_STAFF.hasRole(role)); - manager.put("servant", ManagerRole.SERVANT.hasRole(role)); -// manager.put("accountmanager", ManagerRole.ACCOUNT_MANAGER.hasRole(role)); - manager.put("director", ManagerRole.DIRECTOR.hasRole(role)); - manager.put("sitemanager", ManagerRole.SITE_MANAGER.hasRole(role)); - manager.put("developer", ManagerRole.DEVELOPER.hasRole(role)); - manager.put("bdleader", ManagerRole.BD_LEADER.hasRole(role)); - manager.put("riskmanager", ManagerRole.RISK_MANAGER.hasRole(role)); - manager.put("guest", ManagerRole.GUEST.hasRole(role)); - manager.put("orgmanager", ManagerRole.ORG_MANAGER.hasRole(role)); - manager.put("salesmanager", ManagerRole.SALES_MANAGER.hasRole(role)); -// manager.put("datacontent", ManagerRole.DATA_CONTENT.hasRole(role)); - - } - return managers; - } - - @Override - public void saveManager(ManagerInfo manager, JSONObject loginManager) { - if (!ManagerRole.ADMIN.hasRole(loginManager.getIntValue("role"))) { - if (manager.isAdmin() || manager.isFinacial() || manager.isOperator() || manager.isServant() || manager.isSitemanager() || manager.isDeveloper()) { - throw new BadRequestException("Invalid Role"); - } - if (loginManager.getInteger("org_id")!=null){ - List orgs = orgMapper.listOrgAndChild(loginManager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(manager.getOrgId())){ - throw new BadRequestException("You cannot Add accounts belong to other organizations"); - } - } - //manager.setOrgId(loginManager.getInteger("org_id")); - } - if (managerMapper.findByLoginId(manager.getUsername()) != null) { - throw new BadRequestException("login id exists"); - } - JSONObject obj = manager.accountJson(true); - managerMapper.save(obj); - } - - @Override - public void modify(String userId, ManagerInfo manager, JSONObject loginManager) { - JSONObject managerFromDb = managerMapper.findById(userId); - if (managerFromDb == null) { - throw new NotFoundException("manager not exists or invalid"); - } - JSONObject obj = manager.accountJson(false); - if (!ManagerRole.ADMIN.hasRole(loginManager.getIntValue("role"))) { - checkOrg(loginManager,managerFromDb); - if (manager.isAdmin() || manager.isFinacial() || manager.isOperator() || manager.isServant() || manager.isSitemanager() || manager.isDeveloper()) { - throw new BadRequestException("Invalid Role"); - } - obj.remove("org_id"); - } - obj.put("manager_id", userId); - managerMapper.update(obj); - signInAccountService.clearManager(userId); - } - - @Override - public void disable(String userId, JSONObject loginManager) { - JSONObject manager = managerMapper.findById(userId); - if (!ManagerRole.ADMIN.hasRole(loginManager.getIntValue("role"))){ - checkOrg(loginManager,manager); - } - if (manager != null) { - manager.put("is_valid", 0); - managerMapper.update(manager); - } - } - - @Override - public List listBDUsers(JSONObject loginManager) { - loginManager.put("mask",ManagerRole.BD_USER.getMask()); - return managerMapper.listByRole(loginManager); - } - - @Override - public List listBDLeaders(JSONObject loginManager) { - loginManager.put("mask",ManagerRole.BD_LEADER.getMask()); - return managerMapper.listByRole(loginManager); - } - - @Override - public List listGroupBds(JSONObject loginManager) { - return financialBDConfigMapper.listGroupBds(loginManager.getString("manager_id")); - } - @Override - public JSONObject getBDConfig(String bd_id){ - return financialBDConfigMapper.getBdConfig(bd_id); - } - - @Override - public List listServants(JSONObject loginManager) { - return managerMapper.listServants(ManagerRole.SERVANT.getMask()); - } - - @Override - public void resetPwd(JSONObject account, String password) { - String salt = PasswordUtils.newSalt(); - account.put("salt", salt); - account.put("password_hash", PasswordUtils.hashPwd(password, salt)); - managerMapper.update(account); - signInAccountService.clearManager(account.getString("manager_id")); - } - - private void checkOrg(JSONObject loginManager,JSONObject manager){ - if (loginManager.getInteger("org_id")!=null){ - List orgs = orgMapper.listOrgAndChild(loginManager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(manager.getIntValue("org_id"))){ - throw new BadRequestException("You cannot modify accounts belong to other organizations"); - } - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerLoginLogRepositoryImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerLoginLogRepositoryImpl.java deleted file mode 100644 index 60e21f4c2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerLoginLogRepositoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core.impls; - -import javax.annotation.Resource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import au.com.royalpay.payment.manage.mappers.log.ManagerLoginLogMapper; -import au.com.royalpay.payment.manage.signin.core.ManagerLoginLogRepository; -import au.com.royalpay.payment.manage.signin.events.ManagerLoginEvent; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -/** - * Created by yixian on 2016-10-14. - */ -@Service -public class ManagerLoginLogRepositoryImpl implements ManagerLoginLogRepository, ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ManagerLoginLogMapper managerLoginLogMapper; - - @Override - public JSONObject listLoginLogOfAccount(String accountId, int page, int limit) { - PageList logs = managerLoginLogMapper.listAccountLoginLog(accountId, new PageBounds(page, limit, Order.formString("login_time.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public JSONObject listManagerLoginLogs(int page, int limit) { - PageList logs = managerLoginLogMapper.listManagerLoginLog(new JSONObject(), new PageBounds(page, limit, Order.formString("login_time.desc"))); - return PageListUtils.buildPageListResult(logs); - } - - @Override - public void onApplicationEvent(ManagerLoginEvent managerLoginEvent) { - JSONObject log = managerLoginEvent.toLogObject(); - try { - managerLoginLogMapper.saveLog(log); - } catch (Exception e) { - logger.error("saving manager login log error", e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerWechatBindServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerWechatBindServiceImpl.java deleted file mode 100644 index abc0d9d7e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerWechatBindServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.signin.core.ManagerWechatBindService; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.websocket.notify.CommonPageEvent; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.concurrent.TimeUnit; - -/** - * Created by yixian on 2016-11-03. - */ -@Service -public class ManagerWechatBindServiceImpl implements ManagerWechatBindService,ApplicationEventPublisherAware { - private ApplicationEventPublisher publisher; - @Resource - private ManagerMapper managerMapper; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private CustomerMapper customerMapper; - @Value("${app.redis.prefix}") - private String prefix; - - @Override - public JSONObject newBindRequest(String managerId) { - String bindId = RandomStringUtils.random(16, true, true); - stringRedisTemplate.boundValueOps(prefix + ":mp_bind_manager:" + bindId).set(managerId + "", 5, TimeUnit.MINUTES); - JSONObject manager = managerMapper.findById(managerId); - if (StringUtils.isNotBlank(manager.getString("wx_openid"))){ - JSONObject wx = customerMapper.findCustomerByOpenId(manager.getString("wx_openid")); - if (wx!=null){ - manager.put("wx_headimg",wx.getString("headimg")); - manager.put("wx_nickname",wx.getString("nickname")); - } - } - manager.put("bind_id", bindId); - String url = PlatformEnvironment.getEnv().concatUrl("/system/manager_wechat_binds/" + bindId); - manager.put("url", url); - return manager; - } - - @Override - @CacheEvict(value = ":login:managers:",allEntries = true) - public void bindWechatUser(String bindId, String openid) { - String manageridStr = stringRedisTemplate.boundValueOps(prefix + ":mp_bind_manager:" + bindId).get(); - if (manageridStr == null) { - throw new BadRequestException("URL expired"); - } - JSONObject manager = managerMapper.findById(manageridStr); - if (manager == null) { - throw new BadRequestException("Invalid Manager"); - } - JSONObject managerByOpenId = managerMapper.findByWxOpenId(openid); - if (managerByOpenId != null) { - setOpenId(managerByOpenId.getString("manager_id"), null); - } - setOpenId(manageridStr, openid); - publisher.publishEvent(new CommonPageEvent(this, bindId, "manager_bind_success",manager)); - } - - @Override - public JSONObject removeBindWechat(String managerId) { - JSONObject manager = managerMapper.findById(managerId); - manager.put("wx_openid", null); - managerMapper.update(manager); - return managerMapper.findById(managerId); - } - - private void setOpenId(String managerId, String openId) { - JSONObject manager = new JSONObject(); - manager.put("manager_id", managerId); - manager.put("wx_openid", openId); - managerMapper.update(manager); - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java deleted file mode 100644 index da79a3709..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ /dev/null @@ -1,838 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core.impls; - -import au.com.royalpay.payment.core.exceptions.EmailException; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.device.core.DeviceManager; -import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.manage.signin.events.ClientLoginEvent; -import au.com.royalpay.payment.manage.signin.events.ManagerLoginEvent; -import au.com.royalpay.payment.manage.support.sms.SmsSender; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.locale.LocaleSupport; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.context.MessageSource; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -/** - * account service for sign in Created by yixian on 2016-06-29. - */ -@Service -public class SignInAccountServiceImpl implements SignInAccountService, ApplicationEventPublisherAware { - @Resource - private ManagerMapper managerMapper; - @Resource - private OrgMapper orgMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - @Resource - private MailService mailService; - @Resource - private PermissionManager permissionManager; - @Resource - private SpringTemplateEngine thymeleaf; - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private DeviceManager deviceManager; - @Resource - private ClientConfigService clientConfigService; - @Resource - private SysCustomerServiceMapper sysCustomerServiceMapper; - @Resource - private PermissionClientModulesService permissionClientModulesService; - @Resource - private RoyalThreadPoolExecutor royalThreadPoolExecutor; - @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private SmsSender smsSender; - @Resource - private MessageSource messageSource; - private final String RESET_CLIENT_ACCOUNT_PREFIX = "RESET_CLIENT_ACCOUNT"; - private final String RESET_MANAGER_ACCOUNT_PREFIX = "RESET_MANAGER_ACCOUNT"; - private final String[] FILE_KEYS = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"}; - private final String[] PUT_KEYS = {"file_bank_info", "file_company_info", "file_id_info", "file_agreement_info"}; - private final String[] FILE_NAMES = {"* bank statement", "* Certificate of Registration", "* ID", "* Agreement"}; - - private final String[] KYC_FILE_KEYS = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"}; - private final String[] KYC_PUT_KEYS = {"file_bank_info", "utility_bill_info", "file_id_info"}; - private final String[] KYC_FILE_NAMES = {"* ASIC File", "Utility Bill Files", "* ID"}; - - private ApplicationEventPublisher publisher; - private static final List tags = new ArrayList<>(); - - - @PostConstruct - public void init() { - tags.add("account"); - } - - @Override - @Cacheable(value = ":login:managers:", key = "''+#accountId") - public JSONObject getManager(String accountId) { - JSONObject manager = managerMapper.findById(accountId); - if (manager == null) { - throw new ForbiddenException("用户不存在或已禁用"); - } - if (manager.getInteger("org_id") != null) { - manager.put("org", orgMapper.findOne(manager.getIntValue("org_id"))); - } - List funcs = permissionManager.listUserFunctions(manager.getIntValue("role")); - List funcIds = new ArrayList<>(); - List funcNames = new ArrayList<>(); - Map modules = new HashMap<>(); - for (JSONObject func : funcs) { - funcIds.add(func.getString("func_id")); - if (StringUtils.isNotBlank(func.getString("name"))) { - funcNames.add(func.getString("name")); - } - String module = func.getString("module"); - if (module != null && !modules.containsKey(module)) { - JSONObject mod = new JSONObject(); - mod.put("js_module", func.getString("js_module")); - mod.put("js_path", func.getString("js_path")); - modules.put(module, mod); - } - } - manager.put("available_func_ids", funcIds); - manager.put("available_func_names", funcNames); - manager.put("modules", modules.values()); - manager.put("module_names", modules.keySet()); - if ((manager.getIntValue("role") & ManagerRole.SERVANT.getMask()) > 0) { - JSONObject cs = sysCustomerServiceMapper.findByManagerId(accountId); - if (cs != null) { - manager.put("onoff", cs.getBoolean("onoff")); - } else { - manager.put("onoff", false); - } - } - return manager; - } - - @Override - @CacheEvict(value = ":login:managers:", key = "''+#accountId") - public void clearManager(String accountId) { - - } - - @Override - @Cacheable(value = ":login:clients:", key = "''+#accountId") - public JSONObject getClient(String accountId) { - JSONObject account = clientAccountMapper.findById(accountId); - if (account == null) { - throw new ForbiddenException("用户不存在或已禁用"); - } - int client_id = account.getIntValue("client_id"); - if (client_id > 0) { - JSONObject client = clientManager.getClientDetailById(client_id); - if (client == null) { - throw new ForbiddenException("用户不存在或已禁用"); - } - JSONObject clientConfig = clientConfigService.find(client_id); - if (clientConfig !=null) { - client.putAll(clientConfig); - } - client = clientInfoWithNoSecretInfo(client); - client.put("client_less_file", false); - if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5)) { - List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - if (clientFiles != null && !clientFiles.isEmpty()) { - clientFiles = clientFiles.stream().filter(fileJson -> ((fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2))).collect(Collectors.toList()); - String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"}; - for (String fileKey : fileKeys) { - if (clientFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { - client.put("client_less_file", true); - } - } - } else { - client.put("client_less_file", true); - } - } - if (client.getInteger("parent_client_id") != null) { - JSONObject rootPartner = clientManager.getClientInfoIgnoreInvalid(client.getIntValue("parent_client_id")); - rootPartner.putAll(clientConfigService.find(client.getIntValue("parent_client_id"))); - rootPartner = clientInfoWithNoSecretInfo(rootPartner); - account.put("parent_client", rootPartner); - } - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - client.putAll(mchConfig); - client.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - account.put("client", client); - account.put("client_moniker", client.getString("client_moniker")); - if (client.getIntValue("approve_result") == 2) { - account.put("auth_day", DateUtils.addDays(client.getDate("approve_time"), PlatformEnvironment.getEnv().authDays())); - } - } - - List funcs = permissionClientModulesService.listValidByClientId(account.getIntValue("client_id")); - List funcIds = new ArrayList<>(); - for (JSONObject func : funcs) { - funcIds.add(func.getString("module_id")); - } - account.put("available_module_ids", funcIds); - return account; - } - - @Override - public JSONObject getClientByUsername(String username) { - JSONObject account = clientAccountMapper.findByUsername(username); - Assert.notNull(account, "Username is not exists!"); - return account; - } - - @Override - public JSONObject getManagerByUsername(String username) { - JSONObject account = managerMapper.findAvailableByLoginId(username); - Assert.notNull(account, "Username is not exists!"); - return account; - } - - @Override - @CacheEvict(value = ":login:clients:", key = "''+#accountId") - public void clearAccountCache(String accountId) { - - } - - @Override - public JSONObject managerLoginCheck(LoginInfo loginInfo) { - JSONObject account = managerMapper.findAvailableByLoginId(loginInfo.getLoginId()); - validLoginInfo(loginInfo, account); - JSONObject client = clientManager.getClientInfoIgnoreInvalid(account.getIntValue("client_id")); - if (client != null && !client.getBooleanValue("is_valid")) { - throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); - } - publisher.publishEvent(new ManagerLoginEvent(this, account.getString("manager_id"), RequestEnvironment.getClientIp(), "PASSWORD")); - return account; - } - - @Override - public JSONObject accountCheck(LoginInfo loginInfo) { - JSONObject account = managerMapper.findAvailableByLoginId(loginInfo.getLoginId()); - validLoginInfo(loginInfo, account); - return account; - } - - private void validLoginInfo(LoginInfo loginInfo, JSONObject account) { - if (account == null) { - throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); - } - String salt = account.getString("salt"); - String pwdHash = loginInfo.getPasswordHashed(salt); - if (!StringUtils.equals(pwdHash, account.getString("password_hash"))) { - throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); - } - } - - @Override - public JSONObject clientLoginCheck(LoginInfo loginInfo) { - JSONObject account = clientAccountMapper.findByUsername(loginInfo.getLoginId()); - validLoginInfo(loginInfo, account); - publisher.publishEvent( - new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "PASSWORD")); - return account; - } - - @Override - public JSONObject clientAccountCheck(LoginInfo loginInfo) { - JSONObject account = clientAccountMapper.findByUsername(loginInfo.getLoginId()); - validLoginInfo(loginInfo, account); - return account; - } - - @Override - public void changeManagerPassword(JSONObject manager, ChangePwdBean change) { - manager = managerMapper.findDetail(manager.getString("manager_id")); - String salt = manager.getString("salt"); - if (!PasswordUtils.hashPwd(change.getOldpwd(), salt).equals(manager.getString("password_hash"))) { - throw new BadRequestException("Invalid Original Password"); - } else if (PasswordUtils.hashPwd(change.getOldpwd(), salt).equals(PasswordUtils.hashPwd(change.getPwd(), salt))) { - throw new BadRequestException("The new Password Shouldn't be Common With Last Password"); - } - salt = PasswordUtils.newSalt(); - manager.put("salt", salt); - manager.put("password_hash", PasswordUtils.hashPwd(change.getPwd(), salt)); - managerMapper.update(manager); - } - - @Override - @Transactional - public void changeAccountPassword(JSONObject clientStatus, ChangePwdBean change) { - JSONObject account = clientAccountMapper.findDetail(clientStatus.getString("account_id")); - String salt = account.getString("salt"); - if (!PasswordUtils.hashPwd(change.getOldpwd(), salt).equals(account.getString("password_hash"))) { - throw new BadRequestException("Invalid Original Password"); - } else if (PasswordUtils.hashPwd(change.getOldpwd(), salt).equals(PasswordUtils.hashPwd(change.getPwd(), salt))) { - throw new BadRequestException("The new Password Shouldn't be Common With Last Password"); - } - salt = PasswordUtils.newSalt(); - account.put("salt", salt); - account.put("password_hash", PasswordUtils.hashPwd(change.getPwd(), salt)); - account.put("password_aes", PasswordUtils.encryptAESPwd(change.getPwd())); - account.put("is_password_expired", 0); - clientAccountMapper.update(account); - deviceManager.deviceOffline(clientStatus.getString("account_id")); - } - - @Override - @Cacheable(value = ":login:client_mocks:", key = "#moniker") - public JSONObject mockClient(String moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(moniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject account = new JSONObject(); - client = clientManager.getClientDetailById(client.getIntValue("client_id")); - client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - client = clientInfoWithNoSecretInfo(client); - if (client.getInteger("parent_client_id") != null) { - JSONObject rootPartner = clientManager.getClientInfoIgnoreInvalid(client.getIntValue("parent_client_id")); - rootPartner.putAll(clientConfigService.find(client.getIntValue("parent_client_id"))); - rootPartner = clientInfoWithNoSecretInfo(rootPartner); - account.put("parent_client", rootPartner); - } - account.put("client", client); - account.put("client_moniker", client.getString("client_moniker")); - account.put("account_id", 0); - account.put("client_id", client.getIntValue("client_id")); - account.put("display_name", "Mock User"); - account.put("role", 1); - - List funcs = permissionClientModulesService.listValidByClientId(account.getIntValue("client_id")); - List funcIds = new ArrayList<>(); - for (JSONObject func : funcs) { - funcIds.add(func.getString("module_id")); - } - account.put("available_module_ids", funcIds); - return account; - } - - @Override - public JSONObject managerOpenIdSignIn(String openid) { - JSONObject manager = managerMapper.findByWxOpenId(openid); - if (manager == null) { - throw new ForbiddenException("Your WeChat Account haven't bind to a manager user"); - } - publisher.publishEvent(new ManagerLoginEvent(this, manager.getString("manager_id"), RequestEnvironment.getClientIp(), "wechat")); - return manager; - } - - @Override - public JSONObject clientWechatSignIn(String openid) { - JSONObject account = clientAccountMapper.findByOpenId(openid); - if (account == null) { - throw new ForbiddenException("Your WeChat Account haven't bind to a client user"); - } - publisher.publishEvent( - new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return account; - } - - @Override - public JSONObject clientWechatOneSignIn(String unionId) { - JSONObject account = clientAccountMapper.findOneByUnionIdAndCreateTimeDesc(unionId); - if (account == null) { - return null; - } - publisher.publishEvent( - new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return account; - } - - @Override - public JSONObject clientWechatAppSignIn(String openId) { - JSONObject account = clientAccountMapper.findByAppOpenId(openId); - if (account == null) { - return null; - } - publisher.publishEvent( - new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return account; - } - - @Override - public JSONObject clientAppleSignIn(String appleUserId) { - JSONObject account = clientAccountMapper.findByAppleUserId(appleUserId); - if (account == null) { - return null; - } - publisher.publishEvent( - new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); - return account; - } - - @Override - public JSONObject clientWechatAppSignInByUnionId(String unionId) { - if (StringUtils.isBlank(unionId) || unionId == "" || unionId == null) { - return null; - } - JSONObject account = clientAccountMapper.findByWxUnioinId(unionId); - if (account == null) { - return null; - } - return account; - } - - @Override - public String ForgetPassword(String client_moniker) throws Exception { - JSONObject client = clientMapper.findClientByMoniker(client_moniker); - if (client != null) { - final String contact_email = client.getString("contact_email"); - if (contact_email == null) { - throw new Exception("Email Address of this partner is null,Please contact customer service"); - } - List accounts = clientAccountMapper.listAdminAccounts(client.getIntValue("client_id")); - if (accounts != null && !accounts.isEmpty()) { - - String codeKey = signInStatusManager.addChangepasswordVerifyCode(client_moniker); - String url = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/partner_changepassword_page/" + codeKey); -// JSONObject map = new JSONObject(); -// map.put("url", url); -// map.put("accounts", accounts); -// map.put("client_moniker", client_moniker); - //todo velocityEngine - Context ctx = new Context(); - ctx.setVariable("url", url); - ctx.setVariable("accounts", accounts); - ctx.setVariable("client_moniker", client_moniker); - final String content = thymeleaf.process("mail/reset_password", ctx); - //final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/reset_password.vm", "utf-8", map); - - new Thread(() -> { - try { - mailService.sendEmail("Reset Password", contact_email, "", content); - } catch (Exception ignored) { - } - }).start(); - - return contact_email; - - } else { - throw new Exception("The partner has no Administrator account ,Please contact customer service"); - } - } else { - throw new Exception("Not found the corresponding partner code,Please contact customer service"); - } - } -// public String ForgetPassword(String client_moniker) throws Exception { -// JSONObject client = clientMapper.findClientByMoniker(client_moniker); -// if (client != null) { -// final String contact_email = client.getString("contact_email"); -// if (contact_email == null) { -// throw new Exception("Email Address of this partner is null,Please contact customer service"); -// } -// List accounts = clientAccountMapper.listAdminAccounts(client.getIntValue("client_id")); -// if (accounts != null && !accounts.isEmpty()) { -// -// String codeKey = signInStatusManager.addChangepasswordVerifyCode(client_moniker); -// String url = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/partner_changepassword_page/" + codeKey); -// // JSONObject map = new JSONObject(); -// // map.put("url", url); -// // map.put("accounts", accounts); -// // map.put("client_moniker", client_moniker); -// // todo velocityEngine -// Context ctx = new Context(); -// ctx.setVariable("url", url); -// ctx.setVariable("accounts", accounts); -// ctx.setVariable("client_moniker", client_moniker); -// final String content = thymeleaf.process("mail/reset_password", ctx); -// // final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/reset_password.vm", -// // "utf-8", map); -// -// SendMail sendMail = new SendMail(); -// Set to = new HashSet<>(); -// to.add(contact_email); -// sendMail.setMailTos(to); -// sendMail.setFrom("info@mail.royalpay.com.au"); -// sendMail.setTitle("Reset Password"); -// sendMail.setContent(content); -// sendMail.setTags(tags); -// mailService.sendMail(sendMail); -// -// return contact_email; -// -// } else { -// throw new Exception("The partner has no Administrator account ,Please contact customer service"); -// } -// } else { -// throw new Exception("Not found the corresponding partner code,Please contact customer service"); -// } -// } - - public static JSONObject clientInfoWithNoSecretInfo(JSONObject client) { - JSONObject simpleClient = new JSONObject(); - String[] columns = {"client_id", "client_moniker", "parent_client_id", "company_name", "address", "business_name", "business_structure", "abn", "acn", - "company_phone", "suburb", "postcode", "state", "contact_person", "contact_phone", "contact_email", "short_name", "logo_url", "enable_refund", - "enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "logo_thumbnail", "creator", "create_time", "approver", - "approve_result", "approve_time", "open_status", "timezone", "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", - "enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode", "company_photo", "store_photo", "company_website", "contact_job", "sub_manage", "enable_rpaypmt_card", "enable_rpaypmt_dd"}; - for (String col : columns) { - simpleClient.put(col, client.get(col)); - } - return simpleClient; - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } - - @Override - public void changePasswordByEmail(String codeValue, String login_id, String newPassword) { - - String client_moniker = codeValue; - JSONObject client = clientMapper.findClientByMoniker(client_moniker); - Assert.notNull(client, "partner code is not exists!"); - JSONObject account = clientAccountMapper.findByUsername(login_id); - Assert.notNull(account, "username is not exists!"); - if (account.getIntValue("client_id") != client.getIntValue("client_id")) { - throw new ForbiddenException("username is incorrect"); - } - if (account.getIntValue("role") != 1) { - throw new ForbiddenException("username is incorrect"); - } - - String salt = PasswordUtils.newSalt(); - account.put("salt", salt); - account.put("password_hash", PasswordUtils.hashPwd(newPassword, salt)); - account.put("password_aes", PasswordUtils.encryptAESPwd(newPassword)); - account.put("is_password_expired", 0); - clientAccountMapper.update(account); - } - - @Override - public void getClientResetPwdCode(JSONObject account, String type) { - if (StringUtils.equals(type, "email") && !account.containsKey("contact_email")) { - throw new BadRequestException("Your account is not bound to your mailbox!"); - } - if (StringUtils.equals(type, "phone") && !account.containsKey("contact_phone") && !account.containsKey("nation_code")) { - throw new BadRequestException("Your account is not bound to your phone!"); - } - String accountId = account.getString("account_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your " + type + " or try again in 5 minutes."); - } - String codeKeyValue = RandomStringUtils.random(6, false, true); - switch (type) { - case "email": - Context ctx = new Context(); - ctx.setVariable("account", account); - ctx.setVariable("captcha", codeKeyValue); - final String content = thymeleaf.process("mail/account_reset_email.html", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - mailService.sendEmail("Reset your password", account.getString("contact_email"), - "", content); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - }); - break; - case "phone": - smsSender.sendAuthCodeMessage(account.getString("nation_code").trim(), account.getString("contact_phone"), Locale.ENGLISH, new AuthCodeMessage("Reset password", codeKeyValue, 5)); - break; - } - stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).set(codeKeyValue, 5, TimeUnit.MINUTES); - } - - @Override - public void getManagerResetPwdCode(JSONObject account, String type) { - if (StringUtils.equals(type, "email") && !account.containsKey("email")) { - throw new BadRequestException("Your account is not bound to your mailbox!"); - } - if (StringUtils.equals(type, "phone") && !account.containsKey("phone") && !account.containsKey("nation_code")) { - throw new BadRequestException("Your account is not bound to your phone!"); - } - String managerId = account.getString("manager_id"); - String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).get(); - if (StringUtils.isNotEmpty(codeKeyValueRedis)) { - throw new BadRequestException("Captcha has been sent.Please check your " + type + " or try again in 5 minutes."); - } - String codeKeyValue = RandomStringUtils.random(6, false, true); - switch (type) { - case "email": - Context ctx = new Context(); - ctx.setVariable("account", account); - ctx.setVariable("captcha", codeKeyValue); - final String content = thymeleaf.process("mail/account_reset_email.html", ctx); - royalThreadPoolExecutor.execute(() -> { - try { - mailService.sendEmail("Reset your password", account.getString("email"), - "", content); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } - }); - break; - case "phone": - smsSender.sendAuthCodeMessage(account.getString("nation_code").trim(), account.getString("phone"), Locale.CHINESE, new AuthCodeMessage("密码重置服务", codeKeyValue,5)); - break; - } - stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).set(codeKeyValue, 5, TimeUnit.MINUTES); - } - - @Override - public void verifyClientCaptcha(JSONObject account, String captcha) { - String captchaRedis = stringRedisTemplate.boundValueOps(getResetClientAccountKey(account.getString("account_id"))).get(); - if (StringUtils.isBlank(captchaRedis)) { - throw new BadRequestException("Captcha has expired"); - } - if (StringUtils.equals(captcha, captchaRedis)) { - throw new BadRequestException("Captcha is wrong"); - } - } - - @Override - public void verifyManagerCaptcha(JSONObject account, String captcha) { - String captchaRedis = stringRedisTemplate.boundValueOps(getResetManagerAccountKey(account.getString("manager_id"))).get(); - if (StringUtils.isBlank(captchaRedis)) { - throw new BadRequestException("Captcha has expired"); - } - if (StringUtils.equals(captcha, captchaRedis)) { - throw new BadRequestException("Captcha is wrong"); - } - } - - @Override - public void deleteClientCodeKey(String codekey) { - deleteClientAccountKey(codekey); - } - - @Override - public void deleteManagerCodeKey(String codekey) { - deleteManagerAccountKey(codekey); - } - - private void deleteClientAccountKey(String codeKey) { - stringRedisTemplate.delete(getResetClientAccountKey(codeKey)); - } - - private void deleteManagerAccountKey(String codeKey) { - stringRedisTemplate.delete(getResetManagerAccountKey(codeKey)); - } - - private String getResetClientAccountKey(String codeKey) { - return RESET_CLIENT_ACCOUNT_PREFIX + codeKey; - } - - private String getResetManagerAccountKey(String codeKey) { - return RESET_MANAGER_ACCOUNT_PREFIX + codeKey; - } - - @Override - public JSONObject checkAuthFileStatus(JSONObject client) { - JSONObject result = new JSONObject(); - result.put("client_less_file", false); - result.put("put_fail_pdf", "https://file.royalpay.com.au/open/2019/08/28/1566959635986_P1GuvCkuWINPhUJUqUQnz8E0u6Lgpx.pdf"); - result.put("title", messageSource.getMessage("client.auth.file.title", null, RequestEnvironment.getLocale())); - List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - boolean clientFilesIsLess = false; - for (int i = 0; i < FILE_KEYS.length; i++) { - String fileKey = FILE_KEYS[i]; - if (clientFiles != null && !clientFiles.isEmpty()) { - List clientFileUrl = clientFiles.stream() - .filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (clientFileUrl != null && !clientFileUrl.isEmpty()) { - JSONObject fileJson = new JSONObject(); - fileJson.put("key", PUT_KEYS[i]); - fileJson.put("name", FILE_NAMES[i]); - fileJson.put("file_value", clientFileUrl); - fileJson.put("file_write", false); - result.put(fileKey, fileJson); - } else { - List clientBackToFileUrl = clientFiles.stream() - .filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 3))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - JSONObject fileJson = new JSONObject(); - fileJson.put("key", PUT_KEYS[i]); - fileJson.put("name", FILE_NAMES[i]); - if (clientBackToFileUrl != null && !clientBackToFileUrl.isEmpty()) { - if ("client_agree_file".equals(fileKey)) { - List agreeFile = new ArrayList<>(); - agreeFile.add(clientBackToFileUrl.get(0)); - fileJson.put("file_value", agreeFile); - } else { - fileJson.put("file_value", clientBackToFileUrl); - } - } - fileJson.put("file_write", true); - result.put(fileKey, fileJson); - clientFilesIsLess = true; - } - } else { - clientFilesIsLess = true; - for (int c = 0; c < FILE_KEYS.length; c++) { - String key = FILE_KEYS[c]; - JSONObject fileJson = new JSONObject(); - fileJson.put("key", PUT_KEYS[c]); - fileJson.put("name", FILE_NAMES[c]); - fileJson.put("file_write", true); - result.put(key, fileJson); - } - } - } - if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5)) { - whenClientLessFile(client, result); - if (clientFilesIsLess) { - result.put("client_less_file", clientFilesIsLess); - } - } - return result; - } - - @Override - public JSONObject checkKycFileStatus(JSONObject client, JSONObject account, String sourceType) { - JSONObject result = new JSONObject(); - boolean lessKycFiles = true; - JSONObject kycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id")); - if (kycFilesAuth != null) { - lessKycFiles = false; - } - result.put("client_less_file", lessKycFiles); - JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id")); - if (lessKycFiles || account.containsKey("manager_id") || compliance != null) { - List kycFiles = new ArrayList<>(); - if ("client".equals(sourceType.toLowerCase())) { - kycFiles = clientFilesMapper.findKycClientFileByClient(client.getIntValue("client_id")); - } else { - kycFiles = clientFilesMapper.findKycClientFileByAudit(client.getIntValue("client_id")); - } - for (JSONObject file : kycFiles) { - result.put(file.getString("file_name"), file.getString("file_value")); - } - List clientFileUrl = kycFiles.stream() - .filter(json -> ("kyc_utility_bill_file".equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("status", json.getString("status")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (!clientFileUrl.isEmpty()) { - result.put("kyc_utility_bill_file", clientFileUrl); - } - } - return result; - } - - @Override - public JSONObject checkKycFileStatusForApp(JSONObject client, JSONObject account) { - JSONObject result = new JSONObject(); - boolean lessKycFiles = true; - JSONObject kycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id")); - if (kycFilesAuth != null) { - lessKycFiles = false; - } - result.put("client_less_file", lessKycFiles); - if (lessKycFiles || account.containsKey("manager_id")) { - List kycFiles = new ArrayList<>(); - - kycFiles = clientFilesMapper.findKycClientFileByClient(client.getIntValue("client_id")); - - for (JSONObject file : kycFiles) { - result.put(file.getString("file_name"), file.getString("file_value")); - } - List clientFileUrl = kycFiles.stream() - .filter(json -> ("kyc_utility_bill_file".equals(json.getString("file_name")))) - .sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date"))) - .map(json -> { - JSONObject params = new JSONObject(); - params.put("file_id", json.getString("file_id")); - params.put("status", json.getString("status")); - params.put("file_value", json.getString("file_value")); - return params; - }) - .collect(Collectors.toList()); - if (!clientFileUrl.isEmpty()) { - result.put("kyc_utility_bill_file", clientFileUrl); - } - } - return result; - } - - private void whenClientLessFile(JSONObject client, JSONObject result) { - JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); - if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) { - result.put("client_refuse_reason", "Refuse reason/打回原因:" + authFileCompliance.getString("description")); - } - JSONObject photoInfo = new JSONObject(); - photoInfo.put("company_photo", client.getString("company_photo")); - photoInfo.put("store_photo", client.getString("store_photo")); - photoInfo.put("web_site", client.getString("company_website")); - if (authFileCompliance != null) { - if (StringUtils.isNotBlank(authFileCompliance.getString("company_photo"))) { - photoInfo.put("company_photo", authFileCompliance.getString("company_photo")); - } - if (StringUtils.isNotBlank(authFileCompliance.getString("store_photo"))) { - photoInfo.put("store_photo", authFileCompliance.getString("store_photo")); - } - if (StringUtils.isNotBlank(authFileCompliance.getString("company_website"))) { - photoInfo.put("web_site", authFileCompliance.getString("company_website")); - } - } - result.put("photo_info", photoInfo); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java deleted file mode 100644 index d68279e5e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java +++ /dev/null @@ -1,499 +0,0 @@ -package au.com.royalpay.payment.manage.signin.core.impls; - -import au.com.royalpay.payment.manage.appclient.beans.AppleLoginBean; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.core.SignInAccountService; -import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; -import au.com.royalpay.payment.tools.connections.mpsupport.MpClientAppWechatApiProvider; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.JsonHelper; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import au.com.royalpay.payment.tools.utils.apple.AppleAuthUtils; -import au.com.royalpay.payment.tools.utils.apple.UserClaim; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.BoundValueOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import java.util.concurrent.TimeUnit; - -/** - * Created by yixian on 2016-06-29. - */ -@Service -public class SignInStatusManagerImpl implements SignInStatusManager { - @Resource - private StringRedisTemplate stringRedisTemplate; - @Value("${app.redis.prefix}") - private String redisPrefix; - @Resource - private SignInAccountService signInAccountService; - @Resource - private MpClientAppWechatApiProvider mpClientAppWechatApiProvider; - @Resource - private ClientAccountMapper clientAccountMapper; - private final String CLIENT_LOGIN_WECHAT_BIND_PREFIX = "CLIENT_LOGIN_WECHAT_BIND_PREFIX"; - private final String CLIENT_LOGIN_PHONE_BIND_PREFIX = "CLIENT_LOGIN_PHONE_BIND_PREFIX"; - - @Override - public JSONObject getCurrentManager(String statusKey) { - BoundValueOperations op = stringRedisTemplate.boundValueOps(managerLoginRedisKey(statusKey)); - String accountId = op.get(); - if (accountId == null) { - return null; - } - op.expire(30, TimeUnit.MINUTES); - return signInAccountService.getManager(accountId); - } - - private String managerLoginRedisKey(String statusKey) { - return redisPrefix + ":login_status:manager:" + statusKey; - } - - @Override - public JSONObject getCurrentClient(String statusKey) { - BoundValueOperations op = stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)); - String accountId = op.get(); - if (accountId == null) { - return null; - } - op.expire(30, TimeUnit.MINUTES); - return signInAccountService.getClient(accountId); - } - - private String partnerLoginRedisKey(String statusKey) { - return redisPrefix + ":login_status:partner:" + statusKey; - } - - @Override - public String partnerSignIn(LoginInfo loginInfo) { - JSONObject account = signInAccountService.clientLoginCheck(loginInfo); - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public String getClientInfoByPhoneStatusKey(String phone, String nationCode) { - String statusKey = newStatusKey(); - JSONObject account = clientAccountMapper.findOneByPhoneAndCreateTimeDesc(phone, "+" + nationCode); - if (account == null) { - String expireMin = "5"; - stringRedisTemplate.boundValueOps(getClientLoginPhoneBindRedisKey(phone, nationCode)).set(phone, Long.parseLong(expireMin), TimeUnit.MINUTES); - return null; - } - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - return statusKey; - } - - private String newStatusKey() { - return Long.toHexString(System.currentTimeMillis()) + "_" + RandomStringUtils.random(20, true, true); - } - - @Override - public String verifyClientAccountLogin(LoginInfo loginInfo, String verfiyType) { - JSONObject account = signInAccountService.clientAccountCheck(loginInfo); - if ("phone".equals(verfiyType)) { - if (account.containsKey("contact_phone")) { - throw new BadRequestException("The account has been linked to the phone number!"); - } - } else if (StringUtils.equalsIgnoreCase("apple", verfiyType) - && StringUtils.isNotEmpty(account.getString("apple_userid"))) { - throw new BadRequestException("The account has been binded and exist appleId!"); - } else { - if (account.containsKey("wechat_openid")) { - throw new BadRequestException("The account has been linked to the wechat!"); - } - } - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getString("account_id"), 30, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public String managerSignIn(LoginInfo loginInfo) { - JSONObject manager = signInAccountService.managerLoginCheck(loginInfo); - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(managerLoginRedisKey(statusKey)).set("" + manager.getString("manager_id"), 30, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public void managerSignOut(String statusKey) { - stringRedisTemplate.delete(managerLoginRedisKey(statusKey)); - } - - @Override - public void partnerSignOut(String statusKey) { - stringRedisTemplate.delete(partnerLoginRedisKey(statusKey)); - } - - @Override - public void managerAuthToClient(String managerStatusKey, String clientMoniker) { - JSONObject manager = getCurrentManager(managerStatusKey); - if (manager != null && (ManagerRole.ADMIN.hasRole(manager.getIntValue("role")) || ManagerRole.OPERATOR.hasRole(manager.getIntValue("role")))) { - String cacheKey = clientMockRedisKey(managerStatusKey); - stringRedisTemplate.boundValueOps(cacheKey).set(clientMoniker, 30, TimeUnit.MINUTES); - return; - } - throw new ForbiddenException(); - } - - @Override - public JSONObject managerMockClient(String managerStatusKey) { - String cacheKey = clientMockRedisKey(managerStatusKey); - BoundValueOperations op = stringRedisTemplate.boundValueOps(cacheKey); - String moniker = op.get(); - if (moniker == null) { - return null; - } - op.expire(30, TimeUnit.MINUTES); - return signInAccountService.mockClient(moniker); - } - - private String clientMockRedisKey(String managerStatusKey) { - return managerLoginRedisKey(managerStatusKey) + ":client_mock"; - } - - private String verifyCodeRedisKey(String statusKey) { - return redisPrefix + ":verify_code:login:" + statusKey; - } - - private String changePasswordVerifyCodeRedisKey(String statusKey) { - return redisPrefix + ":verify_code:changepassword:" + statusKey; - } - - @Override - public String addVerifyCode(String code) { - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(verifyCodeRedisKey(statusKey)).set(code, 3, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public String addChangepasswordVerifyCode(String code) { - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(changePasswordVerifyCodeRedisKey(statusKey)).set(code, 12, TimeUnit.HOURS); - return statusKey; - } - - @Override - public String getVerifyCode(String codeKey) { - BoundValueOperations op = stringRedisTemplate.boundValueOps(verifyCodeRedisKey(codeKey)); - String codeValue = op.get(); - return codeValue; - } - - @Override - public String getChangePasswordVerifyCode(String codeKey) { - BoundValueOperations op = stringRedisTemplate.boundValueOps(changePasswordVerifyCodeRedisKey(codeKey)); - String codeValue = op.get(); - return codeValue; - } - - @Override - public void deleteVerifyCodeKey(String codeKey) { - stringRedisTemplate.delete(verifyCodeRedisKey(codeKey)); - } - - @Override - public void deleteChangepasswordVerifyCodeKey(String codeKey) { - stringRedisTemplate.delete(changePasswordVerifyCodeRedisKey(codeKey)); - } - - - @Override - public JSONObject newManagerWechatSignInQRCode() { - String codeId = "manager_" + RandomStringUtils.random(15, true, true) + "_" + System.currentTimeMillis(); - JSONObject res = new JSONObject(); - res.put("code_id", codeId); - res.put("code_img", QRCodeUtils.qrcodeImageCode(PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat_qrcode/" + codeId), 300, false)); - return res; - } - - @Override - public void managerQRCodeSignIn(String codeId, String openid) { - JSONObject manager = signInAccountService.managerOpenIdSignIn(openid); - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(managerLoginRedisKey(statusKey)).set("" + manager.getString("manager_id"), 30, TimeUnit.MINUTES); - stringRedisTemplate.boundValueOps(redisPrefix + ":manager_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); - } - - @Override - public String managerQRCodeSignInStatus(String codeId) { - String statusKey = stringRedisTemplate.boundValueOps(redisPrefix + ":manager_qrcode_signin:code:" + codeId).get(); - if (statusKey == null) { - throw new ForbiddenException("Not signed yet"); - } - stringRedisTemplate.delete(redisPrefix + ":manager_qrcode_signin:code:" + codeId); - return statusKey; - } - - @Override - public String managerWechatSignIn(String openid) { - JSONObject manager = signInAccountService.managerOpenIdSignIn(openid); - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(managerLoginRedisKey(statusKey)).set("" + manager.getString("manager_id"), 30, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public void clientQRCodeSignIn(String codeId, String openid, ModelAndView view) { - JSONObject account = signInAccountService.clientWechatSignIn(openid); - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - stringRedisTemplate.boundValueOps(redisPrefix + ":client_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); - JSONObject res = new JSONObject(); - res.put("notitle", true); - view.addObject("res", res); - view.addObject("account", account); - } - - @Override - public String checkQRCodeClientLoginStatus(String codeId) { - String statusKey = stringRedisTemplate.boundValueOps(redisPrefix + ":client_qrcode_signin:code:" + codeId).get(); - if (statusKey == null) { - throw new ForbiddenException("Not signed yet"); - } - stringRedisTemplate.delete(redisPrefix + ":client_qrcode_signin:code:" + codeId); - return statusKey; - } - - @Override - public JSONObject partnerWechatAppSignIn(String code) { - JSONObject user = mpClientAppWechatApiProvider.getApi("clientapp").appLoginUser(code); - String openId = user.getString("openid"); - String unionId = user.getString("unionid"); - JSONObject account = signInAccountService.clientWechatAppSignIn(openId); - if (account == null) { - account = signInAccountService.clientWechatAppSignInByUnionId(unionId); - if (account == null) { - JSONObject res = new JSONObject(); - res.put("not_exists", true); - res.put("app_openid", openId); - return res; - } - } - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - account = getCurrentClient(statusKey); - account.put("sign_key", statusKey); - account.put("app_openid", openId); - return account; - } - - @Override - public JSONObject mchAppleSignIn(AppleLoginBean appleLoginBean) { - UserClaim userClaim = AppleAuthUtils.verifyIdentifyToken(appleLoginBean.getIdentityToken()); - if (!StringUtils.equalsIgnoreCase(userClaim.getSub(), appleLoginBean.getUser())) { - throw new ForbiddenException("apple userinfo is error"); - } - JSONObject account = signInAccountService.clientAppleSignIn(userClaim.getSub()); - if (account == null || account.isEmpty()) { - return JsonHelper.newJson(json -> { - json.put("apple_userid", userClaim.getSub()); - json.put("bind_status", false); - }); - } - String statusKey = newStatusKey(); - JSONObject result = new JSONObject(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - account = getCurrentClient(statusKey); - account.put("sign_key", statusKey); - result.put("account", account); - account.put("apple_userid", userClaim.getSub()); - result.put("bind_status", true); - result.put("status", "success"); - return result; - } - - @Override - public String clientWechatSignIn(String openid) { - JSONObject account = signInAccountService.clientWechatSignIn(openid); - String statusKey = newStatusKey(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - return statusKey; - } - - @Override - public JSONObject newClientWechatSignInQRCode() { - String codeId = "client_" + RandomStringUtils.random(15, true, true) + "_" + System.currentTimeMillis(); - JSONObject res = new JSONObject(); - res.put("code_id", codeId); - res.put("code_img", QRCodeUtils.qrcodeImageCode(PlatformEnvironment.getEnv().concatUrl("/global/userstatus/partner_signin_wechat_qrcode/" + codeId), 300, false)); - lockRandomCodeId(codeId); - return res; - } - - @Override - public JSONObject newClientAppSignInQRCode() { - String codeId = "app_" + RandomStringUtils.random(20, true, true) + "_" + System.currentTimeMillis(); - JSONObject res = new JSONObject(); - res.put("code_id", codeId); - res.put("code_img", QRCodeUtils.qrcodeImageCode(PlatformEnvironment.getEnv().concatUrl("/global/userstatus/partner_signin_qrcode/verify/" + codeId), 300, false)); - lockRandomCodeId(codeId); - return res; - } - - @Override - public void clientQRCodeAppSignIn(JSONObject device, String codeId, String source) { - getlockRandomCodeId(codeId); - String statusKey = newStatusKey(); - JSONObject account = new JSONObject(); - if (device != null && !device.isEmpty()) { - account = signInAccountService.getClient(device.getString("account_id")); - } - if (account == null || account.size() <= 0) { - throw new ForbiddenException("用户不存在或已禁用"); - } - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getString("account_id"), 30, TimeUnit.MINUTES); - stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); - if (StringUtils.isNotBlank(source)) { - stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin_" + source + ":code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); - } - } - - @Override - public void clientQRCodeWechatSignIn(JSONObject wxUser, String codeId) { - getlockRandomCodeId(codeId); - String statusKey = newStatusKey(); - JSONObject account = new JSONObject(); - if (wxUser != null && !wxUser.isEmpty()) { - account = signInAccountService.clientWechatSignIn(wxUser.getString("openid")); - } - if (account == null || account.size() <= 0) { - throw new ForbiddenException("用户不存在或已禁用"); - } - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set("" + account.getString("account_id"), 30, TimeUnit.MINUTES); - stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).set(statusKey, 1, TimeUnit.MINUTES); - } - - @Override - public JSONObject appQRCodeSignInStatus(String codeId) { - JSONObject statusInfo = new JSONObject(); - String statusKey = stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin:code:" + codeId).get(); - if (statusKey == null) { - throw new ForbiddenException("Not signed yet"); - } - stringRedisTemplate.delete(redisPrefix + ":app_qrcode_signin:code:" + codeId); - String source = stringRedisTemplate.boundValueOps(redisPrefix + ":app_qrcode_signin_RYCBSM:code:" + codeId).get(); - if (source != null) { - statusInfo.put("redirect_geek", true); - stringRedisTemplate.delete(redisPrefix + ":app_qrcode_signin_RYCBSM:code:" + codeId); - } - statusInfo.put("status_key", statusKey); - return statusInfo; - } - - @Override - public JSONObject customerQRCode() { - String codeId = "customer_" + RandomStringUtils.random(15, true, true) + "_" + System.currentTimeMillis(); - JSONObject res = new JSONObject(); - res.put("code_id", codeId); - res.put("code_img", QRCodeUtils.qrcodeImageCode(PlatformEnvironment.getEnv().concatUrl("/global/userstatus/customer_qrcode_scan/" + codeId), 300, false)); - return res; - } - - @Override - public void scanCustomerQrcode(String codeId, String openid) { - stringRedisTemplate.boundValueOps(redisPrefix + ":customer_qrcode:code:" + codeId).set(openid, 1, TimeUnit.MINUTES); - } - - @Override - public String getWechatCustomerId(String codeId) { - String statusKey = stringRedisTemplate.boundValueOps(redisPrefix + ":customer_qrcode:code:" + codeId).get(); - if (statusKey == null) { - throw new ForbiddenException("Not signed yet"); - } - stringRedisTemplate.delete(redisPrefix + ":customer_qrcode:code:" + codeId); - return statusKey; - } - - @Override - public JSONObject clientAppWechatSignIn(String code) { - JSONObject user = mpClientAppWechatApiProvider.getApi("merchant-app").appLoginUser(code); - if (user == null) { - throw new BadRequestException("WeChat users do not exist"); - } - String unionId = user.getString("unionid"); - String openId = user.getString("openid"); - JSONObject account = signInAccountService.clientWechatOneSignIn(unionId); - if (account == null) { - JSONObject wechatUserInfo = mpClientAppWechatApiProvider.getApi("merchant-app").appUserInfo(openId, user.getString("access_token")); - JSONObject res = new JSONObject(); - String nickName = wechatUserInfo.getString("nickname"); - res.put("bind_status", false); - res.put("app_openid", openId); - res.put("status", "success"); - String expireMin = "5"; - stringRedisTemplate.boundValueOps(getClientLoginWechatBindRedisKey(openId)).set(openId + "&" + nickName + "&" + unionId, Long.parseLong(expireMin), TimeUnit.MINUTES); - return res; - } - String statusKey = newStatusKey(); - JSONObject result = new JSONObject(); - stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); - account = getCurrentClient(statusKey); - account.put("sign_key", statusKey); - result.put("account", account); - result.put("app_openid", unionId); - result.put("bind_status", true); - result.put("status", "success"); - return result; - } - - private String getClientLoginWechatBindRedisKey(String openId) { - return "login:" + ":" + CLIENT_LOGIN_WECHAT_BIND_PREFIX + "&" + openId; - } - - - @Override - public JSONObject verifyClientLoginWechatBindCode(String openId) { - String rediskey = getClientLoginWechatBindRedisKey(openId); - String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); - if (codeValue == null || !codeValue.split("&")[0].equals(openId)) { - throw new BadRequestException("The WeChat ID does not apply for binding"); - } - String nickName = codeValue.split("&")[1]; - String unionId = codeValue.split("&")[2]; - stringRedisTemplate.delete(rediskey); - return JsonHelper.newJson(json -> { - json.put("nick_name", nickName); - json.put("union_id", unionId); - }); - } - - private String getClientLoginPhoneBindRedisKey(String phone, String nationCode) { - return "login:" + CLIENT_LOGIN_PHONE_BIND_PREFIX + "&" + nationCode + "&" + phone; - } - - public void verifyClientLoginPhoneBindCode(String phone, String nationCode) { - String rediskey = getClientLoginPhoneBindRedisKey(phone, nationCode); - String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); - if (codeValue == null || !codeValue.equals(phone)) { - throw new BadRequestException("The phone number is for application binding"); - } - stringRedisTemplate.delete(rediskey); - } - - - private void lockRandomCodeId(String codeId) { - stringRedisTemplate.boundValueOps(redisPrefix + "partner_signin" + codeId).set(codeId, 30, TimeUnit.SECONDS); - } - - private void getlockRandomCodeId(String codeId) { - String existId = stringRedisTemplate.boundValueOps(redisPrefix + "partner_signin" + codeId).get(); - if (StringUtils.isEmpty(existId)) { - throw new ForbiddenException("该二维码已过期,请重新获取"); - } - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/events/ClientLoginEvent.java b/src/main/java/au/com/royalpay/payment/manage/signin/events/ClientLoginEvent.java deleted file mode 100644 index 9477ca197..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/events/ClientLoginEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.signin.events; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEvent; - -import java.util.Date; - -/** - * Created by yixian on 2016-10-14. - */ -public class ClientLoginEvent extends ApplicationEvent { - private final int clientId; - private final String accountId; - private final String ip; - private final String method; - - public ClientLoginEvent(Object source, int clientId, String accountId, String ip, String method) { - super(source); - this.clientId = clientId; - this.accountId = accountId; - this.ip = ip; - this.method = method; - } - - public JSONObject toLog() { - JSONObject log = new JSONObject(); - log.put("client_id", clientId); - log.put("account_id", accountId); - log.put("ip", ip); - log.put("login_time", new Date(getTimestamp())); - log.put("method", method); - return log; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/events/ManagerLoginEvent.java b/src/main/java/au/com/royalpay/payment/manage/signin/events/ManagerLoginEvent.java deleted file mode 100644 index 872f01f28..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/events/ManagerLoginEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.signin.events; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEvent; - -import java.util.Date; - -/** - * Created by yixian on 2016-10-14. - */ -public class ManagerLoginEvent extends ApplicationEvent { - private final String managerId; - private final String ip; - private final String method; - - public ManagerLoginEvent(Object source, String managerId, String ip, String loginMethod) { - super(source); - this.managerId = managerId; - this.ip = ip; - this.method = loginMethod; - } - - public JSONObject toLogObject() { - JSONObject log = new JSONObject(); - log.put("manager_id", managerId); - log.put("ip", ip); - log.put("login_time", new Date(getTimestamp())); - log.put("method", method); - return log; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/package-info.java b/src/main/java/au/com/royalpay/payment/manage/signin/package-info.java deleted file mode 100644 index 2424019f1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * sign in - * Created by yixian on 2016-06-29. - */ -package au.com.royalpay.payment.manage.signin; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/web/ManagerAccountsController.java b/src/main/java/au/com/royalpay/payment/manage/signin/web/ManagerAccountsController.java deleted file mode 100644 index cdb8cd904..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/web/ManagerAccountsController.java +++ /dev/null @@ -1,101 +0,0 @@ -package au.com.royalpay.payment.manage.signin.web; - -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.signin.beans.ManagerInfo; -import au.com.royalpay.payment.manage.signin.beans.QueryManagerBean; -import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -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 java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Created by yixian on 2016-07-05. - */ -@RestController -@RequestMapping(value = "/sys/manager_accounts") -public class ManagerAccountsController { - @Resource - private ManagerAccountsService managerAccountsService; - @Resource - private OrgManager orgManager; - -// @RequestMapping(method = RequestMethod.GET) -// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.ACCOUNT_MANAGER}) -// public List listManagers(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { -// return managerAccountsService.listManagers(loginManager); -// } - - @RequestMapping(method = RequestMethod.GET) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.ACCOUNT_MANAGER}) - public JSONObject listManagerss(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager, QueryManagerBean queryManagerBean) { - - return PageListUtils.buildPageListResult(managerAccountsService.listManagers(loginManager,queryManagerBean.toJson())); - } - - @RequestMapping(method = RequestMethod.POST) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.ACCOUNT_MANAGER}) - public void saveManager(@RequestBody @Valid ManagerInfo manager, Errors errors, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - HttpUtils.handleValidErrors(errors); - managerAccountsService.saveManager(manager, loginManager); - } - - @ManagerMapping(value = "/roles/bd_user", method = RequestMethod.GET) - public List listBDUsers(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - JSONObject params = new JSONObject(); - orgManager.checkOrg(loginManager,params); - return managerAccountsService.listBDUsers(params); - } - @ManagerMapping(value = "/roles/org_bd_user", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.ACCOUNT_MANAGER}) - public List listOrgBDUsers(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager,@RequestParam Map map) { - JSONObject params = (JSONObject) JSON.toJSON(map); - return managerAccountsService.listBDUsers(params); - } - - @ManagerMapping(value = "/{userId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.ACCOUNT_MANAGER}) - public void modify(@PathVariable String userId, @RequestBody ManagerInfo manager, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - managerAccountsService.modify(userId, manager, loginManager); - } - - @ManagerMapping(value = "/{userId}", method = RequestMethod.DELETE, role = {ManagerRole.ADMIN, ManagerRole.ACCOUNT_MANAGER}) - public void disableUser(@PathVariable String userId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - managerAccountsService.disable(userId, loginManager); - } - - @ManagerMapping(value = "/roles/bd_leader", method = RequestMethod.GET) - public List listBDLeaders(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - return managerAccountsService.listBDLeaders(loginManager); - } - - @ManagerMapping(value = "/group/group_bds", method = RequestMethod.GET) - public List listGroupBds(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - return managerAccountsService.listGroupBds(loginManager); - } - - @ManagerMapping(value = "/roles/servant", method = RequestMethod.GET,role = {ManagerRole.ADMIN}) - public List listServants(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager) { - return managerAccountsService.listServants(loginManager); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/web/ManagerWechatBindController.java b/src/main/java/au/com/royalpay/payment/manage/signin/web/ManagerWechatBindController.java deleted file mode 100644 index 515d413a8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/web/ManagerWechatBindController.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.signin.web; - -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.signin.beans.ManagerInfo; -import au.com.royalpay.payment.manage.signin.core.ManagerWechatBindService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-11-03. - */ -@Controller -@RequestMapping("/system/manager_wechat_binds") -public class ManagerWechatBindController { - @Resource - private ManagerWechatBindService managerWechatBindService; - - @WechatMapping(value = "/{bindId}", method = RequestMethod.GET,oauthType = WxOauthType.USERINFO) - public String bindManagerWechat(@PathVariable String bindId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) { - managerWechatBindService.bindWechatUser(bindId,wechat.getString("openid")); - return "manager_bind_success"; - } - - @RequestMapping(method = RequestMethod.POST) - @RequireManager - @ResponseBody - public JSONObject newBindRequest(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return managerWechatBindService.newBindRequest(manager.getString("manager_id")); - } - - @PutMapping(value = "/remove/{manager_id}") - @ResponseBody - public JSONObject removeBind(@PathVariable("manager_id") String managerId) { - return managerWechatBindService.removeBindWechat(managerId); - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java b/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java deleted file mode 100644 index 732059794..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java +++ /dev/null @@ -1,420 +0,0 @@ -package au.com.royalpay.payment.manage.signin.web; - -import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; -import au.com.royalpay.payment.manage.signin.beans.FindPwdBean; -import au.com.royalpay.payment.manage.signin.beans.LoginInfo; -import au.com.royalpay.payment.manage.signin.beans.TodoNotice; -import au.com.royalpay.payment.manage.signin.core.*; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.http.HttpUtils; -import au.com.royalpay.payment.tools.permission.consumer.ConsumersAction; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import com.google.code.kaptcha.Producer; -import org.apache.commons.lang3.StringUtils; -import org.springframework.ui.Model; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by yixian on 2016-06-29. - */ -@RestController -@RequestMapping("/global/userstatus") -public class SignInController { - @Resource - private SignInStatusManager signInStatusManager; - @Resource - private SignInAccountService signInAccountService; - @Resource - private ManagerLoginLogRepository managerLoginLogRepository; - @Resource - private ClientLoginLogRepository clientLoginLogRepository; - @Resource - private Producer captchaProducer; - @Resource - private ManagerTodoNoticeProvider[] managerTodoNoticeProviders; - @Resource - private ClientManager clientManager; - @Resource - private ManagerAccountsService managerAccountsService; - - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private CustomerPaymentInfoService customerPaymentInfoService; - - - @PostMapping("/partner_signin") - public void partnerSignIn(@CookieValue(CommonConsts.CODE_KEY) String codeKey, @RequestBody @Valid LoginInfo loginInfo, Errors errors, HttpServletResponse response) throws Exception { - HttpUtils.handleValidErrors(errors); - String codeValue = signInStatusManager.getVerifyCode(codeKey); - if (codeValue == null) { - throw new Exception("Verification code has expired"); - } - if (!codeValue.equals(loginInfo.getVerifyCode())) { - throw new Exception("Verification code is not correct"); - } else { - signInStatusManager.deleteVerifyCodeKey(codeKey); - HttpUtils.dropCookie(response, CommonConsts.CODE_KEY); - } - String statusKey = signInStatusManager.partnerSignIn(loginInfo); - HttpUtils.setCookie(response, CommonConsts.PARTNER_STATUS, statusKey); - } - - @GetMapping("/partner_signin_wechat_qrcode") - public JSONObject newClientWechatSigninQRCode() { - return signInStatusManager.newClientWechatSignInQRCode(); - } - - @WechatMapping(value = "/partner_signin_wechat_qrcode/{codeId}", method = RequestMethod.GET) - public ModelAndView partnerSigninViaQRCode(@PathVariable String codeId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatUser) { - ModelAndView view = new ModelAndView("wechat_bind"); - signInStatusManager.clientQRCodeSignIn(codeId, wechatUser.getString("openid"), view); - return view; - } - - @GetMapping("/partner_signin_wechat_qrcode/{codeId}/check") - public void checkPartnerLoginStatus(@PathVariable String codeId, HttpServletResponse response) { - String statusKey = signInStatusManager.checkQRCodeClientLoginStatus(codeId); - HttpUtils.setCookie(response, CommonConsts.PARTNER_STATUS, statusKey); - } - - @WechatMapping(value = "/partner_signin_wechat", method = RequestMethod.GET) - public void partnerSignInViaWechat(@RequestParam(required = false) String target, - @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatUser, HttpServletResponse response) throws IOException { - String statusKey = signInStatusManager.clientWechatSignIn(wechatUser.getString("openid")); - HttpUtils.setCookie(response, CommonConsts.PARTNER_STATUS, statusKey); - response.sendRedirect(target == null ? "/index.html" : target); - } - - @PostMapping("/manager_signin") - public void managerSignIn(@CookieValue(CommonConsts.CODE_KEY) String codeKey, @RequestBody @Valid LoginInfo loginInfo, Errors errors, HttpServletResponse response) throws Exception { - String codeValue = signInStatusManager.getVerifyCode(codeKey); - if (codeValue == null) { - throw new Exception("Verification code has expired"); - } - if (!loginInfo.getVerifyCode().equals(codeValue)) { - throw new Exception("Verification code is not correct"); - } else { - signInStatusManager.deleteVerifyCodeKey(codeKey); - HttpUtils.dropCookie(response, CommonConsts.CODE_KEY); - } - HttpUtils.handleValidErrors(errors); - String statusKey = signInStatusManager.managerSignIn(loginInfo); - HttpUtils.setCookie(response, CommonConsts.MANAGER_STATUS, statusKey); - } - - @GetMapping("/manager_signin_wechat_qrcode") - public JSONObject newManagerWechatSigninQRCode() { - return signInStatusManager.newManagerWechatSignInQRCode(); - } - - @WechatMapping(value = "/manager_signin_wechat_qrcode/{codeId}", method = RequestMethod.GET) - public ModelAndView managerSigninViaQRCode(@PathVariable String codeId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatUser) { - signInStatusManager.managerQRCodeSignIn(codeId, wechatUser.getString("openid")); - return new ModelAndView("manager_bind_success"); - } - - @GetMapping("/manager_signin_wechat_qrcode/{codeId}/check") - public void checkQRCodeManagerLoginStatus(@PathVariable String codeId, HttpServletResponse response) { - String statusKey = signInStatusManager.managerQRCodeSignInStatus(codeId); - HttpUtils.setCookie(response, CommonConsts.MANAGER_STATUS, statusKey); - } - - @WechatMapping(value = "/manager_signin_wechat", method = RequestMethod.GET) - public void managerSignInViaWechat(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatUser, - @RequestParam(required = false) String target, HttpServletResponse response) throws IOException { - String statusKey = signInStatusManager.managerWechatSignIn(wechatUser.getString("openid")); - HttpUtils.setCookie(response, CommonConsts.MANAGER_STATUS, statusKey); - response.sendRedirect(target == null ? "/manage.html" : target); - } - - @ManagerMapping(value = "/current_manager", method = RequestMethod.GET) - public JSONObject managerLoginStatus(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return manager; - } - - @ManagerMapping(value = "/manager_todo_notices", method = RequestMethod.GET) - public List listTodoNotices(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - List notices = new ArrayList<>(); - if (managerTodoNoticeProviders != null) { - for (ManagerTodoNoticeProvider provider : managerTodoNoticeProviders) { - provider.checkTodo(manager, notices); - } - } - return notices; - } - - @ManagerMapping(value = "/current_manager/clients/{clientMoniker}/auth", method = RequestMethod.GET, role = ManagerRole.ADMIN) - public void authAdminToClient(@CookieValue(CommonConsts.MANAGER_STATUS) String managerStatusKey, @PathVariable String clientMoniker, HttpServletResponse response) throws IOException { - signInStatusManager.managerAuthToClient(managerStatusKey, clientMoniker); - response.sendRedirect("/index.html"); - } - - @ManagerMapping(value = "/current_manager/login_logs", method = RequestMethod.GET) - public JSONObject listCurrentManagerLoginLogs(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return managerLoginLogRepository.listLoginLogOfAccount(manager.getString("manager_id"), page, limit); - } - - @PartnerMapping(value = "/current_partner/login_logs", method = RequestMethod.GET) - public JSONObject listCurrentClientAccountLoginLogs(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientLoginLogRepository.listLoginLogOfAccount(account.getString("account_id"), page, limit); - } - - @PartnerMapping(value = "/current_partner", method = RequestMethod.GET) - public JSONObject partnerLoginStatus(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - partner.put("has_incremental_setvice",clientManager.partnerIncrementalService(partner.getString("client_moniker")).getJSONArray("all_service").size()>0); - partner = clientManager.isLessFiles(partner); - return partner; - } - - @ManagerMapping(value = "/manager_password", method = RequestMethod.PUT) - public void changeManagerPwd(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ChangePwdBean change, Errors errors) { - HttpUtils.handleValidErrors(errors); - signInAccountService.changeManagerPassword(manager, change); - } - - @PartnerMapping(value = "/partner_password", method = RequestMethod.PUT) - public void changePartnerPwd(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody @Valid ChangePwdBean change, Errors errors) { - HttpUtils.handleValidErrors(errors); - signInAccountService.changeAccountPassword(partner, change); - } - - @ManagerMapping(value = "/manager_signout", method = RequestMethod.PUT) - public void managerSignOut(@CookieValue(CommonConsts.MANAGER_STATUS) String statusKey, HttpServletResponse response) { - signInStatusManager.managerSignOut(statusKey); - HttpUtils.dropCookie(response, CommonConsts.MANAGER_STATUS); - } - - @PartnerMapping(value = "/partner_signout", method = RequestMethod.PUT) - public void partnerSignOut(@CookieValue(CommonConsts.PARTNER_STATUS) String statusKey, HttpServletResponse response) { - signInStatusManager.partnerSignOut(statusKey); - HttpUtils.dropCookie(response, CommonConsts.PARTNER_STATUS); - } - - @GetMapping("captcha-login") - public void getKaptchaImage(HttpServletResponse response) throws Exception { - // HttpSession session = request.getSession(); - response.setDateHeader("Expires", 0); - response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - response.addHeader("Cache-Control", "post-check=0, pre-check=0"); - response.setHeader("Pragma", "no-cache"); - response.setContentType("image/jpeg"); - - String capText = captchaProducer.createText(); - System.out.println("登陆验证码: " + capText); - // - // session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); - - String statusKey = signInStatusManager.addVerifyCode(capText); - HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); - HttpUtils.setCookie(response, "code_expire_time", (System.currentTimeMillis() + 150_000) + "", false); - - BufferedImage bi = captchaProducer.createImage(capText); - ServletOutputStream out = response.getOutputStream(); - ImageIO.write(bi, "jpg", out); - try { - out.flush(); - } finally { - out.close(); - } - } - - - @PostMapping("/partner_forgetpassword") - public String partnerForgetPassword(@CookieValue(CommonConsts.CODE_KEY) String codeKey, @RequestBody @Valid FindPwdBean findPwdBean, Errors errors, HttpServletResponse response) throws Exception { - HttpUtils.handleValidErrors(errors); - String codeValue = signInStatusManager.getVerifyCode(codeKey); - if (codeValue == null) { - throw new Exception("Verification code has expired"); - } - if (!codeValue.equals(findPwdBean.getVerifyCode())) { - throw new Exception("Verification code is not correct"); - } else { - signInStatusManager.deleteVerifyCodeKey(codeKey); - HttpUtils.dropCookie(response, CommonConsts.CODE_KEY); - String contact_email = signInAccountService.ForgetPassword(findPwdBean.getPartner_code()); - int index = contact_email.lastIndexOf("@"); - if (index > 4) { - return contact_email.replaceAll(contact_email.substring(index - 4, index), "*******"); - } else { - return contact_email.replaceAll(contact_email.substring(1, index), "*******"); - } - - } - - } - - @GetMapping("/partner_changepassword_page/{codeKey}") - public ModelAndView partnerChangePassword(@PathVariable String codeKey, Model model) throws Exception { - String codeValue = signInStatusManager.getChangePasswordVerifyCode(codeKey); - if (codeValue == null) { - throw new Exception("Verification code has expired or is not correct"); - } - ModelAndView view = new ModelAndView("change_password"); - view.addObject("verifyCode", codeKey); - return view; - } - - @PostMapping("/partner_changepassword") - public void partnerChangePassword(@RequestBody @Valid FindPwdBean findPwdBean, Errors errors) throws Exception { - HttpUtils.handleValidErrors(errors); - String codeValue = signInStatusManager.getChangePasswordVerifyCode(findPwdBean.getVerifyCode()); - if (codeValue == null) { - throw new Exception("Verification code has expired or is not correct"); - } - if (findPwdBean.getLogin_id() == null) { - throw new Exception("Login id can not be null"); - } - if (findPwdBean.getNewPassword() == null) { - throw new Exception("New Password can not be null"); - } - signInAccountService.changePasswordByEmail(codeValue, findPwdBean.getLogin_id(), findPwdBean.getNewPassword()); - signInStatusManager.deleteChangepasswordVerifyCodeKey(findPwdBean.getVerifyCode()); - - } - - - @PartnerMapping(value = "/wechat_user", method = RequestMethod.GET) - public JSONObject getWechatUser(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - MpWechatApi mpWechatApi = mpWechatApiProvider.getNewPaymentApi(); - if (account.getString("wechat_openid") == null) { - throw new BadRequestException("not bind Wechat Account"); - } - return mpWechatApi.userInfoFromWechat(account.getString("wechat_openid")); - - } - - //APP QRCODE - @GetMapping("/partner_signin_app_qrcode") - public JSONObject newClientAppSigninQRCode() { - return signInStatusManager.newClientAppSignInQRCode(); - } - - - @GetMapping("/partner_signin_app_qrcode/{codeId}/check") - public JSONObject checkQRCodeAppLoginStatus(@PathVariable String codeId, HttpServletResponse response) { - JSONObject statusInfo = signInStatusManager.appQRCodeSignInStatus(codeId); - HttpUtils.setCookie(response, CommonConsts.PARTNER_STATUS, statusInfo.getString("status_key")); - statusInfo.remove("status_key"); - return statusInfo; - } - - @WechatMapping(value = "/partner_signin_qrcode/{codeId}", method = RequestMethod.GET) - public ModelAndView partnerAppSigninViaQRCode(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, @PathVariable String codeId) { - signInStatusManager.clientQRCodeWechatSignIn(wxUser, codeId); - return new ModelAndView("manager_bind_success"); - } - - @GetMapping("/partner_signin_qrcode/verify/{codeId}") - public void verifyQRCode(@PathVariable String codeId, @RequestHeader("User-Agent") String ua, - HttpServletResponse response, @RequestParam(required = false) String source) throws IOException { - if (ua.toLowerCase().contains("micromessenger")) { - response.sendRedirect("/global/userstatus/partner_signin_qrcode/" + codeId); - return; - } - if (ua.toLowerCase().contains("royalpayclient")) { - if (StringUtils.isNotBlank(source)) { - response.sendRedirect("/api/v1.0/retail/app/partner_signin_app_qrcode/" + codeId + "?source=" + source); - }else { - response.sendRedirect("/api/v1.0/retail/app/partner_signin_app_qrcode/" + codeId); - } - return; - } - throw new ForbiddenException("error.not_support_browser"); - } - - @GetMapping("/customer_wechat_qrcode") - public JSONObject customerQRCode() { - return signInStatusManager.customerQRCode(); - } - - @ConsumersAction - @GetMapping("/customer_qrcode_scan/{codeId}") - public ModelAndView scanCustomerWechatQrcode(@PathVariable String codeId, @ModelAttribute(CommonConsts.CONSUMER_INFO) JSONObject customerInfo) { - signInStatusManager.scanCustomerQrcode(codeId, customerInfo.getString("customer_id")); - return new ModelAndView("manager_bind_success"); - } - - @GetMapping("/customer_wechat_qrcode/{codeId}/check") - public JSONObject getCustomerID(@PathVariable String codeId, HttpServletResponse response,@RequestParam(value = "pay_info",defaultValue = "false") boolean pay_info) { - JSONObject result = new JSONObject(); - String statusKey = signInStatusManager.getWechatCustomerId(codeId); -// if(pay_info){ -// result = customerPaymentInfoService.selectPaymentInfoByOpenId(statusKey); -// } - HttpUtils.setCookie(response, "CustomerID", statusKey,false); - return result; - } - - /** - * 商户重置密码,发送验证码 - * @param username 用户名 - * @param type email或者phone - */ - @PutMapping("/client/reset_pwd/{type}/{username}") - public void resetMerchantPwd(@PathVariable("username") String username,@PathVariable("type") String type) { - JSONObject account = signInAccountService.getClientByUsername(username); - signInAccountService.getClientResetPwdCode(account,type); - } - - - /** - * 商户重置密码 - * @param info - */ - @PutMapping("/client/reset_pwd") - public void resetClientPwd(@RequestBody LoginInfo info) { - JSONObject account = signInAccountService.getClientByUsername(info.getLoginId()); - signInAccountService.verifyClientCaptcha(account, info.getVerifyCode()); - clientManager.resetAccountPwd(null, null, account.getString("account_id"), info.getPassword()); - signInAccountService.deleteClientCodeKey(account.getString("account_id")); - } - - /** - * 运营重置密码,发送验证码 - * @param username 用户名 - * @param type email或者phone - */ - @PutMapping("/manager/reset_pwd/{type}/{username}") - public void resetManagerPwd(@PathVariable("username") String username,@PathVariable("type") String type) { - JSONObject account = signInAccountService.getManagerByUsername(username); - signInAccountService.getClientResetPwdCode(account,type); - } - - - /** - * 运营重置密码 - * @param info - */ - @PutMapping("/manager/reset_pwd") - public void resetManagerPwd(@RequestBody LoginInfo info) { - JSONObject account = signInAccountService.getManagerByUsername(info.getLoginId()); - signInAccountService.verifyManagerCaptcha(account, info.getVerifyCode()); - managerAccountsService.resetPwd(account, info.getPassword()); - signInAccountService.deleteManagerCodeKey(account.getString("manager_id")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAConfig.java b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAConfig.java deleted file mode 100644 index dd7f85f77..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAConfig.java +++ /dev/null @@ -1,138 +0,0 @@ -package au.com.royalpay.payment.manage.support.abafile; - -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; -import org.apache.commons.lang3.ArrayUtils; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * Create by yixian at 2018-06-25 17:39 - */ -@ConfigurationProperties("settle.abafile") -public class ABAConfig { - - private Map bank = new HashMap<>(); - - public ABAFile initFile(BalanceGroup group, String bank, Date settleDate) { - ABABase base = this.bank.get(bank); - if (base == null) { - throw new BadRequestException("Invalid bank:" + bank); - } - if (!base.acceptBalanceGroup(group)) { - throw new BadRequestException("Balance group not match:" + group + "," + bank); - } - return base.initFile(settleDate); - } - - public String getRemainsTo(BalanceGroup group) { - return bank.entrySet().stream() - .filter(entry -> entry.getValue().acceptBalanceGroup(group)) - .filter(entry -> !entry.getValue().isManualSending()) - .map(Map.Entry::getKey) - .findFirst().orElse(null); - } - - public Map getBank() { - return bank; - } - - public ABABase getBankBase(String bank) { - return this.bank.get(bank); - } - - public ABAConfig setBank(Map bank) { - this.bank = bank; - return this; - } - - public List availableBanks(BalanceGroup group) { - return bank.entrySet().stream() - .filter(entry -> entry.getValue().acceptBalanceGroup(group)) - .map(Map.Entry::getKey) - .collect(Collectors.toList()); - } - - public static class ABABase { - private boolean manualSending = false; - private String bank; - private String apca; - private String bsb; - private String accountNo; - private String accountName; - private BalanceGroup[] balanceGroup; - - public ABAFile initFile(Date settleDate) { - return new ABAFile(this, settleDate); - } - - public boolean isManualSending() { - return manualSending; - } - - public ABABase setManualSending(boolean manualSending) { - this.manualSending = manualSending; - return this; - } - - public String getBank() { - return bank; - } - - public ABABase setBank(String bank) { - this.bank = bank; - return this; - } - - public String getApca() { - return apca; - } - - public ABABase setApca(String apca) { - this.apca = apca; - return this; - } - - public String getBsb() { - return bsb; - } - - public ABABase setBsb(String bsb) { - this.bsb = bsb; - return this; - } - - public String getAccountNo() { - return accountNo; - } - - public ABABase setAccountNo(String accountNo) { - this.accountNo = accountNo; - return this; - } - - public String getAccountName() { - return accountName; - } - - public ABABase setAccountName(String accountName) { - this.accountName = accountName; - return this; - } - - public BalanceGroup[] getBalanceGroup() { - return balanceGroup; - } - - public ABABase setBalanceGroup(BalanceGroup[] balanceGroup) { - this.balanceGroup = balanceGroup; - return this; - } - - public boolean acceptBalanceGroup(BalanceGroup group) { - return ArrayUtils.contains(balanceGroup, group); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java deleted file mode 100644 index 8edcbd48a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java +++ /dev/null @@ -1,206 +0,0 @@ -package au.com.royalpay.payment.manage.support.abafile; - -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.util.Assert; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Optional; - -public class ABAFile { - private final String baseLine = StringUtils.repeat(" ", 120); - private final ABAConfig.ABABase base; - private final Date settleDate; - private List settlements; - private BigDecimal totalSettleAmount; - private Date operateTime; - private String filename; - private String remark; - - public ABAFile(ABAConfig.ABABase base, Date settleDate) { - this.base = base; - this.settleDate = settleDate; - settlements = new ArrayList<>(); - totalSettleAmount = BigDecimal.ZERO; - } - - public void addSettleMerchant(String bsbNo, String accountNo, String accountName, BigDecimal settleAmount, String remark) { - settlements.add(new SettleMerchantInfo(bsbNo, accountNo, accountName, settleAmount, remark)); - totalSettleAmount = totalSettleAmount.add(settleAmount); - } - - public String getRemark() { - return remark; - } - - public ABAFile setRemark(String remark) { - this.remark = remark; - return this; - } - - public boolean manualSending() { - return base.isManualSending(); - } - - public String bank() { - return base.getBank(); - } - - public byte[] output(int serializeNo) { - - StringWriter out = new StringWriter(); - PrintWriter writer = new PrintWriter(out); - writer.print(generateTopLine(serializeNo) + "\r\n"); - for (SettleMerchantInfo info : settlements) { - String line = info.settleLine(); - writer.print(line + "\r\n"); - } - writer.print(generateBalanceLine() + "\r\n"); - writer.print(generateFinalLine()); - writer.flush(); - return out.toString().getBytes(); - } - - public String getTotalSettleAmountStr() { - DecimalFormat format = new DecimalFormat("#,##0.00"); - return format.format(totalSettleAmount); - } - - public BigDecimal getTotalSettleAmount() { - return totalSettleAmount; - } - - private String generateFinalLine() { - StringBuilder lineBuilder = new StringBuilder(baseLine); - lineBuilder.replace(0, 1, "7"); - lineBuilder.replace(1, 8, "999-999"); - lineBuilder.replace(20, 30, StringUtils.leftPad("0", 10, "0")); - lineBuilder.replace(30, 40, amountString(totalSettleAmount, 10)); - lineBuilder.replace(40, 50, amountString(totalSettleAmount, 10)); - lineBuilder.replace(74, 80, StringUtils.leftPad("" + (settlements.size() + 1), 6, "0")); - return lineBuilder.toString(); - } - - private String generateBalanceLine() { - StringBuilder lineBuilder = new StringBuilder(baseLine); - lineBuilder.replace(0, 1, "1"); - lineBuilder.replace(1, 8, bsbNo(base.getBsb())); - lineBuilder.replace(8, 17, StringUtils.leftPad(base.getAccountNo(), 9)); - lineBuilder.replace(18, 20, "13"); - lineBuilder.replace(20, 30, amountString(totalSettleAmount, 10)); - lineBuilder.replace(30, 62, StringUtils.rightPad(StringUtils.substring(base.getAccountName(), 0, 32), 32)); - lineBuilder.replace(62, 80, StringUtils.rightPad(DateFormatUtils.format(settleDate, "yyyyMMdd"), 18)); - lineBuilder.replace(80, 87, bsbNo(base.getBsb())); - lineBuilder.replace(87, 96, StringUtils.leftPad(base.getAccountNo(), 9)); - lineBuilder.replace(96, 112, StringUtils.left(StringUtils.rightPad(base.getAccountName(), 16), 16)); - lineBuilder.replace(112, 120, StringUtils.leftPad("0", 8, "0")); - return lineBuilder.toString(); - } - - private String generateTopLine(int serializeNo) { - StringBuilder topLineBuilder = new StringBuilder(baseLine); - topLineBuilder.replace(0, 1, "0"); - topLineBuilder.replace(18, 20, StringUtils.leftPad("1", 2, "0")); - Assert.isTrue(base.getBank().length() == 3, "Invalid Bank Code:" + base.getBank()); - topLineBuilder.replace(20, 23, base.getBank()); - topLineBuilder.replace(30, 56, StringUtils.rightPad(base.getAccountName(), 26)); - topLineBuilder.replace(56, 62, StringUtils.leftPad(base.getApca(), 6, "0")); - topLineBuilder.replace(62, 74, StringUtils.rightPad(DateFormatUtils.format(settleDate, "yyyyMMdd"), 12)); - topLineBuilder.replace(74, 80, DateFormatUtils.format(settleDate, "ddMMyy")); - return topLineBuilder.toString(); - } - - private static String bsbNo(String bsbNo) { - Assert.isTrue(bsbNo != null && bsbNo.length() == 6, "Invalid BSB No:" + bsbNo); - return bsbNo.substring(0, 3) + "-" + bsbNo.substring(3); - } - - private static String amountString(BigDecimal amountDecimal, int size) { - int amount = CurrencyAmountUtils.toCent(amountDecimal, PlatformEnvironment.getEnv().getForeignCurrency()); - return StringUtils.leftPad("" + amount, size, "0"); - } - - public void setOperateTime(Date operateTime) { - this.operateTime = operateTime; - } - - public String getOperateTimeString() { - return operateTime == null ? "" : DateFormatUtils.format(operateTime, "yyyyMMddHHmmss"); - } - - public Date getOperateTime() { - return operateTime; - } - - public ABAFile setFilename(String filename) { - this.filename = filename; - return this; - } - - public String filename() { - return Optional.ofNullable(filename).orElse("Merchant_Settlement_Info_" + bank() + "_" + getOperateTimeString() + ".aba"); - } - - private class SettleMerchantInfo { - private final String bsbNo; - private final String accountNo; - private final String accountName; - private final BigDecimal settleAmount; - private final String remark; - - public SettleMerchantInfo(String bsbNo, String accountNo, String accountName, BigDecimal settleAmount, String remark) { - this.bsbNo = bsbNo; - this.accountNo = accountNo.replaceAll("\\D", ""); - this.accountName = accountName; - this.settleAmount = settleAmount; - this.remark = remark; - } - - public String settleLine() { - StringBuilder lineBuilder = new StringBuilder(baseLine); - lineBuilder.replace(0, 1, "1"); - lineBuilder.replace(1, 8, getBsbNo()); - lineBuilder.replace(8, 17, getAccountNo()); - lineBuilder.replace(18, 20, "50"); - lineBuilder.replace(20, 30, getSettleAmount()); - lineBuilder.replace(30, 62, getAccountName()); - lineBuilder.replace(62, 80, StringUtils.rightPad(getRemark(), 18)); - lineBuilder.replace(80, 87, bsbNo(base.getBsb())); - lineBuilder.replace(87, 96, StringUtils.leftPad(base.getAccountNo(), 9)); - lineBuilder.replace(96, 112, StringUtils.left(StringUtils.rightPad(base.getAccountName(), 16), 16)); - lineBuilder.replace(112, 120, StringUtils.leftPad("0", 8, "0")); - return lineBuilder.toString(); - } - - protected String getRemark() { - return remark; - } - - protected String getBsbNo() { - return bsbNo(bsbNo); - } - - protected String getAccountNo() { - return StringUtils.leftPad(StringUtils.right(accountNo, 9), 9); - } - - protected String getAccountName() { - return StringUtils.rightPad(StringUtils.substring(accountName, 0, 32), 32); - } - - protected String getSettleAmount() { - Assert.isTrue(settleAmount.compareTo(BigDecimal.ZERO) > 0, "Invalid Settle Amount:" + settleAmount.toPlainString()); - return amountString(settleAmount, 10); - } - - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABATemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABATemplate.java deleted file mode 100644 index 9f9d9a41e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABATemplate.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.support.abafile; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; - -/** - * Create by yixian at 2018-06-25 17:16 - */ -@Component -@EnableConfigurationProperties(ABAConfig.class) -public class ABATemplate { - private static ABATemplate tpl; - private ABAConfig config; - - @PostConstruct - public void init() { - tpl = this; - } - - public static ABAConfig getConfig() { - return tpl.config; - } - - @Autowired - public ABATemplate setConfig(ABAConfig config) { - this.config = config; - return this; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriber.java b/src/main/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriber.java deleted file mode 100644 index 79716a18e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriber.java +++ /dev/null @@ -1,113 +0,0 @@ -package au.com.royalpay.payment.manage.support.abafile; - -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Create by davep at 2019-07-18 15:20 - */ -public class SettleRemarkTemplateDescriber { - private Logger logger = LoggerFactory.getLogger(getClass()); - private final Pattern pattern = Pattern.compile("\\{[^\\{\\}]+\\}"); - private final JSONObject settle; - private final Date settleDate; - private String template; - private List replacers; - - public SettleRemarkTemplateDescriber(String template, JSONObject settle, Date settleDate) { - this.template = template; - this.settle = settle; - this.settleDate = settleDate; - replacers = new ArrayList<>(); - replacers.add(new ClientMonikerReplacer()); - replacers.add(new SettleDateReplacer()); - replacers.add(new SettleAmountReplacer()); - } - - public String compile() { - Matcher matcher = pattern.matcher(template); - StringBuilder target = new StringBuilder(); - int startPos = 0; - while (matcher.find()) { - int start = matcher.start(); - int end = matcher.end(); - target.append(template, startPos, start); - String group = StringUtils.substring(matcher.group(), 1, -1); - String replacement = replacers.stream().filter(replacer -> replacer.match(group)) - .limit(1) - .map(replacer -> replacer.replacement(group, SettleRemarkTemplateDescriber.this)) - .findFirst().orElse(""); - target.append(replacement); - startPos = end; - } - target.append(template.substring(startPos)); - return target.toString(); - } - - interface Replacer { - boolean match(String group); - - String replacement(String group, SettleRemarkTemplateDescriber describer); - } - - class ClientMonikerReplacer implements Replacer { - - @Override - public boolean match(String group) { - return "moniker".equals(group); - } - - @Override - public String replacement(String group, SettleRemarkTemplateDescriber describer) { - return describer.settle.getString("client_moniker"); - } - } - - class SettleDateReplacer implements Replacer { - private final String regex = "^date\\((\\w+)\\)$"; - - @Override - public boolean match(String group) { - return group.matches(regex); - } - - @Override - public String replacement(String group, SettleRemarkTemplateDescriber describer) { - Pattern dtPattern = Pattern.compile(regex); - Matcher matcher = dtPattern.matcher(group); - if (matcher.find()) { - String datePattern = matcher.group(1); - return DateFormatUtils.format(describer.settleDate, datePattern); - } - return ""; - } - } - - class SettleAmountReplacer implements Replacer { - - @Override - public boolean match(String group) { - return "settle_cent".equals(group) || "settle_amount".equals(group); - } - - @Override - public String replacement(String group, SettleRemarkTemplateDescriber describer) { - if ("settle_cent".equals(group)) { - return CurrencyAmountUtils.toCent(describer.settle.getBigDecimal("clearing_amount"), PlatformEnvironment.getEnv().getForeignCurrency()) + ""; - } else { - return CurrencyAmountUtils.scalePlatformCurrency(describer.settle.getBigDecimal("clearing_amount")).toPlainString(); - } - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/alipayclients/MpAlipayAuthApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/alipayclients/MpAlipayAuthApiImpl.java deleted file mode 100644 index f87bc4cbe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/alipayclients/MpAlipayAuthApiImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.support.alipayclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpAlipayAuthApi; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpAlipayClientApi; -import org.springframework.stereotype.Service; - -/** - * Create by yixian at 2017-12-12 16:02 - */ -@Service -public class MpAlipayAuthApiImpl extends AbstractMpAlipayClientApi implements MpAlipayAuthApi { - @Override - public String targetMpAccount() { - return "alipayauth"; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/alipayclients/MpAlipayRedpackApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/alipayclients/MpAlipayRedpackApiImpl.java deleted file mode 100644 index e210abd3f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/alipayclients/MpAlipayRedpackApiImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.com.royalpay.payment.manage.support.alipayclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpAlipayRedpackApi; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpAlipayClientApi; -import org.springframework.stereotype.Service; - -/** - * Create by yixian at 2017-12-12 16:03 - */ -@Service -public class MpAlipayRedpackApiImpl extends AbstractMpAlipayClientApi implements MpAlipayRedpackApi { - @Override - public String targetMpAccount() { - return "alitrans"; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/attachment/package-info.java b/src/main/java/au/com/royalpay/payment/manage/support/attachment/package-info.java deleted file mode 100644 index 24c399a24..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/attachment/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * file upload - * Created by yixian on 2016-07-04. - */ -package au.com.royalpay.payment.manage.support.attachment; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/support/attachment/web/AttachmentController.java b/src/main/java/au/com/royalpay/payment/manage/support/attachment/web/AttachmentController.java deleted file mode 100644 index cf6447bbe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/attachment/web/AttachmentController.java +++ /dev/null @@ -1,54 +0,0 @@ -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; - - @PostMapping("/files") - @RequirePartner - @RequireManager - public JSONObject uploadImage(@RequestParam MultipartFile file) throws IOException { - return attachmentClient.uploadFile(file,false); - } - - @PostMapping("/riskFiles") - public JSONObject uploadRiskImage(@RequestParam MultipartFile file) throws IOException { - return attachmentClient.uploadFile(file,false); - } - - @PostMapping("/secret_files") - @RequirePartner - @RequireManager - public JSONObject uploadFile(@RequestParam MultipartFile file) throws IOException { - return attachmentClient.uploadFile(file,true); - } - - @GetMapping("/files/{fileId}") - 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")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/cms/core/AppStyleService.java b/src/main/java/au/com/royalpay/payment/manage/support/cms/core/AppStyleService.java deleted file mode 100644 index c42dab906..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/cms/core/AppStyleService.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.support.cms.core; - -import com.alibaba.fastjson.JSONObject; - -public interface AppStyleService { - JSONObject listAppStyleGroup(int page, int limit); - - JSONObject getAppStyleByStyleId(String style_id); - - void switchGroupByStyleId(String style_id); - - void addAppStyle(String style_id, JSONObject appStyleGroup); - - void updateAppStyleByStyleId(String style_id, String originStyleId, JSONObject appStyleGroup); - - void updateAppStyleStatus(String style_id, boolean is_valid); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/cms/core/Impl/AppStyleServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/cms/core/Impl/AppStyleServiceImpl.java deleted file mode 100644 index 9434262eb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/cms/core/Impl/AppStyleServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.support.cms.core.Impl; - -import au.com.royalpay.payment.manage.support.cms.core.AppStyleService; -import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport; - -import com.alibaba.fastjson.JSONObject; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -@Service -public class AppStyleServiceImpl implements AppStyleService { - - @Value("${app.cms.host}") - private String cmsHost; - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private RoyalPayCMSSupport royalPayCMSSupport; - @Override - public JSONObject listAppStyleGroup(int page, int limit) { - return royalPayCMSSupport.listAppStyleGroup(page,limit); - } - - @Override - public JSONObject getAppStyleByStyleId(String style_id) { - return royalPayCMSSupport.getAppStyleByStyleId(style_id); - } - - @Override - public void switchGroupByStyleId(String style_id) { - royalPayCMSSupport.switchGroupByStyleId(style_id); - } - - @Override - public void addAppStyle(String style_id, JSONObject appStyleGroup) { - royalPayCMSSupport.addAppStyle(style_id,appStyleGroup); - } - - @Override - public void updateAppStyleByStyleId(String style_id, String originStyleId, JSONObject appStyleGroup) { - royalPayCMSSupport.updateAppStyleByStyleId(style_id,originStyleId,appStyleGroup); - } - - @Override - public void updateAppStyleStatus(String style_id, boolean is_valid) { -// royalPayCMSSupport.updateAppStyleStatus(style_id, is_valid); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/cms/web/AppStyleController.java b/src/main/java/au/com/royalpay/payment/manage/support/cms/web/AppStyleController.java deleted file mode 100644 index e604ca84d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/cms/web/AppStyleController.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.support.cms.web; - - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.support.cms.core.AppStyleService; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -@RestController -@ManagerMapping(value = "/app/cms/app_style", role = {ManagerRole.SITE_MANAGER}) -public class AppStyleController { - @Resource - private AppStyleService appStyleService; - - @GetMapping("/style_group") - public JSONObject listAppStyleGroup(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) { - return appStyleService.listAppStyleGroup(page, limit); - } - - @GetMapping("/style_group/{style_id}") - public JSONObject getAppStyleByStyleId(@PathVariable String style_id) { - return appStyleService.getAppStyleByStyleId(style_id); - } - - @PutMapping("/style_group/{style_id}") - public void switchGroupByStyleId(@PathVariable String style_id) { - appStyleService.switchGroupByStyleId(style_id); - } - - @PostMapping("/style_group") - public void addOneGroupAppStyle(@RequestParam String style_id, @RequestBody JSONObject appStyleGroup) { - appStyleService.addAppStyle(style_id, appStyleGroup); - } - - @PutMapping("/style_group/{style_id}/style") - public void updateAppStyleByStyleId(@PathVariable String style_id,@RequestParam String originStyleId, @RequestBody JSONObject appStyleGroup) { - appStyleService.updateAppStyleByStyleId(style_id, originStyleId, appStyleGroup); - } - - @PutMapping("/style_group/{style_id}/{is_valid}") - public void updateAppStyleStatus(@PathVariable String style_id,@PathVariable Boolean is_valid) { - appStyleService.updateAppStyleStatus(style_id, is_valid); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/cms/web/CMSController.java b/src/main/java/au/com/royalpay/payment/manage/support/cms/web/CMSController.java deleted file mode 100644 index c24041537..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/cms/web/CMSController.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.support.cms.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.cms.ArticleBean; -import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * Created by yixian on 2016-12-05. - */ -@RestController -@ManagerMapping(value = "/app/cms/categories/{catId}/articles", role = {ManagerRole.SITE_MANAGER}) -public class CMSController { - @Resource - private RoyalPayCMSSupport royalPayCMSSupport; - - @RequestMapping(method = RequestMethod.GET) - public JSONObject listArticles(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, @PathVariable String catId, - @RequestParam(defaultValue = "false") boolean recommended, - @RequestParam(defaultValue = "false") boolean published) { - return royalPayCMSSupport.listArticles(catId, recommended, published, page, limit); - } - - @RequestMapping(method = RequestMethod.POST) - public JSONObject newArticle(@RequestBody @Valid ArticleBean article, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @PathVariable String catId) { - return royalPayCMSSupport.saveArticle(catId, article, manager); - } - - @PutMapping("/{articleId}") - public void editArticle(@RequestBody @Valid ArticleBean article, @PathVariable String catId, @PathVariable String articleId) { - royalPayCMSSupport.updateArticle(catId, articleId, article); - } - - @GetMapping("/{articleId}") - public JSONObject getArticleDetail(@PathVariable String catId, @PathVariable String articleId) { - return royalPayCMSSupport.getArticle(catId, articleId); - } - - @PutMapping("/{articleId}/publish_status") - public void setArticlePublishStatus(@PathVariable String catId, @PathVariable String articleId, @RequestBody JSONObject status) { - royalPayCMSSupport.publishArticle(catId, articleId, status.getBooleanValue("published")); - } - - @PutMapping("/{articleId}/recommended") - public void setArticleRecommended(@PathVariable String catId, @PathVariable String articleId, @RequestBody JSONObject status) { - royalPayCMSSupport.recommendArticle(catId, articleId, status.getBooleanValue("recommended")); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/email/MailSendingEvent.java b/src/main/java/au/com/royalpay/payment/manage/support/email/MailSendingEvent.java deleted file mode 100644 index 584de609f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/email/MailSendingEvent.java +++ /dev/null @@ -1,111 +0,0 @@ -package au.com.royalpay.payment.manage.support.email; - -import org.springframework.context.ApplicationEvent; - -import javax.activation.DataHandler; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Session; -import javax.mail.internet.*; -import javax.mail.util.ByteArrayDataSource; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * Created by davep on 2016-09-05. - */ -public class MailSendingEvent extends ApplicationEvent { - private final String title; - private List mailTo = new ArrayList<>(); - private List mailCC = new ArrayList<>(); - private List attachments = new ArrayList<>(); - private String senderAddress; - private String password; - private String content = "Auto sended by system, do not reply"; - - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - * @param title - */ - public MailSendingEvent(Object source, String title) { - super(source); - this.title = title; - } - - public MailSendingEvent username(String emailAddress) { - this.senderAddress = emailAddress; - return this; - } - - public String username() { - return senderAddress; - } - - public MailSendingEvent password(String password) { - this.password = password; - return this; - } - - public String password() { - return password; - } - - public MailSendingEvent content(String content) { - this.content = content; - return this; - } - - public MailSendingEvent addMailTo(String... targets) { - mailTo.addAll(Arrays.asList(targets)); - return this; - } - - public MailSendingEvent addMailCC(String... targets) { - mailCC.addAll(Arrays.asList(targets)); - return this; - } - - public MailSendingEvent attach(byte[] bytes, String mimeType, String id, String fileName) throws MessagingException { - DataHandler handler = new DataHandler(new ByteArrayDataSource(bytes, mimeType)); - MimeBodyPart attach = new MimeBodyPart(); - attach.setDataHandler(handler); - attach.setContentID(id); - try { - attach.setFileName(MimeUtility.encodeText(fileName)); - } catch (UnsupportedEncodingException ignored) { - } - attachments.add(attach); - return this; - } - - public MimeMessage getEmailMessage(Session session) throws MessagingException { - MimeMessage msg = new MimeMessage(session); - buildMimeMessage(msg); - return msg; - } - - public void buildMimeMessage(MimeMessage msg) throws MessagingException { - for (String to : mailTo) { - msg.addRecipients(Message.RecipientType.TO, to); - } - for (String cc : mailCC) { - msg.addRecipients(Message.RecipientType.CC, cc); - } - msg.setFrom(new InternetAddress(senderAddress)); - msg.setSubject(title, "utf-8"); - MimeBodyPart text = new MimeBodyPart(); - text.setContent(content, "text/html;charset=utf-8"); - MimeMultipart multipart = new MimeMultipart(); - multipart.setSubType("related"); - multipart.addBodyPart(text); - for (MimeBodyPart part : attachments) { - multipart.addBodyPart(part); - } - msg.setContent(multipart); - msg.saveChanges(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/email/SendEmailListener.java b/src/main/java/au/com/royalpay/payment/manage/support/email/SendEmailListener.java deleted file mode 100644 index c56141e61..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/email/SendEmailListener.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.support.email; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.mail.*; -import javax.mail.internet.MimeMessage; -import java.util.Properties; - -/** - * send mail after finished settlement - * Created by davep on 2016-09-05. - */ -@Service -public class SendEmailListener implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Value("${spring.mail.host}") - private String host; - @Value("${spring.mail.port}") - private int port; - - @Override - public void onApplicationEvent(final MailSendingEvent event) { - Properties prop = new Properties(); - prop.put("mail.smtp.host", host); - prop.put("mail.smtp.port", port); - prop.put("mail.smtp.starttls.enable", "true"); - prop.put("mail.smtp.auth", "true"); - Session session = Session.getInstance(prop, new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(event.username(), event.password()); - } - }); - session.setDebug(true); - try { - MimeMessage msg = event.getEmailMessage(session); - Transport.send(msg); - } catch (MessagingException e) { - logger.error("sending email failed:", e.getMessage(), e); - throw new RuntimeException("sending email failed", e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/poi/CellStyleFactory.java b/src/main/java/au/com/royalpay/payment/manage/support/poi/CellStyleFactory.java deleted file mode 100644 index fc50524ea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/poi/CellStyleFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -package au.com.royalpay.payment.manage.support.poi; - -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.ss.usermodel.Workbook; - -/** - * Create by davep at 2020-03-12 13:27 - */ -public class CellStyleFactory { - private final short borderTop; - private final short borderBottom; - private final short borderLeft; - private final short borderRight; - private final short align; - private final short valign; - - public CellStyleFactory(short borderTop, short borderBottom, short borderLeft, short borderRight, short align, short valign) { - this.borderTop = borderTop; - this.borderBottom = borderBottom; - this.borderLeft = borderLeft; - this.borderRight = borderRight; - this.align = align; - this.valign = valign; - } - - public CellStyleFactory(short borderTopBottom, short borderLeftRight, short align, short valign) { - this(borderTopBottom, borderTopBottom, borderLeftRight, borderLeftRight, align, valign); - } - - public CellStyleFactory(short border, short align, short valign) { - this(border, border, align, valign); - } - - public CellStyleFactory(short border, short align) { - this(border, border, align, CellStyle.VERTICAL_CENTER); - } - - public CellStyle buildCellStyle(Workbook workbook, Font font) { - CellStyle style = workbook.createCellStyle(); - style.setBorderBottom(borderBottom); - style.setBorderRight(borderRight); - style.setBorderLeft(borderLeft); - style.setBorderTop(borderTop); - style.setAlignment(align); - style.setVerticalAlignment(valign); - if (font != null) { - style.setFont(font); - } - return style; - } - - public CellStyle buildCellStyle(Workbook workbook) { - return buildCellStyle(workbook, null); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelFileBuilder.java b/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelFileBuilder.java deleted file mode 100644 index b63e14efe..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelFileBuilder.java +++ /dev/null @@ -1,72 +0,0 @@ -package au.com.royalpay.payment.manage.support.poi; - - -import com.alibaba.fastjson.JSONObject; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Create by davep at 2020-03-12 11:59 - */ -public class ExcelFileBuilder { - private ExcelTemplate template; - private Map> sheetsData; - private boolean blocked = false; - - public ExcelFileBuilder(ExcelTemplate template) { - this.template = template; - this.sheetsData = new HashMap<>(); - } - - public ExcelFileBuilder bindData(String sheetName, List data) { - checkBlock(); - if (template.hasSheet(sheetName)) { - sheetsData.put(sheetName, data); - } else { - throw new IllegalArgumentException("Sheet name '" + sheetName + "' not exists"); - } - return this; - } - - public void checkBlock() { - if (blocked) { - throw new IllegalStateException("Builder blocked"); - } - } - - public ExcelFileBuilder bindSingleSheetData(List data) { - if (template.getSheets().size() == 1) { - String name = new ArrayList<>(template.getSheets().keySet()).get(0); - bindData(name, data); - } else { - throw new IllegalArgumentException("There are more than one sheet"); - } - return this; - } - - public void build(OutputStream out) { - blocked = true; - try (Workbook workbook = new XSSFWorkbook()) { - Map sheetTpls = template.getSheets(); - for (Map.Entry sheetTpl : sheetTpls.entrySet()) { - Sheet sheet = workbook.createSheet(sheetTpl.getKey()); - List data = sheetsData.get(sheetTpl.getKey()); - if (data == null) { - continue; - } - sheetTpl.getValue().buildSheet(sheet, data); - } - workbook.write(out); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java deleted file mode 100644 index d403ea76a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java +++ /dev/null @@ -1,182 +0,0 @@ -package au.com.royalpay.payment.manage.support.poi; - -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.poi.ss.usermodel.*; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * Create by davep at 2020-03-12 11:59 - */ -public class ExcelTemplate { - public static final CellStyleFactory STYLE_LEFT = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_LEFT); - public static final CellStyleFactory STYLE_RIGHT = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_RIGHT); - private Map sheets; - - public ExcelTemplate() { - this.sheets = new LinkedHashMap<>(); - } - - public SheetTemplate addSheet(String name) { - SheetTemplate sheetTpl = new SheetTemplate(this, name); - sheets.put(name, sheetTpl); - return sheetTpl; - } - - protected Map getSheets() { - return sheets; - } - - protected boolean hasSheet(String sheetName) { - return sheets.containsKey(sheetName); - } - - public static class SheetTemplate { - private ExcelTemplate parent; - private String name; - private List columns; - - private SheetTemplate(ExcelTemplate parent, String name) { - this.parent = parent; - this.name = name; - this.columns = new ArrayList<>(); - } - - public ExcelTemplate build() { - return parent; - } - - public SheetTemplate newSheet(String name) { - return parent.addSheet(name); - } - - public ColumnTemplate addColumn(int columnType, String name, ValueProvider provider) { - ColumnTemplate col = new ColumnTemplate(this, name, columnType, provider); - columns.add(col); - return col; - } - - public ColumnTemplate addDateColumn(String pattern, String name) { - return addDateColumn(pattern, name, name); - } - - public ColumnTemplate addDateColumn(String pattern, String name, String key) { - return this.addColumn(Cell.CELL_TYPE_STRING, name, json -> DateFormatUtils.format(json.getDate(key), pattern)); - } - - public ColumnTemplate addNumberColumn(String name) { - return this.addNumberColumn(name, name); - } - - public ColumnTemplate addNumberColumn(String name, String key) { - return this.addColumn(Cell.CELL_TYPE_NUMERIC, name, json -> json.getString(key)); - } - - public ColumnTemplate addStringColumn(String name) { - return this.addStringColumn(name, name); - } - - public ColumnTemplate addStringColumn(String name, String key) { - return this.addColumn(Cell.CELL_TYPE_STRING, name, json -> json.getString(key)); - } - - public ColumnTemplate addAutoTypeColumn(String name, ValueProvider provider) { - ColumnTemplate col = new ColumnTemplate(this, name, null, provider); - columns.add(col); - return col; - } - - protected String getName() { - return name; - } - - protected List getColumns() { - return columns; - } - - public void buildSheet(Sheet sheet, List data) { - int rowNum = 0; - Row titleRow = sheet.createRow(rowNum); - rowNum++; - Workbook workbook = sheet.getWorkbook(); - Font boldFont = PoiUtils.initBoldFont(workbook); - CellStyle titleStyle = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_CENTER).buildCellStyle(workbook, boldFont); - for (int i = 0, len = columns.size(); i < len; i++) { - ColumnTemplate col = columns.get(i); - Cell cell = titleRow.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(titleStyle); - cell.setCellValue(col.name); - } - for (JSONObject item : data) { - Row dataRow = sheet.createRow(rowNum); - rowNum++; - for (int i = 0, len = columns.size(); i < len; i++) { - ColumnTemplate col = columns.get(i); - col.buildCell(dataRow, i, item); - } - } - } - } - - public static class ColumnTemplate { - private SheetTemplate parent; - private String name; - private ValueProvider valueProvider; - private Integer columnType; - private CellStyleFactory cellStyle; - private FontFactory fontFactory; - - public ColumnTemplate(SheetTemplate parent, String name, Integer columnType, ValueProvider valueProvider) { - this.parent = parent; - this.name = name; - this.columnType = columnType; - this.valueProvider = valueProvider; - } - - public ColumnTemplate setCellStyle(CellStyleFactory cellStyle) { - this.cellStyle = cellStyle; - return this; - } - - public SheetTemplate ok() { - return parent; - } - - protected void buildCell(Row row, int columnNum, JSONObject data) { - Object value = valueProvider.getValue(data); - if (columnType == null) { - columnType = PoiUtils.convertCellType(value); - } - CellStyle style = initCellStyle(row.getSheet().getWorkbook(), columnType); - Cell cell = row.createCell(columnNum, columnType); - cell.setCellStyle(style); - PoiUtils.setCellValue(cell, value); - } - - private CellStyle initCellStyle(Workbook workbook, Integer columnType) { - Font font = fontFactory != null ? fontFactory.buildFont(workbook) : null; - if (cellStyle == null) { - if (columnType == Cell.CELL_TYPE_NUMERIC || this.columnType == Cell.CELL_TYPE_BOOLEAN) { - return STYLE_RIGHT.buildCellStyle(workbook, font); - } else { - return STYLE_LEFT.buildCellStyle(workbook, font); - } - } else { - return cellStyle.buildCellStyle(workbook, font); - } - } - - public ColumnTemplate setFontFactory(FontFactory fontFactory) { - this.fontFactory = fontFactory; - return this; - } - } - - public interface ValueProvider { - T getValue(JSONObject item); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/poi/FontFactory.java b/src/main/java/au/com/royalpay/payment/manage/support/poi/FontFactory.java deleted file mode 100644 index 676270686..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/poi/FontFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.support.poi; - -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.ss.usermodel.Workbook; - -/** - * Create by davep at 2020-03-12 13:27 - */ -public class FontFactory { - private boolean bold; - private short color; - private boolean italic; - - public FontFactory(boolean bold, short color, boolean italic) { - this.bold = bold; - this.color = color; - this.italic = italic; - } - - public FontFactory(boolean bold, boolean italic) { - this(bold, Font.COLOR_NORMAL, italic); - } - - public FontFactory(boolean bold) { - this(bold, false); - } - - public Font buildFont(Workbook workbook) { - Font font = workbook.createFont(); - font.setBold(bold); - font.setColor(color); - font.setItalic(italic); - return font; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/poi/PoiUtils.java b/src/main/java/au/com/royalpay/payment/manage/support/poi/PoiUtils.java deleted file mode 100644 index aab4d9cde..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/poi/PoiUtils.java +++ /dev/null @@ -1,83 +0,0 @@ -package au.com.royalpay.payment.manage.support.poi; - -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.ss.usermodel.Workbook; - -import java.math.BigDecimal; -import java.time.temporal.ChronoUnit; -import java.time.temporal.Temporal; -import java.time.temporal.TemporalField; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * Create by davep at 2020-03-12 12:43 - */ -public class PoiUtils { - private static final Map, Class> PRIMITIVE_CLASSES = new HashMap<>(); - - static { - PRIMITIVE_CLASSES.put(boolean.class, Boolean.class); - PRIMITIVE_CLASSES.put(byte.class, Byte.class); - PRIMITIVE_CLASSES.put(short.class, Short.class); - PRIMITIVE_CLASSES.put(char.class, Character.class); - PRIMITIVE_CLASSES.put(int.class, Integer.class); - PRIMITIVE_CLASSES.put(long.class, Long.class); - PRIMITIVE_CLASSES.put(float.class, Float.class); - PRIMITIVE_CLASSES.put(double.class, Double.class); - PRIMITIVE_CLASSES.put(void.class, Void.class); - } - - public static Font initBoldFont(Workbook workbook) { - Font font = workbook.createFont(); - font.setBold(true); - return font; - } - - - public static int convertCellType(Object value) { - if (value == null) { - return Cell.CELL_TYPE_BLANK; - } - Class valueClass = value.getClass(); - if (valueClass.isPrimitive()) { - valueClass = PRIMITIVE_CLASSES.get(valueClass); - } - if (Number.class.isAssignableFrom(valueClass)) { - return Cell.CELL_TYPE_NUMERIC; - } - if (Date.class.isAssignableFrom(valueClass) || Temporal.class.isAssignableFrom(valueClass)) { - return Cell.CELL_TYPE_NUMERIC; - } - if (Boolean.class.isAssignableFrom(valueClass)) { - return Cell.CELL_TYPE_BOOLEAN; - } - return Cell.CELL_TYPE_STRING; - } - - public static void setCellValue(Cell cell, Object value) { - if (value == null) { - return; - } - Class valueClass = value.getClass(); - if (valueClass.isPrimitive()) { - valueClass = PRIMITIVE_CLASSES.get(valueClass); - } - if (Number.class.isAssignableFrom(valueClass)) { - cell.setCellValue(((Number)value).doubleValue()); - return; - } - if (Date.class.isAssignableFrom(valueClass)) { - cell.setCellValue(((Date) value).getTime() / 1000); - return; - } - if (Boolean.class.isAssignableFrom(valueClass)) { - cell.setCellValue((boolean) value); - return; - } - cell.setCellValue(value.toString()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/representation/PageListRepresentation.java b/src/main/java/au/com/royalpay/payment/manage/support/representation/PageListRepresentation.java deleted file mode 100644 index 910e10da0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/representation/PageListRepresentation.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.support.representation; - -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.github.miemiedev.mybatis.paginator.domain.Paginator; - -public class PageListRepresentation { - - private PageList data; - - private Paginator pagination; - - public PageListRepresentation(PageList pageList) { - this.data = pageList; - this.pagination = pageList.getPaginator(); - - } - - public PageList getData() { - return data; - } - - public void setData(PageList data) { - this.data = data; - } - - public Paginator getPagination() { - return pagination; - } - - public void setPagination(Paginator pagination) { - this.pagination = pagination; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/serverless/ServerlessFunctionTrigger.java b/src/main/java/au/com/royalpay/payment/manage/support/serverless/ServerlessFunctionTrigger.java deleted file mode 100644 index 8d5e9fdb4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/serverless/ServerlessFunctionTrigger.java +++ /dev/null @@ -1,11 +0,0 @@ -package au.com.royalpay.payment.manage.support.serverless; - -import com.alibaba.fastjson.JSONObject; - -/** - * Create by davep at 2019-08-08 15:56 - */ -public interface ServerlessFunctionTrigger { - - JSONObject triggerFunction(String function,JSONObject params); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java b/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java deleted file mode 100644 index 31150db85..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java +++ /dev/null @@ -1,74 +0,0 @@ -package au.com.royalpay.payment.manage.support.serverless.qcloud; - -import au.com.royalpay.payment.manage.support.serverless.ServerlessFunctionTrigger; -import au.com.royalpay.payment.manage.support.serverless.qcloud.support.ServerLessFunctionInvokeRequest; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.server.ResponseStatusException; - -import java.nio.charset.StandardCharsets; -import java.time.Duration; - -/** - * Create by davep at 2019-08-12 9:31 - */ -@Service -public class QCloudServerlessTrigger implements ServerlessFunctionTrigger { - private Logger logger = LoggerFactory.getLogger(getClass()); - private RestTemplate restTemplate; - private String secretId; - private String secretKey; - private String region; - - public QCloudServerlessTrigger(@Value("${qcloud.secret-id}") String secretId, - @Value("${qcloud.secret-key}") String secretKey, - @Value("${qcloud.scf.region}") String region) { - this.secretId = secretId; - this.secretKey = secretKey; - this.region = region; - this.restTemplate = new RestTemplateBuilder() - .setConnectTimeout(Duration.ofMinutes(5)) - .setReadTimeout(Duration.ofMinutes(5)) - .messageConverters(new StringHttpMessageConverter(StandardCharsets.UTF_8)) - .build(); - } - - - @Override - public JSONObject triggerFunction(String function, JSONObject params) { - ServerLessFunctionInvokeRequest request = new ServerLessFunctionInvokeRequest(secretId, secretKey, region, function, params); - ResponseEntity resp = restTemplate.exchange(request.request(), String.class); - if (resp.getStatusCode().is2xxSuccessful()) { - JSONObject data = JSON.parseObject(resp.getBody()); - if (data == null) { - throw new ServerErrorException("Invoke function " + function + " failed:[no response]"); - } - JSONObject response = data.getJSONObject("Response"); - String requestId = response.getString("RequestId"); - JSONObject result = response.getJSONObject("Result"); - int invokeResult = result.getIntValue("InvokeResult"); - if (invokeResult != 0) { - String errMsg = result.getString("ErrMsg"); - logger.error("Invoking function [{}] failed,request id={},invoke result={},errMsg={}", function, requestId, invokeResult, errMsg); - throw new ServerErrorException("Invoke function " + function + " failed:[" + errMsg + "]"); - } else { - String retMsg = result.getString("RetMsg"); - return StringUtils.isNotEmpty(retMsg) ? JSON.parseObject(retMsg) : null; - } - } else { - throw new ResponseStatusException(resp.getStatusCode(), "Invoke function " + function + " failed:[no response]"); - } - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/support/QCloudV3Request.java b/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/support/QCloudV3Request.java deleted file mode 100644 index 1adec2cd1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/support/QCloudV3Request.java +++ /dev/null @@ -1,135 +0,0 @@ -package au.com.royalpay.payment.manage.support.serverless.qcloud.support; - -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpMethod; -import org.springframework.http.RequestEntity; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Create by davep at 2019-08-12 15:06 - */ -public abstract class QCloudV3Request { - private static Logger logger = LoggerFactory.getLogger(QCloudV3Request.class); - private static final String ALGORITHM = "TC3-HMAC-SHA256"; - private String secretId; - private String secretKey; - private String region; - private MultiValueMap headers = new LinkedMultiValueMap<>(); - - - public QCloudV3Request(String secretId, String secretKey, String region) { - this.secretId = secretId; - this.secretKey = secretKey; - this.region = region; - headers.add("host", host()); - headers.add("content-type", contentType()); - } - - protected abstract String host(); - - protected abstract String uri(); - - protected abstract HttpMethod method(); - - protected abstract String action(); - - protected abstract String version(); - - protected abstract String contentType(); - - protected abstract String requestPayload(); - - protected abstract String queryStringParams(); - - protected String service() { - return StringUtils.substringBefore(host(), "."); - } - - public void setHeader(String name, String value) { - headers.add(name, value); - } - - public RequestEntity request() { - UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromHttpUrl("https://" + host() + uri()); - String queryStr = queryStringParams(); - if (StringUtils.isNotEmpty(queryStr)) { - uriBuilder = uriBuilder.query(queryStr); - } - URI url = uriBuilder.build(false).toUri(); - RequestEntity.BodyBuilder builder = RequestEntity.method(method(), url); - MultiValueMap signHeaders = buildSignature(); - for (Map.Entry> entry : signHeaders.entrySet()) { - builder = builder.header(entry.getKey(), entry.getValue().toArray(new String[0])); - } - return builder.body(requestPayload()); - } - - private MultiValueMap buildSignature() { - String timestamp = System.currentTimeMillis() / 1000 + ""; - String date = DateTime.now(DateTimeZone.UTC).toString("yyyy-MM-dd"); - // ************* 步骤 1:拼接规范请求串 ************* - String httpRequestMethod = method().name(); - String canonicalUri = uri(); - String canonicalQueryString = queryStringParams(); - String canonicalHeaders = headers.entrySet().stream() - .flatMap(nameEntry -> nameEntry.getValue().stream() - .map(v -> nameEntry.getKey().toLowerCase() + ":" + v + "\n")) - .sorted() - .collect(Collectors.joining()); - String signedHeaders = headers.keySet().stream().map(String::toLowerCase).sorted().collect(Collectors.joining(";")); - String hashedRequestPayload = DigestUtils.sha256Hex(requestPayload()); - String canonicalRequest = String.join("\n", httpRequestMethod, canonicalUri, canonicalQueryString, canonicalHeaders, signedHeaders, hashedRequestPayload); - logger.info("request:\n{}", canonicalRequest); - // ************* 步骤 2:拼接待签名字符串 ************* - String credentialScope = date + "/" + service() + "/tc3_request"; - String hashedCanonicalRequest = DigestUtils.sha256Hex(canonicalRequest.getBytes(StandardCharsets.UTF_8)); - String stringToSign = String.join("\n", ALGORITHM, timestamp, credentialScope, hashedCanonicalRequest); - logger.info("to sign:\n{}", stringToSign); - // ************* 步骤 3:计算签名 ************* - byte[] secretDate = sign256(("TC3" + secretKey).getBytes(StandardCharsets.UTF_8), date); - byte[] secretService = sign256(secretDate, service()); - byte[] secretSigning = sign256(secretService, "tc3_request"); - String signature = Hex.encodeHexString(sign256(secretSigning, stringToSign)).toLowerCase(); - String authorization = String.format("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", - ALGORITHM, secretId, credentialScope, signedHeaders, signature); - - MultiValueMap signHeaders = new LinkedMultiValueMap<>(headers); - signHeaders.set("Authorization", authorization); - signHeaders.set("X-TC-Action", action()); - signHeaders.set("X-TC-Timestamp", timestamp); - signHeaders.set("X-TC-Version", version()); - signHeaders.set("X-TC-Region", region); - return signHeaders; - } - - private static byte[] sign256(byte[] key, String msg) { - try { - Mac mac = Mac.getInstance("HmacSHA256"); - SecretKeySpec secretKeySpec = new SecretKeySpec(key, mac.getAlgorithm()); - mac.init(secretKeySpec); - return mac.doFinal(msg.getBytes(StandardCharsets.UTF_8)); - } catch (NoSuchAlgorithmException | InvalidKeyException e) { - logger.error(e.getMessage(), e); - throw new ServerErrorException(e); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/support/ServerLessFunctionInvokeRequest.java b/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/support/ServerLessFunctionInvokeRequest.java deleted file mode 100644 index c4302a0cc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/support/ServerLessFunctionInvokeRequest.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.support.serverless.qcloud.support; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.http.HttpMethod; -import org.springframework.util.MimeTypeUtils; - -/** - * Create by davep at 2019-08-12 17:13 - */ -public class ServerLessFunctionInvokeRequest extends QCloudV3Request { - private final String functionName; - private final JSONObject clientContext; - - public ServerLessFunctionInvokeRequest(String secretId, String secretKey, String region, String functionName, JSONObject clientContext) { - super(secretId, secretKey, region); - this.functionName = functionName; - this.clientContext = clientContext == null ? new JSONObject() : clientContext; - } - - @Override - protected String host() { - return "scf.tencentcloudapi.com"; - } - - @Override - protected String uri() { - return "/"; - } - - @Override - protected HttpMethod method() { - return HttpMethod.POST; - } - - @Override - protected String action() { - return "Invoke"; - } - - @Override - protected String version() { - return "2018-04-16"; - } - - @Override - protected String contentType() { - return MimeTypeUtils.APPLICATION_JSON_VALUE; - } - - @Override - protected String requestPayload() { - JSONObject data = new JSONObject(); - data.put("FunctionName", functionName); - data.put("ClientContext", clientContext.toJSONString()); - return data.toJSONString(); - } - - @Override - protected String queryStringParams() { - return ""; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSender.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSender.java deleted file mode 100644 index 5e8538c2d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSender.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms; - -import au.com.royalpay.payment.manage.support.sms.msg.OpenMessage; -import au.com.royalpay.payment.manage.support.sms.msg.RefuseMessage; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; - -import java.util.Locale; - -public interface SmsSender { - - - void sendOpenMessage(String nationCode, String mobile, Locale locale, OpenMessage msg); - - void sendAuthCodeMessage(String nationCode, String mobile, Locale locale, AuthCodeMessage register); - - void sendRefuseMessage(String nationCode, String mobile, Locale locale, RefuseMessage refuse); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderChannel.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderChannel.java deleted file mode 100644 index 083f55780..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderChannel.java +++ /dev/null @@ -1,7 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms; - -import org.springframework.core.Ordered; - -public interface SmsSenderChannel extends SmsSender, Ordered { - boolean supportNationCode(String nationCode); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderDaasImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderDaasImpl.java deleted file mode 100644 index d2ccf279c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderDaasImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms; - -import au.com.royalpay.payment.manage.support.sms.daas.DaasMessageTemplate; -import au.com.royalpay.payment.manage.support.sms.daas.OpenMessageTemplate; -import au.com.royalpay.payment.manage.support.sms.daas.RefuseMessageTemplate; -import au.com.royalpay.payment.manage.support.sms.daas.AuthCodeMessageTemplate; -import au.com.royalpay.payment.manage.support.sms.msg.OpenMessage; -import au.com.royalpay.payment.manage.support.sms.msg.RefuseMessage; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; -import org.apache.commons.codec.binary.Base64; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.RequestEntity; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.FormHttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.stereotype.Service; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestClientResponseException; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.server.ServerErrorException; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.security.InvalidKeyException; -import java.security.Key; -import java.security.NoSuchAlgorithmException; -import java.util.Locale; -import java.util.Optional; - -@Service -@ConditionalOnProperty(value = "royalpay.sms.daas.enable", havingValue = "true") -public class SmsSenderDaasImpl implements SmsSenderChannel { - private final Logger logger = LoggerFactory.getLogger(getClass()); - private final String secretId; - private final String secretKey; - private final RestTemplate restTemplate; - private static final String URL = "https://service-rzq04n9p-1255701024.sh.apigw.tencentcs.com/release/superapi/super/sms/internation/single"; - - public SmsSenderDaasImpl(@Value("${royalpay.sms.daas.secret-id}") String secretId, @Value("${royalpay.sms.daas.secret-key}") String secretKey) { - this.secretId = secretId; - this.secretKey = secretKey; - this.restTemplate = new RestTemplateBuilder().messageConverters(new FormHttpMessageConverter(), - new StringHttpMessageConverter(StandardCharsets.UTF_8), - new FastJsonHttpMessageConverter()) - .build(); - } - - @Override - public void sendOpenMessage(String nationCode, String mobile, Locale locale, OpenMessage msg) { - sendSms(nationCode, mobile, new OpenMessageTemplate(msg)); - } - - @Override - public void sendAuthCodeMessage(String nationCode, String mobile, Locale locale, AuthCodeMessage register) { - sendSms(nationCode, mobile, new AuthCodeMessageTemplate(locale, register)); - } - - @Override - public void sendRefuseMessage(String nationCode, String mobile, Locale locale, RefuseMessage refuse) { - sendSms(nationCode, mobile, new RefuseMessageTemplate(refuse)); - } - - private void sendSms(String nationCode, String mobile, DaasMessageTemplate tpl) { - MultiValueMap body = new LinkedMultiValueMap<>(); - body.add("mobile", nationCode + mobile.replaceAll("^(\\+61)(61)", "")); - body.add("msg", "[RoyalPay]" + tpl.getMessage()); - RequestEntity> request = RequestEntity.post(URI.create(URL)) - .headers(signature()).contentType(MediaType.APPLICATION_FORM_URLENCODED) - .body(body); - try { - ResponseEntity resp = restTemplate.exchange(request, JSONObject.class); - JSONObject respBody = resp.getBody(); - logger.debug("daas sms response:{}", respBody); - Optional.ofNullable(respBody) - .map(resBody -> resBody.getJSONArray("data")) - .filter(arr -> !arr.isEmpty()) - .map(dataArr -> dataArr.getJSONObject(0)) - .ifPresent(data -> { - JSONObject record0 = data.getJSONArray("record").getJSONObject(0); - logger.info("send sms success:[{}]{}, messageNum:{}", record0.getString("resCode"), record0.getString("resDesc"), data.getString("recordNum")); - }); - } catch (RestClientResponseException e) { - logger.error("request sms service failed:[{}]{}", e.getRawStatusCode(), e.getResponseBodyAsString(), e); - } catch (RestClientException e) { - logger.error("request sms service failed", e); - } - } - - private HttpHeaders signature() { - String source = "market"; - String datetime = DateTime.now().withZone(DateTimeZone.UTC).toString("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH); - try { - String auth = calcAuthorization(source, secretId, secretKey, datetime); - MultiValueMap headers = new LinkedMultiValueMap<>(); - headers.add("X-Source", source); - headers.add("X-Date", datetime); - headers.add("Authorization", auth); - return new HttpHeaders(headers); - } catch (NoSuchAlgorithmException | UnsupportedEncodingException | InvalidKeyException e) { - throw new ServerErrorException("Signature failed", e); - } - } - - public static String calcAuthorization(String source, String secretId, String secretKey, String datetime) - throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException { - String signStr = "x-date: " + datetime + "\n" + "x-source: " + source; - Mac mac = Mac.getInstance("HmacSHA1"); - Key sKey = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), mac.getAlgorithm()); - mac.init(sKey); - byte[] hash = mac.doFinal(signStr.getBytes(StandardCharsets.UTF_8)); - String sig = Base64.encodeBase64String(hash); - - return "hmac id=\"" + secretId + "\", algorithm=\"hmac-sha1\", headers=\"x-date x-source\", signature=\"" + sig + "\""; - } - - @Override - public boolean supportNationCode(String nationCode) { - return "61".equals(nationCode); - } - - @Override - public int getOrder() { - return 100; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderQcloudImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderQcloudImpl.java deleted file mode 100644 index c2bbcc243..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderQcloudImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms; - -import au.com.royalpay.payment.manage.support.sms.msg.OpenMessage; -import au.com.royalpay.payment.manage.support.sms.msg.RefuseMessage; -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.github.qcloudsms.SmsSingleSender; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Component; - -import java.util.Locale; - -/** - * @author kira - * @date 2018/8/1 - */ -@Component -@ConditionalOnProperty(value = "royalpay.sms.qcloud.enable", havingValue = "true") -public class SmsSenderQcloudImpl implements SmsSenderChannel { - - private static final int OPEN_MESSAGE_ID = 462770; - private static final int REGISTER_CLIENT_TEMPLID_ZH = 126978; - private static final int REGISTER_CLIENT_TEMPLID_EN = 346078; - private static final int REFUSE_CLIENT_TEMPLID = 166108; - private final SmsSingleSender sender; - private final String sign; - - public SmsSenderQcloudImpl(@Value("${royalpay.sms.qcloud.appid}") int appId, @Value("${royalpay.sms.qcloud.appkey}") String appKey) { - sender = new SmsSingleSender(appId, appKey); - sign = "RoyalPay"; - } - - public SmsSingleSender getSender() { - return sender; - } - - @Override - public void sendOpenMessage(String nationCode, String mobile, Locale locale, OpenMessage msg) { - sendMessage(nationCode, mobile, OPEN_MESSAGE_ID, msg.getMaskedPhoneNumber()); - } - - private void sendMessage(String nationCode, String mobile, int tplId, String... param) { - try { - sender.sendWithParam(nationCode, mobile.replace("+61", ""), tplId, param, sign, "", ""); - } catch (Exception e) { - throw new ServerErrorException("Phone number is wrong :" + mobile, e); - } - } - - @Override - public void sendAuthCodeMessage(String nationCode, String mobile, Locale locale, AuthCodeMessage register) { - if (locale.equals(Locale.CHINESE) || locale.equals(Locale.SIMPLIFIED_CHINESE)) { - sendMessage(nationCode, mobile, REGISTER_CLIENT_TEMPLID_ZH, register.getBiz(), register.getCode(), register.getExpireMin() + ""); - } else { - sendMessage(nationCode, mobile, REGISTER_CLIENT_TEMPLID_EN, register.getBiz(), register.getCode(), register.getExpireMin() + ""); - } - } - - @Override - public void sendRefuseMessage(String nationCode, String mobile, Locale locale, RefuseMessage refuse) { - sendMessage(nationCode, mobile, REFUSE_CLIENT_TEMPLID, refuse.getReason()); - } - - @Override - public boolean supportNationCode(String nationCode) { - return true; - } - - @Override - public int getOrder() { - return Integer.MAX_VALUE; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderRoute.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderRoute.java deleted file mode 100644 index b508155dc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/SmsSenderRoute.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms; - -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; -import au.com.royalpay.payment.manage.support.sms.msg.OpenMessage; -import au.com.royalpay.payment.manage.support.sms.msg.RefuseMessage; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Locale; - -@Service -@Primary -public class SmsSenderRoute implements SmsSender{ - private final List channels; - - public SmsSenderRoute(List channels) { - this.channels = channels; - } - - @Override - public void sendOpenMessage(String nationCode, String mobile, Locale locale, OpenMessage msg) { - channels.stream().filter(channel->channel.supportNationCode(nationCode)).findFirst().ifPresent(channel->channel.sendOpenMessage(nationCode, mobile, locale, msg)); - } - - @Override - public void sendAuthCodeMessage(String nationCode, String mobile, Locale locale, AuthCodeMessage register) { - channels.stream().filter(channel->channel.supportNationCode(nationCode)).findFirst().ifPresent(channel->channel.sendAuthCodeMessage(nationCode, mobile, locale, register)); - } - - @Override - public void sendRefuseMessage(String nationCode, String mobile, Locale locale, RefuseMessage refuse) { - channels.stream().filter(channel->channel.supportNationCode(nationCode)).findFirst().ifPresent(channel->channel.sendRefuseMessage(nationCode, mobile, locale, refuse)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/AuthCodeMessageTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/AuthCodeMessageTemplate.java deleted file mode 100644 index 49ca1e630..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/AuthCodeMessageTemplate.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.daas; - -import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage; - -import java.util.Locale; - -public class AuthCodeMessageTemplate implements DaasMessageTemplate { - private static final String CN_TPL = "您正在申请%s,验证码为%s,%s分钟内有效,请勿向任何人提供此验证码"; - private static final String EN_TPL = "%s secret code is %s (valid in %s min).No reveal to others"; - private final Locale locale; - private final AuthCodeMessage register; - - public AuthCodeMessageTemplate(Locale locale, AuthCodeMessage register) { - this.locale = locale; - this.register = register; - } - - @Override - public String getMessage() { - String tpl = EN_TPL; - if (locale.equals(Locale.CHINESE) || locale.equals(Locale.SIMPLIFIED_CHINESE)) { - tpl = CN_TPL; - } - return String.format(tpl, register.getBiz(), register.getCode(), register.getExpireMin()); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/DaasMessageTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/DaasMessageTemplate.java deleted file mode 100644 index c440c6dfd..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/DaasMessageTemplate.java +++ /dev/null @@ -1,7 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.daas; - -public interface DaasMessageTemplate { - - String getMessage(); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/OpenMessageTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/OpenMessageTemplate.java deleted file mode 100644 index ebc30e0b1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/OpenMessageTemplate.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.daas; - -import au.com.royalpay.payment.manage.support.sms.msg.OpenMessage; - -public class OpenMessageTemplate implements DaasMessageTemplate { - private static final String TEMPLATE = "尊敬的商户,恭喜您注册成功,请使用您的(%s)账户登录网址(https://mpay.royalpay.com.au/)或者使用RoyalPay手机App。您可以使用RoyalPay所有的功能,包括接受客户的付款,在您激活账号之前,RoyalPay将不执行清算操作。因此,请您尽快提交合规材料,若有任何疑问,请联系我们客服。"; - private final OpenMessage openMessage; - - public OpenMessageTemplate(OpenMessage openMessage) { - this.openMessage = openMessage; - } - - - @Override - public String getMessage() { - return String.format(TEMPLATE, openMessage.getMaskedPhoneNumber()); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/RefuseMessageTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/RefuseMessageTemplate.java deleted file mode 100644 index f0155965e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/daas/RefuseMessageTemplate.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.daas; - -import au.com.royalpay.payment.manage.support.sms.msg.RefuseMessage; - -public class RefuseMessageTemplate implements DaasMessageTemplate{ - private static final String TPL = "尊敬的RoyalPay商户,您提交的商户资料审核不通过,原因(%s),请登录系统后台修改后,重新提交审核。[RoyalPay合规部]"; - private final RefuseMessage refuseMessage; - - public RefuseMessageTemplate(RefuseMessage refuseMessage) { - this.refuseMessage = refuseMessage; - } - - @Override - public String getMessage() { - return String.format(TPL,refuseMessage.getReason()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/AuthCodeMessage.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/AuthCodeMessage.java deleted file mode 100644 index da844eb82..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/AuthCodeMessage.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.msg; - -public class AuthCodeMessage { - private final String biz; - private final String code; - private final int expireMin; - - public AuthCodeMessage(String biz, String code, int expireMin) { - this.biz = biz; - this.code = code; - this.expireMin = expireMin; - } - - public String getBiz() { - return biz; - } - - public String getCode() { - return code; - } - - public int getExpireMin() { - return expireMin; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/OpenMessage.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/OpenMessage.java deleted file mode 100644 index 9cadf9ef2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/OpenMessage.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.msg; - -public class OpenMessage { - private final String phoneNumber; - - - public OpenMessage(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - public String getMaskedPhoneNumber(){ - return new StringBuilder(phoneNumber).replace(3,7,"****").toString(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/RefuseMessage.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/RefuseMessage.java deleted file mode 100644 index a8fde5868..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/msg/RefuseMessage.java +++ /dev/null @@ -1,13 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.msg; - -public class RefuseMessage { - private final String reason; - - public RefuseMessage(String reason) { - this.reason = reason; - } - - public String getReason() { - return reason; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/sms/qcloud/QCloudMessageTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/sms/qcloud/QCloudMessageTemplate.java deleted file mode 100644 index 018ddab9c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/sms/qcloud/QCloudMessageTemplate.java +++ /dev/null @@ -1,4 +0,0 @@ -package au.com.royalpay.payment.manage.support.sms.qcloud; - -public interface QCloudMessageTemplate { -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/ClientWechatAppImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/ClientWechatAppImpl.java deleted file mode 100644 index 963e26a09..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/ClientWechatAppImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.WechatAppApi; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractClientWechatAppImpl; -import org.springframework.stereotype.Service; - -/** - * Created by yishuqian on 11/12/2017. - */ -@Service -public class ClientWechatAppImpl extends AbstractClientWechatAppImpl implements WechatAppApi{ - @Override - public String targetMpAccount() { - return "clientapp"; - } - - @Override - public String getOpenIdKey() { - return ""; - } - - @Override - public boolean matchOpenId(String openId) { - return false; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/KangaLandWechatApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/KangaLandWechatApiImpl.java deleted file mode 100644 index baca95d18..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/KangaLandWechatApiImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -/** - * Created by yixian on 2016-12-22. - */ -@Service -public class KangaLandWechatApiImpl extends AbstractMpWechatClientApi implements MpWechatApi { - @Override - public String targetMpAccount() { - return "kangaland"; - } - - @Override - public JSONObject sendRedpack(WechatRedpack redpackInfo) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public String getOpenIdKey() { - return "kanga_openid"; - } - - @Override - public JSONObject redpackStatus(String redpackId) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public boolean matchOpenId(String openId) { - return openId.startsWith("oM_oK"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/MerchantAppWechatImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/MerchantAppWechatImpl.java deleted file mode 100644 index a0cbead02..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/MerchantAppWechatImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.WechatAppApi; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractClientWechatAppImpl; -import org.springframework.stereotype.Service; - -/** - * @Author DuLingLing - * @create 2019/10/21 0021 17:57 - */ -@Service -public class MerchantAppWechatImpl extends AbstractClientWechatAppImpl implements WechatAppApi { - @Override - public String targetMpAccount() { - return "merchant-app"; - } - - @Override - public String getOpenIdKey() { - return ""; - } - - @Override - public boolean matchOpenId(String openId) { - return false; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/NAPWechatApi.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/NAPWechatApi.java deleted file mode 100644 index 61151721f..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/NAPWechatApi.java +++ /dev/null @@ -1,45 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; - -/** - * Created by yishuqian on 11/01/2017. - */ -@Service -public class NAPWechatApi extends AbstractMpWechatClientApi implements MpWechatApi { - @PostConstruct - public void initTemplates() { - } - - @Override - public String targetMpAccount() { - return "globalpay"; - } - - @Override - public String getOpenIdKey() { - return "globalpay_openid"; - } - - @Override - public JSONObject sendRedpack(WechatRedpack redpackInfo) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public JSONObject redpackStatus(String redpackId) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public boolean matchOpenId(String openId) { - return openId.startsWith("olHWD"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/OriginPaymentWechatApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/OriginPaymentWechatApiImpl.java deleted file mode 100644 index 40e1c1fea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/OriginPaymentWechatApiImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; - -/** - * Created by yishuqian on 11/01/2017. - */ -@Service -public class OriginPaymentWechatApiImpl extends AbstractMpWechatClientApi implements MpWechatApi { - - @PostConstruct - public void initTemplates() { - registerTemplateId("payment-success", "P7hrYq_AkRvrfaGHwMm5oFOIUnCw_k-NxyU42Hw0YGE"); - registerTemplateId("refund-audit-notice", "NsaQALWvT7CKx0-5fRqaEkoROY4ZVVLMcN9mtqAJS6I"); - registerTemplateId("task-finished", "b04ZRVLU8mAIc5FBFZvl80VfY7EMTEU9mnp0Y8zor2Q"); - registerTemplateId("new-apply", "h32Ayw3K0B3RXtQXcNJkEzwdjgm0SPJPE2hr_pJ6q1U"); - registerTemplateId("refund-send", "pWfO-UbcF1M-XCHq1Rc77YzWZYjq6USFHo381p05y8Q"); - registerTemplateId("report-generated", "rKaFKe-S6k1M0YmB7ZBQYw3zu2bIKsp33nUmDfc8_5k"); - } - - @Override - public String targetMpAccount() { - return "payment"; - } - - @Override - public String getOpenIdKey() { - return "payment_openid"; - } - - @Override - public JSONObject sendRedpack(WechatRedpack redpackInfo) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public JSONObject redpackStatus(String redpackId) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public boolean matchOpenId(String openId) { - return openId.startsWith("obJ"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/RedpackWechatApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/RedpackWechatApiImpl.java deleted file mode 100644 index 3469e4d4c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/RedpackWechatApiImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi; -import org.springframework.stereotype.Service; - -/** - * Created by yixian on 2016-12-13. - */ -@Service -public class RedpackWechatApiImpl extends AbstractMpWechatClientApi implements MpWechatApi { - - private final String memberMpId = "redpack"; - - @Override - public String targetMpAccount() { - return memberMpId; - } - - @Override - public String getOpenIdKey() { - return "redpack_openid"; - } - - @Override - public boolean matchOpenId(String openId) { - return openId.startsWith("oiE-5"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/WepayWechatApiImpl.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/WepayWechatApiImpl.java deleted file mode 100644 index c09b6342e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/WepayWechatApiImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.support.wechatclients; - -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; -import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; - -/** - * Created by yishuqian on 11/01/2017. - */ -@Service -public class WepayWechatApiImpl extends AbstractMpWechatClientApi implements MpWechatApi { - @PostConstruct - public void initTemplates() { - registerTemplateId("payment-success", "NdM5XU1geDTyyHZAZap65TCMN5dkLmH-LfEwFjwyTQI"); - registerTemplateId("refund-audit-notice", "fYV3ZSYibnkC5Md5olUVVkNeKwgm0iBXeUQBxKp5zTQ"); - registerTemplateId("payment-success-cashier", "wXYaLwlodWmh90kWtOMexDVL4limnX-AZ7hGvjDzsn0"); - registerTemplateId("task-finished", "-UMvfW3Rb8OX4zdrt1V7TwJmOjy8ZHCOR2psdGR48NU"); - registerTemplateId("new-apply", "H9xXsH-ySl0E3okHyKYAR4QMZLhXjds5kBgyZlUQsEk"); - registerTemplateId("refund-send", "VsNDF6TepWUGgl0k9HwGEGdaNJU4sdZ7nISw0SH0OXY"); - registerTemplateId("report-generated", "fcM6-6IgB0L9QvqJwF42xAApGbDTkjUmhOyPbQtI-bQ"); - registerTemplateId("newpartner-overtime", "34KXvWq_C6dBhpa-vxC4Vi0j-tGF-QkZ5J35I-jzucA"); - registerTemplateId("refuse-bd", "_G0dQ3sR_Ltb7Lxu2zw5oTiqeTw189Cxbdoq-J4QPd8"); - registerTemplateId("commission", "ElnMHQ_TxY42CLOgBMu01FlJb4bAHAY7U9LVknkGpeo"); - registerTemplateId("transaction-daily", "uR_Bs5doIoVUdX-CeKYxGviB2FJpZZShlBTiXj73iHM"); - registerTemplateId("settlement", "HqgkogBUWmfInrS5U84_9p-19LbM0apEuExHW4LF4bM"); - registerTemplateId("settlement-check-code", "yaXEOjXFpuipk-DsdxYdd8PnD3bWAgDS5vTKJsrFdR4"); - registerTemplateId("daily-green-channel", "vjeNnggHnnRHvBP80lkEEtPk8ouf7JnvrQYDCyxqx4g"); - registerTemplateId("client-postpone", "5eNJ5ZTKWitC1TJClb2coymtNCmOC7d86h0zCrxmGig"); - registerTemplateId("test-merchant-password","cF_zIhB4VmjdOaDS2_RNVFforyywsKcfjS1yNNgYmWw"); - registerTemplateId("risk-forbidden-channelAndPartner","g79Sf5FOQT6PoCvRVzm7YlgtzbZ_EUD1z6E4Xp2Jwp4"); - } - - @Override - public String targetMpAccount() { - return "wepay"; - } - - @Override - public String getOpenIdKey() { - return "wepay_openid"; - } - - @Override - public JSONObject sendRedpack(WechatRedpack redpackInfo) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public JSONObject redpackStatus(String redpackId) { - throw new ServerErrorException("Cannot send redpack with this merchant"); - } - - @Override - public boolean matchOpenId(String openId) { - return openId.startsWith("o32"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java deleted file mode 100644 index ba97930ce..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.surchargeAccount.core; - -import com.alibaba.fastjson.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -public interface SurchargeAccountService { - - void generatorMonthDetail(); - - List listSettledDatesInMonth(String mon); - - void fillMothsSurcharge(JSONObject manager, String detailId); - - void exportInvoicePDF(int clientId, String clearingDetailIdJSONObject,JSONObject manager, HttpServletResponse httpResponse); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java deleted file mode 100644 index c88bb2a40..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ /dev/null @@ -1,215 +0,0 @@ -package au.com.royalpay.payment.manage.surchargeAccount.core.impl; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.system.ClearingDistributedSurchargeMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientsSurchargeAccountsMapper; -import au.com.royalpay.payment.manage.mappers.system.FinancialSurchargeAccountDetailMapper; -import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService; -import au.com.royalpay.payment.manage.system.core.impl.ClientContractServiceImpl; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.PdfUtils; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class SurchargeAccountServiceImpl implements SurchargeAccountService { - - @Resource - private ClearingDistributedSurchargeMapper clearingDistributedSurchargeMapper; - @Resource - private FinancialSurchargeAccountDetailMapper financialSurchargeAccountDetailMapper; - @Resource - private ClientMapper clientMapper; - @Resource - private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper; - @Resource - private Locker locker; - @Resource - private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper; - private Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class); - - - @Override - @Transactional(rollbackFor = Exception.class) - public void generatorMonthDetail() { - DateTime dateTo = DateTime.now().withMillisOfDay(0).withDayOfMonth(1); - logger.info("===============Start generator surcharge account month detail==============={}", new Date()); - List surchargeTransactions = clearingDistributedSurchargeMapper.listUnClearedByMonth(dateTo); - Map> clientsDistributed = surchargeTransactions.stream().collect(Collectors.groupingBy(trans -> trans.getInteger("client_id"))); - for (Map.Entry> clientEntry : clientsDistributed.entrySet()) { - int clientId = clientEntry.getKey(); - List surchargeTrans = clientEntry.getValue(); - surchargeTrans.sort(Comparator.comparing(trans -> trans.getDate("create_time"))); - JSONObject detail = new JSONObject(); - detail.put("client_id", clientId); - detail.put("settle_month", dateTo.plusMonths(-1).toString("yyyy-MM")); - BigDecimal creditAmount = surchargeTrans.stream() - .filter(trans -> "Credit".equals(trans.getString("type"))) - .map(trans -> trans.getBigDecimal("amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - BigDecimal debitAmount = surchargeTrans.stream() - .filter(trans -> "Debit".equals(trans.getString("type"))) - .map(trans -> trans.getBigDecimal("amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - detail.put("credit_amount", creditAmount); - detail.put("debit_amount", debitAmount); - detail.put("total_surcharge", creditAmount.add(debitAmount)); - JSONObject lastTrans = surchargeTrans.stream().max(Comparator.comparing(trans -> trans.getDate("create_time"))) - .orElse(null); - BigDecimal postBalance; - if (lastTrans == null) { - JSONObject account = clientsSurchargeAccountsMapper.find(clientId); - postBalance = account == null ? BigDecimal.ZERO : account.getBigDecimal("balance"); - } else { - postBalance = lastTrans.getBigDecimal("post_balance"); - } - detail.put("post_balance", postBalance); - detail.put("send_mail", 0); - detail.put("wx_send", 0); - detail.put("create_time", new Date()); - detail.put("checkout", 0); - financialSurchargeAccountDetailMapper.save(detail); - //更新手续费明细中的账单id - surchargeTrans.forEach(trans -> { - trans.put("bill_id", detail.getString("detail_id")); - clearingDistributedSurchargeMapper.update(trans); - }); - } - logger.info("===============generator OVER==============={}", new Date()); - } - - @Override - public List listSettledDatesInMonth(String mon) { - return financialSurchargeAccountDetailMapper.listSettlementDatesInMonth(mon); - } - - @Override - public void fillMothsSurcharge(JSONObject manager, String detailId) { - if (!(ManagerRole.ADMIN.hasRole(manager.getIntValue("role")) || ManagerRole.OPERATOR.hasRole(manager.getIntValue("role")) || ManagerRole.FINANCIAL_STAFF.hasRole(manager.getIntValue("role")))) { - throw new ForbiddenException("无法执行平账操作,权限不足"); - } - JSONObject detail = financialSurchargeAccountDetailMapper.findByDetailId(detailId); - if (detail.getBooleanValue("checkout")) { - throw new BadRequestException("该记录已结清"); - } - if (!locker.lock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill", 120_000)) { - throw new ServerErrorException("Processing task, wait for a moment"); - } - try { - JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(detail.getIntValue("client_id")); - JSONObject transaction = new JSONObject(); - transaction.put("client_id", detail.getIntValue("client_id")); - transaction.put("type", "Credit"); - transaction.put("bill_id", detailId); - transaction.put("total_surcharge", BigDecimal.ZERO); - transaction.put("tax_amount", BigDecimal.ZERO); - transaction.put("amount", detail.getBigDecimal("total_surcharge").negate()); - transaction.put("post_balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); - transaction.put("operation", manager.getString("manager_id")); - transaction.put("create_time", new Date()); - transaction.put("remark", detail.getString("settle_month") + "冲正"); - clearingDistributedSurchargeMapper.save(transaction); - - surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); - clientsSurchargeAccountsMapper.update(surchargeAccount); - detail.put("checkout", 1); - detail.put("operator_id", manager.getString("manager_id")); - financialSurchargeAccountDetailMapper.update(detail); - } finally { - locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill"); - } - } - - @Override - public void exportInvoicePDF(int clientId, String clearingDetailId,JSONObject manager, HttpServletResponse httpResponse) { - JSONObject client = clientMapper.findClient(clientId); - if (client == null) { - throw new InvalidShortIdException(); - } - List distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); - if (distributedDetail.size() > 1) { - throw new BadRequestException("此次清算扣款已回滚"); - } - JSONObject detial = distributedDetail.get(0); - String date = DateFormatUtils.format(detial.getDate("settle_date"), "dd MMM yyyy", Locale.US); - httpResponse.setContentType("application/pdf"); - httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf"); - ServletOutputStream sos = null; - JSONObject pdfInfo = new JSONObject(); - - try { - sos = httpResponse.getOutputStream(); - List clearingAnalysis = clearingDetailAnalysisMapper.listReportChannels(clearingDetailId); - invoiceChannelAmount(clearingAnalysis, pdfInfo); - httpResponse.getOutputStream(); - pdfInfo.put("date", date); - pdfInfo.put("company_name", client.getString("company_name")); - pdfInfo.put("address", client.getString("address")); - pdfInfo.put("suburb", client.getString("suburb") +" " + client.getString("state") +" " +client.getString("postcode")); - pdfInfo.put("country", client.getString("country")); - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath("https://file.royalpay.com.au/open/2019/05/21/1558428021205_9pyF7U1rEloxVOXx2k7bTeRxzJaXi0.pdf"); - pdu.setPdfTemplate(pdfInfo); - File file = new File(client.getString("client_moniker") + "_Invoice_"+ date + ".pdf"); - ByteArrayOutputStream bos = pdu.templetPdfBos(file); - sos.write(bos.toByteArray()); - sos.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void invoiceChannelAmount(List analysis,JSONObject pdfInfo) { - BigDecimal wechatSurcharge = BigDecimal.ZERO; - BigDecimal wechatTaxAmount = BigDecimal.ZERO; - BigDecimal wechatAmount = BigDecimal.ZERO; - BigDecimal alipaySurcharge = BigDecimal.ZERO; - BigDecimal alipayTaxAmount = BigDecimal.ZERO; - BigDecimal alipayAmount = BigDecimal.ZERO; - for (JSONObject detail : analysis) { - switch (detail.getString("channel")) { - case "Wechat": - wechatSurcharge = detail.getBigDecimal("total_charge"); - wechatTaxAmount = detail.getBigDecimal("tax_amount"); - wechatAmount = detail.getBigDecimal("distributed_surcharge"); - break; - case "Alipay": - alipaySurcharge = detail.getBigDecimal("total_charge"); - alipayTaxAmount = detail.getBigDecimal("tax_amount"); - alipayAmount = detail.getBigDecimal("distributed_surcharge"); - break; - default: - break; - } - } - pdfInfo.put("surcharge_wechat", wechatSurcharge); - pdfInfo.put("amount_wechat", wechatSurcharge.add(wechatTaxAmount)); - pdfInfo.put("surcharge_alipay", alipaySurcharge); - pdfInfo.put("amount_alipay", alipaySurcharge.add(alipayTaxAmount)); - pdfInfo.put("amount", wechatSurcharge.add(alipaySurcharge)); - pdfInfo.put("gst", wechatTaxAmount.add(alipayTaxAmount)); - pdfInfo.put("total_amount", (wechatAmount.add(alipayAmount)).setScale(2, RoundingMode.DOWN)); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java deleted file mode 100644 index 6c7a893fa..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.surchargeAccount.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@RequestMapping("/sys/surcharge_account") -@RestController -public class SurchargeAccountController { - - @Resource - private SurchargeAccountService surchargeAccountService; - - @ManagerMapping(value = "/month/{month}/settled_dates", role = {ManagerRole.ADMIN,ManagerRole.OPERATOR}, method = RequestMethod.GET) - public List surchargeAccountSettledDates(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String month) { - return surchargeAccountService.listSettledDatesInMonth(month); - } - - @ManagerMapping(value = "/fill/{detailId}", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.PUT) - public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detailId) { - surchargeAccountService.fillMothsSurcharge(manager, detailId); - } - - @ManagerMapping(value = "/{clientId}/settlement_logs/{clearingDetailId}/export", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.GET) - public void exportInvoicePDF(@PathVariable int clientId, @PathVariable String clearingDetailId, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - surchargeAccountService.exportInvoicePDF(clientId, clearingDetailId, manager, httpResponse); - } -} 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 deleted file mode 100644 index 3dd0d93f4..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.system.core; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import java.util.Date; - -public interface ClientContractService { - - void getOrGenerateSourceAgreement(int client_id, String channel); - - void confirmSourceAgreement(int client_id, String account_id, String channel); - - JSONObject getSourceAgreement(int client_id); - - JSONObject getClientContractExpire(int client_id, String channel); - - void saveContract(int client_id, Date expire_date, String channel); - - JSONObject list(JSONObject param,PageBounds pagination); - - JSONObject analysis(); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/MailGunService.java b/src/main/java/au/com/royalpay/payment/manage/system/core/MailGunService.java deleted file mode 100644 index 0bb964bea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/MailGunService.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.system.core; - - -import au.com.royalpay.payment.tools.mail.SendMail; - -import com.alibaba.fastjson.JSONObject; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Map; -import java.util.Set; - -public interface MailGunService { - - void dealNotify(String nofityString) throws Exception; - - void dealDroppedNotify(Map parameter) throws Exception; - - JSONObject sendMail(SendMail sendMail); - - JSONObject addClientToMailList(JSONObject client); - - JSONObject updateClientOfMailList(JSONObject newClient,JSONObject oldClient); - - JSONObject sendEmail(String notice_id, String title, Set mailTo, String content) throws URISyntaxException, IOException ; - - void removeMailList(JSONObject client); - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/PermissionClientModulesService.java b/src/main/java/au/com/royalpay/payment/manage/system/core/PermissionClientModulesService.java deleted file mode 100644 index 984eb440a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/PermissionClientModulesService.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.system.core; - - -import com.alibaba.fastjson.JSONObject; - -import java.util.List; - -/** - * @author kira - * @date 2018/7/4 - */ -public interface PermissionClientModulesService { - - void save(JSONObject record); - - List listValidByClientId(int clientId); - - List listByClientMoniker(String clientMoniker); - - void switchValid(Long id,boolean isValid,JSONObject account); - - void removeByClientMoniker(String clientMoniker); -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/SystemPackageCacheSupport.java b/src/main/java/au/com/royalpay/payment/manage/system/core/SystemPackageCacheSupport.java deleted file mode 100644 index 74555c750..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/SystemPackageCacheSupport.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.system.core; - -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; - -/** - * @author kira - * @date 2018/7/5 - */ -@Service -public class SystemPackageCacheSupport { - - @CacheEvict(value = ":system:client_permission:", key = "#client_moniker") - public void clearClientPermission(String client_moniker){ - - } - @CacheEvict(value = ":system:client_permission:", key = "#client_id+''") - public void clearClientPermission(int client_id){ - - } - - @CacheEvict(value = ":system:client_permission:",allEntries = true) - public void clearClientPermissionAll(){ - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/TradeSecureService.java b/src/main/java/au/com/royalpay/payment/manage/system/core/TradeSecureService.java deleted file mode 100644 index 60f90ab8e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/TradeSecureService.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.system.core; - -import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile; - -import javax.servlet.http.HttpServletResponse; -import java.util.Date; - -/** - * Create by yixian at 2019-01-08 3:17 - */ -public interface TradeSecureService { - void uploadSecureReportYesterday(); - - void uploadSecureReport(Date date); - - void manualDownloadHanyinSecureReport(Date date, boolean upload, HttpServletResponse resp); - - TradeSecureFile getSecureReportFile(Date date); - - void sendSecurePaySettleFile(String dateStr); - - void sendSecurePayInvoiceFile(String beginDate,String endDate); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/beans/PermissionClientModuleLog.java b/src/main/java/au/com/royalpay/payment/manage/system/core/beans/PermissionClientModuleLog.java deleted file mode 100644 index 7ad83a373..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/beans/PermissionClientModuleLog.java +++ /dev/null @@ -1,98 +0,0 @@ -package au.com.royalpay.payment.manage.system.core.beans; - -import com.fasterxml.jackson.annotation.JsonFormat; - -import org.springframework.data.mongodb.core.mapping.Document; - -import java.util.Date; - -/** - * @author kira - * @date 2018/7/4 - */ -@Document(collection = "permission_client_module_log") -public class PermissionClientModuleLog { - - private long id; - private int clientId; - private String clientMoniker; - private String business; - private String userId; - private String userName; - private String originData; - private String newData; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+10") - private Date createTime; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public int getClientId() { - return clientId; - } - - public void setClientId(int clientId) { - this.clientId = clientId; - } - - public String getClientMoniker() { - return clientMoniker; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getBusiness() { - return business; - } - - public void setBusiness(String business) { - this.business = business; - } - - 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; - } - - public String getOriginData() { - return originData; - } - - public void setOriginData(String originData) { - this.originData = originData; - } - - public String getNewData() { - return newData; - } - - public void setNewData(String newData) { - this.newData = newData; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/beans/TradeSecureFile.java b/src/main/java/au/com/royalpay/payment/manage/system/core/beans/TradeSecureFile.java deleted file mode 100644 index c341b6ae0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/beans/TradeSecureFile.java +++ /dev/null @@ -1,153 +0,0 @@ -package au.com.royalpay.payment.manage.system.core.beans; - -import au.com.royalpay.payment.tools.defines.TradeType; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import com.alibaba.fastjson.JSONObject; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; - -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.math.BigDecimal; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.TimeZone; -import java.util.stream.Collectors; - -/** - * Create by yixian at 2019-01-08 3:27 - */ -public class TradeSecureFile { - private static final DateTimeZone zone = DateTimeZone.forTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); - private final String pid; - private final DateTime transDate; - private final DateTime createTime; - private List tradeItems; - private byte[] content; - - public TradeSecureFile(String pid, Date transDate) { - this.pid = pid; - this.transDate = new DateTime(transDate).withZoneRetainFields(zone).withMillisOfDay(0); - this.tradeItems = new ArrayList<>(); - this.createTime = DateTime.now(zone); - } - - public DateTime getTransDate() { - return transDate; - } - - public Date getFromTime() { - return transDate.withZone(DateTimeZone.forTimeZone(TimeZone.getDefault())).toDate(); - } - - public Date getToTime() { - return transDate.plusDays(1).withZone(DateTimeZone.forTimeZone(TimeZone.getDefault())).toDate(); - } - - public TradeSecureFile addTransactions(List transactions) { - tradeItems.addAll(transactions.stream().map(TradeItem::new).collect(Collectors.toList())); - return this; - } - - public void writeToHttp(HttpServletResponse response) { - response.setContentType("application/octet-stream"); - response.setHeader("Content-Disposition", "attachment; filename=" + filename()); - try (OutputStream ous = response.getOutputStream()) { - ous.write(content()); - ous.flush(); - } catch (IOException e) { - throw new ServerErrorException(e); - } - } - - public String filename() { - return String.join("_", transDate.toString("yyMMdd"), pid, createTime.toString("yyMMddHHmmss")) + ".txt"; - } - - public byte[] content() { - return content == null ? build() : content; - } - - private byte[] build() { - - try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintWriter writer = new PrintWriter(new OutputStreamWriter(bos, StandardCharsets.UTF_8))) { - writer.println(headerLine()); - for (TradeItem item : tradeItems) { - writer.println(item.line()); - } - writer.flush(); - content = bos.toByteArray(); - return content; - } catch (IOException e) { - throw new ServerErrorException(e); - } - } - - private String headerLine() { - int totalCount = tradeItems.size(); - BigDecimal totalCredit = tradeItems.stream().filter(TradeItem::isCredit).map(TradeItem::getClearingAmount) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - BigDecimal totalDebit = tradeItems.stream().filter(TradeItem::isDebit).map(TradeItem::getClearingAmount) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - String date = transDate.toString("yyyy-MM-dd"); - String[] columns = {String.valueOf(totalCount), totalCredit.toPlainString(), totalDebit.toPlainString(), date, pid}; - return String.join("|", columns); - } - - class TradeItem { - - private String clientMoniker; - private String orderId; - private String channel; - private TradeType gateway; - private BigDecimal price; - private BigDecimal clearingAmount; - private String currency; - private BigDecimal exchangeRate; - private String transactionType; - private Date transactionTime; - private String ip; - - public TradeItem(JSONObject item) { - clientMoniker = item.getString("client_moniker"); - transactionType = item.getString("transaction_type"); - orderId = isCredit() ? item.getString("order_id") : item.getString("out_refund_id"); - channel = item.getString("order_channel"); - gateway = TradeType.fromGatewayNumber(item.getIntValue("gateway")); - currency = item.getString("transaction_currency"); - price = CurrencyAmountUtils.scale(item.getBigDecimal("transaction_amount"), currency); - clearingAmount = CurrencyAmountUtils.scale(item.getBigDecimal("clearing_amount"), PlatformEnvironment.getEnv().getForeignCurrency()); - exchangeRate = item.getBigDecimal("exchange_rate"); - transactionTime = item.getDate("transaction_time"); - ip = item.getString("customer_ip"); - } - - public String line() { - String[] columns = {clientMoniker, orderId, channel, gateway.toString(), price.toPlainString(), - clearingAmount.toPlainString(), currency, exchangeRate.toPlainString(), filterStatus(), - new DateTime(transactionTime).withZone(zone).toString("yyyy-MM-dd HH:mm:ss"), ip}; - return String.join("|", columns); - } - - private String filterStatus() { - return isCredit() ? "SUCCESS" : "REFUND"; - } - - public boolean isCredit() { - return "Credit".equals(transactionType); - } - - public boolean isDebit() { - return "Debit".equals(transactionType); - } - - public BigDecimal getClearingAmount() { - return clearingAmount; - } - } -} 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 deleted file mode 100644 index 3b9102fbf..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -package au.com.royalpay.payment.manage.system.core.impl; - -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.system.core.ClientContractService; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.PageListUtils; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -@Service -public class ClientContractServiceImpl implements ClientContractService { - - Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class); - @Resource - private ClientFilesMapper clientFilesMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientsContractMapper clientsContractMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ClientConfigService clientConfigService; - - @Override - @Transactional - public void getOrGenerateSourceAgreement(int client_id, String channel) { - JSONObject client = clientManager.getClientInfo(client_id); - if (client == null) { - throw new NotFoundException("merchant not found"); - } - try { - clientManager.getNewAggregateAgreeFile(client.getString("client_moniker"), null, true); - } catch (Exception e) { - logger.error("App generate PDF failed"); -// throw new ServerErrorException("System error"); - } - - } - - @Override - public void saveContract(int client_id, Date expire_date, String channel) { - JSONObject newContract = new JSONObject(); - newContract.put("create_time", new Date()); - newContract.put("expiry_date", DateUtils.addYears(expire_date, 1)); - newContract.put("sign_channel", channel); - newContract.put("client_id", client_id); - newContract.put("has_sign", false); - clientsContractMapper.save(newContract); - } - - @Override - @Transactional - public void confirmSourceAgreement(int client_id, String account_id, String channel) { - JSONObject client = clientManager.getClientInfo(client_id); - if (client == null) { - throw new NotFoundException("merchant not found"); - } - Date now = new Date(); - JSONObject account = clientAccountMapper.findById(account_id); - JSONObject contract = clientsContractMapper.findByClientId(client_id); - if (contract != null && contract.getBoolean("has_sign")) { - return; - } - if(contract ==null){ - JSONObject record = new JSONObject(); - record.put("has_sign",1); - record.put("client_id",client_id); - record.put("create_time",now); - record.put("sign_account_id", account_id); - record.put("sign_channel", channel); - record.put("confirm_time", now); - record.put("expiry_date", DateUtils.addYears(now, 1)); - record.put("signatory", account.getString("display_name")); - contract = record; - clientsContractMapper.save(record); - } - - getOrGenerateSourceAgreement(client_id, channel); - logger.info("confirmSourceAgreement+client_id+client_id"+client_id+","+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); - } - - @Override - public JSONObject getSourceAgreement(int client_id) { - List files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file"); - if (CollectionUtils.isEmpty(files)) { - throw new NotFoundException("Contract not generated"); - } - return files.get(0); - } - - @Override - public JSONObject getClientContractExpire(int client_id, String channel) { - JSONObject client = clientManager.getClientInfo(client_id); - if (client == null) { - throw new NotFoundException("merchant not found please check ID"); - } - JSONObject sysconfig = sysConfigManager.getSysConfig(); - JSONObject result = new JSONObject(); - result.put("alert", false); - if (sysconfig != null && !sysconfig.getBoolean("sys_new_contract_on")) { - return result; - } - JSONObject contract = clientsContractMapper.findByClientId(client_id); - List files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file"); - if (!CollectionUtils.isEmpty(files)) { - JSONObject file = files.get(0); - if (sysconfig.getDate("sys_new_contract_time").compareTo(file.getDate("last_update_date")) > 0) { - if (contract == null) { - saveContract(client_id, new Date(), channel); - } - } - }else { - if (contract == null) { - saveContract(client_id, new Date(), channel); - } - } - if (contract != null && contract.getBoolean("has_sign")) { - return result; - } - JSONObject clientConfig = clientConfigService.find(client_id); - if (clientConfig.getBooleanValue("tax_in_surcharge")) { - result.put("alert", true); - return result; - } - return result; - } - - @Override - public JSONObject list(JSONObject param,PageBounds pagination) { - return PageListUtils.buildPageListResult(clientsContractMapper.listWithClientInfo(param,pagination)); - } - - @Override - public JSONObject analysis() { - List contractAnalysis =clientsContractMapper.analysisSingstatus(); - JSONObject result = new JSONObject(); - for (JSONObject jsonObject : contractAnalysis) { - if(jsonObject.getIntValue("has_sign")==1){ - result.put("has_sign",jsonObject.getIntValue("count")); - }else { - result.put("not_sign",jsonObject.getIntValue("count")); - } - } - return result; - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/MailGunServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/MailGunServiceImpl.java deleted file mode 100644 index 2f059663b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/MailGunServiceImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -package au.com.royalpay.payment.manage.system.core.impl; - -import au.com.royalpay.payment.manage.mappers.system.MailSendMapper; -import au.com.royalpay.payment.manage.system.core.MailGunService; -import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; -import au.com.royalpay.payment.tools.mail.MailGunClient; -import au.com.royalpay.payment.tools.mail.SendMail; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URLDecoder; -import java.util.*; - -@Service -public class MailGunServiceImpl implements MailGunService { - Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private MailSendMapper mailSendMapper; - - @Resource - private MailGunClient mailGunClient; - - @Value("${mail.mailgun.default.merchantlist}") - private String mailListDefault; - - @Resource - private AttachmentClient attachmentClient; - - @Override - public void dealNotify(String nofityString) throws Exception { - String dd = URLDecoder.decode(nofityString, "UTF-8"); - Map mailgunNotify = getQueryMap(dd); - String myData = mailgunNotify.get("my-custom-data"); - String recipient = mailgunNotify.get("recipient"); - if (StringUtils.isNotEmpty(myData) && StringUtils.isNotEmpty(recipient)) { - JSONObject tmpJSONObject = JSON.parseObject(myData); - String[] mailAddresses = recipient.split(","); - for (String mailAddress : mailAddresses) { - JSONObject record = new JSONObject(); - record.put("id", tmpJSONObject.getString("id")); - record.put("mail_address", mailAddress); - record.put("status", 1); - mailSendMapper.update(record); - } - } - } - - @Override - public void dealDroppedNotify(Map parameter) throws Exception { - String [] myDataArr = parameter.get("my-custom-data"); - String [] recipientArr = parameter.get("recipient"); - logger.info(myDataArr[0]); - logger.info(recipientArr[0]); - if(ArrayUtils.isEmpty(myDataArr)){ - return; - } - if(ArrayUtils.isEmpty(recipientArr)){ - return; - } - String myData = myDataArr[0]; - String recipient = recipientArr[0]; - if (StringUtils.isNotEmpty(myData) && StringUtils.isNotEmpty(recipient)) { - JSONObject tmpJSONObject = JSON.parseObject(myData); - String[] mailAddresses = recipient.split(","); - for (String mailAddress : mailAddresses) { - JSONObject record = new JSONObject(); - record.put("id", tmpJSONObject.getString("id")); - record.put("mail_address", mailAddress); - record.put("status", 2); - mailSendMapper.update(record); - } - } - } - - @Override - public JSONObject sendMail(SendMail sendMail) { - return mailGunClient.sendMail(sendMail); - } - - @Override - public JSONObject addClientToMailList(JSONObject client) { - JSONObject result = null; - try { - JSONObject var = new JSONObject(); - var.put("client_moniker", client.getString("client_moniker")); - var.put("short_name", client.getString("short_name")); - result = mailGunClient.addListMember(client.getString("contact_email"), mailListDefault, client.getString("contact_person"),"", var); - } catch (Exception ignore) { - logger.info("add Mail List Failed email:" + client.getString("contact_email") + " client_moniker:" + client.getString("client_moniker")); - } - return result; - } - - @Override - public JSONObject updateClientOfMailList(JSONObject newClient, JSONObject oldClient) { - JSONObject result = null; - try { - JSONObject var = new JSONObject(); - var.put("client_moniker", newClient.getString("client_moniker")); - var.put("short_name", newClient.getString("short_name")); - result = mailGunClient.updateClientOfMailList(newClient.getString("contact_email"), mailListDefault, newClient.getString("contact_person"), - oldClient.getString("contact_email"), var); - } catch (Exception ignore) { - logger.info("Modify Mail List Failed oldEmail:" + oldClient.getString("contact_email") + " client_moniker:" + newClient.getString("client_moniker") - + " newEmail:" + newClient.getString("contact_email")); - } - return result; - } - - @Override - public JSONObject sendEmail(String notice_id, String title, Set mailTo, String content) throws URISyntaxException, IOException { - List tags = new ArrayList<>(); - tags.add("notice"); - Document doc = Jsoup.parse(content); - Elements links = doc.select("a[href]"); - List files = new ArrayList<>(); - for (Element link : links) { - String linkHref = link.attr("href"); - String linkText = link.text(); - Element e = link.previousElementSibling(); - if (e != null && "img".equalsIgnoreCase(e.tagName())) { - e.remove(); - } - if (linkHref.contains("mailto")) { - continue; - } - JSONObject file = new JSONObject(); - file.put("name", linkText); - file.put("byteArr", attachmentClient.getFileByUrl(linkHref)); - files.add(file); - } - - SendMail sendMail = new SendMail(); - sendMail.setFrom("info@mail.royalpay.com.au"); - sendMail.setTitle(title); - sendMail.setContent(doc.outerHtml()); - sendMail.setNotice_id(notice_id); - sendMail.setMailTos(mailTo); - sendMail.setAttachFiles(files); - sendMail.setTags(tags); - return mailGunClient.sendMail(sendMail); - } - - @Override - public void removeMailList(JSONObject client) { - - mailGunClient.removeClientOfMailList(client.getString("contact_email"),mailListDefault); - } - - public Map getQueryMap(String query) { - String[] params = query.split("&"); - Map map = new HashMap<>(); - for (String param : params) { - String[] tmpArr = param.split("="); - if (tmpArr.length < 2) { - continue; - } - map.put(tmpArr[0], tmpArr[1]); - } - return map; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java deleted file mode 100644 index 20c8dbdce..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package au.com.royalpay.payment.manage.system.core.impl; - -import au.com.royalpay.payment.manage.mappers.system.SysPermissionClientModulesMapper; -import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService; -import au.com.royalpay.payment.manage.system.core.SystemPackageCacheSupport; -import au.com.royalpay.payment.manage.system.core.beans.PermissionClientModuleLog; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import au.com.royalpay.payment.tools.utils.id.IdUtil; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import javax.annotation.Resource; - -/** - * @author kira - * @date 2018/7/4 - */ -@Service -public class PermissionClientModulesServiceImpl implements PermissionClientModulesService { - - @Resource - private SysPermissionClientModulesMapper permissionClientModulesMapper; - - @Resource - private MongoTemplate mongoTemplate; - @Resource - private SystemPackageCacheSupport systemPackageCacheSupport; - - - @Override - public void save(JSONObject record) { - record.put("id",IdUtil.getId()); - permissionClientModulesMapper.save(record); - } - - @Override - @Cacheable(value = ":system:client_permission:", key = "#clientId+''") - public List listValidByClientId(int clientId) { - return permissionClientModulesMapper.listValidByClientId(clientId); - } - - @Override - @Cacheable(value = ":system:client_permission:", key = "#clientMoniker") - public List listByClientMoniker(String clientMoniker) { - return permissionClientModulesMapper.listByClientMoniker(clientMoniker); - } - - - @Override - public void switchValid(Long id, boolean isValid, JSONObject account) { - JSONObject record = permissionClientModulesMapper.find(id); - if (record == null) { - throw new NotFoundException("Permission Client Module Not Found id:" + id); - } - JSONObject updateRecord = new JSONObject(); - updateRecord.put("is_valid", isValid); - saveMongoLog(account,record,updateRecord,(isValid?"打开":"关闭")+"模块 id:"+record.getString("module_id")); - updateRecord.put("id", record.getLong("id")); - permissionClientModulesMapper.update(updateRecord); - systemPackageCacheSupport.clearClientPermission(record.getString("client_moniker")); - systemPackageCacheSupport.clearClientPermission(record.getIntValue("client_id")); - - } - - @Override - public void removeByClientMoniker(String clientMoniker) { - permissionClientModulesMapper.deleteByClientMoniker(clientMoniker); - } - - private void saveMongoLog(JSONObject account, JSONObject oldRecord, JSONObject modifyData, String business) { - try { - modifyData.remove("id"); - PermissionClientModuleLog mongoRecord = new PermissionClientModuleLog(); - mongoRecord.setBusiness(business); - mongoRecord.setClientId(oldRecord.getIntValue("client_id")); - mongoRecord.setClientMoniker(oldRecord.getString("client_moniker")); - mongoRecord.setCreateTime(new Date()); - mongoRecord.setId(IdUtil.getId()); - mongoRecord.setUserId(account.getString("manager_id")); - mongoRecord.setUserName(account.getString("display_name")); - mongoRecord.setNewData(modifyData.toJSONString()); - Map beforeModify = modifyData.keySet().stream().collect(Collectors.toMap(key -> key, oldRecord::get)); - mongoRecord.setOriginData(JSON.toJSONString(beforeModify)); - mongoTemplate.insert(mongoRecord); - }catch (Exception ignore){ - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/TradeSecureServiceHanyinImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/TradeSecureServiceHanyinImpl.java deleted file mode 100644 index 1ddf13f51..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/TradeSecureServiceHanyinImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -package au.com.royalpay.payment.manage.system.core.impl; - -import au.com.royalpay.payment.core.exceptions.ChannelNetworkException; -import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.system.core.TradeSecureService; -import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import com.alibaba.fastjson.JSONObject; -import com.jcraft.jsch.*; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.vfs2.FileSystemOptions; -import org.apache.commons.vfs2.provider.sftp.SftpClientFactory; -import org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.Date; -import java.util.List; -import java.util.Vector; - -/** - * Create by yixian at 2019-01-08 3:26 - */ -@Service -public class TradeSecureServiceHanyinImpl implements TradeSecureService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Value("${app.hanyin-secure.pid:ROYALPAY}") - private String pid; - @Value("${app.hanyin-secure.sftp-host}") - private String sftpHost; - @Value("${app.hanyin-secure.sftp-port}") - private int sftpPort; - @Value("${app.hanyin-secure.sftp-username}") - private String sftpUsername; - @Value("${app.hanyin-secure.sftp-pwd}") - private String sftpPwd; - @Value("${app.securepay.sftp.username:securepay}") - private String securePaySftpName; - @Value("${app.securepay.sftp.password:k0uShtrmUvZ9}") - private String securePaySftpPwd; - @Resource - private TransactionMapper transactionMapper; - @Resource - private ClientAnalysisMapper clientAnalysisMapper; - @Resource - private SysConfigManager sysConfigManager; - @Resource - private TradeLogService tradeLogService; - - @Override - public void uploadSecureReportYesterday() { - if (!sysConfigManager.getSysConfig().getBooleanValue("enable_hanyin_uploading")) { - return; - } - logger.debug("start uploading secure report"); - uploadSecureReport(DateTime.now().plusDays(-1).withMillisOfDay(0).toDate()); - } - - @Override - public void uploadSecureReport(Date date) { - TradeSecureFile file = getSecureReportFile(date); - sftpUpload(file); - } - - @Override - public void manualDownloadHanyinSecureReport(Date date, boolean upload, HttpServletResponse resp) { - TradeSecureFile file = getSecureReportFile(date); - if (upload) { - sftpUpload(file); - } - if (!upload && resp != null) { - file.writeToHttp(resp); - } - } - - private void sftpUpload(TradeSecureFile file) { - Session session = null; - ChannelSftp command = null; - try { - session = initSFTPConnection(); - Channel channel = session.openChannel("sftp"); - channel.connect(); - command = (ChannelSftp) channel; - String dateString = file.getTransDate().toString("yyyyMMdd"); - Vector folders = command.ls("/royalpay"); - String dir = "/royalpay/" + dateString; - if (folders.parallelStream().noneMatch(entry -> entry.getFilename().endsWith(dateString))) { - logger.debug("mk dir:{}", dir); - command.mkdir(dir); - } - String dest = dir + "/" + file.filename(); - byte[] content = file.content(); - logger.debug("find dir, start uploading file:{}(length:{})", dest, content.length); - command.put(new ByteArrayInputStream(content), dest); - logger.debug("uploading file finished:{}", dest); - } catch (IOException | JSchException | SftpException e) { - throw new ChannelNetworkException("Upload Secure file failed", e); - } finally { - if (command != null && command.isConnected()) { - command.exit(); - session.disconnect(); - } - } - } - - private Session initSFTPConnection() throws IOException { - FileSystemOptions fso = new FileSystemOptions(); - SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no"); - return SftpClientFactory.createConnection(sftpHost, sftpPort, - sftpUsername.toCharArray(), sftpPwd.toCharArray(), fso); - } - - @Override - public TradeSecureFile getSecureReportFile(Date date) { - TradeSecureFile file = new TradeSecureFile(pid, date); - Date from = file.getFromTime(); - Date to = file.getToTime(); - List credits = transactionMapper.listCreditTransactionsForSecure(from, to); - file.addTransactions(credits); - List debits = transactionMapper.listDebitTransactionsForSecure(from, to); - file.addTransactions(debits); - return file; - } - - @Override - public void sendSecurePaySettleFile(String dateStr) { - List scpayMchs = clientAnalysisMapper.listSecurePayMchs(); - scpayMchs.forEach(mch -> { - TradeLogQuery query = new TradeLogQuery(); - query.setDatefrom(dateStr); - query.setDateto(dateStr); - byte[] fileData = tradeLogService.exportPDFSettlement(query, mch); - String fileName = dateStr + "-SETTLEMENT-" + RandomStringUtils.random(9, true, true).toUpperCase() + "-" - + mch.getString("client_moniker") + ".pdf"; - sendSftpFile(dateStr, fileName, fileData); - }); - - } - - @Override - public void sendSecurePayInvoiceFile(String begin, String end) { - List scpayMchs = clientAnalysisMapper.listSecurePayMchs(); - scpayMchs.forEach(mch -> { - TradeLogQuery query = new TradeLogQuery(); - query.setDatefrom(begin); - query.setDateto(end); - query.setClearing_status(-1); - byte[] fileData = new byte[0]; - try { - fileData = tradeLogService.exportTransFlowForSecurePay(query, mch); - } catch (Exception e) { - e.printStackTrace(); - } - String fileName = StringUtils.substring(begin, 0, 6) + "-INVOICE-" + RandomStringUtils.random(9, true, true).toUpperCase() + "-" - + mch.getString("client_moniker") + ".pdf"; - sendSftpFile(begin, fileName, fileData); - - }); - - } - - private void sendSftpFile(String dateStr, String fileName, byte[] data) { - Session session = null; - ChannelSftp command = null; - try { - session = initSFTPConnection(securePaySftpName, securePaySftpPwd); - Channel channel = session.openChannel("sftp"); - channel.connect(); - command = (ChannelSftp) channel; - try { - command.mkdir(StringUtils.substring(dateStr, 0, 6)); - } catch (SftpException e) { - logger.error("failed to create dir:{}---{}", fileName, e.getMessage(), e); - } - try { - command.put(new ByteArrayInputStream(data), StringUtils.substring(dateStr, 0, 6) + "/" + fileName); - logger.info("File send success!{}", fileName); - } catch (SftpException e) { - logger.error("failed to upload file:{}", fileName, e); - } - } catch (IOException | JSchException e) { - throw new ChannelNetworkException("Send Settlement file failed", e); - } finally { - if (command != null && command.isConnected()) { - command.exit(); - session.disconnect(); - } - } - } - - private Session initSFTPConnection(String sftpUsername, String sftpPassword) throws IOException { - FileSystemOptions fso = new FileSystemOptions(); - SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no"); - return SftpClientFactory.createConnection("sftp.royalpay.com.au", 2022, - sftpUsername.toCharArray(), sftpPassword.toCharArray(), fso); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/package-info.java b/src/main/java/au/com/royalpay/payment/manage/system/package-info.java deleted file mode 100644 index 158177406..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package au.com.royalpay.payment.manage.system; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/system/web/MailCallBackController.java b/src/main/java/au/com/royalpay/payment/manage/system/web/MailCallBackController.java deleted file mode 100644 index d064c9d68..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/web/MailCallBackController.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.system.web; - -import au.com.royalpay.payment.manage.system.core.MailGunService; -import org.springframework.http.HttpEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@RestController -@RequestMapping(value = "/mailgun") -public class MailCallBackController { - - @Resource - private MailGunService mailService; - - @PostMapping("/callback") - public void dealSuccessNptify(HttpEntity content) throws Exception { - mailService.dealNotify(content.getBody()); - } - - - @PostMapping("/callback/dropped") - public void contractList(HttpServletRequest req, HttpServletResponse res) throws Exception { - mailService.dealDroppedNotify(req.getParameterMap()); - } - -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/system/web/MailController.java b/src/main/java/au/com/royalpay/payment/manage/system/web/MailController.java deleted file mode 100644 index aff69f059..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/web/MailController.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.system.web; - -import au.com.royalpay.payment.manage.notice.core.MailService; - -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import com.alibaba.fastjson.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * @author kira - * @date 2018/6/12 - */ -@RestController -@RequestMapping("/sys/mail") -public class MailController { - - @Resource - private MailService mailService; - - @RequestMapping(value = "/unsub/{id}",method = RequestMethod.DELETE) -// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public void removeSub(@PathVariable Long id) { - mailService.removeUnsub(id); - } - - @RequestMapping(value = "/unsub/{client_moniker}",method = RequestMethod.PUT) -// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public void removeSub(@PathVariable String client_moniker) { - mailService.addUnsub(client_moniker); - } - - @RequestMapping(value = "/unsub/query",method = RequestMethod.GET) -// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT}) - public JSONObject list(@RequestParam(required = false) String client_moniker,@RequestParam(required = false) String address,@RequestParam(required = false,defaultValue = "10") int limit ,@RequestParam(required = false,defaultValue = "1") int page) { - JSONObject params = new JSONObject(); - if(StringUtils.isNotEmpty(client_moniker)){ - params.put("client_moniker",client_moniker); - } - if(StringUtils.isNotEmpty(address)){ - params.put("address",address); - } - return mailService.queryUnsubPageable(params,limit,page); - } -} 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 deleted file mode 100644 index 375111ff9..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java +++ /dev/null @@ -1,49 +0,0 @@ -package au.com.royalpay.payment.manage.system.web; - -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport; -import au.com.royalpay.payment.manage.system.core.ClientContractService; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -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 javax.annotation.Resource; - -@RestController -@RequestMapping(value = "/manage/common/analysis") -public class contractController { - @Resource - private ClientContractService clientContractService; - @Resource - private ManualSettleSupport manualSettleSupport; - - @ManagerMapping(value = "/contract/list", method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject contractList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int limit,@RequestParam(required = false) String client_moniker) { - JSONObject params = new JSONObject(); - params.put("client_moniker",client_moniker); - return clientContractService.list(params,new PageBounds(page,limit)); - } - - @ManagerMapping(value = "/contract", method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject contractAnalysis() { - return clientContractService.analysis(); - } - - @ManagerMapping(value = "/manualSettle/list", method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject manualList(@RequestParam(defaultValue = "1") int page) { - return manualSettleSupport.listWithClearInfo(page); - } - - @ManagerMapping(value = "/manualSettle/analysis", method = RequestMethod.GET) - @ReadOnlyConnection - public JSONObject manualSettleAnalysis() { - return manualSettleSupport.getWithManualSettleAnalysis(); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/BillOrderCheckTask.java b/src/main/java/au/com/royalpay/payment/manage/task/BillOrderCheckTask.java deleted file mode 100644 index cb07a741b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/BillOrderCheckTask.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; - -import java.util.List; - -import javax.annotation.Resource; - -/** - * Created by wangning on 2018/1/2. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class BillOrderCheckTask { - @Resource - private BillOrderMapper billOrderMapper; - - @Resource - private OrderMapper orderMapper; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0/3 * * * ?") - public void checkBillOrderCheck() { - synchronizedScheduler.executeProcess("manage_task:checkBillOrderCheck", 120_000, () -> { - List orderIds = billOrderMapper.findOrderIdByStatus("0"); - if (CollectionUtils.isEmpty(orderIds)) { - return; - } - for (String p : orderIds) { - if (p == null) { - continue; - } - JSONObject order = orderMapper.find(p); - int status = order.getIntValue("status"); - if (status == 3 || status == 1) { - billOrderMapper.updateStatusByOrderId(p, "2"); - } - if (status == 5) { - billOrderMapper.updateStatusByOrderId(p, "1"); - } - } - }); - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java b/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java deleted file mode 100644 index 7a4cb84a7..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.application.core.SimpleClientService; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 12/03/2017. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class CheckPartnerAuthStatusAndSendMessageTask { - @Resource - private SimpleClientService simpleClientService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - // @Scheduled(cron = "0 0 9 * * ?") -// public void checkAuthAndSendMessage(){ -// simpleClientService.checkAuthAndSendMessage(); -// } - @Scheduled(cron = "0 0 9 * * ?") - public void checkPartnerAuthStatusAndSendMessage() { - synchronizedScheduler.executeProcess("manage_task:checkPartnerAuthStatusAndSendMessage", 120_000, () -> simpleClientService.checkGreenChannelClients()); - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/CustomerImpressionTask.java b/src/main/java/au/com/royalpay/payment/manage/task/CustomerImpressionTask.java deleted file mode 100644 index f4b7c7e74..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/CustomerImpressionTask.java +++ /dev/null @@ -1,63 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import com.alibaba.fastjson.JSONObject; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 12/03/2017. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class CustomerImpressionTask { - @Resource - private ClientMapper clientMapper; - @Resource - private CustomerImpressionService customerImpressionService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - private ThreadPoolExecutor generatePool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - - @Scheduled(cron = "0 30 3 * * ?") - public void customerImpressionGenerateTags() { - synchronizedScheduler.executeProcess("manage_task:customerImpressionGenerateTags", 120_000, () -> { - List clients = clientMapper.listValidClient(); - List> splitList = new ArrayList<>(); - for (int i = 0; i < clients.size(); i += 200) { - if (i + 200 > clients.size()) { - splitList.add(clients.subList(i, clients.size())); - } else { - splitList.add(clients.subList(i, i + 200)); - } - - } - for (List splitClients : splitList) { - Runnable task = () -> splitClients.forEach((p) -> { -// System.out.println("当前执行到" + p.getIntValue("client_id")); - customerImpressionService.generateTag(p.getIntValue("client_id")); - }); - generatePool.execute(task); - } - }); - } - -// @Scheduled(cron = "0/1 * * * * ?") -// public void customerImpressionGenerateInfo() { -// synchronizedScheduler.executeProcess("manage_task:CustomerImpression", 1_000, () -> customerImpressionService.generateInfo()); -// } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DBSaleAnalysisTask.java b/src/main/java/au/com/royalpay/payment/manage/task/DBSaleAnalysisTask.java deleted file mode 100644 index 8ce4fd026..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/DBSaleAnalysisTask.java +++ /dev/null @@ -1,34 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.analysis.core.BDAnalysisService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.Date; - -/** - * Created by dulingling on 2019-08-14 - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class DBSaleAnalysisTask { - - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Resource - private BDAnalysisService bdAnalysisService; - - @Scheduled(cron = "0 0 1 * * ?") - public void dailyReportAutoGenerateReport() { - synchronizedScheduler.executeProcess("manage_task:dailyDBSaleReportAutoGenerateReport", 120_000, () -> { - Date yesterday = DateUtils.addDays(new Date(), -1); - bdAnalysisService.generateReport(DateFormatUtils.format(yesterday, "yyyy-MM-dd")); - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java b/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java deleted file mode 100644 index 2c4359451..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java +++ /dev/null @@ -1,35 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.analysis.core.DailyReport; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-03-07. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class DailyReportGenerationTask { - - @Resource - private DailyReport dailyReport; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 9 * * ?") - public void dailyReportAutoGenerateReport() { - synchronizedScheduler.executeProcess("manage_task:dailyReportAutoGenerateReport", 120_000, () -> { - Date yesterday = DateUtils.addDays(new Date(), -1); - dailyReport.generateReport(DateFormatUtils.format(yesterday, "yyyy-MM-dd"), true); - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java deleted file mode 100644 index a89e3e032..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.analysis.core.DashboardService; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-11-14. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class DashboardTaskManager { - @Resource - private DashboardService dashboardService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 30 1 * * ?") - public void analysisDashboard() { - synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000, - () -> dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new Date(), -1))); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DirectedBillCodeStatusDailyCheck.java b/src/main/java/au/com/royalpay/payment/manage/task/DirectedBillCodeStatusDailyCheck.java deleted file mode 100644 index 872b28a8d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/DirectedBillCodeStatusDailyCheck.java +++ /dev/null @@ -1,27 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by yuan on 2018/5/4. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class DirectedBillCodeStatusDailyCheck { - @Resource - private PartnerBillService partnerBillService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 30 5 * * ?") - public void directedBillCodeStatusDailyCheck() { - synchronizedScheduler.executeProcess("manage_task:directedBillCodeStatusDailyCheck", 120_000, - () -> partnerBillService.dailyCheckDirectedBillCode()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/OfeiOrderCheckTask.java b/src/main/java/au/com/royalpay/payment/manage/task/OfeiOrderCheckTask.java deleted file mode 100644 index 8b633e4b6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/OfeiOrderCheckTask.java +++ /dev/null @@ -1,41 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper; -import au.com.royalpay.payment.manage.ofei.core.OfeiServer; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; - -import java.util.List; - -import javax.annotation.Resource; - -/** - * Created by wangning on 2018/1/2. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class OfeiOrderCheckTask { - @Resource - private OfeiServer ofeiServer; - @Resource - private TopUpOrderMapper topUpOrderMapper; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0/20 * * * ?") - public void ofeiOrderCheck() { - synchronizedScheduler.executeProcess("manage_task:ofeiOrderCheck", 120_000, () -> { - List orderIds = topUpOrderMapper.findOrderIdByStatus("10"); - if (CollectionUtils.isEmpty(orderIds)) { - return; - } - for (String orderId : orderIds) { - ofeiServer.checkOrder(orderId); - } - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/OrderIpAnalysisTask.java b/src/main/java/au/com/royalpay/payment/manage/task/OrderIpAnalysisTask.java deleted file mode 100644 index aae5981af..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/OrderIpAnalysisTask.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.datav.core.DatavService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class OrderIpAnalysisTask { - @Resource - private DatavService datavService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 */1 * * ?") - public void ipAnalysis() { - synchronizedScheduler.executeProcess("datav_task:ip_analysis", 300_000, () -> { - datavService.transactionLoc(); - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/OrgCommissionTask.java b/src/main/java/au/com/royalpay/payment/manage/task/OrgCommissionTask.java deleted file mode 100644 index dce6c199a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/OrgCommissionTask.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerPrizeService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.Calendar; -import java.util.Date; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class OrgCommissionTask { - - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private CityPartnerPrizeService cityPartnerPrizeService; - - @Scheduled(cron = "0 15 0 1 * ?") - public void generateOrgCommission() { - synchronizedScheduler.executeProcess("manage_task:cityPartnerPrize", 120_000, () -> { - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(new Date()); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH); - if (month == 0) { - year = year - 1; - month = 12; - } - String monthStr = year + "-" + month; - cityPartnerPrizeService.generate(monthStr); - }); - } -} - - diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PartnerInitEmailChecker.java b/src/main/java/au/com/royalpay/payment/manage/task/PartnerInitEmailChecker.java deleted file mode 100644 index b1f1e31cc..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/PartnerInitEmailChecker.java +++ /dev/null @@ -1,32 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2017-02-22. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class PartnerInitEmailChecker { - - @Resource - private ClientManager clientManager; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0/5 * * * *") - public void checkPartnerInitEmail() { - if (PlatformEnvironment.getEnv().taskEnabled()) { - synchronizedScheduler.executeProcess("manage_task:checkPartnerInitEmail", 120_000, - () -> clientManager.checkEmailStatus()); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java deleted file mode 100644 index 9caf1046e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-11-14. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class PartnerTransactionsDailyMsgTaskManager { - @Resource - private CustomersAnalysisService customersAnalysisService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 8 * * ?") - public void partnerTransactionsDailyMsg() { - synchronizedScheduler.executeProcess("manage_task:partnerTransactionsDailyMsg", 120_000, - () -> customersAnalysisService.sendPartnerTransactionDaily(DateUtils.addDays(new Date(), -1))); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java deleted file mode 100644 index 83f1f664d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java +++ /dev/null @@ -1,92 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.*; -import java.util.stream.Collectors; - -/** - * Created by wangning on 2018/1/2. - */ -@Component -//@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class PostponeClientTask { - - Logger logger = LoggerFactory.getLogger(PostponeClientTask.class); - @Resource - private ClientRateMapper clientRateMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private ClientManager clientManager; - @Resource - private ManagerMapper managerMapper; - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private PaymentApi paymentApi; - - @Scheduled(cron = "0 30 6 * * ?") - public void postponeMerchantRate() { - synchronizedScheduler.executeProcess("manage_task:postponeMerchantRate", 120_000, () -> { - String nextYearExipryDate = DateFormatUtils.format(DateUtils.addYears(new Date(), 1), "yyyy-MM-dd"); - List expiryRateMerchantsChannels = clientRateMapper.getAllClientRateExpiryMerchants(); - Map expiryRateMerchants = expiryRateMerchantsChannels.stream().filter(m -> isActiveChannel(m.getString("rate_name"))) - .collect(HashMap::new, this::addMerchant, (map1, map2) -> map2.forEach((moniker, mch) -> addMerchant(map1, mch))); - sendComplianceNotify(expiryRateMerchants.values().stream() - .filter(m -> clientManager.postponeClientRate(m.getIntValue("client_id"), m.getString("client_moniker"), nextYearExipryDate, m.getJSONArray("channels").toJavaList(String.class))) - .map(m -> m.getString("client_moniker")) - .distinct() - .collect(Collectors.joining("、")), nextYearExipryDate); - }); - } - - private void addMerchant(Map merchantsMap, JSONObject mch) { - if (merchantsMap.containsKey(mch.getString("client_moniker"))) { - merchantsMap.get(mch.getString("client_moniker")).getJSONArray("channels").add(mch.getString("rate_name")); - } else { - List channels = new ArrayList<>(); - channels.add(mch.getString("rate_name")); - mch.put("channels", channels); - merchantsMap.put(mch.getString("client_moniker"), mch); - } - } - - private boolean isActiveChannel(String channel) { - return "CB_BankPay".equalsIgnoreCase(channel) || paymentApi.channelsStream().anyMatch(api -> api.channel().equalsIgnoreCase(channel)); - } - - - private void sendComplianceNotify(String merchantsStr, String newExpireDate) { - List compliance = managerMapper.listOpenIdsOfCompliances(); - compliance.forEach(p -> { - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(p); - TemplateMessage notice = initComplianceMessage(merchantsStr, newExpireDate, p, api.getTemplateId("client-postpone")); - api.sendTemplateMessage(notice); - }); - } - - private TemplateMessage initComplianceMessage(String clients, String newExpiryDate, String wechatOpenid, String templateId) { - TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null); - notice.put("first", "以下商户据合同费率已经自动延期1年", "#ff0000"); - notice.put("keyword1", clients, "#ff0000"); - notice.put("keyword2", newExpiryDate, "#0000ff"); - notice.put("remark", " ", "#000000"); - return notice; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java deleted file mode 100644 index f42cfa782..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.redpack.core.ActRedPackService; -import au.com.royalpay.payment.manage.redpack.core.RedpackService; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 01/02/2017. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class RedPackTaskManager { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private RedpackService redpackService; - @Resource - private ActRedPackService actRedPackService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0/10 * * * ?") - public void updateRedPackStatus() { - synchronizedScheduler.executeProcess("manage_task:updateRedpackStatus", 120_000, () -> redpackService.updateRedPacketsStatus("3")); - } - -// @Scheduled(cron = "0 0/10 * * * ?") - public void updateAlipayRedPackStatus() { - synchronizedScheduler.executeProcess("manage_task:updateAlipayRedpackStatus", 120_000, () -> redpackService.updateAlipayRedPacketsStatus("3")); - } - - - @Scheduled(cron = "0 0/3 * * * *") - public void resendFailedRedpack() { - logger.info("auto resend Redpack Task Fired!"); - synchronizedScheduler.executeProcess("manage_task:resendFailedRedpack", 120_000, () -> actRedPackService.resendFailed()); - logger.info("auto resend Redpack Task End!"); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SecurePayInvoiceFileTask.java b/src/main/java/au/com/royalpay/payment/manage/task/SecurePayInvoiceFileTask.java deleted file mode 100644 index 0e52a13f6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SecurePayInvoiceFileTask.java +++ /dev/null @@ -1,39 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.system.core.TradeSecureService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.Calendar; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SecurePayInvoiceFileTask { - - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private TradeSecureService tradeSecureService; - - @Scheduled(cron = "0 30 3 1 * *") - public void sendSecurePaySettleFile() { - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - //获取前一个月第一天 - Calendar calendar1 = Calendar.getInstance(); - calendar1.add(Calendar.MONTH, -1); - calendar1.set(Calendar.DAY_OF_MONTH,1); - String firstDay = sdf.format(calendar1.getTime()); - //获取前一个月最后一天 - Calendar calendar2 = Calendar.getInstance(); - calendar2.set(Calendar.DAY_OF_MONTH, 0); - String lastDay = sdf.format(calendar2.getTime()); - - synchronizedScheduler.executeProcess("task:securepay_invoice_file_sending", 60_000, () -> - tradeSecureService.sendSecurePayInvoiceFile(firstDay,lastDay) - ); - } -} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SecurePaySettleFileTask.java b/src/main/java/au/com/royalpay/payment/manage/task/SecurePaySettleFileTask.java deleted file mode 100644 index 09d43d79d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SecurePaySettleFileTask.java +++ /dev/null @@ -1,29 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.system.core.TradeSecureService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.Date; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SecurePaySettleFileTask { - - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private TradeSecureService tradeSecureService; - - @Scheduled(cron = "0 0 3 * * *") - public void sendSecurePaySettleFile() { - synchronizedScheduler.executeProcess("task:securepay_settle_file_sending", 60_000, () -> - tradeSecureService.sendSecurePaySettleFile(DateFormatUtils.format(DateUtils.addDays(new Date(), -1), "yyyyMMdd")) - ); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SecureTask.java b/src/main/java/au/com/royalpay/payment/manage/task/SecureTask.java deleted file mode 100644 index b54a6c2ed..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SecureTask.java +++ /dev/null @@ -1,26 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.system.core.TradeSecureService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Create by yixian at 2019-01-08 3:13 - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SecureTask { - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private TradeSecureService tradeSecureService; - - @Scheduled(cron = "0 0 3 * * *") - public void pushSecureFile(){ - synchronizedScheduler.executeProcess("task:secure_file_uploading",600_000,()->tradeSecureService.uploadSecureReportYesterday()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SendUnreadMsgWechatTask.java b/src/main/java/au/com/royalpay/payment/manage/task/SendUnreadMsgWechatTask.java deleted file mode 100644 index 38df5d256..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SendUnreadMsgWechatTask.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.openim.core.CustomerServiceService; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by wangning on 2018/1/2. - * 发送客服未读消息提醒 - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SendUnreadMsgWechatTask { - @Resource - private CustomerServiceService customerServiceService; - -// @Scheduled(cron = "0 0/10 * * * ?") -// public void ofeiOrderCheck() { -// customerServiceService.sendUnreadWxMsg(); -// } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java b/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java deleted file mode 100644 index 802553c7e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService; -import au.com.royalpay.payment.manage.analysis.core.PlatformClearService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/7/5. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SettleEstimateTaskManger { - @Resource - private EstimateAnalysisService estimateAnalysisService; - - @Resource - private PlatformClearService platformClearService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - // 3:15 am at every work days - @Scheduled(cron = "0 20 3 * * ?") - public void generateSettleAmount() { - synchronizedScheduler.executeProcess("manage_task:genSettleAmount", 120_000, () -> estimateAnalysisService.generateSettleAmount()); - } - - // 2:15 every day - @Scheduled(cron = "0 0 3 * * ?") - public void generateTransactionAmount() { - synchronizedScheduler.executeProcess("manage_task:genTransAmount", 120_000, () -> estimateAnalysisService.generateTransactionData()); - } - - @Scheduled(cron = "0 0 13 * * ?") - public void generateSettleLogs() { - synchronizedScheduler.executeProcess("manage_task:genSettleLog", 120_000, () -> platformClearService.generateSettleLogs()); - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SubMerchantIdTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/SubMerchantIdTaskManager.java deleted file mode 100644 index e6dd275cb..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SubMerchantIdTaskManager.java +++ /dev/null @@ -1,23 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SubMerchantIdTaskManager { - @Resource - private MerchantIdManageService merchantIdManageService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 4 * * ?") - public void analysisDashboard() { - synchronizedScheduler.executeProcess("manage_task:checkSubMchId", 120_000, () -> merchantIdManageService.generateClientsSunMerchantId()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SurchargeAccountMonthTask.java b/src/main/java/au/com/royalpay/payment/manage/task/SurchargeAccountMonthTask.java deleted file mode 100644 index 8aae9f9a2..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/SurchargeAccountMonthTask.java +++ /dev/null @@ -1,24 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class SurchargeAccountMonthTask { - @Resource - private SynchronizedScheduler synchronizedScheduler; - @Resource - private SurchargeAccountService surchargeAccountService; - - @Scheduled(cron = "0 0 10 1 * ?") - public void generateSurchargeAccountDetail() { - synchronizedScheduler.executeProcess("manage_task:generateSurchargeAccountMonth", 120_000, () -> - surchargeAccountService.generatorMonthDetail()); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java b/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java deleted file mode 100644 index 99c111b91..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.env.mappers.SysConfigMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class UpdatePartnerPasswordTask { - @Resource - private ClientManager clientManager; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 9 28 * ?") - public void resetPartnerPassword() { - synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 300_000, () -> { - clientManager.updateAllPartnerPassword("PINE"); - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/WeekReportGenerationTask.java b/src/main/java/au/com/royalpay/payment/manage/task/WeekReportGenerationTask.java deleted file mode 100644 index 24595f9e1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/WeekReportGenerationTask.java +++ /dev/null @@ -1,36 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.analysis.core.WeekReporter; - -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; - -import javax.annotation.Resource; - -/** - * Created by wangning on 24/01/2018. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class WeekReportGenerationTask { - - @Resource - private WeekReporter weekReporter; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 2 * * 1") - public void weekReportGeneration() { - synchronizedScheduler.executeProcess("manage_task:weekReportGeneration", 120_000, () -> { - Date lastweek = new Date(); - lastweek = DateUtils.addDays(lastweek, -7); - weekReporter.generateReport(DateFormatUtils.format(lastweek, "yyyy-MM-dd"), true); - }); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java b/src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java deleted file mode 100644 index 43e2e3df3..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java +++ /dev/null @@ -1,33 +0,0 @@ -package au.com.royalpay.payment.manage.task; - -import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; -import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Created by wangning on 2018/1/2. - */ -@Component -@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") -public class initClientLocationTask { - @Resource - private MerchantLocationService merchantLocationService; - @Resource - private SynchronizedScheduler synchronizedScheduler; - - @Scheduled(cron = "0 0 5 * * *") - public void checkBillOrderCheck() { - synchronizedScheduler.executeProcess("manage_task:initClientLocation", 120_000, () -> { - try { - merchantLocationService.initClientLocations(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - }); - - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/ClearingLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/ClearingLogQuery.java deleted file mode 100644 index 042e9b9d8..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/ClearingLogQuery.java +++ /dev/null @@ -1,96 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Created by yishuqian on 04/11/2016. - */ -public class ClearingLogQuery { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private String clientMoniker; - private String begin; - private String end; - private int page = 1; - private int limit = 20; - private String org_id; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - if (begin != null) { - try { - params.put("from", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("to", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - if (clientMoniker != null && !clientMoniker.isEmpty()){ - params.put("client_moniker",clientMoniker); - } - if (org_id != null){ - params.put("org_id",org_id); - } - return params; - } - - - public String getClientMoniker() { - return clientMoniker; - } - - public void setClientMoniker(String clientMoniker) { - this.clientMoniker = clientMoniker; - } - - public String getbegin() { - return begin; - } - - public void setbegin(String begin) { - this.begin = begin; - } - - public String getend() { - return end; - } - - public void setend(String end) { - this.end = end; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/PreRefundQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/PreRefundQueryBean.java deleted file mode 100644 index 8da3790ac..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/PreRefundQueryBean.java +++ /dev/null @@ -1,112 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.beans; - -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateUtils; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Created by wangning on 2017/9/6. - */ -public class PreRefundQueryBean { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private String begin; - private String end; - private String client_id; - private int page = 1; - private int limit = 10; - private String customer_id; - private String type; - private String client_moniker; - - public JSONObject toParams() { - JSONObject params = new JSONObject(); - - if (begin != null) { - try { - params.put("begin", format.parse(begin)); - } catch (ParseException e) { - throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); - } - } - if (end != null) { - try { - params.put("end", DateUtils.addDays(format.parse(end), 1)); - } catch (ParseException e) { - throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); - } - } - params.put("client_id", client_id); - params.put("customer_id", customer_id); - params.put("type", type); - params.put("client_moniker",client_moniker); - return params; - } - - public String getBegin() { - return begin; - } - - public void setBegin(String begin) { - this.begin = begin; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public String getClient_id() { - return client_id; - } - - public void setClient_id(String client_id) { - this.client_id = client_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getCustomer_id() { - return customer_id; - } - - public void setCustomer_id(String customer_id) { - this.customer_id = customer_id; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getClient_moniker() { - return client_moniker; - } - - public void setClient_moniker(String client_moniker) { - this.client_moniker = client_moniker; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java deleted file mode 100644 index 936b2f5b6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java +++ /dev/null @@ -1,267 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.beans; - -import au.com.royalpay.payment.core.beans.OrderStatus; -import au.com.royalpay.payment.core.beans.PayChannelSearch; -import au.com.royalpay.payment.tools.defines.TradeType; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.TimeZone; - -/** - * Created by yixian on 2016-07-04. - */ -public class TradeLogQuery { - private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); - private int page = 1; - private int limit = 20; - private String textType; - private String searchText; - private String datefrom; - private String dateto; - private int[] gateway; - private String source = "ALL" ; - private OrderStatus status = OrderStatus.PAID; - private PayChannelSearch channel = PayChannelSearch.ALL; - private String[] client_ids; - private String dev_id; - private int clearing_status; - private int trans_type; - private boolean onlyGroup = false; - private int group_bd; - private String org_id; - private String org_id2; - private boolean onlyIncrementAmount = false; - - public Integer getGatewayChild() { - return gatewayChild; - } - - public void setGatewayChild(Integer gatewayChild) { - this.gatewayChild = gatewayChild; - } - - private Integer gatewayChild; - - public JSONObject toParams(String timezone) { - JSONObject params = new JSONObject(); - if (datefrom != null) { - DateTime fromDate = DateTime.parse(datefrom, DateTimeFormat.forPattern("yyyyMMdd")) - .withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone) ? timezone : "Australia/Melbourne"))).withZone(DateTimeZone.getDefault()); - params.put("from", fromDate.toDate()); - } - if (dateto != null) { - DateTime toDate = DateTime.parse(dateto, DateTimeFormat.forPattern("yyyyMMdd")).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone) ? timezone : "Australia/Melbourne"))).plusDays(1).withZone(DateTimeZone.getDefault()); - params.put("to", toDate.toDate()); - } - - if (StringUtils.isNotBlank(searchText)) { - params.put("search_text", searchText); - if (StringUtils.isNotBlank(textType)) { - params.put("text_type", textType); - } else { - params.put("text_type", "all"); - } - } - if (gateway != null && gateway.length > 0) { - List tradeTypes = new ArrayList<>(); - for (int typeCode : gateway) { - TradeType type = TradeType.fromGatewayNumber(typeCode); - if (type != null) { - tradeTypes.add(type.getGateway()); - } - } - if (!tradeTypes.isEmpty()) { - params.put("trade_type", tradeTypes); - } - } - if (client_ids != null) { - params.put("client_ids", client_ids); - } - - params.put("source", source); - params.put("status", status.getStatus()); - params.put("channel", channel.getChannels()); - - if (clearing_status != -1) { - params.put("clearing_status", clearing_status); - } - if (trans_type != 0) { - params.put("trans_type", trans_type); - } - if (getDev_id() != null) { - params.put("dev_id", getDev_id()); - } - if (org_id != null && !org_id.equals("ALL")) { - params.put("org_id", org_id); - } - - if (StringUtils.isNotEmpty(org_id2)) { - params.put("org_id2", org_id2); - } - if (onlyIncrementAmount) { - params.put("onlyIncrementAmount", "1"); - } - return params; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getTextType() { - return textType; - } - - public void setTextType(String textType) { - this.textType = textType; - } - - public String getSearchText() { - return searchText; - } - - public void setSearchText(String searchText) { - this.searchText = searchText; - } - - public String getDatefrom() { - return datefrom; - } - - public void setDatefrom(String datefrom) { - this.datefrom = datefrom; - } - - public String getDateto() { - return dateto; - } - - public void setDateto(String dateto) { - this.dateto = dateto; - } - - public int[] getGateway() { - return gateway; - } - - public void setGateway(int[] gateway) { - this.gateway = gateway; - } - - public OrderStatus getStatus() { - return status; - } - - public void setStatus(OrderStatus status) { - this.status = status; - } - - public String[] getClient_ids() { - return client_ids; - } - - public void setClient_ids(String[] client_ids) { - this.client_ids = client_ids; - } - - public void setClearing_status(int clearing_status) { - this.clearing_status = clearing_status; - } - - public void setTrans_type(int trans_type) { - this.trans_type = trans_type; - } - - public String getDev_id() { - return dev_id; - } - - public void setDev_id(String dev_id) { - this.dev_id = dev_id; - } - - public boolean isOnlyGroup() { - return onlyGroup; - } - - public void setOnlyGroup(boolean onlyGroup) { - this.onlyGroup = onlyGroup; - } - - public int getGroup_bd() { - return group_bd; - } - - public void setGroup_bd(int group_bd) { - this.group_bd = group_bd; - } - - - public int getClearing_status() { - return clearing_status; - } - - public int getTrans_type() { - return trans_type; - } - - public PayChannelSearch getChannel() { - return channel; - } - - public void setChannel(PayChannelSearch channel) { - this.channel = channel; - } - - public String getOrg_id() { - return org_id; - } - - public void setOrg_id(String org_id) { - this.org_id = org_id; - } - - public String getorg_id2() { - return org_id2; - } - - public void setorg_id2(String org_id2) { - this.org_id2 = org_id2; - } - - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public boolean isOnlyIncrementAmount() { - return onlyIncrementAmount; - } - - public void setOnlyIncrementAmount(boolean onlyIncrementAmount) { - this.onlyIncrementAmount = onlyIncrementAmount; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/enums/AlipayPlusChannelEnum.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/enums/AlipayPlusChannelEnum.java deleted file mode 100644 index 0a8756086..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/enums/AlipayPlusChannelEnum.java +++ /dev/null @@ -1,322 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.beans.enums; - -public enum AlipayPlusChannelEnum { - ALIPAY_CN { - @Override - public int code() { - return 0; - } - - @Override - public String value() { - return "alipay_cn"; - } - - @Override - public String description() { - return "ALIPAY_CN"; - } - }, - ALIPAY_SG { - @Override - public int code() { - return 1; - } - - @Override - public String value() { - return "alipay_ac_sg"; - } - - @Override - public String description() { - return "ALIPAY_SG"; - } - }, - ALIPAY_MO { - @Override - public int code() { - return 2; - } - - @Override - public String value() { - return "alipay_ac_mo"; - } - - @Override - public String description() { - return "ALIPAY_MO"; - } - }, - ALIPAY_HK { - @Override - public int code() { - return 3; - } - - @Override - public String value() { - return "alipay_ac_hk"; - } - - @Override - public String description() { - return "ALIPAY_HK"; - } - }, - ALIPAY_LU { - @Override - public int code() { - return 4; - } - - @Override - public String value() { - return "alipay_ac_lu"; - } - - @Override - public String description() { - return "ALIPAY_LU"; - } - }, - ALIPAY_GB { - @Override - public int code() { - return 5; - } - - @Override - public String value() { - return "alipay_ac_gb"; - } - - @Override - public String description() { - return "ALIPAY_GB"; - } - }, - ALIPAY_US { - @Override - public int code() { - return 6; - } - - @Override - public String value() { - return "alipay_ac_us"; - } - - @Override - public String description() { - return "ALIPAY_US"; - } - }, - PAYTM { - @Override - public int code() { - return 7; - } - - @Override - public String value() { - return "paytm"; - } - - @Override - public String description() { - return "PAYTM"; - } - }, - KAKAOPAY { - @Override - public int code() { - return 8; - } - - @Override - public String value() { - return "kakaopay"; - } - - @Override - public String description() { - return "KAKAOPAY"; - } - }, - TRUEMONEY { - @Override - public int code() { - return 9; - } - - @Override - public String value() { - return "truemoney"; - } - - @Override - public String description() { - return "TRUEMONEY"; - } - }, - EZLINK { - @Override - public int code() { - return 10; - } - - @Override - public String value() { - return "ezlink"; - } - - @Override - public String description() { - return "EZLINK"; - } - }, - GCASH { - @Override - public int code() { - return 11; - } - - @Override - public String value() { - return "gcash"; - } - - @Override - public String description() { - return "GCASH"; - } - }, - TNG { - @Override - public int code() { - return 12; - } - - @Override - public String value() { - return "tng"; - } - - @Override - public String description() { - return "TNG"; - } - }, - DANA { - @Override - public int code() { - return 13; - } - - @Override - public String value() { - return "dana"; - } - - @Override - public String description() { - return "DANA"; - } - }, - EASYPAISA { - @Override - public int code() { - return 14; - } - - @Override - public String value() { - return "easy_paisa"; - } - - @Override - public String description() { - return "EASYPAISA"; - } - }, - BKASH { - @Override - public int code() { - return 15; - } - - @Override - public String value() { - return "bkash"; - } - - @Override - public String description() { - return "BKASH"; - } - }, - LAZADAWALLET { - @Override - public int code() { - return 16; - } - - @Override - public String value() { - return "lazada_wallet_my"; - } - - @Override - public String description() { - return "LAZADAWALLET"; - } - }, - UNKNOWN { - @Override - public int code() { - return -1; - } - - @Override - public String value() { - return "unknown"; - } - - @Override - public String description() { - return "AlipayPlus"; - } - }; - - /** - * 获取代码。 - * - * @return 代码 - */ - public abstract int code(); - - /** - * 获取代码对应的值。 - * - * @return 代码值 - */ - public abstract String value(); - - /** - * 获取代码对应的描述。 - * - * @return 代码值 - */ - public abstract String description(); - - public static AlipayPlusChannelEnum statusOf(String value) { - for (AlipayPlusChannelEnum item : AlipayPlusChannelEnum.values()) { - if (item.value().equalsIgnoreCase(value)) { - return item; - } - } - return AlipayPlusChannelEnum.UNKNOWN; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/ReportConfigService.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/ReportConfigService.java deleted file mode 100644 index 0fab6a355..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/ReportConfigService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.core; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 11/11/2016. - */ -public interface ReportConfigService { - JSONObject getReportConfig(); - - JSONObject findOne(int pkid); - - void updateReportConfig(int pkid, JSONObject config); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java deleted file mode 100644 index ac4e6caae..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java +++ /dev/null @@ -1,80 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.core; - -import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import com.alibaba.fastjson.JSONObject; -import org.springframework.ui.Model; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yixian on 2016-07-02. - */ -public interface TradeLogService { - JSONObject listPartnerTradeLogs(JSONObject manager, JSONObject account, String clientMoniker, TradeLogQuery query, String timezone) throws Exception; - - JSONObject listPartnerIncrementalTradeLogs(JSONObject manager, JSONObject account, String clientMoniker, TradeLogQuery query, String timezone) throws Exception; - - JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager); - - JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager); - - JSONObject incrementalAnalysisOrders(TradeLogQuery query, JSONObject manager); - - List listOrderRefunds(String orderId, String timezone); - - void getOrderDetail(Model model, String clientMoniker, String orderId, String openid); - - void getRefundStatus(Model model, String clientMoniker, String refundId, String openid); - - JSONObject getOrderDetail(JSONObject manager, String clientMoniker, String orderId, String timezone); - - void updateOrderDetail(int client_id, JSONObject order) throws Exception; - - void releasePreAuthorization(String clientMoniker, String orderId); - - JSONObject listPartnerTransFlowPage(TradeLogQuery query, JSONObject partner) throws Exception; - - void exportTransFlow(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception; - - byte[] exportTransFlowForSecurePay(TradeLogQuery query, JSONObject client) throws Exception; - - ModelAndView exportTransFlow(TradeLogQuery query, JSONObject partner, Model model) throws Exception; - - void exportUpayTransFlow(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception; - - void exportTransFlowApi(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception; - - void exportExcel(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception; - - void exportExcelNew(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception; - - JSONObject listSettlementLog(TradeLogQuery query, JSONObject partner); - - void listSettlementLogExcel(TradeLogQuery query, JSONObject partner,HttpServletResponse response); - - Double getClientUnClearedAmount(JSONObject partner); - - void exportTransLog(TradeLogQuery query, JSONObject manager, HttpServletResponse httpResponse); - - void generateAustracData(String dateFrom, String dateTo); - - int getOrdersCount(JSONObject account); - - void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query)throws Exception; - - JSONObject listPreRefundClients(PreRefundQueryBean params, String preType); - - void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse response); - - void exportSettlementLogCSV(TradeLogQuery query, JSONObject partner, HttpServletResponse response); - - void exportPDFSettlement(TradeLogQuery query, JSONObject partner, HttpServletResponse response); - - byte[] exportPDFSettlement(TradeLogQuery query, JSONObject client); - - void exportExcelAllPartner(TradeLogQuery query, JSONObject partner, HttpServletResponse httpResponse) throws Exception; - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/ReportConfigServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/ReportConfigServiceImp.java deleted file mode 100644 index 47073eaa1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/ReportConfigServiceImp.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.core.impls; - -import au.com.royalpay.payment.manage.mappers.system.ReportConfigMapper; -import au.com.royalpay.payment.manage.tradelog.core.ReportConfigService; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created by yishuqian on 11/11/2016. - */ -@Service -public class ReportConfigServiceImp implements ReportConfigService { - @Resource - private ReportConfigMapper reportConfigMapper; - - @Override - public JSONObject getReportConfig(){ - List configs = reportConfigMapper.listReportConfig(); - if (!configs.isEmpty()) { - return configs.get(0); - } else { - return null; - } - } - @Override - public JSONObject findOne(int pkid){ - return reportConfigMapper.findOne(pkid); - } - @Override - public void updateReportConfig(int pkid, JSONObject config){ - JSONObject rep = reportConfigMapper.findOne(pkid); - Assert.notNull(rep); - config.put("pkid",pkid); - reportConfigMapper.update(config); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java deleted file mode 100644 index 086b071d6..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ /dev/null @@ -1,2305 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.core.impls; - -import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; -import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; -import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.TransactionService; -import au.com.royalpay.payment.core.beans.SettlementLog; -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.exceptions.OrderNotMatchException; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.AustracDataMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; -import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; -import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.organizations.core.OrgManager; -import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.defines.TradeType; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.lock.Locker; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import com.github.miemiedev.mybatis.paginator.domain.Paginator; -import net.sf.jasperreports.engine.JRDataSource; -import net.sf.jasperreports.engine.JasperFillManager; -import net.sf.jasperreports.engine.JasperPrint; -import net.sf.jasperreports.engine.JasperRunManager; -import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; -import net.sf.jasperreports.engine.export.JRXlsExporter; -import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter; -import net.sf.jasperreports.export.*; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.web.servlet.ModelAndView; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; -import org.xhtmlrenderer.pdf.ITextRenderer; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; - - -/** - * Created by yixian on 2016-07-02. - */ -@Service -public class TradeLogServiceImpl implements TradeLogService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private OrderMapper orderMapper; - @Resource - private RefundMapper refundMapper; - @Resource - private ClientAccountMapper clientAccountMapper; - @Resource - private ClientManager clientManager; - @Resource - private PaymentApi paymentApi; - @Resource - private ClearingDetailMapper clearingDetailMapper; - @Resource - private MpPaymentApi mpPaymentApi; - @Resource - private TransactionMapper transactionMapper; - @Resource - private TransactionService transactionService; - @Resource - private AustracDataMapper austracDataMapper; - @Resource - private CustomerMapper customerMapper; - @Resource - private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; - @Resource - private ClientIncrementalMapper clientIncrementalMapper; - @Resource - private ClientCustomersMapper clientCustomersMapper; - @Resource - private ClearingLogMapper clearingLogMapper; - @Resource - private OrgManager orgManager; - @Resource - private ClientMapper clientMapper; - - @Resource - private ClientDeviceMapper clientDeviceMapper; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private Locker locker; - - @Resource - private SpringTemplateEngine thymeleaf; - - // @Value("classpath:/jasper/trans_flow.jasper") -// @Value("classpath:/jasper/trans_flow_new.jasper") - @Value("classpath:/jasper/partner_invoice_gst.jasper") - private org.springframework.core.io.Resource trans_flow; - @Value("classpath:/jasper/incremental_partner_invoice_gst.jasper") - private org.springframework.core.io.Resource incremental_trans_flow; - @Value("classpath:/jasper/partner_upay_invoice_gst.jasper") - private org.springframework.core.io.Resource upay_trans_flow; - @Value("classpath:/jasper/incremental_partner_upay_invoice_gst.jasper") - private org.springframework.core.io.Resource incremental_upay_trans_flow; - @Value("classpath:/jasper/royalpay_logo.png") - private org.springframework.core.io.Resource logo; - @Value("classpath:/jasper/trans_excel.jasper") - private org.springframework.core.io.Resource trans_excel; - @Value("classpath:/jasper/austrac_report.jasper") - private org.springframework.core.io.Resource austrac_report; - @Value("classpath:/jasper/partner_settlement_detail.jasper") - private org.springframework.core.io.Resource partner_settlement_flow; - @Value("classpath:/jasper/securepay_logo.png") - private org.springframework.core.io.Resource securepay_logo; - @Value("classpath:/jasper/securepay_settlement_detail.jasper") - private org.springframework.core.io.Resource securepay_settlement_flow; - - @Override - public JSONObject listPartnerTradeLogs(JSONObject manager, JSONObject account, String shortId, TradeLogQuery query, String timezone) throws Exception { - JSONObject client = clientManager.getClientInfoByMoniker(shortId); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject params = query.toParams(timezone); - clientManager.validateClients(client.getIntValue("client_id"), params); - params.put("client_id", client.getIntValue("client_id")); - clientManager.queryModifyClientIds(client.getIntValue("client_id"), params); - if (manager != null && manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (query.getGatewayChild() != null) { - params.put("trade_type", new ArrayList() {{ - add(query.getGatewayChild()); - }}); - } - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - PageList logs = orderMapper.listOrdersByClients(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - logs.stream().forEach(log->{ - log.put("is_today",DateUtils.isSameDay(Optional.ofNullable(log.getDate("transaction_time")).orElse(new Date()),new Date())) ; - }); - if (timezone != null) { - TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time"); - } - JSONObject result = PageListUtils.buildPageListResult(logs); - JSONObject analysis = orderMapper.analysisOrders(params); - result.put("analysis", analysis); - return result; - } - - @Override - public JSONObject listPartnerIncrementalTradeLogs(JSONObject manager, JSONObject account, String shortId, TradeLogQuery query, String timezone) throws Exception { - JSONObject client = clientManager.getClientInfoByMoniker(shortId); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject params = query.toParams(timezone); - clientManager.validateClients(client.getIntValue("client_id"), params); - params.put("client_id", client.getIntValue("client_id")); - if (manager != null && manager.getInteger("org_id") != null) { - params.put("org_id", manager.getIntValue("org_id")); - } - if (query.getGatewayChild() != null) { - params.put("trade_type", new ArrayList() {{ - add(query.getGatewayChild()); - }}); - } - JSONArray clientIds = clientManager.getAllClientIds(client.getIntValue("client_id")); - logger.info("====>clientIds:{}",clientIds.size()); - if (clientIds.size() > 1) { - String[] arr = new String[clientIds.size()]; - params.put("client_ids", clientIds.toArray(arr)); - } - PageList logs = orderMapper.listIncrementalOrdersByClients(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - if (timezone != null) { - TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time"); - } - JSONObject result = PageListUtils.buildPageListResult(logs); - JSONObject analysis = orderMapper.analysisOrders(params); - result.put("analysis", analysis); - return result; - } - - - @Override - public JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(null); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - if (query.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.remove("bd_user"); - params.put("bd_group", manager.getString("manager_id")); - if (query.getGroup_bd() > 0) { - params.put("bd_group_bd", query.getGroup_bd()); - } - } - orgManager.checkOrgIds(manager, params); - if (query.getGatewayChild() != null) { - params.put("trade_type", new ArrayList() {{ - add(query.getGatewayChild()); - }}); - } - PageList logs = orderMapper.listOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - JSONObject analysis = orderMapper.analysisOrders(params); - result.put("analysis", analysis); - return result; - } - - @Override - public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(null); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - orgManager.checkOrgIds(manager, params); - if (query.getGatewayChild() != null) { - params.put("trade_type", new ArrayList() {{ - add(query.getGatewayChild()); - }}); - } - PageList logs = orderMapper.listIncrementalOrdersNew(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - logs.stream().forEach(log->{ - JSONObject client= clientManager.getClientInfo(log.getInteger("client_id")); - if(client!=null){ - log.put("short_name",client.getString("short_name")); - log.put("client_moniker",client.getString("client_moniker")); - }; - }); - JSONObject result = PageListUtils.buildPageListResult(logs); -// JSONObject analysis = orderMapper.analysisOrders(params); -// result.put("analysis", analysis); - return result; - } - @Override - public JSONObject incrementalAnalysisOrders(TradeLogQuery query, JSONObject manager) { - JSONObject params = query.toParams(null); - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) { - params.put("bd_user", manager.getString("manager_id")); - } - orgManager.checkOrgIds(manager, params); - if (query.getGatewayChild() != null) { - params.put("trade_type", new ArrayList() {{ - add(query.getGatewayChild()); - }}); - } - JSONObject result = new JSONObject(); - JSONObject analysis = orderMapper.analysisOrders(params); - result.put("analysis", analysis); - return result; - } - - - @Override - public List listOrderRefunds(String orderId, String timezone) { - List refunds = refundMapper.listOrderRefunds(orderId, new PageBounds(Order.formString("create_time.desc"))); - if (timezone != null) { - TimeZoneUtils.switchTimeZone(refunds, timezone, "audittime", "create_time", "confirm_time"); - } - return refunds; - } - - @Override - public void getOrderDetail(Model model, String clientMoniker, String orderId, String openid) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject account = clientAccountMapper.findByOpenId(openid); - JSONObject order = orderDetail(orderId, client); - // if (PlatformEnvironment.getEnvironment().isDebug() || (isClientStaff(client, account)) || - // StringUtils.equals(openid, order.getString("customer_id")) - // ) { - model.addAttribute("client", client); - - String timezone = client.getString("timezone"); - formatOrderTime(order, timezone, "create_time"); - formatOrderTime(order, timezone, "confirm_time"); - formatOrderTime(order, timezone, "transaction_time"); - order.put("order_detail", StringEscapeUtils.escapeHtml4(order.getString("order_detail"))); - model.addAttribute("order", order); - - JSONObject customer = paymentApi.getCustomerInfo(order.getString("channel"), order.getString("customer_id")); - if (customer != null) { - model.addAttribute("customer", customer); - } - // } else { - // throw new ForbiddenException("Invalid Wechat Visitor"); - // } - - } - - @Override - public void getRefundStatus(Model model, String clientMoniker, String refundId, String openid) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject account = clientAccountMapper.findByOpenId(openid); - JSONObject refund = refundDetail(client.getIntValue("client_id"), refundId); - JSONObject order = orderDetail(refund.getString("order_id"), client); - // if (PlatformEnvironment.getEnvironment().isDebug() || isClientStaff(client, account) || - // StringUtils.equals(openid, order.getString("customer_id"))) { - model.addAttribute("client", client); - model.addAttribute("refund", refund); - String timezone = client.getString("timezone"); - formatOrderTime(order, timezone, "create_time"); - formatOrderTime(order, timezone, "confirm_time"); - formatOrderTime(order, timezone, "transaction_time"); - model.addAttribute("order", order); - // } else { - // throw new ForbiddenException("Invalid Wechat Visitor"); - // } - - } - - private boolean isClientStaff(JSONObject client, JSONObject account) { - return account != null && (account.getIntValue("client_id") == client.getIntValue("client_id") - || client.getIntValue("parent_client_id") == account.getIntValue("client_id")); - } - - private JSONObject refundDetail(int clientId, String refundId) { - JSONObject refund = refundMapper.findByOutRefundId(refundId); - if (refund == null) { - throw new BadRequestException("order not exists"); - } - if (refund.getIntValue("client_id") != clientId) { - throw new OrderNotMatchException(); - } - String statusStr = ""; - switch (refund.getIntValue("status")) { - case 0: - statusStr = "Waiting Confirm"; - break; - case 1: - statusStr = "Submit Failed"; - break; - case 2: - statusStr = "Submit Success"; - break; - case 3: - statusStr = "Refund Failed"; - break; - case 4: - statusStr = "Refund Success"; - break; - case 5: - statusStr = "Change"; - break; - } - refund.put("status_str", statusStr); - return refund; - } - - private void formatOrderTime(JSONObject order, String timezone, String key) { - if (order.get(key) != null) { - order.put(key, TimeZoneUtils.formatTime(order.getDate(key), TimeZoneUtils.PATTERN_FULL, timezone)); - } - } - - private JSONObject orderDetail(String orderId, JSONObject client) { - JSONObject order = orderMapper.getOrderDetail(orderId); - if (order == null) { - throw new BadRequestException("order not exists"); - } - JSONObject customer = customerMapper.findCustomerByOpenId(order.getString("customer_id")); - if (customer != null) { - order.put("headimg", customer.getString("headimg")); - order.put("nickname", customer.getString("nickname")); - } - - JSONObject customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); - if (customerAlipay != null) { - order.put("headimg", customerAlipay.getString("headimg")); - order.put("nickname", customerAlipay.getString("nickname")); - } - JSONObject client_customers = clientCustomersMapper.getClientCustomer(order.getInteger("client_id"), order.getString("customer_id")); - if (null != client_customers) { - order.put("name_remark", client_customers.getString("name_remak")); - } - int orderClientId = order.getIntValue("client_id"); - JSONObject orderClient = clientManager.getClientInfo(orderClientId); - if (orderClientId != client.getIntValue("client_id") && orderClient.getIntValue("parent_client_id") != client.getIntValue("client_id")) { - throw new OrderNotMatchException(); - } - order.remove("sub_merchant_id"); - - List orderTransaction = transactionMapper.findTransactionsBySysGen(orderId); - order.put("coupons", orderTransaction); - - String statusStr = ""; - switch (order.getIntValue("status")) { - case 0: - statusStr = "Creating"; - break; - case 1: - statusStr = "Create Failed"; - break; - case 2: - statusStr = "Waiting Payment"; - break; - case 3: - statusStr = "Closed"; - break; - case 4: - statusStr = "Payment Failed"; - break; - case 5: - statusStr = "Payment Success"; - break; - case 6: - statusStr = "Partial Refund"; - break; - case 7: - statusStr = "Full Refund"; - break; - } - order.put("status_str", statusStr); - if (StringUtils.equalsIgnoreCase("rpaypmt_card", order.getString("channel")) - || StringUtils.equalsIgnoreCase("rpaypmt_dd", order.getString("channel"))) { - JSONObject extParams = JSON.parseObject(order.getString("ext_params")); - if (extParams != null) { - order.putAll(extParams); - } - } - return order; - } - - @Override - public JSONObject getOrderDetail(JSONObject manager, String clientMoniker, String orderId, String timezone) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - checkOrgPermission(manager, client); - JSONObject clientObj = new JSONObject(); - putValues(clientObj, client, "client_moniker", "short_name", "client_id"); - JSONObject order = orderDetail(orderId, client); - order.put("client", clientObj); - List refundLogs = refundMapper.listOrderRefunds(orderId, new PageBounds(Order.formString("create_time.desc"))); - if (timezone != null) { - TimeZoneUtils.switchTimeZone(refundLogs, timezone, "audittime", "create_time", "confirm_time"); - TimeZoneUtils.switchTimeZone(order, timezone, "create_time", "confirm_time", "transaction_time"); - } - - JSONObject customer = new JSONObject(); - if (order.getString("customer_id") != null) { - if (order.getString("customer_id").startsWith("olH")) { - customer = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id")); - } else { - customer = customerMapper.findCustomerByOpenId(order.getString("customer_id")); - } - if (customer != null && !customer.isEmpty()) { - order.put("headimg", customer.getString("headimg")); - order.put("nickname", customer.getString("nickname")); - } - } - - JSONObject customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); - if (customerAlipay != null) { - order.put("headimg", customerAlipay.getString("headimg")); - order.put("nickname", customerAlipay.getString("nickname")); - } - order.put("refund_logs", refundLogs); - return order; - } - - @Override - public void updateOrderDetail(int client_id, JSONObject order) throws Exception { - String order_id = order.getString("order_id"); - String order_detail = order.getString("order_detail"); - JSONObject orderLog = orderMapper.find(order_id); - if (client_id != orderLog.getIntValue("client_id")) { - throw new Exception("Partner Error"); - } - String name_remark = order.getString("name_remark"); - if (null != name_remark) { - JSONObject obj = new JSONObject(); - obj.put("client_id", orderLog.getInteger("client_id")); - obj.put("customer_id", orderLog.getString("customer_id")); - obj.put("name_remak", name_remark); - obj.put("channel", order.getString("channel")); - obj.put("update_time", new Date()); - JSONObject client_coustom = clientCustomersMapper.getClientCustomer(orderLog.getInteger("client_id"), orderLog.getString("customer_id")); - if (null == client_coustom) { - clientCustomersMapper.insert(obj); - - } else { - clientCustomersMapper.update(obj); - } - } - JSONObject param = new JSONObject(); - param.put("order_id", order_id); - param.put("order_detail", order_detail); - - orderMapper.update(param); - } - - @Override - public void releasePreAuthorization(String clientMoniker, String orderId) { - transactionService.releasePreAuthorization(clientMoniker, orderId); - } - - @Override - public JSONObject listPartnerTransFlowPage(TradeLogQuery query, JSONObject partner) throws Exception { - int client_id = partner.getIntValue("client_id"); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); - clientManager.validateClients(client_id, params); - clientManager.queryModifyClientIds(client_id, params); - - params.put("client_id", client_id); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id")); - params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - List logs = transactionMapper.listTransFlow(params); - TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time"); - Paginator paginator = new Paginator(query.getPage(), query.getLimit(), logs.size()); - List pagedLogsList = logs.stream() - .sorted((log1, log2) -> log2.getDate("transaction_time").compareTo(log1.getDate("transaction_time"))) - .skip(paginator.getOffset()).limit(paginator.getLimit()) - .collect(Collectors.toList()); - PageList pagedLogs = new PageList<>(pagedLogsList, paginator); - JSONObject result = PageListUtils.buildPageListResult(pagedLogs); - JSONObject analysis = transactionMapper.analysisTransFlow(params); - if (analysis.containsKey("paid_fee") && analysis.containsKey("refund_fee")) { - analysis.put("actual_fee", analysis.getBigDecimal("paid_fee").add(analysis.getBigDecimal("refund_fee"))); - } - result.put("analysis", analysis); - return result; - } - - private JSONObject listPartnerTransFlow(TradeLogQuery query, JSONObject partner) throws Exception { - int clientId = partner.getIntValue("client_id"); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); - clientManager.validateClients(clientId, params); - params.put("client_id", clientId); - clientManager.queryModifyClientIds(clientId, params); - List logs = transactionMapper.listTransFlow(params); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time")); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy", Collections.singletonList("clearing_time")); - - final JSONObject analysis = analysisTransLogs(logs); - - JSONObject result = new JSONObject(); - result.put("data", logs); - analysis.put("balance", transactionMapper.analysisBalance(params)); - if (analysis.containsKey("paid_fee") && analysis.containsKey("refund_fee")) { - analysis.put("actual_fee", analysis.getBigDecimal("paid_fee").add(analysis.getBigDecimal("refund_fee"))); - } - result.put("analysis", analysis); - return result; - } - - private JSONObject listPartnerTransFlowByExportPdf(TradeLogQuery query, JSONObject partner, String[] channels) throws Exception { - int clientId = partner.getIntValue("client_id"); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); -// params.put("channel", channels); - clientManager.validateClients(clientId, params); - params.put("client_id", clientId); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id")); - params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - params.put("channel", channels); - clientManager.queryModifyClientIds(clientId, params); - List logs = transactionMapper.listTransFlow(params); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time")); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy", Collections.singletonList("clearing_time")); - - final JSONObject analysis = analysisTransLogs(logs); - - JSONObject result = new JSONObject(); - result.put("data", logs); - analysis.put("balance", transactionMapper.analysisBalance(params)); - if (analysis.containsKey("paid_fee") && analysis.containsKey("refund_fee")) { - analysis.put("actual_fee", analysis.getBigDecimal("paid_fee").add(analysis.getBigDecimal("refund_fee"))); - } - result.put("analysis", analysis); - return result; - } - - private JSONObject listPartnerTransFlowByExportPdfSecurePay(TradeLogQuery query, JSONObject client, String[] channels) throws Exception { - int clientId = client.getIntValue("client_id"); - String timezone = client.getString("timezone"); - JSONObject params = query.toParams(timezone); -// params.put("channel", channels); - clientManager.validateClients(clientId, params); - params.put("client_id", clientId); - JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); - params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); - params.put("channel", channels); - clientManager.queryModifyClientIds(clientId, params); - List logs = transactionMapper.listTransFlow(params); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time")); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy", Collections.singletonList("clearing_time")); - - final JSONObject analysis = analysisTransLogs(logs); - - JSONObject result = new JSONObject(); - result.put("data", logs); - analysis.put("balance", transactionMapper.analysisBalance(params)); - if (analysis.containsKey("paid_fee") && analysis.containsKey("refund_fee")) { - analysis.put("actual_fee", analysis.getBigDecimal("paid_fee").add(analysis.getBigDecimal("refund_fee"))); - } - result.put("analysis", analysis); - return result; - } - - private JSONObject analysisTransLogs(List logs) { - final JSONObject analysis = new JSONObject(); - analysis.put("order_count", logs.size()); - analysis.put("display_amount", logs.parallelStream() - .filter(log -> log.getBigDecimal("display_amount") != null && !"CNY".equals(log.getString("currency"))) - .map(log -> log.getBigDecimal("display_amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("pre_display_amount", logs.parallelStream() - .filter(log -> log.getBigDecimal("display_amount") != null && !"CNY".equals(log.getString("currency")) && log.getBooleanValue("pre_authorization")) - .map(log -> log.getBigDecimal("display_amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("cny_display_amount", logs.parallelStream() - .filter(log -> log.getBigDecimal("display_amount") != null && "CNY".equals(log.getString("currency"))) - .map(log -> log.getBigDecimal("display_amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("pre_cny_display_amount", logs.parallelStream() - .filter(log -> log.getBigDecimal("display_amount") != null && "CNY".equals(log.getString("currency")) && log.getBooleanValue("pre_authorization")) - .map(log -> log.getBigDecimal("display_amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("paid_fee", logs.parallelStream() - .filter(log -> !log.getBooleanValue("system_generate") && "Credit".equals(log.getString("transaction_type")) && !"Settlement".equals(log.getString("channel"))) - .map(log -> log.getBigDecimal("clearing_amount")) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("refund_fee", logs.parallelStream() - .filter(log -> log.getString("refund_id") != null && !"Settlement".equals(log.getString("channel"))) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("clearing_amount"))).reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("pre_refund_fee", logs.parallelStream() - .filter(log -> log.getString("refund_id") != null && !"Settlement".equals(log.getString("channel")) && log.getBooleanValue("pre_authorization")) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("clearing_amount"))).reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - logs.parallelStream() - .filter(log -> "Settlement".equals(log.getString("channel")) && - log.getString("system_transaction_id").contains("MERCHANT")) - .filter(log -> transactionMapper.listTransactionsOfClearingOrder(log.getIntValue("clearing_order"), new PageBounds(1, 1)) - .stream().anyMatch(trans -> trans.getBigDecimal("settle_amount") == null)) - .forEach(settleLog -> { - JSONObject detail = clearingDetailMapper.findByDetailId(settleLog.getIntValue("clearing_order")); - settleLog.put("settle_amount", detail.getBigDecimal("clearing_amount")); - settleLog.put("total_surcharge", detail.getBigDecimal("total_charge")); - settleLog.put("royal_surcharge", detail.getBigDecimal("royalpay_charge")); - settleLog.put("channel_surcharge", detail.getBigDecimal("wechat_charge")); - }); - - analysis.put("total_settle_amount", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("settle_amount"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("total_royal_surcharge", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("royal_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("total_royalpay_fee", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("royal_surcharge") - .add(log.getBigDecimal("surcharge_cashback")) - .add(log.getBigDecimal("channel_surcharge")))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("total_incremental_surcharge", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("total_transaction_fee", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("transaction_fee"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("total_incremental_tax", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge").divide(new BigDecimal(10), 2, RoundingMode.HALF_UP))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("total_surcharge", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount")))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("tax_amount", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("tax_amount"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("wechat_fee", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .filter(log -> "WechatSettlement".contains(log.getString("channel"))) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("channel_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("alipay_fee", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .filter(log -> "Alipay".equals(log.getString("channel"))) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("channel_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - analysis.put("alipay_online_fee", logs.parallelStream() - .filter(log -> log.getBigDecimal("settle_amount") != null) - .filter(log -> "AlipayOnline".equals(log.getString("channel"))) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("channel_surcharge"))) - .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); - return analysis; - } - - private BigDecimal getSymbol(JSONObject log) { - if (!log.containsKey("transaction_fee") || StringUtils.isEmpty(log.getString("transaction_fee"))) { - log.put("transaction_fee", BigDecimal.ZERO); - } - return "Credit".equals(log.getString("transaction_type")) || "Settlement".equals(log.getString("channel")) ? BigDecimal.ONE : BigDecimal.valueOf(-1); - } - - // @Override -// public void exportTransFlow(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception { -// JSONObject transFlow = listPartnerTransFlow(query, partner); -// JSONObject analysis = transFlow.getJSONObject("analysis"); -// JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); -// if (!transFlow.getJSONArray("data").isEmpty()) { -// try { -// List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); -// JSONObject parmerters = new JSONObject(); -// parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) -// ? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : ""); -// parmerters.put("dateTo", -// StringUtils.isNotBlank(query.getDateto()) -// ? DateFormatUtils.format(DateUtils.parseDate(query.getDateto(), "yyyyMMdd"), "dd/MM/yyyy") -// : DateFormatUtils.format(new Date(), "dd/MM/yyyy")); -// parmerters.put("dateRange", (StringUtils.isNotBlank(parmerters.getString("dateFrom")) ? parmerters.getString("dateFrom") : "") + "~" -// + parmerters.getString("dateTo")); -// parmerters.put("partnerCode", client.getString("client_moniker")); -// parmerters.put("clientName", client.getString("company_name")); -// parmerters.put("clientAddress", client.getString("address")); -// parmerters.put("balance", analysis.getDoubleValue("balance")); -// parmerters.put("logo", logo.getInputStream()); -// parmerters.put("actual_fee", takeDecimalOrDefault(analysis, "actual_fee", BigDecimal.ZERO)); -// parmerters.put("totalSettledAmount", takeDecimalOrDefault(analysis, "total_settle_amount", BigDecimal.ZERO)); -// parmerters.put("royalpay_charge", takeDecimalOrDefault(analysis, "total_royal_surcharge", BigDecimal.ZERO)); -// parmerters.put("total_fee", takeDecimalOrDefault(analysis, "total_surcharge", BigDecimal.ZERO)); -// parmerters.put("alipay_fee", takeDecimalOrDefault(analysis, "alipay_fee", BigDecimal.ZERO)); -// parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); -// parmerters.put("bestpay_fee", takeDecimalOrDefault(analysis, "bestpay_fee", BigDecimal.ZERO)); -// parmerters.put("jd_fee", takeDecimalOrDefault(analysis, "jd_fee", BigDecimal.ZERO)); -// parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); -// parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); -// parmerters.put("royalpay_fee", takeDecimalOrDefault(analysis, "total_royalpay_fee", BigDecimal.ZERO)); -// parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); -// parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); -// parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2,RoundingMode.HALF_UP)); -// -// dataList.parallelStream().forEach(item -> { -// BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; -// BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; -// BigDecimal royalpaySurhcarge = item.containsKey("royal_surcharge") ? item.getBigDecimal("royal_surcharge") : BigDecimal.ZERO; -// BigDecimal surhcargeBack = item.containsKey("surcharge_cashback") ? item.getBigDecimal("surcharge_cashback") : BigDecimal.ZERO; -// BigDecimal channelSurcharge = item.containsKey("channel_surcharge") ? item.getBigDecimal("channel_surcharge") : BigDecimal.ZERO; -// BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); -// BigDecimal royalpayTax = taxAmount.subtract(incrementalTax); -// BigDecimal realRoyalpayCharge = royalpaySurhcarge -// .add(surhcargeBack) -// .add(channelSurcharge) -// .add(royalpayTax); -// item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); -// item.put("real_royalpay_surcharge", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP)); -// scaleDecimalVal(item, "display_amount", item.getString("currency")); -// String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); -// scaleDecimalVal(item, "clearing_amount", platformCurrency); -// scaleDecimalVal(item, "settle_amount", platformCurrency); -// scaleDecimalVal(item, "total_surcharge", platformCurrency); -// }); -// JRDataSource jrDataSource = new JRBeanCollectionDataSource(dataList); -// response.setContentType("application/pdf"); -// String fileName = client.getString("client_moniker") + "_" + parmerters.getString("dateRange").replaceAll("/", ""); -// response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); -// OutputStream outs = response.getOutputStream(); -// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); -// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream(); -// byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); -// outs.write(bytes, 0, bytes.length); -// outs.flush(); -// outs.close(); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// } -// } - @Override - public void exportTransFlow(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception { - logger.info("=======>exportTransFlow"); - JSONObject transFlow = listPartnerTransFlowByExportPdf(query, partner, new String[]{"Wechat", "Alipay", "AlipayOnline","ApsCashier","ApsInstore"}); - JSONObject analysis = transFlow.getJSONObject("analysis"); - JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); - Context ctx = new Context(); - JSONObject parmerters = new JSONObject(); - int recordsSize = transFlow.getJSONArray("data").isEmpty() ? 0 : transFlow.getJSONArray("data").size(); - parmerters.put("records", recordsSize); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : ""); - parmerters.put("dateTo", - StringUtils.isNotBlank(query.getDateto()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDateto(), "yyyyMMdd"), "dd/MM/yyyy") - : DateFormatUtils.format(new Date(), "dd/MM/yyyy")); - parmerters.put("dateRange", (StringUtils.isNotBlank(parmerters.getString("dateFrom")) ? parmerters.getString("dateFrom") : "") + " ~ " - + parmerters.getString("dateTo")); - parmerters.put("partnerCode", client.getString("client_moniker")); - parmerters.put("clientName", client.getString("company_name")); - parmerters.put("clientAddress", client.getString("address")); - parmerters.put("balance", analysis.getDoubleValue("balance")); - parmerters.put("logo", logo.getInputStream()); - parmerters.put("actual_fee", takeDecimalOrDefault(analysis, "actual_fee", BigDecimal.ZERO)); - parmerters.put("totalSettledAmount", takeDecimalOrDefault(analysis, "total_settle_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_charge", takeDecimalOrDefault(analysis, "total_royal_surcharge", BigDecimal.ZERO)); - parmerters.put("total_fee", takeDecimalOrDefault(analysis, "total_surcharge", BigDecimal.ZERO)); - parmerters.put("alipay_fee", takeDecimalOrDefault(analysis, "alipay_fee", BigDecimal.ZERO)); - parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); - parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); - parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_fee", takeDecimalOrDefault(analysis, "total_royalpay_fee", BigDecimal.ZERO)); - parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); - parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); - parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP)); - ctx.setVariable("parmerters", parmerters); - JSONObject orgInfo = orgManager.getOrgDetail(client.getIntValue("org_id"), null); - if (!orgInfo.containsKey("logo") || orgInfo.getIntValue("org_id") == 1) { - orgInfo.put("logo", "none"); - } - ctx.setVariable("orgInfo", orgInfo); - try { - OutputStream outs = response.getOutputStream(); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - List dataList = transTransform(transFlow); - ctx.setVariable("dataList", dataList); - final String html = thymeleaf.process("app/invoice.html", ctx); - response.setContentType("application/pdf"); - String fileName = client.getString("client_moniker") + "_Cross_Border_" + parmerters.getString("dateRange").replaceAll("/", ""); - response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); - ITextRenderer renderer = new ITextRenderer(); - //添加字体库end - renderer.setDocumentFromString(html); - renderer.layout(); - renderer.createPDF(os); - byte[] bytes = os.toByteArray(); - outs.write(bytes, 0, bytes.length); - outs.flush(); - renderer.finishPDF(); - } catch (Exception e) { - e.printStackTrace(); - } - - - } - - @Override - public byte[] exportTransFlowForSecurePay(TradeLogQuery query, JSONObject client) throws Exception { - JSONObject transFlow = listPartnerTransFlowByExportPdfSecurePay(query, client, new String[]{"Wechat", "Alipay", "AlipayOnline"}); - JSONObject analysis = transFlow.getJSONObject("analysis"); -// JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); - Context ctx = new Context(); - JSONObject parmerters = new JSONObject(); - int recordsSize = transFlow.getJSONArray("data").isEmpty() ? 0 : transFlow.getJSONArray("data").size(); - parmerters.put("records", recordsSize); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : ""); - parmerters.put("dateTo", - StringUtils.isNotBlank(query.getDateto()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDateto(), "yyyyMMdd"), "dd/MM/yyyy") - : DateFormatUtils.format(new Date(), "dd/MM/yyyy")); - parmerters.put("dateRange", (StringUtils.isNotBlank(parmerters.getString("dateFrom")) ? parmerters.getString("dateFrom") : "") + " ~ " - + parmerters.getString("dateTo")); - parmerters.put("partnerCode", client.getString("client_moniker")); - parmerters.put("clientName", client.getString("company_name")); - parmerters.put("clientAddress", client.getString("address")); - parmerters.put("balance", analysis.getDoubleValue("balance")); - parmerters.put("logo", logo.getInputStream()); - parmerters.put("actual_fee", takeDecimalOrDefault(analysis, "actual_fee", BigDecimal.ZERO)); - parmerters.put("totalSettledAmount", takeDecimalOrDefault(analysis, "total_settle_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_charge", takeDecimalOrDefault(analysis, "total_royal_surcharge", BigDecimal.ZERO)); - parmerters.put("total_fee", takeDecimalOrDefault(analysis, "total_surcharge", BigDecimal.ZERO)); - parmerters.put("alipay_fee", takeDecimalOrDefault(analysis, "alipay_fee", BigDecimal.ZERO)); - parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); - parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); - parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_fee", takeDecimalOrDefault(analysis, "total_royalpay_fee", BigDecimal.ZERO)); - parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); - parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); - parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP)); - ctx.setVariable("parmerters", parmerters); - JSONObject orgInfo = orgManager.getOrgDetail(client.getIntValue("org_id"), null); - if (!orgInfo.containsKey("logo") || orgInfo.getIntValue("org_id") == 1) { - orgInfo.put("logo", "none"); - } - ctx.setVariable("orgInfo", orgInfo); - try { - ByteArrayOutputStream os = new ByteArrayOutputStream(); - List dataList = transTransform(transFlow); - ctx.setVariable("dataList", dataList); - - final String html = thymeleaf.process("app/invoice.html", ctx); - ITextRenderer renderer = new ITextRenderer(); - //添加字体库end - renderer.setDocumentFromString(html); - renderer.layout(); - renderer.createPDF(os); - byte[] bytes = os.toByteArray(); - - renderer.finishPDF(); - os.close(); - return bytes; - - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - private List transTransform(JSONObject transFlow) { - List dataList; - if (!transFlow.getJSONArray("data").isEmpty()) { - dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); - dataList.parallelStream().forEach(item -> { - BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; - BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; - BigDecimal royalpaySurhcarge = item.containsKey("royal_surcharge") ? item.getBigDecimal("royal_surcharge") : BigDecimal.ZERO; - BigDecimal surhcargeBack = item.containsKey("surcharge_cashback") ? item.getBigDecimal("surcharge_cashback") : BigDecimal.ZERO; - BigDecimal channelSurcharge = item.containsKey("channel_surcharge") ? item.getBigDecimal("channel_surcharge") : BigDecimal.ZERO; - BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); - BigDecimal royalpayTax = taxAmount.subtract(incrementalTax); - BigDecimal realRoyalpayCharge = royalpaySurhcarge - .add(surhcargeBack) - .add(channelSurcharge) - .add(royalpayTax); - item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); - item.put("real_royalpay_surcharge", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP)); - scaleDecimalVal(item, "display_amount", item.getString("currency")); - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - scaleDecimalVal(item, "clearing_amount", platformCurrency); - scaleDecimalVal(item, "settle_amount", platformCurrency); - scaleDecimalVal(item, "total_surcharge", platformCurrency); - String debit = item.getString("transaction_type").equals("Debit") ? item.getBigDecimal("clearing_amount").toString() - : "-"; - String credit = item.getString("transaction_type").equals("Credit") ? item.getBigDecimal("clearing_amount").toString() - : "-"; - item.put("debit", debit); - item.put("credit", credit); - item.putIfAbsent("settle_amount", "-"); - }); - } else { - dataList = new ArrayList<>(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("transaction_time", "-"); - jsonObject.put("client_order_id", "-"); - jsonObject.put("order_id", "-"); - jsonObject.put("debit", "-"); - jsonObject.put("credit", "-"); - jsonObject.put("real_royalpay_surcharge", "-"); - jsonObject.put("incremental_surcharge", "-"); - jsonObject.put("settle_amount", "-"); - dataList.add(jsonObject); - } - return dataList; - } - - - @Override - public ModelAndView exportTransFlow(TradeLogQuery query, JSONObject partner, Model model) throws Exception { - logger.info("=======>exportTransFlow::"); - JSONObject transFlow = listPartnerTransFlowByExportPdf(query, partner, new String[]{"Wechat", "Alipay", "AlipayOnline","ApsCashier","ApsInstore"}); - JSONObject analysis = transFlow.getJSONObject("analysis"); - JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); - ModelAndView view = new ModelAndView("app/invoice.html"); - if (!transFlow.getJSONArray("data").isEmpty()) { - try { - List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); - JSONObject parmerters = new JSONObject(); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : ""); - parmerters.put("dateTo", - StringUtils.isNotBlank(query.getDateto()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDateto(), "yyyyMMdd"), "dd/MM/yyyy") - : DateFormatUtils.format(new Date(), "dd/MM/yyyy")); - parmerters.put("dateRange", (StringUtils.isNotBlank(parmerters.getString("dateFrom")) ? parmerters.getString("dateFrom") : "") + " ~ " - + parmerters.getString("dateTo")); - parmerters.put("partnerCode", client.getString("client_moniker")); - parmerters.put("clientName", client.getString("company_name")); - parmerters.put("clientAddress", client.getString("address")); - parmerters.put("balance", analysis.getDoubleValue("balance")); - parmerters.put("logo", logo.getInputStream()); - parmerters.put("actual_fee", takeDecimalOrDefault(analysis, "actual_fee", BigDecimal.ZERO)); - parmerters.put("totalSettledAmount", takeDecimalOrDefault(analysis, "total_settle_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_charge", takeDecimalOrDefault(analysis, "total_royal_surcharge", BigDecimal.ZERO)); - parmerters.put("total_fee", takeDecimalOrDefault(analysis, "total_surcharge", BigDecimal.ZERO)); - parmerters.put("alipay_fee", takeDecimalOrDefault(analysis, "alipay_fee", BigDecimal.ZERO)); - parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); - parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); - parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_fee", takeDecimalOrDefault(analysis, "total_royalpay_fee", BigDecimal.ZERO)); - parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); - parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); - parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP)); - - dataList.parallelStream().forEach(item -> { - BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; - BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; - BigDecimal royalpaySurhcarge = item.containsKey("royal_surcharge") ? item.getBigDecimal("royal_surcharge") : BigDecimal.ZERO; - BigDecimal surhcargeBack = item.containsKey("surcharge_cashback") ? item.getBigDecimal("surcharge_cashback") : BigDecimal.ZERO; - BigDecimal channelSurcharge = item.containsKey("channel_surcharge") ? item.getBigDecimal("channel_surcharge") : BigDecimal.ZERO; - BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); - BigDecimal royalpayTax = taxAmount.subtract(incrementalTax); - BigDecimal realRoyalpayCharge = royalpaySurhcarge - .add(surhcargeBack) - .add(channelSurcharge) - .add(royalpayTax); - item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); - item.put("real_royalpay_surcharge", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP)); - scaleDecimalVal(item, "display_amount", item.getString("currency")); - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - scaleDecimalVal(item, "clearing_amount", platformCurrency); - scaleDecimalVal(item, "settle_amount", platformCurrency); - scaleDecimalVal(item, "total_surcharge", platformCurrency); - String debit = item.getString("transaction_type").equals("Debit") ? item.getBigDecimal("clearing_amount").toString() - : "-"; - String credit = item.getString("transaction_type").equals("Credit") ? item.getBigDecimal("clearing_amount").toString() - : "-"; - item.put("debit", debit); - item.put("credit", credit); - item.putIfAbsent("settle_amount", "-"); - }); - view.addObject("parmerters", parmerters); - view.addObject("dataList", dataList); - JSONObject orgInfo = orgManager.getOrgDetail(client.getIntValue("org_id"), null); - if (!orgInfo.containsKey("logo") || orgInfo.getIntValue("org_id") == 1) { - orgInfo.put("logo", "none"); - } - view.addObject("orgInfo", orgInfo); - } catch (Exception e) { - e.printStackTrace(); - } - } - return view; - } - - @Override - public void exportUpayTransFlow(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws - Exception { - JSONObject transFlow = listPartnerTransFlowByExportPdf(query, partner, new String[]{"rpaypmt_card", "rpaypmt_dd"}); - JSONObject analysis = transFlow.getJSONObject("analysis"); - JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); - if (!transFlow.getJSONArray("data").isEmpty()) { - try { - List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); - JSONObject parmerters = new JSONObject(); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : ""); - parmerters.put("dateTo", - StringUtils.isNotBlank(query.getDateto()) - ? DateFormatUtils.format(DateUtils.parseDate(query.getDateto(), "yyyyMMdd"), "dd/MM/yyyy") - : DateFormatUtils.format(new Date(), "dd/MM/yyyy")); - parmerters.put("dateRange", (StringUtils.isNotBlank(parmerters.getString("dateFrom")) ? parmerters.getString("dateFrom") : "") + "~" - + parmerters.getString("dateTo")); - parmerters.put("partnerCode", client.getString("client_moniker")); - parmerters.put("clientName", client.getString("company_name")); - parmerters.put("clientAddress", client.getString("address")); - parmerters.put("balance", analysis.getDoubleValue("balance")); - parmerters.put("logo", logo.getInputStream()); - parmerters.put("actual_fee", takeDecimalOrDefault(analysis, "actual_fee", BigDecimal.ZERO)); - parmerters.put("totalSettledAmount", takeDecimalOrDefault(analysis, "total_settle_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_charge", takeDecimalOrDefault(analysis, "total_royal_surcharge", BigDecimal.ZERO)); - parmerters.put("total_fee", takeDecimalOrDefault(analysis, "total_surcharge", BigDecimal.ZERO)); - parmerters.put("alipay_fee", takeDecimalOrDefault(analysis, "alipay_fee", BigDecimal.ZERO)); - parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); - parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); - parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); - parmerters.put("royalpay_fee", takeDecimalOrDefault(analysis, "total_royalpay_fee", BigDecimal.ZERO)); - parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); - parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); - parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP)); - BigDecimal totalTransactionFee = analysis.getBigDecimal("total_transaction_fee").setScale(2, RoundingMode.HALF_UP); - BigDecimal totalRoyalpaySvcFee = analysis.getBigDecimal("total_surcharge") - .subtract(analysis.getBigDecimal("total_transaction_fee")) - .subtract(analysis.getBigDecimal("total_incremental_surcharge")) - .subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP); - parmerters.put("total_transaction_fee", totalTransactionFee); - parmerters.put("total_royalpay_fee", totalRoyalpaySvcFee); - parmerters.put("total_card_fee", totalRoyalpaySvcFee.add(totalTransactionFee)); - parmerters.put("total_incremental_fee", parmerters.getBigDecimal("incremental_fee").add(parmerters.getBigDecimal("incremental_gst"))); - dataList.parallelStream().forEach(item -> { - BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; - BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; - BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); - //增加transaction_fee为null异常 - if (!item.containsKey("transaction_fee") || StringUtils.isEmpty(item.getString("transaction_fee"))) { - item.put("transaction_fee", BigDecimal.ZERO); - } - BigDecimal transactionFee = item.getBigDecimal("transaction_fee"); - BigDecimal royalpaySvcFee = (item.containsKey("total_surcharge") ? item.getBigDecimal("total_surcharge") : BigDecimal.ZERO) - .add(taxAmount).subtract(incrementalSurcharge).subtract(incrementalTax).subtract(transactionFee); - item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); - item.put("total_surcharge_intax", royalpaySvcFee.setScale(2, RoundingMode.HALF_UP)); - item.put("transaction_fee_intax", transactionFee.setScale(2, RoundingMode.HALF_UP)); - scaleDecimalVal(item, "display_amount", item.getString("currency")); - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - scaleDecimalVal(item, "clearing_amount", platformCurrency); - scaleDecimalVal(item, "settle_amount", platformCurrency); - scaleDecimalVal(item, "total_surcharge", platformCurrency); - }); - JRDataSource jrDataSource = new JRBeanCollectionDataSource(dataList); - response.setContentType("application/pdf"); - String fileName = client.getString("client_moniker") + "_Card_Payment_" + parmerters.getString("dateRange").replaceAll("/", ""); - response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); - OutputStream outs = response.getOutputStream(); - JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); - InputStream jasper = clientIncrement == null ? upay_trans_flow.getInputStream() : incremental_upay_trans_flow.getInputStream(); - byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); - outs.write(bytes, 0, bytes.length); - outs.flush(); - outs.close(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - } - - @Override - public void exportTransFlowApi(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws - Exception { - query.setClearing_status(-1); - String clientKey = "exportTransFlow:" + partner.getString("client_id"); - - JSONObject client = clientManager.getClientInfoByMoniker(partner.getString("client_moniker")); - if (client == null) { - throw new InvalidShortIdException(); - } - partner.put("client_id", client.getIntValue("client_id")); - partner.put("client", client); - - long internal = 0; - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); - long start = formatter.parse(query.getDatefrom()).getTime(); - long end = formatter.parse(query.getDateto()).getTime(); - internal = (end - start) / (1000 * 60 * 60 * 24); - } catch (Exception e) { - throw new ServerErrorException("查询参数格式不正确"); - } - - if (internal > 90) { - throw new ServerErrorException("最大查询区间为90天,请确认查询区间"); - } - - try { - if (!locker.lock(clientKey, 300_000)) { - throw new ServerErrorException("其他Invoice正在生成中,请稍后再试"); - } - exportTransFlow(query, partner, response); - } finally { - locker.unlock(clientKey); - } - } - - - private void scaleDecimalVal(JSONObject obj, String key, String currency) { - BigDecimal decimal = obj.getBigDecimal(key); - if (decimal == null) { - return; - } - obj.put(key, CurrencyAmountUtils.scale(decimal, currency)); - } - - private BigDecimal takeDecimalOrDefault(JSONObject analysis, String key, BigDecimal defaultVal) { - BigDecimal decimal = analysis.containsKey(key) ? analysis.getBigDecimal(key) : defaultVal; - return CurrencyAmountUtils.scale(decimal, PlatformEnvironment.getEnv().getForeignCurrency()); - } - - @Override - public void exportExcel(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws - Exception { - logger.debug("excel The method======= exportExcel() start......................."); - JSONObject transFlow = listPartnerTransFlow(query, partner); - JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); - if (!transFlow.getJSONArray("data").isEmpty()) { - try { - List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); - String transType; - JSONObject device; - int status; - for (JSONObject data : dataList) { - transType = data.getString("trans_type"); - if (!"refund".equals(transType)) - continue; - status = data.getIntValue("status"); - if (status == 6) - transType = "Partly " + transType; - else if (status == 7) { - transType = "Fully " + transType; - } - data.put("trans_type", transType); - device = clientDeviceMapper.find(data.getString("order_dev_id")); - if (device != null) - data.put("dev_id", device.getString("client_dev_id")); - } - JSONObject parmerters = new JSONObject(); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) ? query.getDatefrom() : ""); - parmerters.put("dateTo", StringUtils.isNotBlank(query.getDateto()) ? query.getDateto() : DateFormatUtils.format(new Date(), "yyyyMMdd")); - parmerters.put("partnerCode", client.getString("client_moniker")); - // parmerters.put("actual_fee", analysis.containsKey("actual_fee") ? - JRDataSource jrDataSource = new JRBeanCollectionDataSource(dataList); - response.setContentType("application/vnd.ms-excel"); - String fileName = StringUtils.isEmpty(parmerters.getString("dateFrom")) ? parmerters.getString("dateTo") - : (parmerters.getString("dateFrom") + "~" + parmerters.getString("dateTo")); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx"); - OutputStream outputStream = response.getOutputStream(); - JasperPrint jasperPrint = JasperFillManager.fillReport(trans_excel.getInputStream(), parmerters, jrDataSource); - JRXlsxExporter exporter = new JRXlsxExporter(); - ExporterInput exporterInput = new SimpleExporterInput(jasperPrint); - exporter.setExporterInput(exporterInput); - OutputStreamExporterOutput exporterOutput = new SimpleOutputStreamExporterOutput(outputStream); - exporter.setExporterOutput(exporterOutput); - // 设置导出时参数 - SimpleXlsxReportConfiguration xlsReportConfiguration = new SimpleXlsxReportConfiguration(); - xlsReportConfiguration.setOnePagePerSheet(false); - xlsReportConfiguration.setRemoveEmptySpaceBetweenRows(true); - xlsReportConfiguration.setDetectCellType(true); - xlsReportConfiguration.setWhitePageBackground(false); - exporter.setConfiguration(xlsReportConfiguration); - exporter.exportReport(); - outputStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - } - - private void excelTrans(Row row, JSONObject data) { - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(data.getString("transaction_time")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(data.getString("client_order_id")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(data.getString("system_transaction_id")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(data.getString("client_moniker")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(data.getString("short_name")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_id")); - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(data.getString("channel")); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(data.getString("display_amount")); - row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(data.getString("transaction_amount")); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(data.getString("currency")); - row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_amount")); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(data.getString("settle_amount")); - row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(data.getString("total_surcharge")); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(StringUtils.defaultString(data.getString("incremental_surcharge"), "0.0000")); - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(data.getString("tax_amount")); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_time")); - row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type").equals("clearing") ? "-" : data.getBigDecimal("exchange_rate").toString()); - row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type")); - row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clear_status")); - row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(data.getString("gateway")); - row.createCell(20, Cell.CELL_TYPE_STRING).setCellValue(data.containsKey("order_detail") && !"".equals(data.getString("order_detail")) ? data.getString("order_detail") : data.getString("remark")); - row.createCell(21, Cell.CELL_TYPE_STRING).setCellValue(data.getString("dev_id")); - - } - - @Override - public void exportExcelNew(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws - Exception { - logger.debug("excel The method======= exportExcelNew() start......................."); - JSONObject transFlow = listPartnerTransFlow(query, partner); - JSONObject client = clientManager.getClientInfo(partner.getIntValue("client_id")); - if (!transFlow.getJSONArray("data").isEmpty()) { - List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); - try (HSSFWorkbook workbook = new HSSFWorkbook()) { - // 声明一个工作薄 - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet("trans_excel"); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth((short) 40); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index); - style.setFillPattern(CellStyle.SOLID_FOREGROUND); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font = workbook.createFont(); - // font.setColor(HSSFColor.VIOLET.index); - font.setFontHeightInPoints((short) 16); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - // 把字体应用到当前的样式 - style.setFont(font); - - HSSFCellStyle style2 = workbook.createCellStyle(); - // 设置这些样式 - style2.setFillForegroundColor(HSSFColor.WHITE.index); - style2.setFillPattern(CellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(CellStyle.BORDER_THIN); - style2.setBorderLeft(CellStyle.BORDER_THIN); - style2.setBorderRight(CellStyle.BORDER_THIN); - style2.setBorderTop(CellStyle.BORDER_THIN); - style2.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font2 = workbook.createFont(); - // font.setColor(HSSFColor.VIOLET.index); - font2.setFontHeightInPoints((short) 12); - font2.setBoldweight(Font.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - - HSSFCellStyle style3 = workbook.createCellStyle(); - style3.setFillForegroundColor(HSSFColor.WHITE.index); - style3.setFillPattern(CellStyle.SOLID_FOREGROUND); - style3.setBorderBottom(CellStyle.BORDER_THIN); - style3.setBorderLeft(CellStyle.BORDER_THIN); - style3.setBorderRight(CellStyle.BORDER_THIN); - style3.setBorderTop(CellStyle.BORDER_THIN); - style3.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font3 = workbook.createFont(); - font3.setFontHeightInPoints((short) 12); - font3.setBoldweight(Font.BOLDWEIGHT_NORMAL); - font3.setColor(HSSFColor.RED.index); - style3.setFont(font3); - HSSFRow row0 = sheet.createRow(0); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell02 = row0.createCell(2); - HSSFCell cell03 = row0.createCell(3); - HSSFCell cell04 = row0.createCell(4); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell02.setCellStyle(style); - cell03.setCellStyle(style); - cell04.setCellStyle(style); - HSSFRichTextString text00 = new HSSFRichTextString("Data/Time"); - HSSFRichTextString text01 = new HSSFRichTextString("Description"); - HSSFRichTextString text02 = new HSSFRichTextString("Debit"); - HSSFRichTextString text03 = new HSSFRichTextString("Credit"); - HSSFRichTextString text04 = new HSSFRichTextString("Remark"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell02.setCellValue(text02); - cell03.setCellValue(text03); - cell04.setCellValue(text04); - for (int i = 0; i < dataList.size(); i++) { - HSSFRow row = sheet.createRow(i + 1); - HSSFCell cell0 = row.createCell(0); - HSSFCell cell1 = row.createCell(1); - HSSFCell cell2 = row.createCell(2); - HSSFCell cell3 = row.createCell(3); - HSSFCell cell4 = row.createCell(4); - cell0.setCellStyle(style2); - cell1.setCellStyle(style2); - cell2.setCellStyle(style2); - cell4.setCellStyle(style2); - JSONObject dataItem = dataList.get(i); - HSSFRichTextString text0 = new HSSFRichTextString(dataItem.getString("transaction_time")); - HSSFRichTextString text1 = new HSSFRichTextString(dataItem.getString("order_id2")); - String debit = dataItem.getString("transaction_type").equals("Debit") ? dataItem.getBigDecimal("clearing_amount").toString() - : "-"; - HSSFRichTextString text2 = new HSSFRichTextString(debit); - String credit = dataItem.getString("transaction_type").equals("Credit") ? dataItem.getBigDecimal("clearing_amount").toString() - : "-"; - HSSFRichTextString text3 = new HSSFRichTextString(credit); - HSSFRichTextString text4 = new HSSFRichTextString(dataItem.containsKey("order_detail") ? dataItem.getString("order_detail") : dataItem.getString("remark")); - cell0.setCellValue(text0); - cell1.setCellValue(text1); - cell2.setCellValue(text2); - if (dataItem.getString("transaction_type").equals("Debit")) { - cell2.setCellStyle(style3); - } else { - cell2.setCellStyle(style2); - } - cell3.setCellValue(text3); - cell4.setCellValue(text4); - } - JSONObject parmerters = new JSONObject(); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) ? query.getDatefrom() : ""); - parmerters.put("dateTo", StringUtils.isNotBlank(query.getDateto()) ? query.getDateto() : DateFormatUtils.format(new Date(), "yyyyMMdd")); - parmerters.put("partnerCode", client.getString("client_moniker")); - response.setContentType("application/vnd.ms-excel"); - String fileName = StringUtils.isEmpty(parmerters.getString("dateFrom")) ? parmerters.getString("dateTo") - : (parmerters.getString("dateFrom") + "~" + parmerters.getString("dateTo")); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); - OutputStream outputStream = response.getOutputStream(); - - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { - - e.printStackTrace(); - } - } - } - - } - - private void putValues(JSONObject target, JSONObject source, String... keys) { - for (String key : keys) { - target.put(key, source.get(key)); - } - } - - @Override - public JSONObject listSettlementLog(TradeLogQuery query, JSONObject partner) { - JSONObject client = clientManager.getClientInfoByMoniker(partner.getString("client_moniker")); - int clientId = partner.getIntValue("client_id"); - JSONObject params = query.toParams(TimeZone.getDefault().getID()); - params.put("client_id", clientId); - clientManager.queryModifyClientIds(clientId, params); - JSONObject result = new JSONObject(); - result.put("analysis", transactionMapper.getClientAmountAnalysis(params)); - boolean mergeSettle = clientManager.getMergeSettleStatus(client); - if (mergeSettle && query.getClient_ids() == null) { - params.remove("client_ids"); - params.put("merge_settle", true); - } - PageList logs = transactionMapper.listSettlementLogForDashbord(params, - new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); - logs.forEach(log -> log.put("padding", log.getBooleanValue("editable"))); - result.putAll(PageListUtils.buildPageListResult(logs)); - result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable"))); - logger.info("##editable{}", result.getBooleanValue("padding")); - return result; - } - - @Override - public void listSettlementLogExcel(TradeLogQuery query, JSONObject partner, HttpServletResponse response) { - JSONObject client = clientManager.getClientInfoByMoniker(partner.getString("client_moniker")); - int clientId = partner.getIntValue("client_id"); - String timezone = partner.getJSONObject("client").getString("timezone"); - if (query.getClient_ids() != null) { - if (query.getClient_ids().length > 1) { - query.setClient_ids(null); - } - } - JSONObject params = query.toParams(timezone); - params.put("client_id", clientId); - clientManager.queryModifyClientIds(clientId, params); - boolean mergeSettle = clientManager.getMergeSettleStatus(client); - - if (mergeSettle && query.getClient_ids() == null) { - params.remove("client_ids"); - params.put("merge_settle", true); - } - PageList logs = transactionMapper.listSettlementLog(params, - new PageBounds(1, 100000000, Order.formString("clearing_time.desc"))); - try (HSSFWorkbook workbook = new HSSFWorkbook()) { - if (query.getClient_ids() == null) { - addSheet(0, workbook, client, logs); - if (!mergeSettle) { - List childs = clientMapper.listChildClients(client.getIntValue("client_id")); - for (int i = 0; i < childs.size(); i++) { - params.put("client_id", childs.get(i).getInteger("client_id")); - PageList childLogs = transactionMapper.listSettlementLog(params, new PageBounds(1, 100000000, Order.formString("clearing_time.desc"))); - if (!childLogs.isEmpty()) { - addSheet(i + 1, workbook, childs.get(i), childLogs); - } - } - } - } else { - JSONObject chlidClient = clientMapper.findClient(Integer.parseInt(query.getClient_ids()[0])); - addSheet(0, workbook, chlidClient, logs); - } - String fileName = "Settlement Log - " + (query.getDatefrom() + "~" + query.getDateto()); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); - OutputStream outputStream = response.getOutputStream(); - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - private void addSheet(int sheetNum, HSSFWorkbook workbook, JSONObject client, List logs) { - HSSFSheet sheet = workbook.createSheet(); - workbook.setSheetName(sheetNum, client.getString("client_moniker") + "_excel"); - sheet.setDefaultColumnWidth((short) 40); - HSSFCellStyle style = workbook.createCellStyle(); - style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index); - style.setFillPattern(CellStyle.SOLID_FOREGROUND); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font = workbook.createFont(); - font.setFontHeightInPoints((short) 16); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - style.setFont(font); - - HSSFCellStyle style2 = workbook.createCellStyle(); - style2.setFillForegroundColor(HSSFColor.WHITE.index); - style2.setFillPattern(CellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(CellStyle.BORDER_THIN); - style2.setBorderLeft(CellStyle.BORDER_THIN); - style2.setBorderRight(CellStyle.BORDER_THIN); - style2.setBorderTop(CellStyle.BORDER_THIN); - style2.setAlignment(CellStyle.ALIGN_CENTER); - HSSFFont font2 = workbook.createFont(); - // font.setColor(HSSFColor.VIOLET.index); - font2.setFontHeightInPoints((short) 12); - font2.setBoldweight(Font.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - HSSFRow row0 = sheet.createRow(0); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell02 = row0.createCell(2); - HSSFCell cell03 = row0.createCell(3); - HSSFCell cell04 = row0.createCell(4); - HSSFCell cell05 = row0.createCell(5); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell02.setCellStyle(style); - cell03.setCellStyle(style); - cell04.setCellStyle(style); - cell05.setCellStyle(style); - HSSFRichTextString text00 = new HSSFRichTextString("Short Name"); - HSSFRichTextString text01 = new HSSFRichTextString("Client Moniker"); - HSSFRichTextString text02 = new HSSFRichTextString("Settle Time"); - HSSFRichTextString text03 = new HSSFRichTextString("Transaction Amount"); - HSSFRichTextString text04 = new HSSFRichTextString("to Merchant"); - HSSFRichTextString text05 = new HSSFRichTextString("Service Fee"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell02.setCellValue(text02); - cell03.setCellValue(text03); - cell04.setCellValue(text04); - cell05.setCellValue(text05); - for (int i = 0; i < logs.size(); i++) { - HSSFRow row = sheet.createRow(i + 1); - HSSFCell cell0 = row.createCell(0); - HSSFCell cell1 = row.createCell(1); - HSSFCell cell2 = row.createCell(2); - HSSFCell cell3 = row.createCell(3); - HSSFCell cell4 = row.createCell(4); - HSSFCell cell5 = row.createCell(5); - cell0.setCellStyle(style2); - cell1.setCellStyle(style2); - cell2.setCellStyle(style2); - cell3.setCellStyle(style2); - cell4.setCellStyle(style2); - cell5.setCellStyle(style2); - JSONObject dataItem = logs.get(i); - HSSFRichTextString text0 = new HSSFRichTextString(client.getString("short_name")); - HSSFRichTextString text1 = new HSSFRichTextString(client.getString("client_moniker")); - HSSFRichTextString text2 = new HSSFRichTextString(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dataItem.getDate("report_date"))); - HSSFRichTextString text3 = new HSSFRichTextString(dataItem.getBigDecimal("total").setScale(2, RoundingMode.HALF_DOWN).toString()); - HSSFRichTextString text4 = new HSSFRichTextString(dataItem.getBigDecimal("income").setScale(2, RoundingMode.HALF_DOWN).toString()); - HSSFRichTextString text5 = new HSSFRichTextString(dataItem.getBigDecimal("fee").setScale(2, RoundingMode.HALF_DOWN).toString()); - cell0.setCellValue(text0); - cell1.setCellValue(text1); - cell2.setCellValue(text2); - cell3.setCellValue(text3); - cell4.setCellValue(text4); - cell5.setCellValue(text5); - } - } - - @Override - public Double getClientUnClearedAmount(JSONObject partner) { - return transactionMapper.getClientUnClearedAmount(partner.getIntValue("client_id")); - } - - public static JSONObject tunnel() { - JSONObject res = new JSONObject(); - res.put("abn", "16601619685"); - res.put("acn", "601619685"); - res.put("client_name", "Tunnel Show Pty Ltd"); - res.put("country", "AUSTRALIA"); - res.put("state", "VIC"); - res.put("suburb", "Melbourne"); - res.put("address", "Level 11, 15 William Street"); - res.put("postcode", "3000"); - res.put("short_name", "short_name"); - res.put("business_name", "RoyalPay"); - res.put("business_structure", "Company"); - res.put("contact_email", ""); - res.put("company_phone", "+61 03 9448 8865"); - res.put("account_name", ""); - res.put("account_no", "11655861"); - res.put("bank_name", "CBA"); - res.put("bank_city", "Box Hill"); - res.put("currency", "AUD"); - return res; - } - - public static JSONObject alipayInfo() { - JSONObject res = new JSONObject(); - res.put("bw", "Alipay.com Co., Ltd."); - res.put("bx", "ALIPAY"); - res.put("by", ""); - res.put("bz", "ALIPAY"); - res.put("ca", "Pudong New Area"); - res.put("cb", "Shanghai"); - res.put("cc", "200120"); - res.put("cd", "CHINA"); - res.put("ce", "Room 108E, No.98, 91 Lane of E’shan Road"); - res.put("cf", "Pudong New Area"); - res.put("cg", "Shanghai"); - res.put("ch", "200120"); - res.put("ci", "CHINA"); - res.put("cj", "85222155100"); - res.put("ck", "global.service@alipay.com"); - res.put("cl", "Payment Services"); - res.put("cm", ""); - res.put("cn", "Company"); - return res; - } - - @Override - public void exportTransLog(TradeLogQuery query, JSONObject manager, HttpServletResponse httpResponse) { - // List ausTracData = austracDataMapper.getAustracData(query.toParams(null)); - List ausTracData = austracDataMapper.getAustracReport(query.toParams(null)); - - // if (Integer.parseInt(query.getDatefrom()) < 20170112){//新清算上线 - // ausTracData = austracDataMapper.getAustracData(query.toParams(null)); - // }else { - // ausTracData = austracDataMapper.getAustracDataNew(query.toParams(null)); - // } - if (!ausTracData.isEmpty()) { - for (JSONObject data : ausTracData) { - if (data.getIntValue("client_id") == 0) { - data.putAll(tunnel()); - } - if (StringUtils.isNotBlank(data.getString("channel")) && "Alipay".equals(data.getString("channel"))) { - data.putAll(alipayInfo()); - } - if (StringUtils.isNotBlank(data.getString("channel")) && "AlipayOnline".equals(data.getString("channel"))) { - data.putAll(alipayInfo()); - } - - } - } - int partitionCount = 10000; - int ausTracDataSize = ausTracData.size(); - List> partitions = new ArrayList<>(); - - if (ausTracDataSize < partitionCount) { - partitions.add(ausTracData); - } else { - int forCount = ausTracDataSize / partitionCount; - int remainCount = ausTracDataSize % partitionCount; - for (int i = 0; i < forCount; i++) { - List tmpList = ausTracData.subList(i * partitionCount, (i + 1) * partitionCount); - partitions.add(tmpList); - } - if (remainCount > 0) { - List tmpLsit = ausTracData.subList(partitionCount * forCount, ausTracDataSize); - partitions.add(tmpLsit); - } - } - - try { - OutputStream outputStream = httpResponse.getOutputStream(); - httpResponse.setContentType("application/zip"); - String fileName = "transactions_logs"; - if (query.getDatefrom() != null) { - fileName = fileName + query.getDatefrom(); - } - if (query.getDateto() != null) { - fileName = fileName + "-" + query.getDateto(); - } - httpResponse.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".zip"); - ZipOutputStream zos = new ZipOutputStream(outputStream); - int i = 1; - for (List partition : partitions) { - JRDataSource jrDataSource = new JRBeanCollectionDataSource(partition); - String finalFileName = fileName + "_" + i + ".xls"; - JasperPrint jasperPrint = JasperFillManager.fillReport(austrac_report.getInputStream(), null, jrDataSource); - JRXlsExporter exporter = new JRXlsExporter(); - ExporterInput exporterInput = new SimpleExporterInput(jasperPrint); - - exporter.setExporterInput(exporterInput); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - OutputStreamExporterOutput exporterOutput = new SimpleOutputStreamExporterOutput(bos); - - exporter.setExporterOutput(exporterOutput); - bos.close(); - - // 设置导出时参数 - SimpleXlsxReportConfiguration xlsReportConfiguration = new SimpleXlsxReportConfiguration(); - xlsReportConfiguration.setOnePagePerSheet(false); - xlsReportConfiguration.setRemoveEmptySpaceBetweenRows(true); - xlsReportConfiguration.setDetectCellType(true); - xlsReportConfiguration.setWhitePageBackground(false); - exporter.setConfiguration(xlsReportConfiguration); - exporter.exportReport(); - zos.putNextEntry(new ZipEntry(finalFileName)); - IOUtils.write(bos.toByteArray(), zos); - i++; - } - zos.flush(); - IOUtils.closeQuietly(zos); - outputStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Override - public void generateAustracData(String dateFrom, String dateTo) { - DateFormat format = new SimpleDateFormat("yyyyMMdd"); - DecimalFormat df = new DecimalFormat("#.00"); - Date from = new Date(); - Date to = new Date(); - try { - from = format.parse(dateFrom); - } catch (ParseException e) { - throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format"); - } - try { - to = format.parse(dateTo); - } catch (ParseException e) { - throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format"); - } - List clearings = new ArrayList<>(); - for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()) { - clearings.addAll(mpPaymentApi.settlementLogs(from, to, mch.getMerchantId())); - } - for (SettlementLog clear : clearings) { - JSONObject dateParams = new JSONObject(); - dateParams.put("from", clear.getStart()); - dateParams.put("to", clear.getEnd()); - dateParams.put("clearing_date", clear.getSettlementDate()); - List oneClear = transactionMapper.getMerchantAmount(dateParams); - Date now = new Date(); - for (JSONObject clientClear : oneClear) { - austracDataMapper.delete(clientClear.getIntValue("client_id"), clientClear.getDate("clearing_time")); - BigDecimal lastTransTotal = austracDataMapper.getClientLastTransactionTotal(clientClear.getIntValue("client_id"), - clientClear.getDate("clearing_time")); - clientClear.put("clearing_amount", clientClear.getBigDecimal("clearing_amount").setScale(0, RoundingMode.DOWN)); - if (lastTransTotal != null && lastTransTotal.compareTo(new BigDecimal(0)) < 0) { - clientClear.put("clearing_amount", clientClear.getBigDecimal("clearing_amount").add(lastTransTotal)); - } - clientClear.put("create_time", now); - clientClear.put("settle_from", clear.getStart()); - clientClear.put("settle_to", clear.getEnd()); - clientClear.put("settlement", clear.getSettlementFee()); - clientClear.put("bank_settlement_data", clear.getBankSettlementDate()); - austracDataMapper.save(clientClear); - } - JSONObject fee = transactionMapper.getSumMerchantAmount(dateParams); - fee.put("clearing_amount", clear.getSettlementFee().subtract(fee.getBigDecimal("clearing_amount")).setScale(0, RoundingMode.DOWN)); - fee.put("clearing_time", clear.getSettlementDate()); - fee.put("order_time", clear.getSettlementDate()); - fee.put("create_time", now); - fee.put("client_id", 0); - austracDataMapper.delete(0, clear.getSettlementDate()); - fee.put("settle_from", clear.getStart()); - fee.put("settle_to", clear.getEnd()); - fee.put("settlement", clear.getSettlementFee()); - fee.put("bank_settlement_data", clear.getBankSettlementDate()); - austracDataMapper.save(fee); - } - } - - @Override - public int getOrdersCount(JSONObject account) { - return transactionMapper.countOrders(account.getIntValue("client_id")); - } - - @Override - public void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query) throws Exception { - String timezone = account.getJSONObject("client").getString("timezone"); - JSONObject client = clientManager.getClientInfoByMoniker(account.getString("client_moniker")); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject params = query.toParams(timezone); - clientManager.validateClients(client.getIntValue("client_id"), params); - params.put("client_id", client.getIntValue("client_id")); - List logs = orderMapper.listOrdersByClientsNoPages(params); - - if (!logs.isEmpty()) { - int count = 0; - for (JSONObject object : logs) { - if (object.getIntValue("clearing_status") == 2 && object.getIntValue("client_id") == client.getIntValue("client_id")) { - JSONObject updation = new JSONObject(); - updation.put("transaction_id", object.getString("transaction_id")); - updation.put("clearing_status", 0); - transactionService.update(updation); - ++count; - } - } - if (count == 0) { - throw new BadRequestException("无预授权订单"); - } - } else { - throw new BadRequestException("无预授权订单"); - } - - } - - @Override - public JSONObject listPreRefundClients(PreRefundQueryBean params, String preType) { - PageList data = null; - if (StringUtils.equalsIgnoreCase("geek", preType)) { - data = transactionMapper.listPreGeekCostClients(new PageBounds(params.getPage(), params.getLimit())); - } else { - data = transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit())); - } - return PageListUtils.buildPageListResult(data); - } - - @Override - public void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse resp) { - String begin = query.getDatefrom() == null ? "" : query.getDatefrom(); - String end = query.getDateto() == null ? "" : query.getDateto(); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); - if (params.get("client_ids") == null) { - params.put("client_id", partner.getJSONObject("client").getString("client_id")); - } - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - - List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); - List clientOrders = new ArrayList<>(clientOrderList.size()); - clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order"))); - List settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders); - try (OutputStream ous = resp.getOutputStream(); - Workbook wb = new XSSFWorkbook()) { - JSONObject clearDetailTotal = transactionMapper.getClearDetailTotal(params); - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + "Merchant_Settlement_Info_" + begin + "_" + end + ".xlsx"); - Cell cell = null; - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - //红色字体提示 - Font font2 = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font2.setFontHeightInPoints((short) 10); - font2.setColor(HSSFColor.RED.index); - CellStyle analysisStyle2 = wb.createCellStyle(); - analysisStyle2.setFont(font2); - Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + begin + "_" + end); - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", - "Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Surcharge", "GST", "Remark", "Dev No", "Company Name", "Short Name", "Settlement Date"}; - String[] analysis = {"Total Credit", "Total Debit", "Gross Amount", "Total Charge", "Net Amount"}; - for (int i = 0; i < title.length; i++) { - row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); - } - - JSONObject device; - String clientDevId = ""; - for (JSONObject settle : settlementLogDetailList) { - if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { - continue; - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_time")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); - if (settle.getInteger("gateway") != null) { - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); - } else { - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("-"); - } - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).toPlainString()); - cell = row.createCell(6, Cell.CELL_TYPE_STRING); - cell.setCellValue(settle.getString("transaction_type")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); - cell = row.createCell(8, Cell.CELL_TYPE_STRING); - cell.setCellValue(convertMarkedAmountString(settle, "display_amount")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(9, Cell.CELL_TYPE_STRING); - cell.setCellValue(convertMarkedAmountString(settle, "transaction_amount")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(10, Cell.CELL_TYPE_STRING); - cell.setCellValue(convertMarkedAmountString(settle, "clearing_amount")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("rate") == null ? "" : settle.getBigDecimal("rate").toPlainString() + "%"); - cell = row.createCell(12, Cell.CELL_TYPE_STRING); - cell.setCellValue(convertMarkedAmountString(settle, "settle_amount")); - cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" - : settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString()); - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? "" - : settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("remark")); - device = clientDeviceMapper.find(settle.getString("dev_id")); - if (device != null) - clientDevId = device.getString("client_dev_id"); - row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); - row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("company_name")); - row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("short_name")); - row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("settle_date")); - } - row = sheet.createRow(++rowNum); - for (int i = 0; i < analysis.length; i++) { - cell = row.createCell(i, Cell.CELL_TYPE_STRING); - cell.setCellStyle(analysisStyle); - cell.setCellValue(analysis[i]); - } - row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_payment")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_refund")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("gross_amount")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getBigDecimal("total_charge").add(clearDetailTotal.getBigDecimal("tax_amount")).toPlainString()); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("clearing_amount")); - - wb.write(ous); - ous.flush(); - } catch (IOException e) { - throw new ServerErrorException(e); - } - - } - - @Override - public void exportSettlementLogCSV(TradeLogQuery query, JSONObject partner, HttpServletResponse response) { - String begin = query.getDatefrom() == null ? "" : query.getDatefrom(); - String end = query.getDateto() == null ? "" : query.getDateto(); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); - if (params.get("client_ids") == null) { - params.put("client_id", partner.getJSONObject("client").getString("client_id")); - } - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); - List clientOrders = new ArrayList<>(clientOrderList.size()); - clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order"))); - List settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders); - String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", - "Input Amount", "Total Amount", "Clearing Amount", "Surcharge Rate", "Settle Amount", "Surcharge", "GST", "Remark", "Dev No", "Company Name", "Short Name", "Settlement Date"}; - CSVFormat format = CSVFormat.DEFAULT.withFirstRecordAsHeader().withHeader(title); - response.setCharacterEncoding("UTF-8"); - response.setContentType("application/octet-stream;"); - response.addHeader("Content-Disposition", - "attachment; filename=" + "Merchant_Settlement_Info_" + begin + "_" + end + ".csv"); - try (PrintWriter writer = response.getWriter(); - CSVPrinter printer = new CSVPrinter(writer, format)) { - printer.printRecord((Object[]) title); - JSONObject clearDetailTotal = transactionMapper.getClearDetailTotal(params); - - - for (JSONObject settle : settlementLogDetailList) { - if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { - continue; - } - String gateway = settle.getInteger("gateway") != null ? TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType() : "-"; - String displayAmount = convertMarkedAmountString(settle, "display_amount"); - String transAmt = convertMarkedAmountString(settle, "transaction_amount"); - String clearAmt = convertMarkedAmountString(settle, "clearing_amount"); - String settleAmt = convertMarkedAmountString(settle, "settle_amount"); - JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); - String clientDevId = device == null ? "" : device.getString("client_dev_id"); - //print row - printer.printRecord( - settle.getString("order_id"), - settle.getString("client_order_id"), - settle.getString("transaction_time"), - settle.getString("channel"), - gateway, - settle.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).toPlainString(), - settle.getString("transaction_type"), - settle.getString("transaction_currency"), - displayAmount, - transAmt, - clearAmt, - settle.getBigDecimal("rate") == null ? "" : settle.getBigDecimal("rate").toPlainString() + "%", - settleAmt, - settle.getBigDecimal("total_surcharge") == null ? "" - : settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString(), - settle.getBigDecimal("tax_amount") == null ? "" - : settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString(), - settle.getString("remark"), - clientDevId, settle.getString("company_name"), - settle.getString("short_name"), - settle.getString("settle_date")); - } - String[] analysisRow = {"Total Credit", - clearDetailTotal.getString("total_payment"), - "Total Debit", - clearDetailTotal.getString("total_refund"), - "Gross Amount", - clearDetailTotal.getString("gross_amount"), - "Total Charge", - clearDetailTotal.getBigDecimal("total_charge").add(clearDetailTotal.getBigDecimal("tax_amount")).toPlainString(), - "Net Amount", - clearDetailTotal.getString("clearing_amount")}; - - - printer.printRecord((Object[]) analysisRow); - writer.flush(); - } catch (IOException e) { - throw new ServerErrorException(e); - } - } - - public String convertMarkedAmountString(JSONObject settle, String key) { - if (settle.getBigDecimal(key) == null) { - return ""; - } else { - return "Credit".equals(settle.getString("transaction_type")) ? - settle.getBigDecimal(key).setScale(2, RoundingMode.DOWN).toPlainString() : - "-" + settle.getBigDecimal(key).setScale(2, RoundingMode.DOWN).toPlainString(); - } - } - - @Override - public void exportPDFSettlement(TradeLogQuery query, JSONObject partner, HttpServletResponse response) { - String begin = query.getDatefrom() == null ? "" : query.getDatefrom(); - String end = query.getDateto() == null ? "" : query.getDateto(); - JSONObject client = partner.getJSONObject("client"); - String timezone = client.getString("timezone"); - JSONObject params = query.toParams(timezone); - if (params.get("client_ids") == null) { - params.put("client_id", client.getString("client_id")); - } - clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params); - List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); - List clientOrders = new ArrayList<>(clientOrderList.size()); - clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order"))); - List settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders); - TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Arrays.asList("transaction_time")); - try { - - JSONObject parmerters = new JSONObject(); - parmerters.put("dateRange", "(Statement Period " + begin + "~" - + end + ")"); - parmerters.put("clientName", client.getString("company_name")); - parmerters.put("clientAddress", client.getString("address")); - parmerters.put("clientLocation", client.getString("suburb") + "," + client.getString("state") + "," + client.getString("postcode")); - parmerters.put("logo", logo.getInputStream()); - settlementLogDetailList.parallelStream().forEach(item -> { - scaleDecimalVal(item, "display_amount", item.getString("transaction_currency")); - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - scaleDecimalVal(item, "clearing_amount", platformCurrency); - scaleDecimalVal(item, "settle_amount", platformCurrency); - scaleDecimalVal(item, "total_surcharge", platformCurrency); - scaleDecimalVal(item, "transaction_amount", platformCurrency); - item.put("exchange_rate", item.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN)); - item.put("gateway", item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType()); - item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").toPlainString() + "%"); - }); - JRDataSource jrDataSource = new JRBeanCollectionDataSource(settlementLogDetailList); - response.setContentType("application/pdf"); - String fileName = partner.getString("client_moniker") + "_" + parmerters.getString("dateRange").replace("/", ""); - response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); - OutputStream outs = response.getOutputStream(); - byte[] bytes = JasperRunManager.runReportToPdf(partner_settlement_flow.getInputStream(), parmerters, jrDataSource); - outs.write(bytes, 0, bytes.length); - outs.flush(); - outs.close(); - } catch (Exception e) { - throw new ServerErrorException(e); - } - } - - @Override - public byte[] exportPDFSettlement(TradeLogQuery query, JSONObject client) { - logger.info("exporting settlement pdf for {}", client.getString("client_moniker")); - String begin = query.getDatefrom() == null ? "" : query.getDatefrom(); - String timezone = client.getString("timezone"); - JSONObject params = query.toParams(timezone); - if (params.get("client_ids") == null) { - params.put("client_id", client.getString("client_id")); - } - clientManager.queryModifyClientIds(client.getIntValue("client_id"), params); - List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); - JSONObject parmerters = new JSONObject(); - try { - String beginParse = DateFormatUtils.format(DateUtils.parseDate(begin, "yyyyMMdd"), "dd.MM.yyyy"); - parmerters.put("dateRange", "Your Statement For:" + beginParse + ""); - - } catch (ParseException e) { - e.printStackTrace(); - } - parmerters.put("clientName", client.getString("company_name")); - parmerters.put("clientAddress", client.getString("address")); - parmerters.put("clientLocation", client.getString("suburb") + "," + client.getString("state") + "," + client.getString("postcode")); - List settlementLogDetailList = new ArrayList<>(); - try { - parmerters.put("logo", logo.getInputStream()); - parmerters.put("org_logo", securepay_logo.getInputStream()); - if (!clientOrderList.isEmpty()) { - List clientOrders = new ArrayList<>(clientOrderList.size()); - clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order"))); - settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders); - TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Collections.singletonList("transaction_time")); - settlementLogDetailList.parallelStream().forEach(item -> { - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - scaleDecimalVal(item, "clearing_amount", platformCurrency); - scaleDecimalVal(item, "settle_amount", platformCurrency); - scaleDecimalVal(item, "total_surcharge", platformCurrency); - scaleDecimalVal(item, "transaction_amount", platformCurrency); - item.put("exchange_rate", item.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).stripTrailingZeros()); - item.put("gateway", item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType()); - item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").stripTrailingZeros().toPlainString() + "%"); - }); - } else { - JSONObject mockJson = new JSONObject(); - mockJson.put("order_id", "-"); - mockJson.put("client_order_id", "-"); - mockJson.put("transaction_time", "-"); - mockJson.put("channel", "-"); - mockJson.put("gateway", "-"); - mockJson.put("exchange_rate", BigDecimal.ZERO); - mockJson.put("transaction_type", "-"); - mockJson.put("transaction_currency", "-"); - mockJson.put("settle_amount", BigDecimal.ZERO); - mockJson.put("remark", ""); - mockJson.put("transaction_amount", BigDecimal.ZERO); - mockJson.put("total_surcharge", BigDecimal.ZERO); - mockJson.put("clearing_amount", BigDecimal.ZERO); - mockJson.put("transaction_fee", BigDecimal.ZERO); - mockJson.put("tax_amount", BigDecimal.ZERO); - mockJson.put("rate", BigDecimal.ZERO); - settlementLogDetailList.add(mockJson); - } - Context ctx = new Context(); - JSONObject orgInfo = orgManager.getOrgDetail(client.getIntValue("org_id"), null); - if (!orgInfo.containsKey("logo") || orgInfo.getIntValue("org_id") == 1) { - orgInfo.put("logo", "none"); - } - ctx.setVariable("orgInfo", orgInfo); - ctx.setVariable("parmerters", parmerters); - ctx.setVariable("settlementLogDetailList", settlementLogDetailList); - logger.info("=====>reports/securepay_settlement.html:"); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - final String html = thymeleaf.process("reports/securepay_settlement.html", ctx); - - ITextRenderer renderer = new ITextRenderer(); - //添加字体库end - renderer.setDocumentFromString(html); - renderer.layout(); - renderer.createPDF(os); - byte[] bytes = os.toByteArray(); - - renderer.finishPDF(); - os.close(); - -// JRDataSource jrDataSource = new JRBeanCollectionDataSource(settlementLogDetailList); -// return JasperRunManager.runReportToPdf(securepay_settlement_flow.getInputStream(), parmerters, jrDataSource); - return bytes; - } catch (Exception e) { - throw new ServerErrorException("Failed to export settlement report pdf for " + client.getString("client_moniker"), e); - } - } - - @Override - public void exportExcelAllPartner(TradeLogQuery query, JSONObject partner, HttpServletResponse resp) throws - Exception { - logger.debug("excel The method======= exportExcel() start......................."); - int clientId1 = partner.getIntValue("client_id"); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); - clientManager.validateClients(clientId1, params); - params.put("client_id", clientId1); - clientManager.queryModifyClientIds(clientId1, params); - List logs = transactionMapper.listTransFlow(params); - - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time")); - TimeZoneUtils.switchTimeZoneToString(logs, TimeZone.getDefault().getID(), "dd/MM/yyyy", Collections.singletonList("clearing_time")); - if (!logs.isEmpty()) { - OutputStream ous = null; - String transType; - int status; - try (HSSFWorkbook wb = new HSSFWorkbook()) { - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - String[] clientIds = query.getClient_ids(); - List clientIdList = new ArrayList<>(); - clientIdList.add("ALL"); - if (clientIds != null && clientIds.length >= 2) { - clientIdList.addAll(Arrays.asList(clientIds)); - } - HSSFSheet sheet = null; - JSONObject client = null; - JSONObject device = null; - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - for (String clientId : clientIdList) { - if ("ALL".equals(clientId)) { - sheet = wb.createSheet(clientId); - } else { - client = clientManager.getClientInfo(Integer.parseInt(clientId)); - sheet = wb.createSheet(client == null ? clientId : client.getString("client_moniker")); - } - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"Transaction Time", "Client Order ID", "System Order ID", "Client Moniker", "Short Name", - "Order ID", "Channel", "Input Amount", "Transaction Amount", "Transaction Currency", "Clearing Amount", - "Settle Amount", "Surcharge", "Incremental Surcharge", "GST", "Settle Date", "Exchange Rate", - "Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No"}; - for (int j = 0; j < title.length; j++) { - row.createCell(j, Cell.CELL_TYPE_STRING).setCellValue(title[j]); - } - if ("ALL".equals(clientId)) { - for (JSONObject log : logs) { - log.put("order_detail", (StringUtils.isEmpty(log.getString("order_detail")) ? "" : log.getString("order_detail"))); - transType = log.getString("trans_type"); - if ("refund".equals(transType)) { - status = log.getIntValue("status"); - if (status == 6) - transType = "Partly " + transType; - else if (status == 7) { - transType = "Fully " + transType; - } - log.put("trans_type", transType); - device = clientDeviceMapper.find(log.getString("order_dev_id")); - if (device != null) - log.put("dev_id", device.getString("client_dev_id")); - } - scaleDecimalVal(log, "display_amount", platformCurrency); - scaleDecimalVal(log, "transaction_amount", platformCurrency); - scaleDecimalVal(log, "clearing_amount", platformCurrency); - scaleDecimalVal(log, "settle_amount", platformCurrency); - scaleDecimalVal(log, "total_surcharge", platformCurrency); - scaleDecimalVal(log, "tax_amount", platformCurrency); - row = sheet.createRow(++rowNum); - excelTrans(row, log); - } - } else { - List logsByClientId = logs.stream().filter(log -> log.getString("client_id").equals(clientId)).collect(Collectors.toList()); - for (JSONObject log : logsByClientId) { - scaleDecimalVal(log, "display_amount", platformCurrency); - scaleDecimalVal(log, "transaction_amount", platformCurrency); - scaleDecimalVal(log, "clearing_amount", platformCurrency); - scaleDecimalVal(log, "settle_amount", platformCurrency); - scaleDecimalVal(log, "total_surcharge", platformCurrency); - scaleDecimalVal(log, "tax_amount", platformCurrency); - row = sheet.createRow(++rowNum); - excelTrans(row, log); - } - } - } - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + query.getDatefrom() + "_" + query.getDateto() + ".xls"); - ous = resp.getOutputStream(); - try { - wb.write(ous); - ous.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/package-info.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/package-info.java deleted file mode 100644 index ccc4e3a70..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 订单列表 - * Created by yixian on 2016-07-02. - */ -package au.com.royalpay.payment.manage.tradelog; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/RefundService.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/RefundService.java deleted file mode 100644 index b31eb4c3d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/RefundService.java +++ /dev/null @@ -1,54 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund; - -import au.com.royalpay.payment.manage.analysis.beans.RefundReviewBean; - -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; - -/** - * refund - * Created by yixian on 2016-07-04. - */ -public interface RefundService { - - JSONObject checkOrderRefundAmount(String orderId, JSONObject account); - - JSONObject checkOrderRefundInfo(String orderId); - - JSONObject listNeedReviewRefundOrders(RefundReviewBean reviewBean); - - int notifyRefundReview(); - - boolean reviewNewRefundOrder(String orderId, BigDecimal fee, String remark, JSONObject account, JSONObject manager); - - JSONObject cancelOrder(JSONObject partnerAccount, String orderId); - - JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager); - - @Transactional - JSONObject newReviewRefundOrder(String orderId, BigDecimal fee,boolean original, String remark, JSONObject manager); - - JSONObject auditionInfo(String auditionId, String openid); - - JSONObject auditionInfoByAccount(String auditionId, JSONObject account); - - void auditRefundByOpenId(String auditionId, String openid, boolean pass); - - void auditRefundByAccount(JSONObject account, String auditionId, boolean agree); - - JSONObject auditionsFromOpenId(String openid); - - JSONObject auditionsFromAccount(JSONObject account); - - void offRefundReviewOrder(JSONObject review, JSONObject manager); - - JSONObject findReviewOrder(String reviewId); - - JSONObject checkRefundAuditFlag(); - - JSONObject listUnionAllApply(JSONObject params,PageBounds pagination); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/NewRefundReviewEvent.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/NewRefundReviewEvent.java deleted file mode 100644 index f107e991d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/NewRefundReviewEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.events; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEvent; - -/** - * Created by davep on 2016-07-23. - */ -public class NewRefundReviewEvent extends ApplicationEvent { - private final JSONObject refundOrder; - private final JSONObject operator; - public NewRefundReviewEvent(Object source, JSONObject refundOrder, JSONObject operator) { - super(source); - this.refundOrder = refundOrder; - this.operator = operator; - } - - public JSONObject getRefundOrder() { - return refundOrder; - } - - public JSONObject getOperator() { - return operator; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/RefundRefunseEvent.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/RefundRefunseEvent.java deleted file mode 100644 index 35a47c870..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/RefundRefunseEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.events; - -import com.alibaba.fastjson.JSONObject; -import org.springframework.context.ApplicationEvent; - -public class RefundRefunseEvent extends ApplicationEvent { - private final JSONObject refundReviewBean; - - public RefundRefunseEvent(Object source, JSONObject refundReviewBean) { - super(source); - this.refundReviewBean = refundReviewBean; - } - - public JSONObject getRefundReviewBean() { - return refundReviewBean; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java deleted file mode 100644 index 87fcd0787..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java +++ /dev/null @@ -1,82 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.events.listeners; - -import au.com.royalpay.payment.core.events.NewRefundAuditEvent; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.RefundAuditionMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - * Created by davep on 2016-07-23. - */ -@Service -public class NoticeRefundAuditListener implements ApplicationListener { - @Resource - private RefundAuditionMapper refundAuditionMapper; - @Resource - private ClientManager clientManager; - @Resource - private OrderMapper orderMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - @Override - public void onApplicationEvent(NewRefundAuditEvent newRefundAuditEvent) { - JSONObject audition = new JSONObject(); - int clientId = newRefundAuditEvent.getRefundOrder().getIntValue("client_id"); - audition.put("client_id", clientId); - String orderId = newRefundAuditEvent.getRefundOrder().getString("order_id"); - audition.put("order_id", orderId); - audition.put("refund_id", newRefundAuditEvent.getRefundOrder().getString("refund_id")); - String operatorName = "anonymous"; - if (newRefundAuditEvent.getOperator() != null) { - audition.put("applyerid", newRefundAuditEvent.getOperator().getString("operator_id")); - operatorName = newRefundAuditEvent.getOperator().getString("operator"); - audition.put("applyername", StringUtils.defaultString(operatorName, "System")); - } - String remark = newRefundAuditEvent.getRefundOrder().getString("remark"); - audition.put("remark", remark); - audition.put("applytime", new Date(newRefundAuditEvent.getTimestamp())); - refundAuditionMapper.save(audition); - List accounts = clientManager.listRefundAuditAccounts(clientId); - JSONObject client = clientManager.getClientInfo(clientId); - JSONObject order = orderMapper.find(orderId); - - for (JSONObject account : accounts) { - String wechatOpenid = account.getString("wechat_openid"); - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(wechatOpenid); - String templateId = api.getTemplateId("refund-audit-notice"); - if (api != null && StringUtils.isNotEmpty(templateId)) { - try { - TemplateMessage notice = initMessage(newRefundAuditEvent, operatorName, remark, client, order, templateId, wechatOpenid); - api.sendTemplateMessage(notice); - } catch (Exception e) { - e.printStackTrace(); - } - } - - } - } - - private TemplateMessage initMessage(NewRefundAuditEvent newRefundAuditEvent, String operatorName, String remark, JSONObject client, JSONObject order, String templateId, String wechatOpenid) { - TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/refund/auditions")); - notice.put("first", operatorName + "提交了订单" + order.getString("order_description") + "的退款申请,请审核", "#ff0000"); - notice.put("keyword1", order.getString("currency") + " " + newRefundAuditEvent.getRefundOrder().getDoubleValue("amount"), "#ff0000"); - notice.put("keyword2", operatorName, "#0000ff"); - notice.put("keyword3", client.getString("client_moniker"), "#0000ff"); - notice.put("keyword4", remark == null ? "无备注" : remark, "#0000FF"); - notice.put("remark", "点击处理", "#000000"); - return notice; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundReviewListener.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundReviewListener.java deleted file mode 100644 index 7e977e43a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundReviewListener.java +++ /dev/null @@ -1,111 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.events.listeners; - -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.tradelog.refund.events.NewRefundReviewEvent; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.SysConfigManager; - -import com.alibaba.fastjson.JSONObject; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by Tayl0r on 2017/7/6. - */ -@Service -public class NoticeRefundReviewListener implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Resource - private ClientMapper clientMapper; - @Resource - private ManagerMapper managerMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private SysConfigManager sysConfigManager; - - @Override - public void onApplicationEvent(NewRefundReviewEvent event) { - JSONObject client = clientMapper.findClient(event.getRefundOrder().getIntValue("client_id")); - JSONObject operator = event.getOperator(); - - //操作人模板消息 - if (operator.getString("wechat_openid") != null || operator.getString("wx_openid") != null) { - String wechatOpenid = operator.getString("wechat_openid") != null ? operator.getString("wechat_openid") : operator.getString("wx_openid"); - sendOperatorNotify(event, client, operator, wechatOpenid); - } - - //风控团队接收 - String openidStrings = sysConfigManager.getSysConfig().getString("refund_audit_notice_people"); - String[] openids = openidStrings.split(","); - for (String openid : openids) { - sendRefundAuditNotify(event, client, operator, openid); - } - } - - private void sendOperatorNotify(NewRefundReviewEvent event, JSONObject client, JSONObject operator, String wechatOpenid){ - try { - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(wechatOpenid); - if (api != null) { - String templateId = api.getTemplateId("refund-audit-notice"); - if (templateId != null) { - TemplateMessage notice = initMessageToOperator(event, operator.getString("display_name"), client, event.getRefundOrder(), templateId, wechatOpenid); - api.sendTemplateMessage(notice); - } - } - } catch (Exception e) { - logger.error("Sending Notify failure", e); - } - } - - private void sendRefundAuditNotify(NewRefundReviewEvent event, JSONObject client, JSONObject operator, String wechatOpenid) { - try { - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(wechatOpenid); - if (api != null) { - String templateId = api.getTemplateId("refund-audit-notice"); - if (templateId != null) { - TemplateMessage notice = initMessage(event, operator.getString("display_name"), client, event.getRefundOrder(), templateId, wechatOpenid); - api.sendTemplateMessage(notice); - } - } - } catch (Exception e) { - logger.error("Sending Notify failure", e); - } - } - - private TemplateMessage initMessage(NewRefundReviewEvent newRefundReviewEvent, String operatorName, JSONObject client, JSONObject review, String templateId, String wechatOpenid) { - String uri = "/api/payment/v1.0/refund/review/" + review.getString("review_id"); - String loginUrl = PlatformEnvironment.getEnv().concatUrl("/global/userstatus/manager_signin_wechat") + "?target=" + uri; - TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, loginUrl); - notice.put("first", operatorName + "提交了订单的退款申请,请审核", "#ff0000"); - notice.put("keyword1", review.getString("currency") + newRefundReviewEvent.getRefundOrder().getDoubleValue("amount"), "#ff0000"); - notice.put("keyword2", operatorName, "#0000ff"); - notice.put("keyword3", client.getString("short_name") + "(" + client.getString("client_moniker") + ")", "#0000ff"); - notice.put("keyword4", review.getString("remark") == null ? "无备注" : review.getString("remark"), "#0000FF"); - notice.put("remark", "点击处理", "#000000"); - return notice; - } - - private TemplateMessage initMessageToOperator(NewRefundReviewEvent newRefundReviewEvent, String operatorName, JSONObject client, JSONObject review, String templateId, String wechatOpenid) { - String uri = PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/refund/review/check/" + review.getString("review_id")); - TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, uri); - notice.put("first", operatorName + ",您的退款申请已提交,请等待RoyalPay审核", "#ff0000"); - notice.put("keyword1", review.getString("currency") + newRefundReviewEvent.getRefundOrder().getDoubleValue("amount"), "#ff0000"); - notice.put("keyword2", operatorName, "#0000ff"); - notice.put("keyword3", client.getString("short_name") + "(" + client.getString("client_moniker") + ")", "#0000ff"); - notice.put("keyword4", review.getString("remark") == null ? "无备注" : review.getString("remark"), "#0000FF"); - notice.put("remark", "点击处理", "#000000"); - return notice; - } - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefuseRefundListener.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefuseRefundListener.java deleted file mode 100644 index 89e55b9ad..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefuseRefundListener.java +++ /dev/null @@ -1,62 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.events.listeners; - -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.tradelog.refund.events.RefundRefunseEvent; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; - -@Service -public class NoticeRefuseRefundListener implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private ClientMapper clientMapper; - @Resource - private MpWechatApiProvider mpWechatApiProvider; - - @Override - public void onApplicationEvent(RefundRefunseEvent event) { - JSONObject review = event.getRefundReviewBean(); - JSONObject client = clientMapper.findClient(review.getInteger("client_id")); - String wxopenid = review.getString("creator_open_id"); - if (wxopenid != null) { - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(wxopenid); - if (api != null) { - String templateId = api.getTemplateId("refuse-bd"); - if (templateId != null) { - try { - - TemplateMessage msg = initOperatorTemplate(wxopenid, templateId, review, client); - api.sendTemplateMessage(msg); - } catch (Exception e) { - logger.error("notice error", e); - } - } - } - } - - } - - private TemplateMessage initOperatorTemplate(String wxopenid, String templateId, JSONObject review, JSONObject client) { - String uri = PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/refund/review/check/" + review.getString("review_id")); - TemplateMessage msg = new TemplateMessage(wxopenid, templateId, uri); - msg.put("first", client.getString("short_name") + "(" + client.getString("client_moniker") + ")退款申请被退回", "#ff0000"); - msg.put("keyword1", review.getString("review_id"), "#0000ff"); - msg.put("keyword2", "RoyalPay", "#000000"); - msg.put("keyword3", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss,z"), "#000000"); - msg.put("keyword4", review.getString("description") == null ? "" : review.getString("description"), "#000000"); - msg.put("remark", "请及时处理", "#ff0000"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java deleted file mode 100644 index cd4e70265..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java +++ /dev/null @@ -1,459 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.impls; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.exceptions.RefundExistException; -import au.com.royalpay.payment.manage.analysis.beans.RefundReviewBean; -import au.com.royalpay.payment.manage.mappers.log.CouponAccuessLogMapper; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.payment.RefundAuditionMapper; -import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; -import au.com.royalpay.payment.manage.mappers.payment.RefundReviewMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.tradelog.refund.RefundService; -import au.com.royalpay.payment.manage.tradelog.refund.events.NewRefundReviewEvent; -import au.com.royalpay.payment.manage.tradelog.refund.events.RefundRefunseEvent; -import au.com.royalpay.payment.tools.defines.OperatorType; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.mappers.SysConfigMapper; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.MessageFormat; -import java.util.Date; -import java.util.List; - -/** - * Created by yixian on 2016-07-04. - */ -@Service -public class RefundServiceImpl implements RefundService, ApplicationEventPublisherAware { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private OrderMapper orderMapper; - @Resource - private RefundAuditionMapper refundAuditionMapper; - @Resource - private RefundMapper refundMapper; - @Resource - private RefundReviewMapper refundReviewMapper; - @Resource - private ClientManager clientManager; - @Resource - private ClientMapper clientMapper; - @Resource - private ClientBDMapper clientBDMapper; - @Resource - private SysConfigMapper sysConfigMapper; - @Resource - private CouponAccuessLogMapper couponAccuessLogMapper; - @Resource - private ClientConfigService clientConfigService; - - @Resource - private PaymentApi paymentApi; - private ApplicationEventPublisher publisher; - - @Override - public JSONObject checkOrderRefundAmount(String orderId, JSONObject account) { - JSONObject order = orderMapper.getOrderDetail(orderId); - if (account != null && (account.getIntValue("client_id") != order.getIntValue("client_id"))) { - JSONObject client = clientMapper.findClient(account.getIntValue("client_id")); - ////父商户全局管理子商户时候,跳过 - JSONObject orderTargetClient = clientMapper.findClient(order.getIntValue("client_id")); - if (orderTargetClient.getIntValue("parent_client_id") != account.getIntValue("client_id") && !clientManager.listLevel3Client(account.getIntValue("client_id")).contains(orderTargetClient.getIntValue("parent_client_id"))) { - throw new ForbiddenException("Order is not belong to your shop/merchant"); - } else if (!client.getBooleanValue("sub_manage")) { - throw new ForbiddenException("Order is not belong to your shop/merchant"); - } - } - Assert.notNull(order, "Order Not Exists"); - List apply = refundAuditionMapper.listAuditingRefundsOfOrder(orderId); - JSONObject undoRefundOrder = refundReviewMapper.findUnResolveByOrderId(orderId); - if (undoRefundOrder != null) { - throw new RefundExistException(); - } - if (apply.isEmpty()) { - order.put("available", BigDecimal.valueOf(order.getDoubleValue("customer_payment_amount")) - .subtract(BigDecimal.valueOf(order.getDoubleValue("refund_fee"))).doubleValue()); - return order; - } else { - if (account != null) { - PartnerRole role = PartnerRole.getRole(account.getIntValue("role")); - if (role == PartnerRole.MANAGER || role == PartnerRole.ADMIN) { - JSONObject json = new JSONObject(); - json.put("applying", true); - json.put("auditable", true); - JSONObject audition = refundAuditionMapper.find(apply.get(0).getString("id")); - JSONObject refund = refundMapper.find(audition.getString("refund_id")); - json.put("audition", audition); - json.put("refund", refund); - return json; - } - } - JSONObject json = new JSONObject(); - json.put("applying", true); - json.put("url", PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/refund/auditions/" + apply.get(0).getString("id"))); - return json; - } - } - - @Override - public JSONObject checkOrderRefundInfo(String orderId) { - JSONObject order = orderMapper.getOrderDetail(orderId); - Assert.notNull(order, "order not exists"); - JSONObject undoRefundOrder = refundReviewMapper.findUnResolveByOrderId(orderId); - if (undoRefundOrder != null) { - throw new BadRequestException("该笔订单有退款正在处理,请稍后再试!"); - } - order.put("available", BigDecimal.valueOf(order.getDoubleValue("customer_payment_amount")) - .subtract(BigDecimal.valueOf(order.getDoubleValue("refund_fee"))).doubleValue()); - return order; - } - - @Override - public JSONObject listNeedReviewRefundOrders(RefundReviewBean reviewBean) { - JSONObject params = reviewBean.toParams(); - PageList reviewOrders = refundReviewMapper.listNeedReviewOrders(params, new PageBounds(reviewBean.getPage(), reviewBean.getLimit())); - JSONObject result = PageListUtils.buildPageListResult(reviewOrders); - JSONObject analysis = refundReviewMapper.analysisReviewRefundOrders(params); - result.put("analysis", analysis); - return result; - } - - @Override - public int notifyRefundReview() { - return refundReviewMapper.notifyRefundReview(); - } - - @Override - public boolean reviewNewRefundOrder(String orderId, BigDecimal feeAmount, String remark, JSONObject account, JSONObject manager) { - JSONObject order = orderMapper.find(orderId); - int clientId = order.getIntValue("client_id"); - String currency = order.getString("currency"); - - // 增加角色审核 - JSONObject client = clientManager.getClientInfo(clientId); - Assert.notNull(client, "client not exists"); - JSONObject clientConfig = clientConfigService.find(clientId); - OperatorType type = account != null ? OperatorType.PARTNER : OperatorType.MANAGER; - boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER - && clientConfig.getBooleanValue("enable_refund_auth"); - logger.debug("applyer type={}; require audit={}", type, requireAudit); - - paymentApi.clientRefundBalanceCheck(clientId, orderId, currency, feeAmount); - Assert.notNull(order, "Order Not exists"); - checkOrderUseCustomerCoupon(order, feeAmount); - JSONObject review = new JSONObject(); - review.put("client_id", order.getString("client_id")); - review.put("order_id", order.getString("order_id")); - review.put("currency", order.getString("currency")); - review.put("amount", feeAmount); - review.put("status", 0); - review.put("remark", remark); - review.put("creation_by", account != null ? account.getString("display_name") : manager.getString("display_name")); - review.put("creation_date", new Date()); - review.put("creator_open_id", account != null ? account.getString("wechat_openid") : manager.getString("wx_openid")); - review.put("last_update_date", new Date()); - review.put("last_update_by", account != null ? account.getString("display_name") : manager.getString("display_name")); - if (requireAudit) { - return true; - } else { - refundReviewMapper.save(review); - publisher.publishEvent(new NewRefundReviewEvent(this, review, account != null ? account : manager)); - return false; - } - } - - @Override - public JSONObject cancelOrder(JSONObject partnerAccount, String orderId) { - return null; - } - - @Override - public JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager) { - JSONObject order = orderMapper.getOrderDetail(orderId); - Assert.notNull(order, "Order Not Exists!"); - int clientId = order.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(clientId); - Assert.notNull(client, "Client Not Exists"); - JSONObject clientConfig = clientConfigService.find(clientId); - if (!clientConfig.getBoolean("enable_refund")) { - throw new ForbiddenException("Merchant has no refund permission"); - } - - BigDecimal realAmount = original ? fee : CurrencyAmountUtils.toAmount(fee, order.getString("currency")); - JSONObject refundConfig = checkRefundAuditFlag(); - if (partnerAccount != null && refundConfig != null && !refundConfig.isEmpty() && refundConfig.getBoolean("refundAudit")) { - if (realAmount.compareTo(refundConfig.getBigDecimal("refundAuditAmount")) > 0) { - // 订单需要审核 - boolean casherRefund = reviewNewRefundOrder(orderId, realAmount, remark, partnerAccount, manager); - if (casherRefund) { - return executeRefund(orderId, realAmount, remark, partnerAccount, manager, order, client); - } else { - throw new BadRequestException("退款已提交,请等待Royalpay审核"); - } - } - } - return executeRefund(orderId, realAmount, remark, partnerAccount, manager, order, client); - - } - - private JSONObject executeRefund(String orderId, BigDecimal amount, String remark, JSONObject partnerAccount, JSONObject manager, JSONObject order, - JSONObject client) { - checkOrderUseCustomerCoupon(order, amount); - JSONObject clientConfig = clientConfigService.find(client.getIntValue("client_id")); - OperatorType type = partnerAccount != null ? OperatorType.PARTNER : OperatorType.MANAGER; - JSONObject operator = new JSONObject(); - if (type == OperatorType.PARTNER) { - - int accountClientId = partnerAccount.getIntValue("client_id"); - Assert.isTrue(accountClientId == client.getIntValue("client_id") || accountClientId == client.getIntValue("parent_client_id") - || clientManager.listLevel3Client(accountClientId).contains(client.getIntValue("parent_client_id")), - "This order is not belong to current merchant"); - operator.put("operator_id", partnerAccount.getString("account_id")); - operator.put("operator", partnerAccount.getString("display_name")); - } else { - operator.put("operator_id", manager.getString("manager_id")); - operator.put("operator", manager.getString("display_name")); - } - boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(partnerAccount.getIntValue("role")) == PartnerRole.CASHIER - && clientConfig.getBooleanValue("enable_refund_auth"); - logger.debug("applyer type={}; require audit={}", type, requireAudit); - return paymentApi.refundOrder(null, orderId, null, amount, remark, operator, type, requireAudit); - } - - // 订单使用积分商城优惠券,仅支持全额退款 - private void checkOrderUseCustomerCoupon(JSONObject order, BigDecimal feeAmount) { - JSONObject couponLogs = couponAccuessLogMapper.findUsedCouponByOrderId(order.getString("order_id")); - if (couponLogs != null) { - BigDecimal customerPayAmount = order.getBigDecimal("customer_payment_amount"); - if (customerPayAmount.compareTo(feeAmount) != 0) { - throw new ForbiddenException("该订单使用了积分商城优惠券,仅支持全额退款!"); - } - } - } - - @Override - // @Transactional - public JSONObject newReviewRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject manager) { - JSONObject reviewOrder = refundReviewMapper.findUnResolveByOrderId(orderId); - reviewOrder.put("status", 1); - reviewOrder.put("last_update_date", new Date()); - reviewOrder.put("last_update_by", manager.getString("display_name")); - refundReviewMapper.updateReviewOrders(reviewOrder); - return newRefundOrder(orderId, fee, original, remark, null, manager); - } - - @Override - public JSONObject auditionInfo(String auditionId, String openid) { - JSONObject account = clientManager.getAccountByOpenId(openid); - if (account == null || account.size() <= 0) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - return auditionInfoGet(auditionId, account); - } - - @Override - public JSONObject auditionInfoByAccount(String auditionId, JSONObject account) { - if (account == null || account.size() <= 0) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - return auditionInfoGet(auditionId, account); - } - - private JSONObject auditionInfoGet(String auditionId, JSONObject account) { - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - JSONObject audition = refundAuditionMapper.find(auditionId); - if (audition == null) { - throw new BadRequestException("Audition not exists"); - } - if (account.getIntValue("client_id") != audition.getIntValue("client_id")) { - throw new ForbiddenException("Audition is not belong to your shop/merchant"); - } - if (audition.getBoolean("audit_result") != null) { - throw new BadRequestException("Audition Already Measured"); - } - JSONObject order = orderMapper.find(audition.getString("order_id")); - audition.put("order", order); - JSONObject refund = refundMapper.find(audition.getString("refund_id")); - audition.put("refund", refund); - return audition; - } - - @Override - public void auditRefundByOpenId(String auditionId, String openid, boolean pass) { - JSONObject account = clientManager.getAccountByOpenId(openid); - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - JSONObject audition = refundAuditionMapper.find(auditionId); - if (audition == null) { - throw new BadRequestException("Audition not exists"); - } - if (account.getIntValue("client_id") != audition.getIntValue("client_id")) { - throw new ForbiddenException("Audition is not belong to your shop/merchant"); - } - if (audition.getBoolean("audit_result") != null) { - throw new BadRequestException("Audition Already Measured"); - } - audition.put("auditorid", account.getString("account_id")); - audition.put("auditorname", account.getString("display_name")); - audition.put("audit_result", pass); - audition.put("audittime", new Date()); - refundAuditionMapper.update(audition); - if (pass) { - submitRefund(account, audition); - } - } - - @Override - public void auditRefundByAccount(JSONObject account, String auditionId, boolean agree) { - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - JSONObject audition = refundAuditionMapper.find(auditionId); - if (audition == null) { - throw new BadRequestException("Audition not exists"); - } - if (account.getIntValue("client_id") != audition.getIntValue("client_id")) { - throw new ForbiddenException("Audition is not belong to your shop/merchant"); - } - if (audition.getBoolean("audit_result") != null) { - throw new BadRequestException("Audition Already Measured"); - } - audition.put("auditorid", account.getString("account_id")); - audition.put("auditorname", account.getString("display_name")); - audition.put("audit_result", agree); - audition.put("audittime", new Date()); - refundAuditionMapper.update(audition); - if (agree) { - submitRefund(account, audition); - } - } - - private void submitRefund(JSONObject account, JSONObject audition) { - JSONObject refundLog = refundMapper.find(audition.getString("refund_id")); - boolean platformAuditFlag = auditRefundAndCommitToPlatform(refundLog.getBigDecimal("amount"), audition.getString("remark"), - refundLog.getString("order_id"), account); - if (!platformAuditFlag) { - paymentApi.submitRefund(audition.getString("refund_id")); - } - } - - private boolean auditRefundAndCommitToPlatform(BigDecimal amount, String remark, String orderId, JSONObject account) { - if (amount.compareTo(BigDecimal.ZERO) > 0) { - JSONObject refundConfig = checkRefundAuditFlag(); - if (refundConfig != null && refundConfig.getBoolean("refundAudit") && amount.compareTo(refundConfig.getBigDecimal("refundAuditAmount")) >= 0) { - // 订单需要审核 - reviewNewRefundOrder(orderId, amount, remark, account, null); - return true; - } - // 退款 - return false; - } else { - throw new BadRequestException("Refund amount can not be 0"); - } - } - - @Override - public JSONObject auditionsFromOpenId(String openid) { - JSONObject account = clientManager.getAccountByOpenId(openid); - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - JSONObject res = new JSONObject(); - int clientId = account.getIntValue("client_id"); - res.put("client", clientManager.getClientInfo(clientId)); - res.put("auditions", refundAuditionMapper.listAuditingRefundsOfClient(clientId)); - return res; - } - - @Override - public JSONObject auditionsFromAccount(JSONObject account) { - if (account == null) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - throw new BadRequestException("You have no permission to audit an refund order"); - } - JSONObject res = new JSONObject(); - int clientId = account.getIntValue("client_id"); - res.put("client", clientManager.getClientInfo(clientId)); - List auditions = refundAuditionMapper.listAuditingRefundsOfClient(clientId); - res.put("auditions", auditions); - res.put("counts", auditions.size()); - return res; - } - - @Override - public void offRefundReviewOrder(JSONObject review, JSONObject manager) { - review.put("last_update_by", manager.getString("display_name")); - review.put("is_valid", 0); - refundReviewMapper.updateReviewOrders(review); - publisher.publishEvent(new RefundRefunseEvent(this, review)); - } - - @Override - public JSONObject findReviewOrder(String reviewId) { - JSONObject review = refundReviewMapper.findByReviewId(reviewId); - review.put("amount", review.getBigDecimal("amount")); - JSONObject client = clientMapper.findClient(review.getIntValue("client_id")); - review.put("client_moniker", client.getString("client_moniker")); - review.put("short_name", client.getString("short_name")); - List currentBDs = clientBDMapper.listClientBDAvailable(client.getIntValue("client_id"), new Date()); - StringBuilder bdNameStr = new StringBuilder(); - for (JSONObject bd : currentBDs) { - bdNameStr.append(bd.getString("bd_name")).append(","); - } - review.put("bd_name", bdNameStr.deleteCharAt(bdNameStr.length() - 1).toString()); - JSONObject order = orderMapper.find(review.getString("order_id")); - review.put("available", BigDecimal.valueOf(order.getDoubleValue("customer_payment_amount")) - .subtract(BigDecimal.valueOf(order.getDoubleValue("refund_fee"))).doubleValue()); - review.put("create_time", order.getDate("create_time")); - review.put("channel", order.getString("channel")); - return review; - } - - @Override - public JSONObject checkRefundAuditFlag() { - String refundAudit = sysConfigMapper.findValueByKey("refund_audit"); - String refundAuditAmount = sysConfigMapper.findValueByKey("refund_audit_amount"); - JSONObject refundConfig = new JSONObject(); - refundConfig.put("refundAudit", refundAudit); - refundConfig.put("refundAuditAmount", refundAuditAmount); - return refundConfig; - } - - @Override - public JSONObject listUnionAllApply(JSONObject params, PageBounds pagination) { - if (params.get("client_id") == null && params.get("client_ids") == null) { - return null; - } - return PageListUtils.buildPageListResult(refundMapper.listUnionAllApply(params, pagination)); - - } - - @Override - public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { - this.publisher = applicationEventPublisher; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/listeners/RefundSendTemplateMessageSender.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/listeners/RefundSendTemplateMessageSender.java deleted file mode 100644 index c30aa4071..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/listeners/RefundSendTemplateMessageSender.java +++ /dev/null @@ -1,115 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.refund.listeners; - -import au.com.royalpay.payment.core.PaymentApi; -import au.com.royalpay.payment.core.events.RefundSendEvent; -import au.com.royalpay.payment.core.mappers.PmtOrderMapper; -import au.com.royalpay.payment.manage.appclient.core.RetailAppService; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; -import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.RoundingMode; -import java.util.List; -import java.util.TimeZone; - -/** - * Created by yixian on 2017-02-14. - */ -@Service -public class RefundSendTemplateMessageSender implements ApplicationListener { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - private MpWechatApiProvider mpWechatApiProvider; - @Resource - private PmtOrderMapper pmtOrderMapper; - @Resource - private MerchantInfoProvider merchantInfoProvider; - @Resource - private RetailAppService retailAppService; - @Resource - private PaymentApi paymentApi; - @Resource - private ClientAccountMapper clientAccountMapper; - - @Override - public void onApplicationEvent(RefundSendEvent event) { - logger.debug("发送退款受理通知"); - try { - sendTemplateMessage(event); - } catch (Exception e) { - logger.error("模板消息发送失败", e); - } - try { - sendAppMessage(event); - } catch (Exception e) { - logger.error("发送App消息失败", e); - } - } - - private void sendAppMessage(RefundSendEvent event) { - JSONObject refundOrder = event.getRefundOrder(); - JSONObject order = pmtOrderMapper.find(refundOrder.getString("order_id")); - String refundAmount = order.getString("currency") + " " + refundOrder.getBigDecimal("amount").setScale(2, RoundingMode.DOWN).toPlainString(); - retailAppService.sendRefundAppMessage(refundAmount, order); - } - - private void sendTemplateMessage(RefundSendEvent event) { - JSONObject refundOrder = event.getRefundOrder(); - List accounts = clientAccountMapper.listPaymentNoticeAccounts(refundOrder.getIntValue("client_id")); - JSONObject order = pmtOrderMapper.find(refundOrder.getString("order_id")); - JSONObject client = merchantInfoProvider.getClientInfo(order.getIntValue("client_id")); - - String refundTimeString = DateFormatUtils.format(refundOrder.getDate("create_time"), "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone(client.getString("timezone"))); - String refundAmount = order.getString("currency") + " " + refundOrder.getBigDecimal("amount").setScale(2, RoundingMode.DOWN).toPlainString(); - for (JSONObject account : accounts) { - String openId = account.getString("wechat_openid"); - if (openId != null) { - buildAndSendMessage(refundOrder, order, client, openId, refundTimeString, refundAmount); - } - } - if ("Wechat".equals(order.getString("channel"))) { - String customerOpenId = order.getString("customer_id"); - buildAndSendMessage(refundOrder, order, client, customerOpenId, refundTimeString, refundAmount); - } - } - - private void buildAndSendMessage(JSONObject refundOrder, JSONObject order, JSONObject client, String openId, String refundTimeString, String refundAmount) { - String uri = "/api/v1.0/wechat_notice/partners/" + client.getString("client_moniker") + "/refunds/" + refundOrder.getString("out_refund_id") + "/status"; - String url = PlatformEnvironment.getEnv().concatUrl(uri); - try { - MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(openId); - if (api != null) { - String templateId = api.getTemplateId("refund-send"); - if (templateId != null) { - TemplateMessage msg = initMessage(order, openId, refundTimeString, refundAmount, url, templateId); - api.sendTemplateMessage(msg); - } - } - } catch (Exception e) { - logger.error("模板消息发送失败", e); - } - } - - private TemplateMessage initMessage(JSONObject order, String openId, String refundTimeString, String refundAmount, String url, String templateId) { - TemplateMessage msg = new TemplateMessage(openId, templateId, url); - String channel = order.getString("channel"); - String channelName = paymentApi.channelName(channel); - msg.put("first", "退款已提交" + channelName + "处理", "#10b24c"); - msg.put("keyword1", refundTimeString, "#000000"); - msg.put("keyword2", order.getString("order_id"), "#000000"); - msg.put("keyword3", order.getString("order_description"), "#000000"); - msg.put("keyword4", refundAmount, "#000000"); - msg.put("remark", channelName + "已受理您的退款申请,将在近期到账", "#10b24c"); - return msg; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java deleted file mode 100644 index 7d5e62e95..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java +++ /dev/null @@ -1,88 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.web; - -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.NotFoundException; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * Created by yixian on 2016-07-02. - */ -@RestController -@RequestMapping("/sys/trade_logs") -public class ManageTradelogController { - @Resource - private TradeLogService tradeLogService; - @Resource - private ClientManager clientManager; - - @RequestMapping(method = RequestMethod.GET) - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - public JSONObject listAllTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return tradeLogService.listAllTradeLogs(query, manager); - } - - @RequestMapping(value = "/incremental", method = RequestMethod.GET) - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return tradeLogService.listAllIncrementalTradeLogs(query, manager); - } - @RequestMapping(value = "/incremental/analysis", method = RequestMethod.GET) - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - public JSONObject incrementalAnalysisOrders(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return tradeLogService.incrementalAnalysisOrders(query, manager); - } - - @ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) - @ReadOnlyConnection - @RequirePartner - public List listTradeRefunds(@PathVariable String tradeId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return tradeLogService.listOrderRefunds(tradeId, partner != null ? partner.getJSONObject("client").getString("timezone") : null); - } - - @ManagerMapping(value = "/report/excel", method = RequestMethod.GET) - @ReadOnlyConnection - public void exportExcel(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportTransLog(query, manager, httpResponse); - } - - @ManagerMapping(value = "/trans_flow", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF}) - @ReadOnlyConnection - public JSONObject listTransFlow(TradeLogQuery query, @RequestParam String client_moniker) throws Exception { - return tradeLogService.listPartnerTransFlowPage(query, getPartnerParams(client_moniker)); - } - - @ManagerMapping(value = "/trans_flow/pdf", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF}) - @ReadOnlyConnection - public void exportTransFlowPDF(TradeLogQuery query, @RequestParam String client_moniker, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportTransFlow(query, getPartnerParams(client_moniker), httpResponse); - } - - private JSONObject getPartnerParams(String clientMoniker) { - JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new NotFoundException("Client Not Exists"); - } - JSONObject params = new JSONObject(); - params.put("client_id", client.getIntValue("client_id")); - params.put("client", client); - params.put("client_moniker", clientMoniker); - return params; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/PayNoticeController.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/PayNoticeController.java deleted file mode 100644 index d5ec2225e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/PayNoticeController.java +++ /dev/null @@ -1,42 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.web; - -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; - -import com.alibaba.fastjson.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; - -/** - * Created by yixian on 2016-07-13. - */ -@Controller -@RequestMapping("/api/v1.0/wechat_notice/partners/{clientMoniker}") -public class PayNoticeController { - @Resource - private TradeLogService tradeLogService; - - @WechatMapping(value = "/orders/{orderId}/notice", method = RequestMethod.GET, oauthType = WxOauthType.USERBASE) - @ReadOnlyConnection - public String noticeView(Model model, @PathVariable String clientMoniker, @PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) { - tradeLogService.getOrderDetail(model, clientMoniker, orderId, wechat.getString("openid")); - return "paynotice"; - } - - @WechatMapping(value = "/refunds/{refundId}/status", method = RequestMethod.GET, oauthType = WxOauthType.USERBASE) - @ReadOnlyConnection - public String refundStatus(Model model, @PathVariable String clientMoniker, @PathVariable String refundId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) { - tradeLogService.getRefundStatus(model, clientMoniker, refundId, wechat.getString("openid")); - return "refund_status"; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/RefundController.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/RefundController.java deleted file mode 100644 index 94fc70088..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/RefundController.java +++ /dev/null @@ -1,153 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.web; - -import au.com.royalpay.payment.manage.analysis.beans.RefundReviewBean; -import au.com.royalpay.payment.manage.mappers.payment.RefundReviewMapper; -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.tradelog.refund.RefundService; -import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -/** - * Created by yixian on 2016-07-04. - */ -@RestController -@RequestMapping("/api/payment/v1.0/refund") -public class RefundController { - @Resource - private RefundService refundService; - @Resource - private RefundReviewMapper refundReviewMapper; - - - @GetMapping("/orders/{orderId}/refund_check") - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - @RequirePartner - public JSONObject refundCheck(@PathVariable String orderId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return refundService.checkOrderRefundAmount(orderId, account); - } - - @PostMapping("/orders/offReview") - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - public void offReview(@RequestBody JSONObject review, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - refundService.offRefundReviewOrder(review, manager); - } - - @GetMapping("/orders/{orderId}/refund_orderInfo") - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - public JSONObject refundOrderInfo(@PathVariable String orderId) { - return refundService.checkOrderRefundInfo(orderId); - } - - @GetMapping("/orders/needReview") - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - public JSONObject listNeedReviewRefundOrders(RefundReviewBean reviewBean) { - return refundService.listNeedReviewRefundOrders(reviewBean); - } - - @GetMapping("/orders/notifyReview") - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - public int notifyReviewRefundOrders() { - return refundService.notifyRefundReview(); - } - - @WechatMapping(value = "/auditions", method = RequestMethod.GET) - @ReadOnlyConnection - public ModelAndView auditionListPage(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) { - ModelAndView view = new ModelAndView("refund_audit_list"); - view.addAllObjects(refundService.auditionsFromOpenId(user.getString("openid"))); - return view; - } - - @WechatMapping(value = "/auditions/{auditionId}", method = RequestMethod.GET) - @ReadOnlyConnection - public ModelAndView auditionPage(@PathVariable String auditionId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) { - ModelAndView view = new ModelAndView("refund_audit"); - view.addAllObjects(refundService.auditionInfo(auditionId, user.getString("openid"))); - return view; - } - - @GetMapping("/json/auditions") - @ReadOnlyConnection - public JSONObject auditionListPageJson(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return refundService.auditionsFromAccount(account); - } - - @GetMapping("/json/auditions/{auditionId}") - @ReadOnlyConnection - public JSONObject auditionPageJson(@PathVariable String auditionId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return refundService.auditionInfoByAccount(auditionId, account); - } - - @PartnerMapping(value = "/auditions/{auditionId}/page_audit", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) - public void auditRefundApply(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String auditionId, @RequestBody JSONObject agree) { - refundService.auditRefundByAccount(account, auditionId, agree.getBooleanValue("agree")); - } - - @GetMapping("/review/{reviewId}") - @ReadOnlyConnection - public ModelAndView reviewRefundPage(@PathVariable String reviewId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) { - ModelAndView view = new ModelAndView("refund_review"); - view.addObject("review", refundService.findReviewOrder(reviewId)); - return view; - } - - @GetMapping("/review/check/{reviewId}") - @ReadOnlyConnection - public ModelAndView refundStatusCheck(@PathVariable String reviewId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) { - ModelAndView view = new ModelAndView("refund_review_client"); - view.addObject("review", refundService.findReviewOrder(reviewId)); - return view; - } - - @PutMapping("/auditions/{auditionId}/wx_audit") - public JSONObject audit(@PathVariable String auditionId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, @RequestBody JSONObject audit) { - refundService.auditRefundByOpenId(auditionId, wxUser.getString("openid"), audit.getBooleanValue("pass")); - return new JSONObject(); - } - - @PostMapping("/review/orders/{orderId}") - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - public void reviewNewRefund(@PathVariable String orderId, @RequestBody JSONObject fee, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - BigDecimal amount = fee.getBigDecimal("fee"); - boolean original = fee.getBooleanValue("original_number"); - String remark = fee.getString("remark"); - if (amount.compareTo(BigDecimal.ZERO) > 0) { - refundService.newReviewRefundOrder(orderId, amount, original, remark, manager); - } else { - throw new BadRequestException("Refund amount can not be 0"); - } - } - - @PostMapping("/orders/{orderId}") - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT}) - @RequirePartner - public JSONObject newRefundOrder(@PathVariable String orderId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, - @RequestBody JSONObject fee, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - BigDecimal amount = fee.getBigDecimal("fee"); - boolean original = fee.getBooleanValue("original_number"); - String remark = fee.getString("remark"); - if (amount.compareTo(BigDecimal.ZERO) > 0) { - //退款 - return refundService.newRefundOrder(orderId, amount, original, remark, account, manager); - } else { - throw new BadRequestException("Refund amount can not be 0"); - } - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ReportConfigController.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ReportConfigController.java deleted file mode 100644 index a7f0732ea..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ReportConfigController.java +++ /dev/null @@ -1,43 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.web; - -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; -import au.com.royalpay.payment.manage.permission.manager.RequireManager; -import au.com.royalpay.payment.manage.tradelog.core.ReportConfigService; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 11/11/2016. - */ -@RestController -@RequestMapping("/sys/report_config") -public class ReportConfigController { - @Resource - private ReportConfigService reportConfigService; - - @RequestMapping(method = RequestMethod.GET) - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR,ManagerRole.FINANCIAL_STAFF}) - public JSONObject listReprtConfg(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return reportConfigService.getReportConfig(); - } - - @RequestMapping(value = "/{pkid}",method = RequestMethod.GET) - @ReadOnlyConnection - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR,ManagerRole.FINANCIAL_STAFF}) - public JSONObject getReportConfigDetail(@PathVariable int pkid, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return reportConfigService.findOne(pkid); - } - - @RequestMapping(value = "/{pkid}",method = RequestMethod.PUT) - @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR,ManagerRole.FINANCIAL_STAFF}) - public void updateReportConfig(@PathVariable int pkid, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject config) { - reportConfigService.updateReportConfig(pkid,config); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/TradeFlowController.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/TradeFlowController.java deleted file mode 100644 index ea744807d..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/TradeFlowController.java +++ /dev/null @@ -1,109 +0,0 @@ -package au.com.royalpay.payment.manage.tradelog.web; - -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; -import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -/** - * 交易流水 - * Created by yishuqian on 9/12/16. - */ -@Controller -@RequestMapping("/client/trans_flow") -public class TradeFlowController { - @Resource - private TradeLogService tradeLogService; - - @PartnerMapping(value = "", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public JSONObject listTransFlow(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) throws Exception { - return tradeLogService.listPartnerTransFlowPage(query, partner); - } - - - @PartnerMapping(value = "/report/pdf", method = RequestMethod.GET) - @ReadOnlyConnection - public void exportPDF(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportTransFlow(query, partner, httpResponse); - } - - @PartnerMapping(value = "/report/upay_pdf", method = RequestMethod.GET) - @ReadOnlyConnection - public void exportUpayPDF(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportUpayTransFlow(query, partner, httpResponse); - } - - @PartnerMapping(value = "/report/excel", method = RequestMethod.GET) - @ReadOnlyConnection - public void exportExcel(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportExcelNew(query, partner, httpResponse); - } - - @PartnerMapping(value = "/report/excel_detail", method = RequestMethod.GET) - @ReadOnlyConnection - public void exportExcelDetail(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportExcel(query, partner, httpResponse); - } - - @PartnerMapping(value = "/settlement/log", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public JSONObject listSettlementLog(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - return tradeLogService.listSettlementLog(query, partner); - } - - @PartnerMapping(value = "/settlement/log/excelAll", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public void listSettlementLogExcel(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) { - tradeLogService.listSettlementLogExcel(query, partner, response); - } - - @PartnerMapping(value = "/settlement/unclear", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public String getClientUnClearedAmount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { -// JSONObject res = new JSONObject(); -// res.put("unCleared",tradeLogService.getClientUnClearedAmount(partner)); - return tradeLogService.getClientUnClearedAmount(partner).toString(); - } - - @PartnerMapping(value = "/settlement/log/excel", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public void exportSettlementLog(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) { - tradeLogService.exportSettlementLog(query, partner, response); - } - - @PartnerMapping(value = "/settlement/log/csv", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public void exportSettlementLogCSV(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) { - tradeLogService.exportSettlementLogCSV(query, partner, response); - } - - @PartnerMapping(value = "/settlement/log/pdf", method = RequestMethod.GET) - @ReadOnlyConnection - @ResponseBody - public void exportLogPDF(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) { - tradeLogService.exportPDFSettlement(query, partner, response); - } - - @PartnerMapping(value = "/report/excel_detail_all", method = RequestMethod.GET) - @ReadOnlyConnection - public void exportExcelDetailAllPartner(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception { - tradeLogService.exportExcelAllPartner(query, partner, httpResponse); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipCusQuery.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipCusQuery.java deleted file mode 100644 index aa66c6cb0..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipCusQuery.java +++ /dev/null @@ -1,31 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.beans; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 31/10/2016. - */ -public class VipCusQuery { - private int page = 1; - private int limit = 10; - public JSONObject toJsonParams() { - JSONObject params = new JSONObject(); - return params; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipCustomerInfo.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipCustomerInfo.java deleted file mode 100644 index 954e6381b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipCustomerInfo.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.beans; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import javax.validation.constraints.NotEmpty; - -/** - * Created by yishuqian on 31/10/2016. - */ -public class VipCustomerInfo { - @NotEmpty(message = "error.payment.valid.param_missing") - private String vip_code; - private String vip_name; - private String total_amount; - private String remark; - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getTotal_amount() { - return total_amount; - } - - public void setTotal_amount(String total_amount) { - this.total_amount = total_amount; - } - - public String getVip_code() { - return vip_code; - } - - public void setVip_code(String vip_code) { - this.vip_code = vip_code; - } - - - public JSONObject insertObject(){ - JSONObject res = (JSONObject) JSON.toJSON(this); - return res; - } - - public JSONObject updateObject() { - JSONObject obj = insertObject(); - obj.remove("vip_code"); - return obj; - } - - public String getVip_name() { - return vip_name; - } - - public void setVip_name(String vip_name) { - this.vip_name = vip_name; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipOrderQuery.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipOrderQuery.java deleted file mode 100644 index 737c40317..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/beans/VipOrderQuery.java +++ /dev/null @@ -1,44 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.beans; - -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 02/11/2016. - */ -public class VipOrderQuery { - private String vip_customer_id; - private int page=1; - private int limit=10; - - public JSONObject toJsonParams(){ - JSONObject res = new JSONObject(); - if (vip_customer_id != null){ - res.put("vip_customer_id",vip_customer_id); - } - return res; - } - - public String getVip_customer_id() { - return vip_customer_id; - } - - public void setVip_customer_id(String vip_customer_id) { - this.vip_customer_id = vip_customer_id; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/VipCustomerOrderService.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/VipCustomerOrderService.java deleted file mode 100644 index 0ae1b1b76..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/VipCustomerOrderService.java +++ /dev/null @@ -1,14 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.core; - -import au.com.royalpay.payment.manage.vipcustomer.beans.VipOrderQuery; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 01/11/2016. - */ -public interface VipCustomerOrderService { - - JSONObject listVipOrders(JSONObject partner, VipOrderQuery query); - - void openClearing(String client_moniker, String vip_order_id) throws Exception; -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/VipCustomerService.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/VipCustomerService.java deleted file mode 100644 index d911b6f6e..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/VipCustomerService.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.core; - -import au.com.royalpay.payment.manage.vipcustomer.beans.VipCusQuery; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipCustomerInfo; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by yishuqian on 31/10/2016. - */ -public interface VipCustomerService { - JSONObject listVipCustomers(JSONObject partner, VipCusQuery partnerQuery); - - JSONObject createVipCustomer(JSONObject partner, VipCustomerInfo vipCustomerInfo); - - void updateVipCustomer(JSONObject partner, String vip_code, VipCustomerInfo info); - - JSONObject getVipCustomerInfoByCode(String vipCode); - - JSONObject getVipCustomerDetail(JSONObject partner, String vip_code); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/impls/VipCustomerOrderServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/impls/VipCustomerOrderServiceImp.java deleted file mode 100644 index dc2e08b6b..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/impls/VipCustomerOrderServiceImp.java +++ /dev/null @@ -1,52 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.core.impls; - -import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; -import au.com.royalpay.payment.manage.mappers.vipcustomer.VipCustomerMapper; -import au.com.royalpay.payment.manage.mappers.vipcustomer.VipCustomerOrderMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientManager; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipOrderQuery; -import au.com.royalpay.payment.manage.vipcustomer.core.VipCustomerOrderService; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * Created by yishuqian on 01/11/2016. - */ -@Service -public class VipCustomerOrderServiceImp implements VipCustomerOrderService { - - @Resource - private VipCustomerMapper vipCustomerMapper; - @Resource - private VipCustomerOrderMapper vipCustomerOrderMapper; - @Resource - private ClientManager clientManager; - - @Override - public JSONObject listVipOrders(JSONObject partner, VipOrderQuery query) { - JSONObject params = query.toJsonParams(); - params.put("client_id",partner.getIntValue("client_id")); - PageList vipOrders = vipCustomerOrderMapper.listVipOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(vipOrders); - } - - @Override - public void openClearing(String client_moniker, String vip_customer_id) throws Exception { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); - if (client == null) { - throw new InvalidShortIdException(); - } - JSONObject vip_customer = vipCustomerMapper.findVipCustomer(vip_customer_id); - if (vip_customer == null) { - throw new Exception("VIP Code not exists"); - } - vipCustomerOrderMapper.updateClearingStatus(client.getIntValue("client_id"),vip_customer_id); - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/impls/VipCustomerServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/impls/VipCustomerServiceImp.java deleted file mode 100644 index bb36abe63..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/core/impls/VipCustomerServiceImp.java +++ /dev/null @@ -1,78 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.core.impls; - -import au.com.royalpay.payment.manage.mappers.vipcustomer.VipCustomerMapper; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipCusQuery; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipCustomerInfo; -import au.com.royalpay.payment.manage.vipcustomer.core.VipCustomerService; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.Order; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; - -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.annotation.Resource; -import java.util.Date; - -/** - * Created by yishuqian on 31/10/2016. - */ -@Service -public class VipCustomerServiceImp implements VipCustomerService { - @Resource - private VipCustomerMapper vipCustomerMapper; - - @Override - public JSONObject listVipCustomers(JSONObject partner, VipCusQuery query) { - JSONObject params = query.toJsonParams(); - params.put("client_id", partner.getIntValue("client_id")); - PageList vipCustomers = vipCustomerMapper.listVipCustomers(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); - return PageListUtils.buildPageListResult(vipCustomers); - } - - @Override - public JSONObject createVipCustomer(JSONObject partner, VipCustomerInfo vipCustomerInfo) { - String vipCode = partner.getString("client_moniker") + vipCustomerInfo.getVip_code().toUpperCase(); - JSONObject vipCustomer = getVipCustomerInfoByCode(vipCode); - if (vipCustomer != null) { - throw new BadRequestException("error.vipcustomer.valid.dumplicate_vip_code"); - } - JSONObject info = vipCustomerInfo.insertObject(); - info.put("vip_code", vipCode); - info.put("client_id", partner.getIntValue("client_id")); - info.put("create_time", new Date()); - vipCustomerMapper.save(info); - return info; - } - - @Override - public void updateVipCustomer(JSONObject partner, String vip_code, VipCustomerInfo info) { - JSONObject vipCustomerInfo = getVipCustomerInfoByCode(vip_code); - Assert.notNull(vipCustomerInfo, "customer not exists"); - JSONObject updateInfo = info.updateObject(); - updateInfo.put("client_id", partner.getIntValue("client_id")); - updateInfo.put("vip_customer_id", vipCustomerInfo.getString("vip_customer_id")); - vipCustomerMapper.update(updateInfo); - } - - @Override - public JSONObject getVipCustomerInfoByCode(String vipCode) { - return vipCustomerMapper.findVipCustomerByCode(vipCode); - } - - @Override - public JSONObject getVipCustomerDetail(JSONObject partner, String vip_code) { - JSONObject vip_customer = getVipCustomerInfoByCode(vip_code); - Assert.notNull(vip_customer, "customer not exists"); - String clientMoniker = partner.getString("client_moniker"); - String url = PlatformEnvironment.getEnv().concatUrl("/partner/vip/" + clientMoniker + "/payment/qrcode/" + vip_code); - vip_customer.put("url", url); - vip_customer.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false)); - return vip_customer; - } -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/package-info.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/package-info.java deleted file mode 100644 index bfbe14ee1..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * vip客户单 - */ -package au.com.royalpay.payment.manage.vipcustomer; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/web/VipCustomerContorller.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/web/VipCustomerContorller.java deleted file mode 100644 index f9dfd2286..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/web/VipCustomerContorller.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.web; - -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.manage.permission.manager.RequirePartner; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipCusQuery; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipCustomerInfo; -import au.com.royalpay.payment.manage.vipcustomer.core.VipCustomerService; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - - -/** - * Created by yishuqian on 31/10/2016. - */ -@Controller -@RequestMapping("/partner/vip") -public class VipCustomerContorller { - @Resource - private VipCustomerService vipCustomerService; - - - @RequestMapping(method = RequestMethod.GET) - @RequirePartner(roles = PartnerRole.ADMIN) - @ResponseBody - public JSONObject listVipCustomers(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, VipCusQuery query) { - return vipCustomerService.listVipCustomers(partner, query); - } - - @RequestMapping(method = RequestMethod.POST) - @RequirePartner(roles = PartnerRole.ADMIN) - @ResponseBody - public JSONObject createVipCustomer(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody VipCustomerInfo vipCustomerInfo) { - return vipCustomerService.createVipCustomer(partner, vipCustomerInfo); - } - - @PartnerMapping(value = "/{vip_code}", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) - @ResponseBody - public void updateVipCustomer(@PathVariable String vip_code, @RequestBody VipCustomerInfo info, - @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - vipCustomerService.updateVipCustomer(partner, vip_code, info); - } - - @PartnerMapping(value = "/{vip_code}", method = RequestMethod.GET, roles = PartnerRole.ADMIN) - @ResponseBody - public JSONObject getVipCustomerByCode(@PathVariable String vip_code, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - return vipCustomerService.getVipCustomerDetail(partner, vip_code); - } - - -} diff --git a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/web/VipCustomerPaymentContorller.java b/src/main/java/au/com/royalpay/payment/manage/vipcustomer/web/VipCustomerPaymentContorller.java deleted file mode 100644 index acdd0ec63..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/vipcustomer/web/VipCustomerPaymentContorller.java +++ /dev/null @@ -1,38 +0,0 @@ -package au.com.royalpay.payment.manage.vipcustomer.web; - -import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; -import au.com.royalpay.payment.manage.vipcustomer.beans.VipOrderQuery; -import au.com.royalpay.payment.manage.vipcustomer.core.VipCustomerOrderService; -import au.com.royalpay.payment.manage.vipcustomer.core.VipCustomerService; -import au.com.royalpay.payment.tools.CommonConsts; -import com.alibaba.fastjson.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - - -/** - * Created by yishuqian on 31/10/2016. - */ -@Controller -@RequestMapping("/partner/vip/payment") -public class VipCustomerPaymentContorller { - @Resource - private VipCustomerService vipCustomerService; - @Resource - private VipCustomerOrderService vipCustomerOrderService; - - @PartnerMapping(value = "/orders",method = RequestMethod.GET) - @ResponseBody - public JSONObject listVipOrders(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, VipOrderQuery query){ - return vipCustomerOrderService.listVipOrders(partner,query); - } - - @PartnerMapping(value = "/clear/{vip_customer_id}", method = RequestMethod.PUT) - @ResponseBody - public void openClearing(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String vip_customer_id) throws Exception { - vipCustomerOrderService.openClearing(partner.getString("client_moniker"),vip_customer_id); - } - -} diff --git a/src/main/resources/apiclient_cert.p12 b/src/main/resources/apiclient_cert.p12 deleted file mode 100644 index 96de2220f..000000000 Binary files a/src/main/resources/apiclient_cert.p12 and /dev/null differ diff --git a/src/main/resources/apiclient_new_cert.p12 b/src/main/resources/apiclient_new_cert.p12 deleted file mode 100644 index 9c26f0bb5..000000000 Binary files a/src/main/resources/apiclient_new_cert.p12 and /dev/null differ diff --git a/src/main/resources/apple_message_cert_dev.p12 b/src/main/resources/apple_message_cert_dev.p12 deleted file mode 100644 index 922b88d93..000000000 Binary files a/src/main/resources/apple_message_cert_dev.p12 and /dev/null differ diff --git a/src/main/resources/application-alipay.yml b/src/main/resources/application-alipay.yml deleted file mode 100644 index 5214a7459..000000000 --- a/src/main/resources/application-alipay.yml +++ /dev/null @@ -1,69 +0,0 @@ -app: - alipay: - host: https://mapi-hk.alipay.com/gateway.do - merchants: - - key: hmwjrganlzb4aqgggdgdlod7l3lsjkn6 - pid: 2088821643021586 - pid-type: ONLINE - biz-type: ONLINE - private-key: classpath:data/crypt/alipay_private.pem - public-key: classpath:data/crypt/alipay_public.pem - sftp-password: XNBB3S - sftp-username: openvisePTY - - key: jb5mt4vhtlzg1xlc0k967sib7v81sba6 - pid: 2088721525235246 - pid-type: RETAIL - biz-type: RETAIL - sftp-password: XNBB3S - sftp-username: openvisePTY - - pid: SANDBOX_5Y2Z6G2Y6CD006426 - bill-pid: '' - pid-type: CONNECT - biz-type: RETAIL - api-prefix: /ams - private-key-string: |- - MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC7Q56Mi0ESd7lIImLl/qvoHry8M1pg6qMyzzsMsHe6kMMculI7B7G2/fGpSS2JC46jZrVRb/fYf1NLehhAh1MK51md/7dEgqjkowtXIjhEQTPXwTWWkxtnb/l+KoqWtBrkOfMIef+O6QbqvveneLlCq9wMnvKNsj0p9GtUKxYUyxY8Nwuc2tf2wG2zKuh0JoRMLMRMayr7WdhAy4jatJS5pDjJqoIxyhD6X7fPleoeJgzyYSZAPgnH01TSO5ePFQZ/7SxDRC8+D5rAnefsridaabmeBQG2QWf4Gz7qPuavnZfwKzkjptj390+D0PAR3f3JCvYXTrRRUGKdVpiuuFAbAgMBAAECggEBAJrmxUjWi9494Kq1nv9HGWYpvs8i33jZvmNyHhNSCcfupSanTQv9QljvWK5ClQMO509sz0FtECQqtnjxpwwBpISZeH0EoNFwD0sJP4E1EjwLf1nSPYSvbPS0IDnn8LnWg4QUF2AEoovRYGJf0zXZ2801ohFijZr+PC/vObTm6x4IsVasse+urTpAKb1XBnkOF2eKFTM4JdRHFSl4Uk0npdPtULUEvACpsORrBVjJz1dWjIkvHeOrqv5rKR1bxuRlhiDcVoDb7oDD3KIqR93YljOI0mdXLm2DuboGEpj0yKZYU+RaPWxMOErRT99UIAAVpPDVjGKZdt95K6BrWoqxq7kCgYEA5bzUMCM6/0jLt/kmuwkOF+zckz4DLtWFlosGrf658of9PQIvjkZbun3TcpJ2aQ8g7k2qFAUvwc5Uy5G0lW+uCIRA7zcKd2Rz4Rb4Q8qgI+9bIOuDjmvg36zOvqg3xuepoYq/2jcFGR+cBFGpbEu0VWESW3vytDsMosDp4xYkvt0CgYEA0KvSnx9ZqNHINQJCTgLd+mWbEv4lTSDXwi/OBtS8O7tTQRw73OkpOXobXv/vhTV4KimPOWTFFSEZcY7Rl0eyFV7rQD+gIioTCpt4m/ez/zImCv11tQWBqa/GoqZ0d0P9HPgmVjMh8Be0CVTEzGgXeOD2mcP+0WJCns/Js2s2j1cCgYEAk6EOMYjSJq4eyzA+JT6iYdmBvNTCstvfJmhceH8R+rpMj2HSMXkhBOxKbnuTv9tK7BfYTVkv4Ti34MDW7JiBm1NxbsdN4H8av/BExTt2QOFVDAiL13+XV+TyTi5G+Xhw1zAULSPiEMzxMw1O9BqJ3butUkCKLCst6YBSS+0027kCgYEAn+BFiyzV4QZ5wkNs0aBYupRGcBLQOXvEUz+VNp6faZRogSZEp0jtEOCBQBQPS5xf6M3Wsj6G0V1+xQaLhsCjrMQAskUNR5+83w+nJLhv7EJb62euW3dQlNXb9ppZ+VbaAuwNU1Xx1qYShmOwNHw8H50c00rbXUlPiaXh/9lRABkCgYBC9cIcIEutg3hmOlGrRVSSNnuYVO2MuLAIK1KnQftpZHZ+euuCnhPaoC3ZOtenWoBwgS6qV4Mpxq30qcc/mUouErpqUcrNxawlVgWjTSwNd6rT2MBg1lcOxpqsR9ZWolBp4nHvnbLxhI+2KiXpRV9Y8Gbkw1jI8/tMYcSEJsOfEA== - public-key-string: |- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqME6KAPZcMlFuy19J+RAj34PaS6iuyjINzQvdjR808IeVQAcLdUULMEgCTSQLshC606GFoGkN5nOouoMCZQmPv9hbZSWcDHMrPNNVYuAqwk0N80FSnASNPtlucoqzVjAaqgXD88hqjODCIS/b9LWrprCA3q3aAfVQu3eQLoFM1nn9EdznCp0uVClHgLtwj1rMRkjN+4CSwOW66/RNzsgnDJMkrTlRDeJCrbdXAs0Q3MWQEQv2z1fd34U1yyY2StkHbfKAVp2cCzhSl26K3LcCooDv9VDSv3BDH58sBQ8TIprIW0EsDA4jbLXEDEKXIjqIOaC/+x8jXyRpci17ZvRowIDAQAB - pid-host: https://open-sea.alipay.com - - pid: SANDBOX_5Y372Y2YBKQN02382 - bill-pid: 'Z02TE1650000000A' - pid-type: APS - biz-types: - - ONLINE - - RETAIL - api-prefix: /aps - private-key-string: |- - MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDWXsXs+dZPb/cd - BSmffOCjjoXLBQmAtrr9etHQBRUARP2jROppMYlvpfHkBvDlSs8mkz5dNeFF9L0z - QblRWxgW2658nq6u833CjPgTROsLEQZIrJuGCWwQuNslv8ACoKW/FippMDLnDUfk - /41TfzIiMhVrAUuy7P14pa/O8fIrDXMU/G1jknhPfvpLqkPfAB9N2Bf/F61XZsNN - 3Xco8X/wW8EdGaw1NdS2hjNvAvuxlcVexqPwXoECJgPQNip/9G/a+8NmKn7hLL1V - 8eXyC2J5pBMGq+H52Z2Su/jTyK9h5Qs9j42rQaBp06PHxfK4PhziIVaskLSqNO+j - IrONpumzAgMBAAECggEAEepHtj9G5sqfp0A4M0j3aRPPIKFiIuyige6SvETAdY5O - eCeZQ4NNThRbO8hMt4zh9QJXMuj+057ZdQAoIaFwSPDBC08joCFfQDQRw2J+FiWt - FcO/F5uP+XHJdsUooc+VKnwKvVG231Jf0MZ+pBy8Ltlqqs+n6OMfZ8bJA416xJgq - 35tfzKA1orpXtMk8YF7RrCnUlAxYWG5t30kqS/i7k0XtnaG26f0x/TllA+bT8G0I - Sv6JHlJYUh7GwjRmvt9DWnCIWCfr0HnIfDG28Hj1ZrIgpCULiM9/0JHB0DYj7xWn - kIYnN8M+aPi0uc10GPKpf6Z9d6BfKlTjkwjSSBADGQKBgQD9lPqEBUuYQYrG+mqJ - 3eQQ/ydt7LJ+q9k2Nv0v0yxp2VeZfGHy3IpJzL3tg38+YXY+BpUa30QjyEjD+TCz - +9Q/DR/d0chR+2+ZKB69RA39GjLNvebS6IogAzZi0+a4h48iB+4o9E39vJNZEfZt - ICa+QYBdfJuJ/hYfmmeVafTixwKBgQDYahML6Oj14qw+8ymEXToPwdYRs7+bikiw - BKU3t5jj+74kYGMBA5i1AdYA9pl7QZaLUPToPOyfG+YWzWKes1VrAq55h3h44S1S - REBK7pct9EmeXBajAmYJf+4smamWgmNvfOB1f6K4Bvz/wr/eSiOAXBtt2OMKe1H/ - kr0E85XVtQKBgCftYDCPYOK9VyuTXFkO3g0rD7tILKazSkU2DVGNb43PEfLx2b5S - qVeLbFBMhyl8URDdGncbtm/n5kUtJFUCjt3KpDzZ/i+iZmT4Izbr00QJ7vvkLccB - pFX8C4EuGkLt3USfeQlrxifwnEbHBEUUbeVBDQQrTZZBspwRRMQK5esbAoGAT7bi - xSRJiyivYZCX3lWoqV0wyNx424YYOB297cQG4RM9epC2Zw04FpRSi5BKAIisNyze - yRyH3COeoQ+OH/7Wm9AlDEbGLWBkHUVemTtBHIA7DcXF4M1lYGJrDKqdOP9WOR66 - Xw1gloCceGj3251bblB/GfslxhqenZEjZsuCiXECgYAYSe9ZS2pK06NG/0qqEK2t - LktRAEZLMZNKoCfTZ73Tv/3RbIKOTih/0u1esAz8ZNDba1rCY/Yk7tEnn7TdBmh6 - tZ2ioys08F2bZingLcTGes1s86/ideNGeoKT2e+071dD/AfdTqchaFRZdYlyPrF7 - Geg8LExk9alI9NEyoD7cKA== - public-key-string: |- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkuBPpcDeFpO12FUgi4UGHWCJ6OdPp0GVvYFUSJzJ+KNUodFpmgw306rNA+0Q5Bn/mw9aaqGCCmZYPpF4TnzGqQcLrAFABW+tpUfGj3WwNndhLyCBnqvp740iufsCaLvzlZyQplL8CBQ4AQPdIVa4YlCiX+AxJNq+kXsNvgUKK0iDLujYE6XzgjOCSq03tFfY3ry58DoEvf86WmS+fP7zAl77kmDf1CmJa5V06aviUlzmuyo/p8m3fUucB1Fv3WNF7qRpNPkMuL6jjHenb9LzWr1tieRTd7mZxOd9KOq75CJiX4XiTHhWbvd2pW/NIkDPZ9dAJPSK57mrh+e7zgT2pQIDAQAB - pid-host: https://open-sea.alipayplus.com - enabled: true - sftp-username: test_upload - sftp-password: 123456 - sftp-host: sftp-dev.alipay.com diff --git a/src/main/resources/application-bestpay.yml b/src/main/resources/application-bestpay.yml deleted file mode 100644 index 4c616ef10..000000000 --- a/src/main/resources/application-bestpay.yml +++ /dev/null @@ -1,10 +0,0 @@ -app: - bestpay: - debug: false - ftp: - host: 58.213.97.77 - password: cbp@oig - username: cbp - host: https://cbp.bestpay.com.cn/cashier - merchant-id: 1010101010376850 - production-key: 924181926043 \ No newline at end of file diff --git a/src/main/resources/application-common.yml b/src/main/resources/application-common.yml deleted file mode 100644 index e8639b946..000000000 --- a/src/main/resources/application-common.yml +++ /dev/null @@ -1,105 +0,0 @@ -app: - mail: - appid: 1 - host: https://mailsupport.royalpay.com.au - crossapp: - enable: true - agreetemplate: - aggregate: -# path: https://file.royalpay.com.au/open/2020/08/19/1597805249800_iNrLHtY7gxCDBtgTnKdtB62DdADxFt.pdf - path: https://file.royalpay.com.au/open/2022/01/18/1642486796388_3mnY02Hpq1Bbl836LKs7sxVzTJyDXQ.pdf - classic: - path: https://file.royalpay.com.au/open/2017/07/10/1499665073802_qV7fpEuS9rdbTnpa4po6rmbW9CSUfE.pdf - allow-clearing-generation: false - partner: - aes-key: xyc7Ya6TmL8/csM1ygtviA== - redis: - prefix: payment - redpack_auth: - enable: false - risk: - aes-key: NRvwd9dgbT2Cdz6zJz9AWA== - control: - aes-key: Aa+MtthC4Ztq4Kfa9aL+UA== - server: - ip: 127.0.0.1 - settle: - aes-key: EPrfsM2JE69ZPR7BhXn34g== - ueditor: - enable: true - tax: - type: GST - atoreport: - companies: - - brand: RoyalPay - reference-prefix: RPAY - abn: 16601619685 - company: TUNNEL SHOW PTY LTD - balance-groups: - - NORMAL_CROSS_BORDER - contact: - name: Locky - phone: +61394488865 - email: info@royalpay.com.au - address: - address: Level 11, 15 William St - suburb: Melbourne - state: VIC - postcode: 3000 - country: AUS - - brand: UPay - reference-prefix: UPAY - abn: 62627588514 - company: UPAY PTY LTD - balance-groups: - - RPAY_SVC_CARD - - RPAY_SVC_DIRECTDEBIT - contact: - name: Locky - phone: +61394488865 - email: info@royalpay.com.au - address: - address: Level 11, 15 William St - suburb: Melbourne - state: VIC - postcode: 3000 - country: AUS -logging: - level: - au: - com: - royalpay: - payment: debug - java: - sql: - Connection: debug - PreparedStatement: debug - Statement: debug - pattern: - console: '[%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){blue}] %clr(%-5level) %logger: %msg%n' -mybatis: - configuration: - mapUnderscoreToCamelCase: true - dialects: - - com.yixsoft.support.mybatis.dialects.mysql.MySqlDialect - paginator: - enable: true - advanced-count: true - dialect: com.github.miemiedev.mybatis.paginator.dialect.MySQLDialect -spring: - application: - name: @project.artifactId@ - version: @project.version@ - mail: - host: smtp.office365.com - port: 587 - thymeleaf: - mode: HTML - mvc: - converters: - preferred-json-mapper: fastjson -stockholder: - mails: leo.huang@royalpay.com.au -client_card: - account_reserve: 1000 - annual_rate: 0 diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml deleted file mode 100644 index 187beb9e6..000000000 --- a/src/main/resources/application-dev.yml +++ /dev/null @@ -1,167 +0,0 @@ -spring: - datasource: - master: - host: 192.168.0.92:3306 - jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: SuTUUxyvzS0cLETi6Rzm - schema-name: royalpay - username: rpaydev - slave: - host: 192.168.0.92:3306 - jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: SuTUUxyvzS0cLETi6Rzm - schema-name: royalpay - username: rpaydev - type: com.zaxxer.hikari.HikariDataSource -#spring: -# datasource: -# master: -# host: office.geekforbest.com:33306 -# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# username: rpaydev_out -# schema-name: royalpay -# password: SuTUUxyvzS0cLETi6Rzm -# slave: -# host: office.geekforbest.com:33306 -# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# username: rpaydev_out -# schema-name: royalpay -# password: SuTUUxyvzS0cLETi6Rzm - - -#spring: -# datasource: -# master: -# host: 127.0.0.1:3306 -# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# password: dalong -# schema-name: royalpay_payment -# username: root -# slave: -# host: 127.0.0.1:3306 -# jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# password: dalong -# schema-name: royalpay_payment -# username: root -# type: com.zaxxer.hikari.HikariDataSource -#spring: -# datasource: -# master: -# host: 119.28.3.196:3310 -# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# password: read0nly -# schema-name: royalpay_production -# username: readonly -# slave: -# host: 119.28.3.196:3310 -# jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# password: read0nly -# schema-name: royalpay_production -# username: readonly -# type: com.zaxxer.hikari.HikariDataSource -# redis: -# database: 1 -# host: 127.0.0.1 -# port: 6379 - redis: - database: 1 - host: 192.168.0.84 - port: 6379 - mail: - host: smtp.exmail.qq.com - port: 465 -app: - run-tasks: false - host: - main: https://65e5-222-95-183-204.ngrok.io/ - regions: - au: http://dalong-au.dev.rpaygroup.com/ - cn: http://dalong-au.dev.rpaygroup.com/ - mail: - appid: 1 - host: https://dev.mailsupport.hcqtech.com - # Mpsupport - mpsupport: - appid: payment - auth_code: eaHe5iaztrnz6xrc8mgX - host: https://mp.globepay.co - account: globepay - # 微信模板消息 - wechat: - accounts: - vitesse: - mp-id: vitesse - app-id: wxfa5d340b39a63a57_dev - open-id-key: vitesse_openid - open-id-start: o1vB - templates: - commission: whcyp5eYvKG9CtmkA820yBOoLs5gDvCJOTUn_QXOQmY - new-apply: QQUoZ_k73XJHgq2XCcUtoYNSXjuwgPSIx19cT5jgOy4 - newpartner-overtime: enoAIvboVTAhNkNTl6JHPV22XTXbWZ-9NbQXAqiK9xQ - payment-success: c2W-buYXHZb4hVwZ6jepKz_RRNHHh0tlfe8JkhpgPkE1OnY - payment-success-customer: buYXHZb4hVwZ6jepKz_RRNHHh0tlfe8JkhpgPkE1OnY - payment-success-cashier: buYXHZb4hVwZ6jepKz_RRNHHh0tlfe8JkhpgPkE1OnY - refund-audit-notice: I30yZCRupub8Lwi4jWAZwH17BQgKMGgzGeUkf63jfeo - refund-send: Z9j88_AZXmAa_V7CP1Lu2riUwDN-jpzazEDiO5AW2So - refuse-bd: dkEQ1QBY5rmEhiOzkRDheLEtnJB9oACO_pfURQPLnGQ - report-generated: '' - settlement: m6JfuEKLw3-c_XOeioJaFBj1QR4S497SlvDFv74fY-w - settlement-check-code: cJE5GwNIxmby2OAZ_mcC90vZppOGDcq1YLsGc2jNq40 - task-finished: VZHxG_2rBtk1UznqLtgfKojJls_-eXFkk2r-BkzeElQ - transaction-daily: '' - login-notice: CYtSHQ9gly6Tz68NfG8pm2Kp0dWcfwn5plPU26Rw6Pg - risk-warning-notice: JJz1KAgh2WHEV30ZzY5UdnMqJZL_eq14LEJV9Dh7Zuw - globepay: - mp-id: globepay - app-id: wxa0aa0b46f598ee79_dev - open-id-key: openid - open-id-start: oHew - templates: - commission: whcyp5eYvKG9CtmkA820yBOoLs5gDvCJOTUn_QXOQmY - new-apply: QQUoZ_k73XJHgq2XCcUtoYNSXjuwgPSIx19cT5jgOy4 - newpartner-overtime: enoAIvboVTAhNkNTl6JHPV22XTXbWZ-9NbQXAqiK9xQ - payment-success: c2W-buYXHZb4hVwZ6jepKz_RRNHHh0tlfe8JkhpgPkE1OnY - payment-success-customer: buYXHZb4hVwZ6jepKz_RRNHHh0tlfe8JkhpgPkE1OnY - payment-success-cashier: buYXHZb4hVwZ6jepKz_RRNHHh0tlfe8JkhpgPkE1OnY - refund-audit-notice: I30yZCRupub8Lwi4jWAZwH17BQgKMGgzGeUkf63jfeo - refund-send: xfhJsfopcj3MG8YADaLRSeNNjk5qCs07Oi2WITsNw4w - refuse-bd: dkEQ1QBY5rmEhiOzkRDheLEtnJB9oACO_pfURQPLnGQ - report-generated: '' - settlement: m6JfuEKLw3-c_XOeioJaFBj1QR4S497SlvDFv74fY-w - settlement-check-code: JGlluEjt-WNBnnPph30zldrtr4y_yaLYC3Nc4to7zjc - task-finished: sTuHL1bMOqikwDVSdZDlPDtoG3OCGvok3Fh2Das6Em4 - transaction-daily: '' - login-notice: C3YzQJuDPKDjmXgpRtyfl-sSo3xY51pKzcsbnyoi6KA - risk-warning-notice: BrSfB7UdPS4uywrbki_4C0Z9dsmNgm2RNY5k7n6bUxI - ronghan: - mp-id: ronghan - app-id: wxfab9f0f16082d77e - open-id-key: ronghan_openid - open-id-start: oTIy - templates: - commission: '' - new-apply: '' - newpartner-overtime: '' - payment-success: '' - payment-success-customer: '' - payment-success-cashier: '' - refund-audit-notice: '' - refund-send: '' - refuse-bd: '' - report-generated: '' - settlement: '' - settlement-check-code: '' - task-finished: '' - transaction-daily: '' - login-notice: '' -mail: - send: - credentialCode: Fd1aRfdjc9_dev -merchant: - mail: - sender: - password: pYhfyz-sutzew-dadzo2 - username: test1@geekforbest.com -gfp: - app: - host: http:localhost:9008/ diff --git a/src/main/resources/application-devproxy.yml b/src/main/resources/application-devproxy.yml deleted file mode 100644 index 173625c98..000000000 --- a/src/main/resources/application-devproxy.yml +++ /dev/null @@ -1,8 +0,0 @@ -spring: - datasource: - driver-class-name: com.mysql.jdbc.Driver - host: 119.28.3.196:3310 - password: read0nly - schema-name: rppaymentdev - url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - username: readonly diff --git a/src/main/resources/application-jd.yml b/src/main/resources/application-jd.yml deleted file mode 100644 index cf8a06f7a..000000000 --- a/src/main/resources/application-jd.yml +++ /dev/null @@ -1,8 +0,0 @@ -app: - jd: - agent-id: 110519142 - des-key-string: ti+JnsgV/XOKBwHZE2eUTJRMO/6DtqhY - md5-key: DI9JrGHK8W35Jeyt - merchant-id: 110519142002 - rsa-private-key-string: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIYEz9fiv9jVJ5swEWQ6s+UB17CLo1D717U36f0JXzqFJoIOGENQ+MW9Wo/oEbyyXgDwPFfIEnwqJ8bPj+cavMQKaKZZ1yZGJE2uCNn/dZhpEQC9hvPRFexNMoVekBdmnPpXpOZiowI7mhsO0SC5lx8knuBGQVQmz+DwRwVLVfnPAgMBAAECgYB50IvezeLVQ0IBw9o7AUScpmUXuoTSymbR+CW98rPVLEvJMOiK32GP0sIrRaRBoNri/XnLzDZJF8QZ6HYDeQETzICBDI42QID1R925zHW7p6cf66EePNnH0B6lv57o6zYpTYglW9jeUreSTOUdWnnDbW4XMzDjUUFuXHujVj2vQQJBAPiTDNOmsQFNpZ23MRB2blk9DjAnQbt3ZrHn+ZJU/up9QCfc7Iz9qelLZLifnageS7vwqb8T4pMTrJC8MXKoR2ECQQCKBbVQ65HDRoODkf/w00BnL1YgkqkkM2CMo4/BMSLMZbTIGv3uHXXfh3/1PCFQXa2+lO6jO0D2dZOCFxdg4D8vAkEA6Sn2ZCn96r0M1s3ZhhmxFKACyQRp0hEEEWkJX0u++fGW1k2SzgW69Yy048FFP0d7vsTWVNewNknEGteMgoJ6wQJAJv6934Lux9EgTwfs28mTpJOHLeTBzOyHFrUPZHHRdxY1IWQe4iuIpgLOcCbw8pfFAtdpJM0U6Y0Gg/aqMECrGQJAIEYcVNMHKj96+wOYC2DZfKLn6FK/oMDCCzUchdOB/7Q9naaGPTJhc+Upi0UKK7214vCyiRLTFcgPP3esCVDqAw== - rsa-public-key-string: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCKE5N2xm3NIrXON8Zj19GNtLZ8xwEQ6uDIyrS3S03UhgBJMkGl4msfq4Xuxv6XUAN7oU1XhV3/xtabr9rXto4Ke3d6WwNbxwXnK5LSgsQc1BhT5NcXHXpGBdt7P8NMez5qGieOKqHGvT0qvjyYnYA29a8Z4wzNR7vAVHp36uD5RwIDAQAB diff --git a/src/main/resources/application-lakala.yml b/src/main/resources/application-lakala.yml deleted file mode 100644 index d6a74d717..000000000 --- a/src/main/resources/application-lakala.yml +++ /dev/null @@ -1,9 +0,0 @@ -app: - lakalapay: - host: https://intl.lakala.com:7777 - merchants: - COPAUS000003: - accountId: COPAUS000003 - currency: AUD - privateKey: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIDjX164cAJrlsikv2aCtGendMxOi97lCU/7sLp5qpMGIIYjpN71LpYR2SBm2vzQNGP0UE6kFtOUfsPLf8CZxPHXVd2Qnz3YC+2uUGkWmafEWVkw1LnDenI9SD5vvGZYeEH5H7Ct6yYv5/JTSevRgCVllWqcPXDs8spQmbcr8/oVAgMBAAECgYAF9v/d6Vk9s276AC3fd6MTvPs5zVTJzv28VuCZ8LGFNl5g9ttVejFavp620ivGUXhrO85PpWZtCk1HkG5sInGr0pVnBb8dtsfyEzTHnguv7mNSQ6tYEsINcyYbhOnPMsECaNrdwCC7q0i82MQGTHss50F0mjxRCVz4ndiBseRXYQJBANJ9lTuyuKUmUdxsQNLy+ajFSWvVcC0IRLBT2E1EqgPBRJuTc2wlULJVAKz/+eSEjDsmJ0yD9fnISjdY1csyS20CQQCcwTBZIejjwP011sB2A91z2DSnveU4vvgFWnj0hhM4a/ChuUKoylMVYlDQ1vrqErFag96keU9BUwQ1LlmfC1hJAkANDKoW1GKsIm8Kyk9OhK/Drc96dvYIZK3VfK05RRuBNhcpyf9q4flZxPlQwGHer/T9qcTf8oJqZOds/P3sJgcVAkB/C6Sf2Pfj/3o5tH/wJlnJliW2/hVV1JE35Ye6xx+0zucMbBY2ryR/ZFuTp2ldZSEQ92fvbdJqY1o5sAM6//rhAkAMhwWEtGZ8tboADbWBnxD/maMGYlI/oGsQHWTT9/Jt2LmlR+dgpl1DVwizPbVJ0hVJZWkF/BC5bdZ9XEIZsv/K - publicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPg0O4rPQJL1O+jqJ4rBjFVNRAuDmBSoii9pYfPQBaescCVY0irkWWoLyfTT65TjvnPpOx+IfNzBTlB13qCEFm7algREoeUHjFgFNHiXJ2LK/R0+VWgXe5+EDFfbrFCPnmLKG3OcKDGQszP0VOf6VVTM1t56CpgaRMm1/+Tzd2TQIDAQAB diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml deleted file mode 100644 index a773595aa..000000000 --- a/src/main/resources/application-local.yml +++ /dev/null @@ -1,15 +0,0 @@ -spring: - datasource: - master: - host: 119.28.3.196:3310 - jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: read0nly - schema-name: royalpay_production - username: readonly - slave: - host: 119.28.3.196:3310 - jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: read0nly - schema-name: royalpay_production - username: readonly - type: com.zaxxer.hikari.HikariDataSource \ No newline at end of file diff --git a/src/main/resources/application-officedev.yml b/src/main/resources/application-officedev.yml deleted file mode 100644 index 21dafbe0e..000000000 --- a/src/main/resources/application-officedev.yml +++ /dev/null @@ -1,26 +0,0 @@ -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - host: 192.168.0.92:3306 - master: - driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: ${spring.datasource.pwd} - username: ${spring.datasource.user} - pwd: SuTUUxyvzS0cLETi6Rzm - schema-name: royalpay - slave: - driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: ${spring.datasource.pwd} - username: ${spring.datasource.user} - user: rpaydev - redis: - database: 9 - host: 192.168.0.84 - port: 6379 -app: - http: - cache: - enable: true - path: / \ No newline at end of file diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml deleted file mode 100644 index 43912f208..000000000 --- a/src/main/resources/application-production.yml +++ /dev/null @@ -1,8 +0,0 @@ -spring: - datasource: - driver-class-name: com.mysql.jdbc.Driver - host: 10.0.0.30:3306 - password: Pine@ppl321 - schema-name: royalpay_production - url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - username: ap_prod_user diff --git a/src/main/resources/application-proxy.yml b/src/main/resources/application-proxy.yml deleted file mode 100644 index ea9b304c2..000000000 --- a/src/main/resources/application-proxy.yml +++ /dev/null @@ -1,15 +0,0 @@ -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - host: 119.28.3.196:3310 - master: - driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: ZOIBhellor0yalpay - username: root - schema-name: royalpay_production - slave: - driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: read0nly - username: readonly diff --git a/src/main/resources/application-rpay.yml b/src/main/resources/application-rpay.yml deleted file mode 100644 index 0f8f6a4a2..000000000 --- a/src/main/resources/application-rpay.yml +++ /dev/null @@ -1,5 +0,0 @@ -app: - rpay: - appId: 8850afd2-6183-4cff-83af-9be5ca916e16 - privateKey: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKikZJwvKZ3dj5QsRy6xN/cPinAZa3leg8X40YzGrMEYWc2nmZY/EczYPq/kUp1uL2uikweDO35fuVpA4rALmJwXhHzsZyhVk4lEjHaqH8rNpVpmrwKP9rMmbFD23Mfvvt+BkKWan2T2dAMbSdjPY0+DTS4sN1ZrqzycRFxKFpohAgMBAAECgYBoO0Mb7WJxehFV6ZANYedPQkG0S2HL4AjeAY2yztDTf/NxUpdw74ZW74i/OgV93C5e/lqVmBzbXNq418XEPUaSohOqbcv+QRlEdlTAtn82aAUp/c9oSogPiHWs2VKiGoutejwVXQ6V9BAGMMegLwVphUu9dgrPC4dnfGO11fvLiQJBANt0VPmdqdG52rNVllKhF5+d+dIamOOQewWZf7HnkW0uYt9kWSbZCYyey4nP7NlONL7NEdUxn9exg/DYzegB99sCQQDEudve+jV2Ay6gbOS+ylHoCxSroF6jlkBQ0q7LIsWAAzIVLOuo5skC+wJmHzKXDoQBLXcFerP/T/iUSzisKqSzAkEAmjRVXY02/gLttWQnm+pMckGMgOFlm0oz18xzmSwR2TlmCnk12AFcH26ZsT3kvRGiKIxqwnb7TZIUF1IQ5b00TwJALD7xKNF1vLkyf3p+aDrw+ROk7oT/RCPDC2qXTbDgYs5VMVYNGsvtYfI6s+VIZ5koL2ueXWkfmsjNy+yvLmnY6QJADV9xlAa1+mWN2TfzAugd3L0fNLqPJPHBKQS5/bBKcoZlwfXwByrcCceKaCntJRZ056eQ7IeqkJfxjkEo/kgaRg== - rpayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxRx80vX64kSu5nrHbwPX/3SctyFIGrjBEJ9NEBOQPP4KHRQ49QyhVZ1fu7NvtD98n+PGR0ULUrK6S4KsYw6Huaga2RwbSVVkYPFGEFZ70XvjlGSzBG7fkbU8nscWAPOP+k5STD5sOZ35+9ko2H7IBz5RAclREoyB4/JaorQiBrEqS8RmX2TCjtx2lgi9TTcLinMDmULcg5qz44xpn08RwjuVpwRXyWFraxSaF0AcnpqstHON9AEyYanBjpQzR7yvj1IUGPMVNKpu/f4Z0ABvGZ9iAe3lyYESkkZ93ajy4vylY3YQvQsgHAsgazVsg2b25TC6TvAp9xPcaO0U8aoLLQIDAQAB diff --git a/src/main/resources/application-rppaysvc.yml b/src/main/resources/application-rppaysvc.yml deleted file mode 100644 index 5acb434de..000000000 --- a/src/main/resources/application-rppaysvc.yml +++ /dev/null @@ -1,10 +0,0 @@ -app: - rpaysvc: - appid: royalpaytest - priv-key: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDE55tREo6t6m1hekGlaMmDivorV3a+MkA/Wna0k917u/CGYIf7FtmWk1um7VcBRdljluLjqThePZgbgtwqTdHWXJP2gPwoJjLUluVEyKh19blSgrq7K1FEryAzQ5XFLzMX//EMc1BNrqcREHC6XVlJeNzpOd8+C83cxGxL+ayLoQ/ePEyp/8yXBbA6t2yXyi7H1ry8WiFFg9RFf+zAeESFXlKIS72fw9I9GxG6PLUhbD8S+IIJ2A0ZudKUQIUw4M0wSilo40lfqp/xRyfUBZevKcPrO5/ZCJX6V2d154s1m5p0Z/eLtQ1ido0quVi/LzBb1KXDYNHV6hPJjNQmNbMnAgMBAAECggEAY/rqLW9LzVk0cwN947xiXg2qW2mM3KRtZP3NOoG+O37BcaoAQelnUILATfFDdVz/Ngc+a7TX71o9KvL2UfCztLHLW6ZA4y4KL1HzVkrA5yx/DjtdD36+RC7cHcuad8YwnmYSAm1nABrHr+12H9sYZCsfmLkO9tVNkWSXTLiY+UhJ1hTua2LYgaTsHR9lYLt/K+PNIBAToKuMcKFTEMWbrnekrFhXkPdeS3alFL/0X7csaPhLvZTDaAtpAytvnmN4nuZmnONnDqPJ3IEFjc7xwZ15D9Qgv/+g74q1VzU/0+2421S6BSijUK3kUdeHXASU3YvIczfnbr5t+NYL7nd68QKBgQDlLFNMz9rVFLd5b351tnld9rni8KzHi+V+eXeJpQ+zriTODOvvkFJrTSZKm+JQoBrpTI+EA1fovxLnDBhNnrR4HmHhudMTGqU6JOZLj+fk8UQKXDpVEGWO6QT68ds+Ii1ex1UEkbBkLWGrrHlFAdY0q+Af7L7Fe0osZX9382b+aQKBgQDb9EmDD79IFOxSjMJVnlN0g2P48hQ9M40cEzXRD/iyyBr9l8rE400Q6GT35ZgHKSrG2nXZehWCaQQqniHu+y6UHnJfhbC0LEYdcYRoyamlGwEFp8xSRJ88R2IoL+2g+XJ1Tc6eACjsEJWZooga6bqdrYjaAe0uSGid0Buh6JMTDwKBgGIfJFtS84MgJ55a2m5T/or4xIYiPhgCEfSg1Umd3qcz/JYseihMRr2ifq6bJ78VjfAt05TWSaFhjhpW12EEfoifmZEoGvOnCO9oNSJNLyCbHGLDMkaRiqoxouw++XwU7hASkJgwOLHrrFHwusuNCcXrgT6qAtRTAWMY4gbdtE9hAoGAWnZsTZUKbND+KS1vN9t4I3FuipK1tD4hiSx1c9iHxq/6OdZWNQfvSEbsT/CDyF4sE8EBu0I02n/qkMSc3Dc+fvjOvW60sEWNSMrJVHesaBVlJDhRFnzWqOoK+tBLgWtWodwwYFdcfUqM3LU2GSuL7xHSOSeVrvVk4ZMX6k1HQA0CgYAypY0eecX8Gc7SCt7wpYoNuL2MuZZIDXNZVMpWYMokA1Z74oX1uzecyTNLHgCFHpjiJPyc6KW1/pnDpcA9FuTmLUuNyuqsX85IEMZPkIqPFebAl4IvOuwzvXDPxxgh8B+XBQBydgFADeqgqXG8rxomC4PUrX47pKb1G89bTGp8Dw== - pub-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmifNnVZG6HZBYdvLnCGyNm7rQTZKyl3w+7xdBGgjsQeaskdy/IgmrWRG4Ii1o82KV/ZA+bw86vE37axpoxbqOU3LYVb69nVYvmJOL018iBs74HhbZ8CtWtQmEIKqmX/rNUdp15OgwzDckvrK/EEzjdOoQfAkFB68wLOsTcsRwBB3JUL/uiHGK6b5Ofmh4PxYeAVNpWYHyCaQIuN6JH85VHBVS4etP25GbgWxl+ktuZucaPsQ2G25mwhlpNiC28J4la0wD33JKMfCNCjORlWkw2HcDvrRLqza4lJOXu0rFy3JuUkZ0hn834ZWd3MboqNNE6a2xe4ppZUJ9ccM9312JQIDAQAB - server-root: https://channel.rpayplus.com/channel/v1/ - upload-file-keys: - - upay_application_form - - upay_desc_file - diff --git a/src/main/resources/application-wechat.yml b/src/main/resources/application-wechat.yml deleted file mode 100644 index e78baaea7..000000000 --- a/src/main/resources/application-wechat.yml +++ /dev/null @@ -1,23 +0,0 @@ -app: - wechatpay: - api-host: https://api.mch.weixin.qq.com - merchants: - '1307485301': - app-id: wx703febcbd34dae38 - example-sub-merchant-id: 11755174 - key-file: /Users/qingjiaoxuan/extra/apiclient_cert.p12 - mch-key: 7e2d8c4aab15e4cabec1207ba79086b1 - merchant-id: 1307485301 - '1431999902': - app-id: wx703febcbd34dae38 - example-sub-merchant-id: 42991963 - key-file: /Users/qingjiaoxuan/extra/apiclient_new_cert.p12 - mch-key: p3tgzrAJbe6eQrunbv8jb8gz5yXxvJdE - merchant-id: 1431999902 - '1487387142': - app-id: wx3e14d1144d898197 - example-sub-merchant-id: 117551742 - key-file: /Users/qingjiaoxuan/extra/napclient_cert.p12 - mch-key: OuvLIL93STqFhTngNaBGT8751ZJn4FKL - merchant-id: 1487387142 - mp-id: globalpay diff --git a/src/main/resources/application-yeepay.yml b/src/main/resources/application-yeepay.yml deleted file mode 100644 index 2edf4b618..000000000 --- a/src/main/resources/application-yeepay.yml +++ /dev/null @@ -1,20 +0,0 @@ -app: - yeepay: - aes-secret-key: '' - app-key: cbp_120180753 - http-client: - connect-timeout: 30000 - max-conn-per-route: 0 - max-conn-total: 200 - read-timeout: 30000 - merchant-id: '' - private-key: - cert-type: RSA2048 - password: '' - store-type: string - value: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVe+jKyfAYhuWGVBBqGm1+B912h6atpVE2TyzPL5CcHjCEx8LHGBGqH/CR4cyI+Ro9/tRftntM7r4Wmt9qbeeI3Lh8+HRymdaOyxzSVXY9RcHwjZrrgMHINLqs9v6elSXKUdkJFdm4xElsqRCZLGwc4LiGlu4SLZbEWu0cejGwFIVl1maXYCrD2LdS0vyb/fk1Kc5esUiYtpTpmuhdqAsfh6gaYWlxX5X3k0O1t5WLtx1YKinLBmmZyW543lgyowdOl/yXO5iS/3ZgoU7PTpv8tQEQiuRw64XjYbK7Xh1Hu5QBUfq4aNOSHZAbCGx0TSOvK/TAFVBUM+jtBoBSXTntAgMBAAECggEACx++ciDW8ixPtlBZLFwtG7zgGSr9F1z/DyiTMBPdEhEZETiAYSqEXgGkeGayPtsyvbxR95Fv2YjGso3x5Eyrdz7dp8che0nBcrzgtzJO6z5esVUIW1Aom4p4/dgfmJOGzWiL2yY6HorU3/Yw2wU4QmnisXlX3BhyaMhPbtgVDIJNPS68AAkerm/QpHu31JltBAfVnmp50lRvF910Upn+jUhMV1oi2WHQ/JMsJBuZFQR1nkvFcQ+vQMhWgrXfNY1Do/QavhSjvlTpLMfrfZrE1RLLuzbGc0svBxHTBq6FNs+LY/ITfToS3D087w2gjeCyWew0tsjIr9ToxFy/cLTurQKBgQDSnw1T3zxlbwB2n/TBHUhBhGKSjdzosEaDHbYO7TbeLXSW94ar2+/5O9ypjU0dgNfVk0cZwMJneg/ZzuMR4zwadBEPGa7Iwf5hnHc/xxkfyzY8tRnYs1q2ZYgw/P+VjKXqVpxI6fnhr+6yQf+w2N3M3xS5WB0fMDaw1DAmIfroswKBgQC1sMsBdjRSCAYgPlGKDsjzFjMERE4xxz/3HX04wq3mYf5ntm9VNC/rw7xxkUEzZ3A6WBrFCfGvemYaq/TFG1u8BnnEseqSCSKzkY7Gdiofw7PzcP0pqCseNxliOOhgtl+B57uM/nxgx/wZMzy4RhInshbHWTF82mrk/TMq0Whi3wKBgQCp6mSvIC4ySp2eFac30C7FpE59mvL3yZXpGyQP4LFeBl/DlwdPSEzNzcxUAMmQnqwBAiLfFNIA9sko1y369U48rRxCCV8nWNGm37qYej+7lY445YVnfDIXacu4cbKjbGdBqQPGEvRjbTJtHq9vdVVifSnT6ND9o0DL4TLC4LDx3wKBgEHUQWlRK5nBIH8UNTThMHuqwmc8XFx6xblCLPmgx6MeRC/NkL79PpOcgq1fJJF8W9Q30dMsTC35Gf916CR2SiFw8zOKBuRMfQ80oNdVPuPtY0jD2mX6cUzsR70nw0IvMaF+lZx7JBNowfVbdBeMA83wH4Kw1VZYSLyY5K4R21FfAoGATkJe+qohXJDTbbj8+c0wbhDk5SFeR/P+CT3YsS/fneHkwjk98A3hrYuIc1JxxflOcvYMrRndSSQ57/13qVWZBEUcPpjvMITwWdJSIWn+Z6nsGsQD9ell8SGidefEoZsAjwEcORNLEcKg1F10c97cQQWDIgITEj7WtbrDkzdVf9M= - public-key: - cert-type: RSA2048 - password: '' - store-type: string - value: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlXvoysnwGIblhlQQahptfgfddoemraVRNk8szy+QnB4whMfCxxgRqh/wkeHMiPkaPf7UX7Z7TO6+Fprfam3niNy4fPh0cpnWjssc0lV2PUXB8I2a64DByDS6rPb+npUlylHZCRXZuMRJbKkQmSxsHOC4hpbuEi2WxFrtHHoxsBSFZdZml2Aqw9i3UtL8m/35NSnOXrFImLaU6ZroXagLH4eoGmFpcV+V95NDtbeVi7cdWCopywZpmclueN5YMqMHTpf8lzuYkv92YKFOz06b/LUBEIrkcOuF42Gyu14dR7uUAVH6uGjTkh2QGwhsdE0jryv0wBVQVDPo7QaAUl057QIDAQAB diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index 31a4d01cd..000000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,187 +0,0 @@ -server: - port: 5555 -spring: - profiles: - active: dev,alipay,bestpay,jd,wechat,rpay,yeepay,rppaysvc,common,alipayplusaps,apsinstore,apscashier - mail: - host: '' - port: '' - redis: - database: 1 - host: 127.0.0.1 - port: 6379 - thymeleaf: - mode: LEGACYHTML5 - cache: false -jetty: - threadPool: - maxThreads: 1000 -multipart: - max-file-size: 10Mb -app: - crossapp: - enable: true - agreetemplate: - aggregate: - path: https://file.royalpay.com.au/open/2022/01/17/1642390648147_iqMS6R0NrVfVZ1ICaaq5i2f1GhQ1sL.pdf -# path: https://file.royalpay.com.au/open/2020/08/19/1597805249800_iNrLHtY7gxCDBtgTnKdtB62DdADxFt.pdf - classic: - path: https://file.royalpay.com.au/open/2017/07/10/1499665073802_qV7fpEuS9rdbTnpa4po6rmbW9CSUfE.pdf - allow-clearing-generation: false - attachment: - host: https://file.royalpay.com.au/ - source: 3 - cms: - host: http://127.0.0.1:9533 - customer: - host: http://192.168.0.33:9008/ - foreign-currency: AUD - hanyin-secure: - pid: ROYALPAY - sftp-host: 180.168.61.93 - sftp-port: 28480 - sftp-pwd: royalpay - sftp-username: royalpay - host: - main: http://192.168.0.33:9009/ - regions: - au: http://192.168.0.33:9009/ - cn: http://192.168.0.33:9009/ - mail: - appid: 1 - host: https://mailsupport.royalpay.com.au - mpsupport: - appid: royalpay - auth_code: W3xucYnbmbE6rZDmA2V9BsKmagTrVIny - host: https://mp.royalpay.com.au - name: RoyalPay - ofei: - md5-key: Khjx6wejblaJzmG0JBWFlPFKAUxhFIXQ - pwd: aomi@8888 - sp-code: A1407200 - partner: - aes-key: xyc7Ya6TmL8/csM1ygtviA== - redis: - prefix: payment - settle: - check-code: - prefix: settlementCheckCode - redpack_auth: - enable: false - risk: - aes-key: NRvwd9dgbT2Cdz6zJz9AWA== - control: - aes-key: Aa+MtthC4Ztq4Kfa9aL+UA== - run-tasks: false - aps-online-prefix: '00-' - server: - ip: 127.0.0.1 - settle: - aes-key: EPrfsM2JE69ZPR7BhXn34g== - settlement: - email-cc: leo.huang@royalpay.com.au - email-to: astro.dai@royalpay.com.au - ueditor: - enable: true - tax: - type: GST -android: - message: - appkey: '' - secret: '' -apple: - message: - apns: - file: classpath:dev.p12 - password: HQeYblIajOb0 - saneboxMode: true -customer: - app: - appid: customer - auth-code: xxnpdBRwd4sIaCCI -env: - company: RoyalPay -hf: - rsa-file: /opt/2000604000101.pfx -im: - openim: - appkey: 24986533 - secret: 96e28e7be21a874177211c31834b5174 -mail: - mailgun: - api_key: api:key-2e67b891a1a7974bf3a40ea440d5a77f - default: - merchantlist: merchants@mail.royalpay.com.au - domain: mail.royalpay.com.au - public_key: api:pubkey-1aaaffc2662ba1b400c409d3e974ba7e - send: - credentialCode: Fd1aRfdjc9 -qcloud: - scf: - region: ap-hongkong - secret-id: AKIDlHdjgWzZliPvBauZFfrnW0MaZOyHdTPz - secret-key: YswoQDsIZfWEqEAEvMXS8Yic84lFn9Jp -royalpay: - sms: - qcloud: - appid: 1400094878 - appkey: 43390d81e20c5191c278fbf4cd275be2 - enable: true - daas: - secret-id: AKIDKR8WAXdaRcfbZysCU41K6ViGMwL2XG49zdDE - secret-key: 15ug40UL3X74v7705tKqb2u0bmqyOr873Yyyn41C - enable: true -settle: - abafile: - bank: - ANZ: - account-name: Tunnel Show Pty Ltd - account-no: '837022519' - apca: '514624' - bank: ANZ - bsb: '013006' - manual-sending: true - balance-group: - - NORMAL_CROSS_BORDER - CBA: - account-name: Tunnel Show Pty Ltd - account-no: '11655861' - apca: '301500' - bank: CBA - bsb: '063109' - balance-group: - - NORMAL_CROSS_BORDER - NAB: - account-name: Tunnel Show Pty Ltd - account-no: '837022519' - apca: '514624' - bank: NAB - bsb: '013006' - manual-sending: true - balance-group: - - NORMAL_CROSS_BORDER - CARD: - account-name: UPay Pty Ltd - account-no: '13677888' - apca: '301500' - bank: CBA - bsb: '063010' - balance-group: - - RPAY_SVC_CARD - - RPAY_SVC_DIRECTDEBIT -logging: - level: - au: - com: - royalpay: - payment: debug - -shopify: - apiVersion: 2022-01 - auth: - apiKey: 99e631dd0faa1076ceffae36cf91a93b - apiSecretKey: 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 - scope: write_orders,write_payment_gateways,write_payment_sessions - - - diff --git a/src/main/resources/aps_productionA.p12 b/src/main/resources/aps_productionA.p12 deleted file mode 100644 index 525f4fbcd..000000000 Binary files a/src/main/resources/aps_productionA.p12 and /dev/null differ diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml deleted file mode 100644 index bd0c23023..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml deleted file mode 100644 index 74eed6179..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientRatesAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientRatesAnalysisMapper.xml deleted file mode 100644 index 8529a00fc..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientRatesAnalysisMapper.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml deleted file mode 100644 index dea1108de..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml +++ /dev/null @@ -1,793 +0,0 @@ - - - - - - - - DELETE FROM statistics_customer_order - WHERE date >= #{begin} - and date < #{end} - - and client_id = #{client_id} - - - and channel = #{channel} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/EstimateAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/EstimateAnalysisMapper.xml deleted file mode 100644 index 020df407e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/EstimateAnalysisMapper.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml deleted file mode 100644 index 0ab520bda..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml deleted file mode 100644 index 2d3a0aa89..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ /dev/null @@ -1,1179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.xml deleted file mode 100644 index 1e35cf676..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml deleted file mode 100644 index 26ec3bbbf..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.xml deleted file mode 100644 index cf1d7c79e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActDietOrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActDietOrderMapper.xml deleted file mode 100644 index c64c2ec93..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActDietOrderMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleMapper.xml deleted file mode 100644 index 148b52ee4..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleRedPackMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleRedPackMapper.xml deleted file mode 100644 index 46314de86..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActMonDelaySettleRedPackMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActSignEventsSignLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActSignEventsSignLogMapper.xml deleted file mode 100644 index d15d02e0c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActSignEventsSignLogMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeClientMapper.xml deleted file mode 100644 index 2bbbbd0f5..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeClientMapper.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - UPDATE sys_aps_notice_clients - SET modifier = #{modifier}, - modify_time = #{modify_time}, - is_valid = 1 - WHERE partner_code = #{partner_code} - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeMapper.xml deleted file mode 100644 index cffa52c91..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/apskyc/ApsNoticeMapper.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/bill/BillMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/bill/BillMapper.xml deleted file mode 100644 index a213ff20d..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/bill/BillMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/bill/BillOrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/bill/BillOrderMapper.xml deleted file mode 100644 index f6de6ebf8..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/bill/BillOrderMapper.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - update pmt_bill_order - set order_status = #{order_status} - where order_id = #{order_id} - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/cashback/CashbackDrawDepositsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/cashback/CashbackDrawDepositsMapper.xml deleted file mode 100644 index 3505ebf13..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/cashback/CashbackDrawDepositsMapper.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/cashback/CashbackRecordsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/cashback/CashbackRecordsMapper.xml deleted file mode 100644 index d9ce45e15..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/cashback/CashbackRecordsMapper.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/cashiers/CashierOrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/cashiers/CashierOrderMapper.xml deleted file mode 100644 index be4f13721..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/cashiers/CashierOrderMapper.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml deleted file mode 100644 index 497e19d7a..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - update sys_clients_customers - set total_amount = total_amount + #{total_amount}, - payment_times = payment_times + #{payment_times}, - last_payment_time = #{last_payment_time}, - nick_name = #{nick_name}, - headimg = #{headimg} - where client_id= #{client_id} - and customer_id = #{customer_id} - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientSubMerchantIdMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientSubMerchantIdMapper.xml deleted file mode 100644 index 852e1bf60..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientSubMerchantIdMapper.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.xml deleted file mode 100644 index 8f3c59631..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml deleted file mode 100644 index cdc7d09bc..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CusRewardLogsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CusRewardLogsMapper.xml deleted file mode 100644 index 068ac0efb..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CusRewardLogsMapper.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - UPDATE cus_reward_log SET send_time=#{send_time},openid=#{openid} WHERE date <=#{date} AND openid IS NULL ORDER BY rand() LIMIT 1 - - - UPDATE cus_reward_log SET send_time=#{send_time},openid=#{openid} WHERE date <=#{date} AND openid IS NULL AND type in(2,3) ORDER BY rand() LIMIT 1 - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageConfigMapper.xml deleted file mode 100644 index 6fde12f4c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageConfigMapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyAccessLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyAccessLogMapper.xml deleted file mode 100644 index 4f115c7d3..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyAccessLogMapper.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyUseLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyUseLogMapper.xml deleted file mode 100644 index 4d025397b..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerEncourageMoneyUseLogMapper.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml deleted file mode 100644 index 63477ee9d..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - UPDATE cus_membership - SET encourage_balance = encourage_balance + #{amount} - WHERE member_id = #{memberId} - - - UPDATE cus_membership - SET encourage_balance = encourage_balance - #{amount} - WHERE member_id = #{memberId} - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerPointsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerPointsMapper.xml deleted file mode 100644 index a63535c3f..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerPointsMapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionDetailMapper.xml deleted file mode 100644 index a4c412d42..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionDetailMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionMapper.xml deleted file mode 100644 index 09ea9f0f7..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialAgentCommissionMapper.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDCommissionConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDCommissionConfigMapper.xml deleted file mode 100644 index 7c0dabf26..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDCommissionConfigMapper.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml deleted file mode 100644 index 755fe1e07..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeDetailMapper.xml deleted file mode 100644 index d3e9d787c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeDetailMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - DELETE d FROM financial_bd_prize_detail d - INNER JOIN financial_bd_prize_log l ON l.prize_log_id = d.prize_log_id - WHERE l.record_id = #{record_id} - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeRecordMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeRecordMapper.xml deleted file mode 100644 index 952fd63af..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeRecordMapper.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionDetailMapper.xml deleted file mode 100644 index 539bb7de5..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionDetailMapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml deleted file mode 100644 index 398df1cec..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionDetailMapper.xml deleted file mode 100644 index 25db564d2..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionDetailMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionMapper.xml deleted file mode 100644 index 4eab9c9e2..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialReferrerCommissionMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestClientLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestClientLogMapper.xml deleted file mode 100644 index 6058e29e1..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestClientLogMapper.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestLogMapper.xml deleted file mode 100644 index 4c097378b..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanInterestLogMapper.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanMerchantMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanMerchantMapper.xml deleted file mode 100644 index c7f02b46a..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanMerchantMapper.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - UPDATE fund_xplan_merchants - SET balance = balance + #{amount} - WHERE client_id = #{client_id} - - - UPDATE fund_xplan_merchants - SET balance = balance - #{amount} - WHERE client_id = #{client_id} - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanTransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanTransactionMapper.xml deleted file mode 100644 index 8a69f882d..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/funds/XPlanTransactionMapper.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/loanapplication/LoanApplicationMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/loanapplication/LoanApplicationMapper.xml deleted file mode 100644 index e00f94c5e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/loanapplication/LoanApplicationMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.xml deleted file mode 100644 index b192eb741..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.xml deleted file mode 100644 index 2163c5568..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - DELETE a FROM log_clearing_detail_analysis a - inner JOIN log_clearing_detail d on d.clear_detail_id = a.clearing_detail_id - where d.clearing_id = #{clearing_id} - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml deleted file mode 100644 index 31ff6d0d7..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - update log_clearing_detail - set settle_bank=#{settle_bank} - where clearing_id = #{clearing_id} - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.xml deleted file mode 100644 index 75f117f77..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - update log_clearing - set editable=0 - where settle_date = #{date} - - - update log_clearing set editable=0 - where clearing_id in - - #{id} - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClientLoginLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClientLoginLogMapper.xml deleted file mode 100644 index 213ee7dc0..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClientLoginLogMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClientReviewLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClientReviewLogMapper.xml deleted file mode 100644 index d1eb5cc13..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClientReviewLogMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.xml deleted file mode 100644 index 0e9155385..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/LogRiskMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/LogRiskMapper.xml deleted file mode 100644 index e64fee472..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/LogRiskMapper.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/LogSettleMailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/LogSettleMailMapper.xml deleted file mode 100644 index 523d09f91..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/LogSettleMailMapper.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ManagerLoginLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ManagerLoginLogMapper.xml deleted file mode 100644 index 064bc9a74..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ManagerLoginLogMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml deleted file mode 100644 index 3e17fbc8e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml deleted file mode 100644 index a9ed6893d..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PreSettleTaskMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PreSettleTaskMapper.xml deleted file mode 100644 index 38e237ac2..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PreSettleTaskMapper.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - update log_presettle_task p - inner join log_clearing_detail cd on cd.clear_detail_id = p.clear_detail_id - set p.clear_detail_id=null, - p.finish_flag=0 - where cd.clearing_id = #{clearing_id} - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/StatisticsBDSalesReportMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/StatisticsBDSalesReportMapper.xml deleted file mode 100644 index 8f1a8a177..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/StatisticsBDSalesReportMapper.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml deleted file mode 100644 index c6c49fe1f..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - DELETE FROM log_order_validation WHERE valid_date=date(#{valid_date}) - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/WechatTemplateMsgSendLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/WechatTemplateMsgSendLogMapper.xml deleted file mode 100644 index 18c295640..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/WechatTemplateMsgSendLogMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/notice/NoticeManageMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/notice/NoticeManageMapper.xml deleted file mode 100644 index dcdd5cf88..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/notice/NoticeManageMapper.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/notice/NoticePartnerMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/notice/NoticePartnerMapper.xml deleted file mode 100644 index f0fe72f7e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/notice/NoticePartnerMapper.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/ofei/TopUpOrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/ofei/TopUpOrderMapper.xml deleted file mode 100644 index ae8e329c1..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/ofei/TopUpOrderMapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/AustracDataMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/AustracDataMapper.xml deleted file mode 100644 index 559f926f9..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/AustracDataMapper.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.xml deleted file mode 100644 index 624cd0323..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/GoodOrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/GoodOrderMapper.xml deleted file mode 100644 index 87a43f7f1..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/GoodOrderMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml deleted file mode 100644 index 68d95eb60..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ /dev/null @@ -1,1301 +0,0 @@ - - - - - SELECT - o.order_id, - o.client_id, - o.total_amount, - o.display_amount, - o.customer_payment_amount, - o.coupon_payment_amount, - o.currency, - o.create_time, - o.confirm_time, - o.status, - o.order_description, - o.order_detail, - o.client_order_id, - o.gateway, - o.channel, - o.pay_type, - o.pre_authorization, - p.client_moniker, - p.short_name, - o.refund_amount refund_fee, - o.customer_id, - o.source, - sum(t.clearing_amount) clearing_amount, - t.refund_id, - t.transaction_time, - t.transaction_type, - t.transaction_id, - t.exchange_rate, - t.clearing_status, - t.settle_amount, - t.incremental_surcharge, - t.total_surcharge, - t.tax_amount, - t.surcharge_rate - - - SELECT - o.order_id, - o.client_id, - o.total_amount, - o.display_amount, - o.customer_payment_amount, - o.coupon_payment_amount, - o.currency, - o.create_time, - o.confirm_time, - o.status, - o.order_description, - o.order_detail, - o.client_order_id, - o.gateway, - o.channel, - o.pay_type, - o.pre_authorization, - o.refund_amount refund_fee, - o.customer_id, - o.source, - sum(t.clearing_amount) clearing_amount, - t.refund_id, - t.transaction_time, - t.transaction_type, - t.transaction_id, - t.exchange_rate, - t.clearing_status, - t.settle_amount, - t.incremental_surcharge, - t.total_surcharge, - t.tax_amount, - t.surcharge_rate - - - SELECT - o.order_id order_id, - format(o.total_amount * 100, 0) total_fee, - format(o.customer_payment_amount * 100, 0) real_fee, - o.currency, - o.channel, - o.create_time, - o.confirm_time pay_time, - o.pre_authorization, - o.source, - o.pay_type, - CASE o.status - WHEN 0 - THEN 'SUBMITTING' - WHEN 1 - THEN 'SUBMIT_FAIL' - WHEN 2 - THEN 'WAITING_PAYMENT' - WHEN 3 - THEN 'CLOSED' - WHEN 4 - THEN 'PAYMENT_FAIL' - WHEN 5 - THEN 'SUCCESS' - WHEN 6 - THEN 'PARTIAL_REFUND' - WHEN 7 - THEN 'FULL_REFUND' - END AS `status`, - o.order_description order_body, - o.client_order_id partner_order_id, - CASE o.gateway - WHEN 0 - THEN 'Retail In-Store' - WHEN 1 - THEN 'Retail In-Store' - WHEN 2 - THEN 'QR Code' - WHEN 3 - THEN 'Online API' - WHEN 4 - THEN 'In-APP H5' - WHEN 5 - THEN 'Retail API' - WHEN 6 - THEN 'Retail API' - WHEN 7 - THEN 'QR Code' - WHEN 8 - THEN 'Mobile H5' - WHEN 9 - THEN 'Third Party Gateway' - WHEN 10 - THEN 'APP' - WHEN 12 - THEN 'MICROAPP' - WHEN 13 - THEN 'Native QR Code' - WHEN 14 - THEN 'Share Link' - END AS gateway, - p.client_moniker partner_code, - p.short_name partner_name, - format(o.refund_amount * 100, 0) refund_fee, - t.clearing_status, - t.settle_amount, - t.transaction_time - - - SELECT - o.client_id, - o.order_id order_id, - format(o.total_amount * 100, 0) total_fee, - format(o.customer_payment_amount * 100, 0) real_fee, - o.currency, - o.channel, - o.create_time, - o.confirm_time pay_time, - o.pre_authorization, - o.source, - o.pay_type, - CASE o.status - WHEN 0 - THEN 'SUBMITTING' - WHEN 1 - THEN 'SUBMIT_FAIL' - WHEN 2 - THEN 'WAITING_PAYMENT' - WHEN 3 - THEN 'CLOSED' - WHEN 4 - THEN 'PAYMENT_FAIL' - WHEN 5 - THEN 'SUCCESS' - WHEN 6 - THEN 'PARTIAL_REFUND' - WHEN 7 - THEN 'FULL_REFUND' - END AS `status`, - o.order_description order_body, - o.client_order_id partner_order_id, - CASE o.gateway - WHEN 0 - THEN 'Retail In-Store' - WHEN 1 - THEN 'Retail In-Store' - WHEN 2 - THEN 'QR Code' - WHEN 3 - THEN 'Online API' - WHEN 4 - THEN 'In-APP H5' - WHEN 5 - THEN 'Retail API' - WHEN 6 - THEN 'Retail API' - WHEN 7 - THEN 'QR Code' - WHEN 8 - THEN 'Mobile H5' - WHEN 9 - THEN 'Third Party Gateway' - WHEN 10 - THEN 'APP' - WHEN 12 - THEN 'MICROAPP' - WHEN 13 - THEN 'Native QR Code' - WHEN 14 - THEN 'Share Link' - END AS gateway, - format(o.refund_amount * 100, 0) refund_fee, - t.clearing_status, - t.settle_amount, - t.transaction_time - - - - 0 AND r.t < o.customer_payment_amount - THEN 6 - WHEN r.t >= o.customer_payment_amount - THEN 7 - END - WHERE o.order_id = #{order_id} - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundAuditionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundAuditionMapper.xml deleted file mode 100644 index 2c0de0985..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundAuditionMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml deleted file mode 100644 index ee43e6e60..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundReviewMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundReviewMapper.xml deleted file mode 100644 index 2fb580cbf..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundReviewMapper.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - UPDATE pmt_refunds_review SET last_update_date = now() - - ,last_update_by = #{last_update_by} - - - ,is_valid = #{is_valid} - - - ,description = #{description} - - - ,status = #{status} - - where order_id = #{order_id} - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml deleted file mode 100644 index df1ad9c86..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - UPDATE task_client_manual_settle s - INNER JOIN log_clearing_detail d ON d.clear_detail_id = s.clearing_order - SET s.finish_time = NULL, s.clearing_order = NULL - WHERE d.clearing_id = #{clearing_id} - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml deleted file mode 100644 index 06badda43..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ /dev/null @@ -1,1586 +0,0 @@ - - - - - UPDATE pmt_transactions AS t - INNER JOIN ( - select d.clear_detail_id,count(p.task_id) pre_settle_flag from log_clearing_detail d - left join log_presettle_task p on p.clear_detail_id = d.clear_detail_id - where d.clearing_id=#{clearing_id} - group by d.clear_detail_id) dd - ON dd.clear_detail_id = t.clearing_order - SET clearing_status = if(pre_settle_flag > 0, 4, 0), - clearing_order = NULL, - clearing_time = NULL - - - DELETE t - FROM pmt_transactions t - INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order - WHERE d.clearing_id = #{clearing_id} - AND t.transaction_type = 'Debit' - AND t.refund_id IS NULL - and t.channel = 'Settlement' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.xml deleted file mode 100644 index 0a8bf90a6..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActClientApplyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActClientApplyMapper.xml deleted file mode 100644 index 740eeff76..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActClientApplyMapper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActClientInvitationCodeMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActClientInvitationCodeMapper.xml deleted file mode 100644 index adc936957..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActClientInvitationCodeMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - UPDATE act_client_invitation_code - SET invitation_code = #{invitation_code} - WHERE client_moniker = #{client_moniker} AND act_id = #{act_id}; - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml deleted file mode 100644 index a0663b740..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - DELETE FROM act_red_packets_orders WHERE open_id is null AND act_id=#{act_id} and red_pack_type_id=#{red_pack_type_id} and lock_key is null - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMMapper.xml deleted file mode 100644 index e284e3b93..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMMapper.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - UPDATE act_red_packets SET status = 0 WHERE act_type = 'partner'; - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerWechatRelationMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerWechatRelationMapper.xml deleted file mode 100644 index 9760ea20c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerWechatRelationMapper.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - UPDATE act_red_packets_wechat SET is_valid=0 - , update_id = #{update_id} - act_id=#{act_id} - and customer_id = #{customer_id} - and client_id = #{client_id} - - and channel = #{channel} - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml deleted file mode 100644 index d0e07513d..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeMapper.xml deleted file mode 100644 index b25f4a821..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeMapper.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerMapper.xml deleted file mode 100644 index a3993f280..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml deleted file mode 100644 index 4e58cf59b..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - DELETE FROM act_red_packets_customer_orders - WHERE open_id IS NULL AND act_id = #{act_id} AND red_pack_type_id = #{red_pack_type_id} AND lock_key IS NULL - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/RedPackLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/RedPackLogMapper.xml deleted file mode 100644 index d4225b16b..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/RedPackLogMapper.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantDetailLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantDetailLogMapper.xml deleted file mode 100644 index 282f8690c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantDetailLogMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantRecordMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantRecordMapper.xml deleted file mode 100644 index 2d8749648..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskMerchantRecordMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskTransactionLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskTransactionLogMapper.xml deleted file mode 100644 index b413d7bbd..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/risk/RiskTransactionLogMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml deleted file mode 100644 index 049b34728..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.xml deleted file mode 100644 index 5db6ff17c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/CalendarMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/CalendarMapper.xml deleted file mode 100644 index 5e2a6ebaa..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/CalendarMapper.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - UPDATE calendar c - SET clearing_day = 0 - WHERE year(c.datelist) = year(#{month}) AND month(c.datelist) = month(#{month}) - - - UPDATE calendar c SET clearing_day=1 WHERE date(c.datelist) in - date(#{day}) - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.xml deleted file mode 100644 index 1dec5350c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml deleted file mode 100644 index 2169bb1f6..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.xml deleted file mode 100644 index 16b7e12f0..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientBDMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientBDMapper.xml deleted file mode 100644 index 6b85ccc3c..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientBDMapper.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - UPDATE sys_client_bd b - SET b.end_date = #{end_date} - SET b.is_valid = #{is_valid} - WHERE b.client_id = #{client_id} and b.end_date is null - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml deleted file mode 100644 index 516572600..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.xml deleted file mode 100644 index 7e18c8768..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - update sys_clients_devices - set is_offline = 1 - where - account_id = #{account_id} - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml deleted file mode 100644 index 6f5180818..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml deleted file mode 100644 index e2914bf54..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - update sys_files - set state = 2 - where file_name = 'source_agree_file' - and client_id = #{client_id} - - - - update sys_files - set status = #{status} - where client_id = #{client_id} - and is_valid = 1 - - AND status IN - - #{status_type} - - - - AND file_name IN - - #{file_name} - - - - - - UPDATE sys_files - SET is_valid = 0 - WHERE - client_id = #{client_id} - AND file_name = #{file_name} - AND file_id NOT IN ( - SELECT - a.file_id - FROM - ( - SELECT - file_id - FROM - sys_files a - WHERE - client_id = #{client_id} - AND a.is_valid = 1 - AND `status` = 1 - AND a.file_name = #{file_name} - ORDER BY - last_update_date DESC - LIMIT 1 - ) a - ) - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientLocationsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientLocationsMapper.xml deleted file mode 100644 index 73e3950fc..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientLocationsMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMWFilesMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMWFilesMapper.xml deleted file mode 100644 index 5fbb5d9e0..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMWFilesMapper.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml deleted file mode 100644 index 8ea46adeb..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ /dev/null @@ -1,955 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml deleted file mode 100644 index cff095259..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientServicesApplyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientServicesApplyMapper.xml deleted file mode 100644 index 69fba1de3..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientServicesApplyMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientSettleDelayConfMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientSettleDelayConfMapper.xml deleted file mode 100644 index ff6488b16..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientSettleDelayConfMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - UPDATE sys_clients_settle_delay_conf SET enabled=0 WHERE client_id=#{client_id} - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.xml deleted file mode 100644 index 5f52e7f36..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/CommoditiesMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/CommoditiesMapper.xml deleted file mode 100644 index 29e128405..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/CommoditiesMapper.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ExchangeRateMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ExchangeRateMapper.xml deleted file mode 100644 index 1c552bbf8..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ExchangeRateMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/FinancialSurchargeAccountDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/FinancialSurchargeAccountDetailMapper.xml deleted file mode 100644 index 583edb902..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/FinancialSurchargeAccountDetailMapper.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/HolidayMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/HolidayMapper.xml deleted file mode 100644 index e7f7d98cf..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/HolidayMapper.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/MailSendMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/MailSendMapper.xml deleted file mode 100644 index c9a2dea57..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/MailSendMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - update sys_mail_send - set status = #{status} - where id = #{id} - and mail_address = #{mail_address} - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/MailUnsubMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/MailUnsubMapper.xml deleted file mode 100644 index 0e0f6daff..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/MailUnsubMapper.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml deleted file mode 100644 index df785f3e7..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.xml deleted file mode 100644 index bc421783e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/OrgMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/OrgMapper.xml deleted file mode 100644 index cd1a6d272..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/OrgMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/OrgSignInfoMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/OrgSignInfoMapper.xml deleted file mode 100644 index 5ce3c51b9..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/OrgSignInfoMapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/PermissionFunctionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/PermissionFunctionMapper.xml deleted file mode 100644 index 23011cddf..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/PermissionFunctionMapper.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - SELECT - f.*, - m.js_module, - m.js_path, - m.remark mod_remark - FROM sys_permission_functions f - LEFT JOIN sys_permission_modules m ON m.module_name = f.module - - - - - - - - #{id} - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerFunctionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerFunctionMapper.xml deleted file mode 100644 index 0abaa2209..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerFunctionMapper.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - SELECT - f.*, - m.js_module, - m.js_path, - m.remark mod_remark - FROM sys_permission_partner_functions f - LEFT JOIN sys_permission_partner_modules m ON m.module_name = f.module - - - - - - - - #{id} - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/RateMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/RateMapper.xml deleted file mode 100644 index 963bfec6d..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/RateMapper.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysChannelConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysChannelConfigMapper.xml deleted file mode 100644 index a7bc1b1af..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysChannelConfigMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - update cb_channel_config - SET is_valid = #{is_valid},last_update_by = #{last_update_by},last_update_date = #{last_update_date} - - type = #{type} - - and channel_id = #{channel_id} - - - and channel_id != #{channel_id} - - - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysCustomerServiceMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysCustomerServiceMapper.xml deleted file mode 100644 index ff15768e0..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysCustomerServiceMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - udpate sys_customer_servie - set status = #{status} - where manager_id = #{managerId} - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysPermissionClientModulesMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysPermissionClientModulesMapper.xml deleted file mode 100644 index 4a329d96e..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/SysPermissionClientModulesMapper.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - SELECT - f.*, - m.js_module, - m.js_path, - m.remark mod_remark - FROM sys_permission_functions f - LEFT JOIN sys_permission_modules m ON m.module_name = f.module - - - - - - update sys_permission_partner_modules_clients - set is_valid =#{is_valid} - where module_id = #{module_id} - - - - delete from sys_permission_partner_modules_clients - where module_id = (SELECT id from sys_permission_partner_modules where module_name=#{module_name}) - - - - delete from sys_permission_partner_modules_clients - where client_moniker= #{client_moniker} - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/aps/ApsConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/aps/ApsConfigMapper.xml deleted file mode 100644 index 3c0630c8f..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/aps/ApsConfigMapper.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - UPDATE sys_client_aps_config SET modify_time = now(), modifier = #{modifier} - , alipay_cn_switch = #{alipayCnSwitch} - , enable_alipayaps = #{enableAlipayAps} - WHERE client_id = #{clientId} - - - \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerOrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerOrderMapper.xml deleted file mode 100644 index e03ef4458..000000000 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/vipcustomer/VipCustomerOrderMapper.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - SELECT - o.order_id, - o.client_id, - o.total_amount, - o.customer_payment_amount, - o.currency, - o.create_time, - o.confirm_time, - o.status, - o.order_description, - o.order_detail, - o.client_order_id, - o.gateway, - o.refund_amount refund_fee, - t.clearing_amount, - t.transaction_time, - t.exchange_rate, - t.clearing_status - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt deleted file mode 100644 index 2227ae75a..000000000 --- a/src/main/resources/banner.txt +++ /dev/null @@ -1,14 +0,0 @@ -${AnsiColor.YELLOW} - ____ __ ____ - / __ \____ __ ______ _/ / / __ \____ ___ __ - / /_/ / __ \/ / / / __ `/ / / /_/ / __ `/ / / / - / _, _/ /_/ / /_/ / /_/ / / / ____/ /_/ / /_/ / - /_/ |_|\____/\__, /\__,_/_/ /_/ \__,_/\__, / - /____/ /____/ - -${AnsiColor.GREEN} - 澳洲皇家支付 www.royalpay.com.au - - -Application Version: ${application.version}${application.formatted-version} -Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version} \ No newline at end of file diff --git a/src/main/resources/data/category/billbuddyindustry.json b/src/main/resources/data/category/billbuddyindustry.json deleted file mode 100644 index 94ac7cc39..000000000 --- a/src/main/resources/data/category/billbuddyindustry.json +++ /dev/null @@ -1,331 +0,0 @@ -[ - { - "children": [ - { - "children": [], - "label": "机票", - "mccCode": "10001" - }, - { - "children": [], - "label": "旅游行业", - "mccCode": "10002" - }, - { - "children": [], - "label": "私人定制旅游", - "mccCode": "10003" - }, - { - "children": [], - "label": "租车", - "mccCode": "10004", - "category": "RENTAL" - }, - { - "children": [], - "label": "巴士", - "mccCode": "10005" - } - ], - "label": "旅游出行", - "mccCode": "1", - "category": "PROFRSSIONAL SERV" - }, - { - "children": [ - { - "children": [], - "label": "饭店", - "mccCode": "20001" - }, - { - "children": [], - "label": "奶茶店", - "mccCode": "20002" - }, - { - "children": [], - "label": "烧烤", - "mccCode": "20003" - }, - { - "children": [], - "label": "火锅", - "mccCode": "20004" - }, - { - "children": [], - "label": "Coffee", - "mccCode": "20005" - }, - { - "children": [], - "label": "酒吧", - "mccCode": "20006" - } - ], - "label": "餐饮", - "mccCode": "2", - "category": "RETAIL" - }, - { - "children": [ - { - "children": [], - "label": "培训类", - "mccCode": "30001" - }, - { - "children": [], - "label": "移民留学", - "mccCode": "30002" - }, - { - "children": [], - "label": "私人幼儿园", - "mccCode": "30003" - } - ], - "label": "教育", - "mccCode": "3", - "category": "SCHOOLS & EDUCATION SERV" - }, - { - "children": [ - { - "children": [], - "label": "换汇", - "mccCode": "40001" - }, - { - "children": [], - "label": "房产", - "mccCode": "40002" - } - ], - "label": "商务咨询", - "mccCode": "4", - "category": "FINANCE" - }, - { - "children": [ - { - "children": [], - "label": "公众号服务商", - "mccCode": "50001" - }, - { - "children": [], - "label": "各种媒体类宣传", - "mccCode": "50002" - } - ], - "label": "传媒", - "mccCode": "5", - "category": "PROFESSIONAL SERV" - }, - { - "children": [ - { - "children": [], - "label": "美容院", - "mccCode": "60001" - }, - { - "children": [], - "label": "医疗美容", - "mccCode": "60002" - } - ], - "label": "医美", - "mccCode": "6", - "category": "FITNESS" - }, - { - "children": [ - { - "label": "超市", - "mccCode": "70001" - }, - { - "children": [], - "label": "服装店", - "mccCode": "70002" - }, - { - "children": [], - "label": "鞋店", - "mccCode": "70003" - }, - { - "children": [], - "label": "珠宝店", - "mccCode": "70004" - }, - { - "children": [], - "label": "箱包", - "mccCode": "70005" - } - ], - "label": "零售", - "mccCode": "7", - "category": "RETAIL" - }, - { - "children": [ - { - "children": [], - "label": "桌游吧", - "mccCode": "80001" - }, - { - "children": [], - "label": "演唱会", - "mccCode": "80002", - "category": "UTILITIES" - }, - { - "children": [], - "label": "马术训练", - "mccCode": "80003", - "category": "FITNESS" - }, - { - "children": [], - "label": "瑜伽", - "mccCode": "80004", - "category": "FITNESS" - }, - { - "children": [], - "label": "健身", - "mccCode": "80005", - "category": "FITNESS" - }, - { - "children": [], - "label": "社团", - "mccCode": "80006" - }, - { - "children": [], - "label": "网吧", - "mccCode": "80007", - "category": "EQUIPMENT HIRE" - }, - { - "children": [], - "label": "KTV", - "mccCode": "80008", - "category": "EQUIPMENT HIRE" - }, - { - "children": [], - "label": "电影", - "mccCode": "80009" - } - ], - "label": "休闲娱乐", - "mccCode": "8", - "category": "OTHER" - }, - { - "children": [ - { - "children": [], - "label": "摄影", - "mccCode": "90001", - "category": "PROFESSIONAL SERV" - }, - { - "children": [], - "label": "massage", - "mccCode": "90002" - }, - { - "children": [], - "label": "通讯运营商", - "mccCode": "90003", - "category": "TELECOM" - }, - { - "children": [], - "label": "车行", - "mccCode": "90004", - "category": "TRADES & VOC" - }, - { - "children:": [], - "label": "软件服务", - "mccCode": "90005", - "category": "PROFESSIONAL SERV" - } - ], - "label": "其他服务类", - "mccCode": "9", - "category": "OTHER" - }, - { - "children": [ - { - "children": [], - "label": "Hotel", - "mccCode": "100001" - }, - { - "children": [], - "label": "Motel", - "mccCode": "100002" - } - ], - "label": "酒店", - "mccCode": "10", - "category": "RENTAL" - }, - { - "children": [ - { - "children": [], - "label": "代购", - "mccCode": "110001" - }, - { - "children": [], - "label": "物流(大宗出口贸易)", - "mccCode": "110002" - }, - { - "children": [], - "label": "红酒出口", - "mccCode": "110003" - }, - { - "children": [], - "label": "综合电商", - "mccCode": "110004" - } - ], - "label": "出口贸易", - "mccCode": "11", - "category": "TRADES & VOC" - }, - { - "children": [ - { - "children": [], - "label": "建材", - "mccCode": "120001" - }, - { - "children": [], - "label": "家居", - "mccCode": "120002" - } - ], - "label": "家居建材", - "mccCode": "12", - "category": "TRADES & VOC" - } -] \ No newline at end of file diff --git a/src/main/resources/data/crypt/alipay_private.pem b/src/main/resources/data/crypt/alipay_private.pem deleted file mode 100644 index b3546c08e..000000000 --- a/src/main/resources/data/crypt/alipay_private.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC72cPSVWP66+5iDU+Yyg6ODfjDeb+nty90e5UtESIB1YOn4qaq -gjPiNgDZUDpaUhHKCW95U/V3pQi2FBbIj16z8uAAxVe+Uz45NlWhBIT9+4PY57oF -yLkaVCr/6Kwir/ql28cvwkhkbrQ2veOpGd7/W8UpMjWMyNuZGelEibmBKQIDAQAB -AoGABdjpd4qg6had/P9dEux3N4TH0Y3goV/aYk3Wfuihnlz/FCLB/VzAMLJtpFYS -+uzDEP7qMWSjp23Dr6dAbk3ILNQgogrJ4a4z9Uq9fVYt8lBo/T98hjR1xSXDJEQS -FsUw8XRbYGFOFxnLzlTjLix1b6+gmTJsKihbETMXBKRl/WECQQDkf0LRjoDCME4H -kgLzm4dq5iCPdJNQLOZT+xJsQy72/RNdnlbYJVO0E9NSo1oIpFtKA2C8z/BTnAUk -5nuLeac/AkEA0nYN1i4TZCyaB0MbGIgFU/dc7aIY/5QIY4oGrs//3CnqLDxU0Doa -yFEQAaZTINa7hy4aZqtPl7rdeYBPFwRllwJBAOIrCRNtbwtHTuT1ZJCGQKrR8Cau -p+WzG6TCnoCkm0cERvfic2lswQY8nW5tm/9z15xR7Z3WYLYRd5IHxP/QQXcCQQC1 -fDveUAlEvvlr/cAl3VXK3Gp0OO4Zpsu9Gk88+/yFHFflIXl5vkFOMCj/YzAYB1Pa -9DSsCFowW2GU3sJU9OOtAkBB8WLs1AGsBRdMy9b2ucfeeCDjMip5deLCwX9jii/p -Am5f2ajaEkr60blSbG4sbK/EKZ2uENUZzKqcIje83TB8 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/src/main/resources/data/crypt/alipay_public.pem b/src/main/resources/data/crypt/alipay_public.pem deleted file mode 100644 index d0ef3cc49..000000000 --- a/src/main/resources/data/crypt/alipay_public.pem +++ /dev/null @@ -1 +0,0 @@ -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB \ No newline at end of file diff --git a/src/main/resources/data/geo/GeoLite2-City.mmdb b/src/main/resources/data/geo/GeoLite2-City.mmdb deleted file mode 100644 index 3ce37cb25..000000000 Binary files a/src/main/resources/data/geo/GeoLite2-City.mmdb and /dev/null differ diff --git a/src/main/resources/dev.p12 b/src/main/resources/dev.p12 deleted file mode 100644 index 5210b6fa4..000000000 Binary files a/src/main/resources/dev.p12 and /dev/null differ diff --git a/src/main/resources/graphql/paymentsAppConfigure.graphql b/src/main/resources/graphql/paymentsAppConfigure.graphql deleted file mode 100644 index e6e0d32dc..000000000 --- a/src/main/resources/graphql/paymentsAppConfigure.graphql +++ /dev/null @@ -1,8 +0,0 @@ -mutation PaymentsAppConfigure($externalHandle: String, $ready: Boolean!) { - paymentsAppConfigure(externalHandle: $externalHandle, ready: $ready) { - userErrors{ - field - message - } - } -} \ No newline at end of file diff --git a/src/main/resources/i18n/addon_en.properties b/src/main/resources/i18n/addon_en.properties deleted file mode 100644 index 639f94ac6..000000000 --- a/src/main/resources/i18n/addon_en.properties +++ /dev/null @@ -1 +0,0 @@ -manual_settle.notice=Settlement will be executed on the second working day after this application has been submitted. During this period, your balance will not be updated. \ No newline at end of file diff --git a/src/main/resources/i18n/addon_zh.properties b/src/main/resources/i18n/addon_zh.properties deleted file mode 100644 index 9cf1789bf..000000000 --- a/src/main/resources/i18n/addon_zh.properties +++ /dev/null @@ -1 +0,0 @@ -manual_settle.notice=提现申请提交后会在第二个工作日到账,在此期间您的余额不会更新 \ No newline at end of file diff --git a/src/main/resources/i18n/msg_en.properties b/src/main/resources/i18n/msg_en.properties deleted file mode 100644 index c67637fce..000000000 --- a/src/main/resources/i18n/msg_en.properties +++ /dev/null @@ -1,127 +0,0 @@ -msg.test=Test - -error.payment.valid.param_missing=Required Param {0} not found -error.payment.valid.invalid_time=invalid time format -error.payment.valid.invalid_channel=Invalid Channel -error.payment.valid.invalid_fee=invalid price number -error.payment.valid.invalid_short_id=Partner Code is invalid -error.payment.valid.sign_timeout=Sign timeout -error.payment.valid.sign_invalid=Sign invalid -error.payment.valid.sign_expired=Sign expired -error.payment.valid.order_mismatch=Order is not belong to current Partner -error.payment.valid.order_not_exist=Order not exists -error.payment.valid.order_not_pre_auth=Order not Pre Authorization Order -error.payment.valid.order_pre_auth=Pre Authorization Order is not allowed to create refund order. Release it first if required. -error.payment.valid.refund_mismatch=Refund Order is not belong to Trade Order -error.payment.valid.refund_not_exist=Refund Order not exists -error.payment.valid.order_not_paid=Failed to create refund order:Order not paid -error.payment.valid.not_enough_balance=You do not have enough balance not settled to finish the refund. Contact RoyalPay if you have question. -error.payment.valid.refund_wait_solve=This Order is subject to refund. Please try again later -error.payment.valid.refund_review=The refund has been submitted. Please wait for the RoyalPay review -error.payment.valid.order_paid=Order already paid -error.payment.valid.invalid_url=Param {0} Error:URL is not valid -error.payment.valid.invalid_timezone=Timezone not acceptable! -error.payment.valid.invalid_date_format=Invalid Date Format -error.payment.valid.invalid_auth_code=Invalid Payment Code -error.payment.valid.error_currency=Param {0} Error:Invalid currency. Only AUD or CNY is allowed. -error.payment.valid.invalid_email=Param {0} Error: Email format invalid. -error.payment.valid.order_locked=Another user is paying this order -error.payment.valid.order_closed=Order payment timeout and was closed. Try to create new Order and try again. - -error.payment.valid.same-amount=Too often on this payment amount. Change another count or try Alipay instead please. - -error.payment.no_approvement=Client has not approved so that payment permission is disabled. -error.payment.quick_open_overtime=Client has not been authenticated. - -error.payment.permission.jsapi=QRCode Pay for this partner has not enabled -error.payment.permission.gateway=Gateway Pay for this partner has not enabled -error.payment.permission.retail=Retail Pay for this partner has not enabled - -error.payment.system.partner_not_exists=Partner not exists or disabled -error.payment.system.server_invisible=Wechat Server connection failed -error.payment.system.invalid_url=Invalid Url:{0} -error.payment.system.unreadable_return=Response from wechat server is not readable -error.payment.system.sign_failed=Sign from response data is invalid - -error.payment.system.create_order_fail=Failed to create trade order:{0} -error.payment.system.check_order=Failed to verify order status:{0} -error.payment.system.close_order=Failed to close order:{0} -error.payment.system.new_refund=Failed to create refund order:{0} - -error.permission.not_login=Please sign in first -error.permission.login_again=Your login has expired. Please sign in again. -error.permission.nopermission=You have no permission to access this resource. -error.permission.not_manager_login=Use manager account and sign in. - -error.settlement.season_invalid=Season of next rate cycle not started. Unable to generate new rate automatically - -error.partner.valid.dumplicate_client_moniker=Partner code exists -error.partner.valid.account_not_match=Account does not belong to current partner. - -error.vipcustomer.valid.dumplicate_vip_code=VIP code exists - -error.not_wechat_browser=Please use WeChat client to visit this page. -error.not_support_browser=This browser is not supported - -error.payment.max_order_limit=Order fee is larger than max order fee limit to current merchant - -error.payment.max_customer_limit=Dear Customer, Your payment amount is over limit. Please input a lower count or use another channel. - -error.payment.customer_cheat=Trading frequency, please try again tomorrow. - -error.cashier.valid.dumplicate_cashier_code=Cashier code exists - -error.register.valid.dumplicate_email=The email address has been registered,please use the other mailbox - -error.payment.xplan.enable=Activity not started yet. Keep attention about us. -error.payment.xplan.not-auto-join=Self-join not allowed yet. Contact our service please. - -error.login.password=User name or password error. - - -todo.settlement.date_setting=Settle Dates configured are running out. Config new Settle Dates -todo.rate.expire_warning=Some clients' rate are expiring soon or expired. Please fix it as soon as possible. -todo.client.approve=Some clients are waiting for compliance. -todo.client.greenchannel=The data of Some clients in Green channel are waiting for committing. -todo.bd.order=The merchant managed by you is transferred. Please submit the materials as soon as possible. - -app.message.title.payment=Payment Message -app.message.body.payment=You have received a payment of -app.message.title.risk=Risk Control Message -app.message.body.risk=You have received a risk control reminder. Please handle as soon as possible. -app.message.title.notice=System Message -app.message.body.refund=Your refund request has been sent,refund count is -app.message.body.cashback=You got a cashback of -app.message.title.clean=Settlement Notification -app.message.body.clean=Today's clearing has been completed,settlement count is -app.message.title.daily_notice=Daily Transaction Report -app.message.title.annual_bill=Royal Pay thanks for your company in 2018 -app.message.body.annual_bill=Come and check your annual bill -app.message.rservices.body= {0} has been successfully payment!,$ {1} .Thank you for your use. If you have any questions or issues related to this adjustment, please don’t hesitate to call 1300 107 750 or email info@royalpay.com.au. - - -app.label.pay=Pay -app.label.remark=Remark -app.label.creating-order=... -app.label.close=Close -app.label.coupons=Available Coupons - - -sys.contract.ordinary.info=Dear merchant, your service contract with ROYALPAY has expired. In order not to affect your normal use, please contact your supervisor or use your administrator account as soon as possible for service renewal. -sys.contract.ordinary.waring=Dear merchant, your service contract with ROYALPAY expires in {0} days. In order not to affect your normal use, please contact your supervisor or use your administrator account as soon as possible in order to renew your service contract. -sys.contract.waring=Dear merchant, your service contract with ROYALPAY is due to expire in {0} days. In order not to affect your normal use, please see the latest service agreement for renewal. -sys.contract.info=Dear merchant, your service contract with ROYALPAY has expired. Please check the latest service agreement to renew your contract so as not to affect your normal use. -contract.old.waring=Dear Valued Merchants ,to ensure we comply with the ATO, we will need to adjust our current service agreements to be exclusionary of GST. This will result in contractual changes to your agreement,please read it carefully. - -sys.mondelay.cancel.waring=Are you sure to quit this activity? - -client.auth.file.title=RoyalPay is committed to providing a secure and safe platform for Chinese payments. As a part of this we regularly participate in communication with Austrac and China's Foreign Exchange Regulator. To ensure your business is fully compliant, we require certain documents from you by the February 29. If you believe you may not be able to submit these documents on time please get in touch with us as soon as possible. -client.auth.file.aggregate.title=Notice Of Supplementary Files -client.auth.file.compliance.type=2019-10 KYC Certification Information Supplement(1) -client.auth.file.kyc.type=2020-01 KYC Certification Information Supplement(2) -client.auth.file.help_confirm=Click YES if you like our customer service team to assist? -client.auth.file.help_success=succesfuly, our customer service team will review as soon as possible. Thank you! -client.auth.file.status.wait_auth=Pending examination and approval -client.auth.file.status.passed=Done -client.auth.file.status.refused=Refused -client.auth.file.status.not_submitted=Not Submitted diff --git a/src/main/resources/i18n/msg_zh.properties b/src/main/resources/i18n/msg_zh.properties deleted file mode 100644 index 88fd110a1..000000000 --- a/src/main/resources/i18n/msg_zh.properties +++ /dev/null @@ -1,120 +0,0 @@ -msg.test=测试 - -error.payment.valid.param_missing= {0} 请填写 -error.payment.valid.invalid_time=时间格式不正确 -error.payment.valid.invalid_channel=不合法的支付通道 -error.payment.valid.invalid_fee=不正确的金额 -error.payment.valid.invalid_short_id=非法的商户编码 -error.payment.valid.sign_timeout=签名超时 -error.payment.valid.sign_invalid=签名校验未通过 -error.payment.valid.sign_expired=签名已作废,您可能重复使用了签名 -error.payment.valid.order_mismatch=订单与商户不匹配 -error.payment.valid.order_not_exist=不存在的订单 -error.payment.valid.order_not_pre_auth=不是预授权订单 -error.payment.valid.order_pre_auth=预授权订单禁止退款,如果需要,请先解冻订单 -error.payment.valid.refund_mismatch=退款单与订单不匹配 -error.payment.valid.refund_not_exist=不存在的退款单 -error.payment.valid.order_not_paid=退款失败:订单未支付 -error.payment.valid.not_enough_balance=您没有足够的未结算余额完成退款,如有疑问请与RoyalPay联系 -error.payment.valid.refund_wait_solve=该笔订单有退款正在处理,请稍后再试 -error.payment.valid.refund_review=退款已提交,请等待RoyalPay审核 -error.payment.valid.order_paid=订单已支付 -error.payment.valid.invalid_url=参数{0}错误:URL格式不正确 -error.payment.valid.invalid_timezone=不合法的时区配置 -error.payment.valid.invalid_date_format=日期格式不正确 -error.payment.valid.invalid_auth_code=不合法的付款码 -error.payment.valid.error_currency=参数{0}错误:币种不正确,只接受CNY或AUD -error.payment.valid.invalid_email=参数{0}错误:Email格式不正确 -error.payment.valid.order_locked=订单已有其他账户正在支付 -error.payment.valid.order_closed=订单超时已关闭,请尝试重新下单 - -error.payment.valid.same-amount=该支付金额过于频繁,请修改金额后再次提交或使用支付宝支付 - -error.payment.no_approvement=商户未审核,无法开启支付 - -error.payment.quick_open_overtime=商户未及时提交审核资料,支付服务关闭 - -error.payment.permission.jsapi=商户未开通商户二维码 -error.payment.permission.gateway=商户未开通网关支付 -error.payment.permission.retail=商户未开通线下支付 - -error.payment.system.partner_not_exists=商户不存在或已禁用 -error.payment.system.server_invisible=微信服务器无法访问 -error.payment.system.invalid_url=URL无法解析:{0} -error.payment.system.sign_failed=微信服务器返回值校验失败 -error.payment.system.unreadable_return=微信服务器返回值无法解析 - -error.payment.system.create_order_fail=创建支付订单失败:{0} -error.payment.system.check_order=查询订单状态失败:{0} -error.payment.system.close_order=关闭订单失败:{0} -error.payment.system.new_refund=退款失败:{0} - -error.settlement.season_invalid=下周期开始时间所在季度未到,无法生成新费率 - -error.permission.not_login=请先登陆 -error.permission.login_again=登陆已超时,请重新登陆 -error.permission.nopermission=您没有权限访问当前资源 -error.permission.not_manager_login=请先用管理员账号登陆 - -error.partner.valid.dumplicate_client_moniker=商户编码已存在 -error.partner.valid.account_not_match=账号不属于当前商户 - -error.not_wechat_browser=请使用微信客户端访问当前页面 -error.not_support_browser=不支持此浏览器 - -error.register.valid.dumplicate_email=此邮箱地址已被注册,请使用其他邮箱 - -error.payment.max_order_limit=订单金额超出当前商户最大订单金额限制 - -error.payment.max_customer_limit=尊敬的用户,您已超出支付限额,请调低支付金额或使用其它支付方式 - -error.payment.customer_cheat=交易次数过频,请明日再试 - -error.payment.xplan.enable=活动暂未开通,敬请期待 -error.payment.xplan.not-auto-join=暂不允许自主申请,详请联系我们客服 - -error.login.password=用户名或密码错误 - -todo.settlement.date_setting=已配置清算日即将到期,请配置新的清算日 -todo.rate.expire_warning=有商户费率即将到期或已过期,请尽快处理 -todo.client.approve=有等待审核的商户 -todo.client.greenchannel=有绿色通道商户等待提交资料 -todo.bd.order=有商户被调单,请尽快提交材料 - -app.message.title.payment=到账通知 -app.message.body.payment=您有一笔新的到账, -app.message.title.risk=风控通知 -app.message.body.risk=您收到了一条风控提醒,请及时处理 -app.message.title.notice=系统通知 -app.message.body.refund=退款申请已提交渠道方处理,退款金额 -app.message.body.cashback=您获得了一笔ROYALPAY返现,金额 -app.message.title.clean=清算通知 -app.message.body.clean=您今日的清算已完成,共 -app.message.title.daily_notice=每日交易汇总提醒 -app.message.title.annual_bill=2018年RoyalPay感谢有你 -app.message.body.annual_bill=快来查收你的年度账单 -app.message.rservices.body= {0} 已付款成功!,$ {1} .感谢您的使用,如有疑问或需帮助,请拨打我们的客服电话:1300 107 750或添加RoyalPay官方客服号:royalpay_1详询. - -app.label.pay=支付 -app.label.remark=备注 -app.label.creating-order=... -app.label.close=关闭 -app.label.coupons=可用优惠券 - -sys.contract.ordinary.info=尊敬的商户,您与ROYALPAY的服务合同已到期,为了不影响您的正常使用,请尽快联系您的主管或使用管理员账户登录以便进行服务续约 -sys.contract.ordinary.waring=尊敬的商户,您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请尽快联系您的主管或使用管理员账户登录以便进行服务续约 -sys.contract.waring=尊敬的商户,您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请查看最新服务协议进行续约。 -sys.contract.info=尊敬的商户,您与ROYALPAY的服务合同已到期,为了不影响您的正常使用,请查看最新服务协议进行续约。 -contract.old.waring=尊敬的商户,RoyalPay于近期正式收到澳洲监管机构的通知,应澳大利亚税务局ATO的要求进行了合同上GST部分的相应调整。请仔细阅读合同条款并确认。 -sys.mondelay.cancel.waring=是否确认退出活动 - -client.auth.file.title=RoyalPay致力于为中国用户提供一个安全可靠的支付平台,对此我们定期会与澳大利亚和中国外汇监管机构进行沟通。为确保您的业务符合相关机构要求,我们需要您在2020年2月29日前提交所需文件,如果您无法在截止日期提交这些文件,请尽快与我们联系,谢谢您的配合。 -client.auth.file.aggregate.title=补充材料通知 -client.auth.file.compliance.type=2019-10月KYC材料认证补充(1) -client.auth.file.kyc.type=2020-01月KYC材料认证补充(2) -client.auth.file.help_confirm=如果您需要我们的客户服务团队协助,请点击“确定”。 -client.auth.file.help_success=提交成功,我们的卡湖服务团队会尽快查看。谢谢您!。 -client.auth.file.status.wait_auth=待审核 -client.auth.file.status.passed=已完成 -client.auth.file.status.refused=打回 -client.auth.file.status.not_submitted=未提交 diff --git a/src/main/resources/jasper/austrac_report.jasper b/src/main/resources/jasper/austrac_report.jasper deleted file mode 100644 index a0b55d6c7..000000000 Binary files a/src/main/resources/jasper/austrac_report.jasper and /dev/null differ diff --git a/src/main/resources/jasper/incremental_partner_invoice_gst.jasper b/src/main/resources/jasper/incremental_partner_invoice_gst.jasper deleted file mode 100644 index c3ea935bf..000000000 Binary files a/src/main/resources/jasper/incremental_partner_invoice_gst.jasper and /dev/null differ diff --git a/src/main/resources/jasper/incremental_partner_upay_invoice_gst.jasper b/src/main/resources/jasper/incremental_partner_upay_invoice_gst.jasper deleted file mode 100644 index cf6b40d3d..000000000 Binary files a/src/main/resources/jasper/incremental_partner_upay_invoice_gst.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice.jasper b/src/main/resources/jasper/partner_invoice.jasper deleted file mode 100644 index a3918115e..000000000 Binary files a/src/main/resources/jasper/partner_invoice.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice_gst.jasper b/src/main/resources/jasper/partner_invoice_gst.jasper deleted file mode 100644 index 118b70f8c..000000000 Binary files a/src/main/resources/jasper/partner_invoice_gst.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_settlement_detail.jasper b/src/main/resources/jasper/partner_settlement_detail.jasper deleted file mode 100644 index caeb59160..000000000 Binary files a/src/main/resources/jasper/partner_settlement_detail.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_upay_invoice_gst.jasper b/src/main/resources/jasper/partner_upay_invoice_gst.jasper deleted file mode 100644 index cd6a18014..000000000 Binary files a/src/main/resources/jasper/partner_upay_invoice_gst.jasper and /dev/null differ diff --git a/src/main/resources/jasper/royalpay.png b/src/main/resources/jasper/royalpay.png deleted file mode 100644 index 25e70f48f..000000000 Binary files a/src/main/resources/jasper/royalpay.png and /dev/null differ diff --git a/src/main/resources/jasper/royalpay_logo.png b/src/main/resources/jasper/royalpay_logo.png deleted file mode 100644 index b71a9e051..000000000 Binary files a/src/main/resources/jasper/royalpay_logo.png and /dev/null differ diff --git a/src/main/resources/jasper/royalpay_logo_bak.png b/src/main/resources/jasper/royalpay_logo_bak.png deleted file mode 100644 index b71a9e051..000000000 Binary files a/src/main/resources/jasper/royalpay_logo_bak.png and /dev/null differ diff --git a/src/main/resources/jasper/securepay_logo.png b/src/main/resources/jasper/securepay_logo.png deleted file mode 100644 index 86f3892b9..000000000 Binary files a/src/main/resources/jasper/securepay_logo.png and /dev/null differ diff --git a/src/main/resources/jasper/securepay_settlement_detail.jasper b/src/main/resources/jasper/securepay_settlement_detail.jasper deleted file mode 100644 index 81d8c724f..000000000 Binary files a/src/main/resources/jasper/securepay_settlement_detail.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel.jasper b/src/main/resources/jasper/trans_excel.jasper deleted file mode 100644 index 51c5ed6fc..000000000 Binary files a/src/main/resources/jasper/trans_excel.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow.jasper b/src/main/resources/jasper/trans_flow.jasper deleted file mode 100644 index 22243fc5c..000000000 Binary files a/src/main/resources/jasper/trans_flow.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow_excel.jasper b/src/main/resources/jasper/trans_flow_excel.jasper deleted file mode 100644 index a183462e5..000000000 Binary files a/src/main/resources/jasper/trans_flow_excel.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow_new.jasper b/src/main/resources/jasper/trans_flow_new.jasper deleted file mode 100644 index dc9874901..000000000 Binary files a/src/main/resources/jasper/trans_flow_new.jasper and /dev/null differ diff --git a/src/main/resources/logback_cfg.xml b/src/main/resources/logback_cfg.xml deleted file mode 100644 index 14435fc61..000000000 --- a/src/main/resources/logback_cfg.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - 30 - /var/log/payment/%d{yyyy-MM,aux}/manage.%d{yyyy-MM-dd}.%i.log - 200MB - - - [ Server--${ROYALOS_NODE_IP} ] ${FILE_LOG_PATTERN} - UTF-8 - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/mybatis-config.xml b/src/main/resources/mybatis-config.xml deleted file mode 100644 index 9304ed6a6..000000000 --- a/src/main/resources/mybatis-config.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/napclient_cert.p12 b/src/main/resources/napclient_cert.p12 deleted file mode 100644 index 2c9e2f5cc..000000000 Binary files a/src/main/resources/napclient_cert.p12 and /dev/null differ diff --git a/src/main/resources/redpack_cert.p12 b/src/main/resources/redpack_cert.p12 deleted file mode 100644 index f0d785a2f..000000000 Binary files a/src/main/resources/redpack_cert.p12 and /dev/null differ diff --git a/src/main/resources/templates/activity/encourage_money/desc.html b/src/main/resources/templates/activity/encourage_money/desc.html deleted file mode 100644 index 595bfe20e..000000000 --- a/src/main/resources/templates/activity/encourage_money/desc.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - 鼓励金活动介绍 - - - - - - - -

    - -
    -
    欢迎使用RoyalPay支付
    -
    奖励再翻倍
    - -
    -
    -
    - - 参与方式 - -
    -
    - 用户在支持RoyalPay的商户使用微信、支付宝进行消费,金额≥10澳币时, - 立即获得随机鼓励金。最高可达888元,每人每天可领取三次。 -
    -
    -
    -
    - - 使用规则 - -
    -
    - 用户每次完成消费后的鼓励金,可在下次消费进行金额的抵扣,鼓励金可一次全部使用, - 也可分批使用。 -
    -
    -
    -
    - - 金额翻倍 - -
    -
    - 用户在完成每笔交易获得鼓励金后,在支付完成页面有一个点击翻倍按钮,点击后有机会获得双倍鼓励金。 -
    -
    -
    -
    - - 活动规则 - -
    -
    - 同一微信号、手机号码、身份证号码、手机设备,符合其中一个条件者视为同一用户。享受优惠的订单若发生退款,相应的鼓励金将不退回。 - 鼓励金仅在活动期间有效,活动结束鼓励金自动清零。 -
    -
    - - - -
    本活动的最终解释权归RoyalPay所有
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/activity/encourage_money/merchants.html b/src/main/resources/templates/activity/encourage_money/merchants.html deleted file mode 100644 index 72d673774..000000000 --- a/src/main/resources/templates/activity/encourage_money/merchants.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - 活动商家 - - - - - - - -
    -
    -
    - - 商贸礼品 - -
    - -
    -
    -
    - - 药店保健品 - -
    - -
    -
    -
    - - 餐饮 - -
    - -
    -
    -
    - - 快递物流 - -
    - -
    -
    -
    - - 旅游租车 - -
    - -
    -
    -
    - - 酒店 - -
    - -
    -
    -
    - - 零售商超 - -
    - -
    -
    -
    - - 服饰与美容 - -
    - -
    -
    -
    - - 珠宝 - -
    - -
    - - 澳洲微信支付请认准RoyalPay皇家支付 - 申请开通 - - -
    本活动的最终解释权归RoyalPay所有
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/activity/encourage_money/my.html b/src/main/resources/templates/activity/encourage_money/my.html deleted file mode 100644 index a5b4f9cf4..000000000 --- a/src/main/resources/templates/activity/encourage_money/my.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - 鼓励金详情 - - - - - - - - -
    - -
    活动期间任意消费满10澳币,获随机鼓励金
    -
    -
    - [[${balance_status['from']}]]至[[${balance_status['to']}]] - -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    - -
    - -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/activity/mondelay/mondelay.html b/src/main/resources/templates/activity/mondelay/mondelay.html deleted file mode 100644 index 846f3f7f4..000000000 --- a/src/main/resources/templates/activity/mondelay/mondelay.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - 跨境电商优选补贴计划 - - - - - -
    -
    -

    -
    -
    - -
    -
    -
    活动已结束
    -
    -
    -
    -
    -

    活动说明

    -
    -
      -
    • 参与商户每周一即可获得营销补贴
    • -
    • - 营销补贴金额,以发放时账户余额为基数,折算年化比率不低于15%,最高20%,2000$封顶 -
    • -
    • - 每周一15:00~16:00(GMT+10时区)发放营销补贴至商户营销账户。 -
    • -
    • - 参与活动商户系统不再自动清算,商户可以根据自己的需要自行提现,提现完第二天会清算到商户银行账户。 -
    • -
    • - 补贴活动周期:2018/3/20-2018/6/30 -
    • -
    • 商户自愿参加,可以随时取消(除周一外,周一为补贴的计算和发放日,在此期间无法进行报名和取消操作,17:00之后恢复报名和取消报名)
    • -
    • 商户一旦取消,则放弃活动补贴,第二天系统会恢复自动清算
    • -
    • 本活动最终解释权归RoyalPay所有
    • -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -

    补贴金额记录

    -
    - -
    -
    累计补贴金额
    -
    $
    -
    - -
    - - - - - - - - - - - - - -
    时间补贴金额
    >04-01 12:00$5.00
    -
    -
    -
    -
    - -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/src/main/resources/templates/activity/new_year_reward/description.html b/src/main/resources/templates/activity/new_year_reward/description.html deleted file mode 100644 index fdfad0390..000000000 --- a/src/main/resources/templates/activity/new_year_reward/description.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - Pay Successful - - - -
    -

    活动说明

    -

    1、用户通过支付宝或微信完成支付后,支付成功页面出现“RoyalPay2019年春节红包抽奖”活动弹窗,点击进入即可参与抽奖,没人每天有2次抽奖机会; -

    -

    2、用户每天有2次抽奖机会。同一手机号,同一手机终端,同一账户,符合以上任一条件,均视为同一用户; -

    -

    3、参与本次活动需通过支付成功页面入口参加活动(需用户主扫二维码支付); -

    -

    4、本次活动只针对线下场景支付行为; -

    -

    5、用户需满18岁周岁;

    -

    6、如用户出现违规行为(如虚假交易、作弊、刷单等),RoyalPay将撤销违规用户活动参加资格,并有权回收违规用户获得的福利; -

    -

    7、本次活动最终解释权归RoyalPay所有。 -

    -
    - - diff --git a/src/main/resources/templates/activity/new_year_reward/reward.html b/src/main/resources/templates/activity/new_year_reward/reward.html deleted file mode 100644 index 5d85af02e..000000000 --- a/src/main/resources/templates/activity/new_year_reward/reward.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - Pay Successful - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    恭喜您获得RoyalPay新春红包
    -
    .00
    红包将自动转入您的钱包
    -
    -
    -
    - -
    恭喜您获得RoyalPay新春好礼
    -
    -
    - -
    -
    AU8口气清新剂一瓶
    -

    地址:1/550 George St Sydney NSW 2000

    -

    有效期: 2019年2月4日-2019年2月9日

    -

    使用说明:到店领取,先到先得

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - diff --git a/src/main/resources/templates/activity/one_dollar_day/merchant_bind.html b/src/main/resources/templates/activity/one_dollar_day/merchant_bind.html deleted file mode 100644 index 92e37d9cd..000000000 --- a/src/main/resources/templates/activity/one_dollar_day/merchant_bind.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - 身份绑定成功 - - - - - - - - -

    身份绑定已完成,奖励将随后发出,敬请留意微信通知

    - - \ No newline at end of file diff --git a/src/main/resources/templates/activity/one_dollar_day/merchant_detail.html b/src/main/resources/templates/activity/one_dollar_day/merchant_detail.html deleted file mode 100644 index ce1e7710f..000000000 --- a/src/main/resources/templates/activity/one_dollar_day/merchant_detail.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - $merchant.display_name - - - - - - - - -
    -
    -

    - 买单 -

    -
    -
    -
    - -
    -
    - - - - -
    -
    -
    - -
    -
    -
    - 餐饮商户特惠日立减优惠 - 每周二微信支付买单立减一澳币 -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/activity/one_dollar_day/merchants.html b/src/main/resources/templates/activity/one_dollar_day/merchants.html deleted file mode 100644 index 55bb91b6c..000000000 --- a/src/main/resources/templates/activity/one_dollar_day/merchants.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - 特惠日活动商户 - - - - - - - - - - -
    - No Result -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/app/app_customer.html b/src/main/resources/templates/app/app_customer.html deleted file mode 100644 index bd3b689c1..000000000 --- a/src/main/resources/templates/app/app_customer.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - RoyalPay - - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/src/main/resources/templates/app/bd_prize_rules.html b/src/main/resources/templates/app/bd_prize_rules.html deleted file mode 100755 index 8510450c8..000000000 --- a/src/main/resources/templates/app/bd_prize_rules.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Title - - - - - - -
    -
    -

    BD分级提成费率速查表

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    BD LevelKPI完成度Junior BDIntermediate BDSenior BD
    费率0.6-0.790.8-2.00.6-0.790.8-2.00.6-0.790.8-2.0
    -
    -

    补充说明

    -
      -
    • 按月度发放
    • -
    • 每月发放总提成额度的60%,剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放
    • -
    • 提前离职者,40%提成不予发放
    • -
    • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分,扣下部分如果第二年考评超出一定评分110%可以补发;同样,如果年度考评分数超过100 分按照同比例发放
    • -
    • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
    • -
    • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
    • -
    • 分配后的商户流水客户专员只能占一半
    • -
    • 离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; - 离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金
    • -
    • 被客户投诉情况严重者,此商户由销管中心无条件收回重新分配
    • -
    • 活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配
    • -
    • 后期维护不及时,连续一个月不跟踪者,此商户上交销管中心,统一重新分配
    • -
    • 以上分配,销管中心 leader 和跨境支付事业部商量好之后需做好方案后经 COO 审批方可执行
    • -
    -
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/app/invoice.html b/src/main/resources/templates/app/invoice.html deleted file mode 100644 index f85d4f216..000000000 --- a/src/main/resources/templates/app/invoice.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - [[${#dates.format((new java.util.Date()), 'dd-MM-yyyy')}]] [[${parmerters.partnerCode}]] Invoice - - - - - -
    -
    - - -
    -
    -
    - - Tunnel Show Pty Ltd trading as RoyalPay
    - ABN 16 601 619 685
    - Representative of AFSL 448066 -

    -
    - -
    -
    -
    - Tax Invoice -
    -
    Merchant code -
    -
    Statement -
    -
    - Issue Date - -
    -
    Current -
    -
    -
    -
    - Your Statement
    -
    - -
    -
    - Date/Time -
    -
    - Client Order ID -
    -
    - Transaction ID -
    -
    - Debit - -
    -
    - Credit - -
    -
    - Service Fee for RoyalPay (GST Inclusive) - -
    -
    - Service fee for Mini Program(GST Inclusive) -
    - -
    - Settlement Amount -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    - - -
    -
    - - - -
    -
    - - -
    -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - -
    -     records. -
    -
    -
    - Total Settlement Amount: - -
    -
    - Merchant Service Fee: - (GST Inclusive) -
    -
    - GST: - -
    -
    - - diff --git a/src/main/resources/templates/app/org_prize_rules.html b/src/main/resources/templates/app/org_prize_rules.html deleted file mode 100755 index cbd015139..000000000 --- a/src/main/resources/templates/app/org_prize_rules.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Title - - - - -
    -
    -
    -
    -
    -
    合伙人提成计算说明
    -

    2018-11-30更新

    -
    -
    -
    - 合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下:    - (取整规则为:四舍五入保留2位小数) -
    -
      -
    • 单笔订单 :  (单笔订单交易金额 * 商家签约费率)取整     - -   (单笔订单交易金额 * 组织成本费率)取整     - =    单笔订单合伙人提成 -
    • -
    • 总交易额 :  合伙人签约的商户累计交易额
    • -
    • 平台手续费:合伙人签约的商户(单笔订单交易金额 * 组织成本费率)取整 累加
    • -
    • 合伙人提成: 每笔订单合伙人提成累加
    • -
    -
    -
    如合伙人存在二级代理,可从二级代理的交易额中得到分润,分润规则如下:
    -
      -
    • 二级代理合伙人提成计算规则如同一级代理,分润从平台手续费中扣除。
    • -
    • 如A合伙人与平台签约组织成本费率为1.5%,A合伙人的二级代理B的签约组织成本费率为1.8%,B的商户签约费率为3%
    • -
    • 假设B当月只有一笔交易且交易额为1000,总手续费为30,平台手续费为18,B合伙人提成为12。
    • -
    • 计算A的分润时,会将B的交易额1000 * A的组织成本费率 1.5% = 15,A的分润就是 18-15=3,而B合伙人平台手续费为15,其中扣除3是A的分润
    • -
    -
    补充说明
    -
      -
    • 退款成功的订单不计入合伙人提成内
    • -
    • 当本月有合伙人手续费存在欠款时,无法下载汇款文件
    • -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/change_password.html b/src/main/resources/templates/change_password.html deleted file mode 100644 index 889f760ca..000000000 --- a/src/main/resources/templates/change_password.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - RoyalPay - Change Passowrd - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - - diff --git a/src/main/resources/templates/contract_for_compliance.html b/src/main/resources/templates/contract_for_compliance.html deleted file mode 100644 index da8d09390..000000000 --- a/src/main/resources/templates/contract_for_compliance.html +++ /dev/null @@ -1,1369 +0,0 @@ - - - - - - - - - - - - - - test - - - - - - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    -
    - -
    - -
    -
    - - -
    -

    -

    1

    -

    1

    -

    1

    -

    1

    -

    CORNWALL STODART

    -

    Level 10

    -

    114 William Street

    -

    DX 636

    -

    MELBOURNE VIC 3000

    -

    Telephone: +61 3 9608 2000

    -

    Facsimile: +61 3 9608 2222

    -

    Email: j.masterson@cornwalls.com.au

    -

    Reference: Joel Masterson:1040326

    -
    -

    SERVICES AGREEMENT

    -

    -

    Date

    - - -

    -

    -

    -

    This Services Agreement is made on the day it is signed by all parties.

    -

    -

    PARTIES

    -

    -
    - - -
    - - - - - - - - - - - - - - - - - - -
    -

    -
    -

    The Supplier

    -
    -

    The Client:

    -
    -

    Name:

    -
    -

    Tunnel Show Pty Ltd (ACN 601 619 685)

    -

    trading as RoyalPay

    -
    - - -

    -

    -

    -

    Address:

    -
    -

    Level 11
    15 William Street
    Melbourne VIC3000

    -
    -


    {{aggregateFileInfo.address_sub}}

    -
    -
    - -
    - - -
    -

    INTRODUCTION

    -

    -
      -
    • The Supplier is a leading Australian financial technology company dedicated to providing mobile payment platforms to facilitate simple and efficient cross-border payments.
    • -
    • To this end, the Supplier has developed a certain software application and platform which provides Clients (who have web-based gateway APIs (being application programming interfaces) and point-of-sale payment processing and settlement capabilities in the Chinese currency) with a payment integration system, which:
    • -
    -
      -
    1. utilises the WeChat Pay payment technology that is owned by Tencent Holdings Limited (China) and that is licensed to the Supplier to facilitate third party payments in Australia;
    2. -
    3. utilises the Alipaypayment technology that is owned by Alipay.com Co., Ltd. (China) and that is licensed to the Supplier to facilitate third party payments in Australia;
    4. -
    5. utilises the BestPaypayment technology that is owned by China Telecom Orange Finance (China) and that is licensed to the Supplier to facilitate third party payments in Australia;
    6. -
    7. utilises theJDpay payment technology that is owned by Chinabank Payment (Beijing) Technology Co., Ltd.and that is licensed to the Supplier to facilitate third party payments in Australia;
    8. -
    9. utilisesthe CB BankPay payment technology licensed to the Supplier by Lakala Payment Co., Ltd, Yeepay Co., Ltd, PnR Data Service Co.,Ltdand other companiesto facilitate third party payments in Australia;
    10. -
    11. processes payments from users of the WeChat Pay, Alipay, BestPay, JDpay, CB BankPay and otherpayment technologies and Chinese bank cardsin Chinese Yuan, converts such payments to the Australian Dollar equivalent and then sends such payments to the Client by utilising settlement functions forming part of the software application;
    12. -
    13. allows the Client to access the merchant management portal feature of the software application which facilitates transaction management, reporting and provides transactional analytics; and
    14. -
    15. provides the Client with opportunity to access to additional unique WeChat Pay marketing features including WeChat Lucky Money (an incentive program where payers randomly receive cashbacks) and WeChat Moment (being social media advertising aimed at enhancing a Clients brand awareness).
    16. -
    17. provides the Client with access to additional Alipay Discovery marketing features such as 12% Off Event (an incentive program where payers randomly receive discount) and Discovery Channel (location based services to attract nearby clients).
    18. -
    -

    -

    (RoyalPay Cross-Border Payment Services)

    -
      -
    • The Client wishes to use the RoyalPay Cross-Border Payment Services provided by the Supplier for receiving payments from the Clients customers, for the Clients own goods and/or services provided by the Client to its customers at the Clients own retail outlets and/or through the Clients own website.
    • -
    • The parties agree that the Supplier will supply the Client with the RoyalPay Cross-Border Payment Services in accordance with the terms of this Agreement.
    • -
    -

    -

    OPERATIVE PROVISIONS

    -

    -

    The Parties agree as follows:

    -

    -

    1.Agreement

    -
      -
    • 1.1 The Supplier agrees to provide the RoyalPay Cross-BorderPaymentServices (and to provide the Client with any applicable documentationor guidancepertaining to the Clients use of the RoyalPay Cross-Border Payment Services) subject to the terms of this Agreement.
    • -
    • 1.2 The Client agrees to pay to the Supplier the Fees and charges for the RoyalPay Cross-Border Payment Services as set out in Schedule B.
    • -
    • 1.3 This Agreement shall apply to the supply and provision of any and all RoyalPay Cross-Border Payment Services to the Client during the Term.
    • -
    -

    2.Contract Manager

    -
      -
    • 2.1 The Clientmay nominate a manager in Schedule Bor otherwise in writing from time to time to act as the Clients contract manager in dealing with the Supplier under this Agreement (ContractManager).
    • -
    • 2.2 If the Supplier appoints a Contract Manager, the Contract Manager will be the authorised representative of the Supplier for the purposes of this Agreement.
    • -
    -

    3.Term

    -
      -
    • 3.1 This Agreement commences on the Commencement Date and continues for the Initial Term (Term), unless extended under clause 3.2or otherwise terminated earlier in accordance with clause 15.
    • -
    • 3.2 The Term of this Agreement will automatically extend beyond the Initial Term for subsequent rolling 12 month periods (Renewed Term), unless:
    • -
        -
      • (a) either party notifies the other of termination in writing, at least thirty (30) calendar days before the end of the Initial Term or any Renewed Term (as the case may be); or
      • -
      • (b) this Agreement is terminated earlier pursuant to clause 15.
      • -
      -
    -

    4.Acceptance Testing

    -
      -
    • 4.1 The Client shall conduct and complete all Acceptance Testing as soon as practicable but within five (5) Business Days of the delivery of the RoyalPay Cross-Border Payment Services by the Supplier. The Client will allow the Supplier to be present at any Acceptance Testing, provided that the Supplier gives the Client sufficient notice of its wish to be present.
    • -
    • 4.2 Where, during Acceptance Testing and for a reasonable period after Acceptance Testing is completed, the Client encounters any malfunction, defect or suspected error in the Suppliers RoyalPay Cross-Border Payment Services, the Supplier will correct any such malfunction, defect and suspected errors as soon as practicable.
    • -
    • 4.3 If the Supplier disputes the validity of the Acceptance Testing, the parties agree to resolve the dispute as set out in clause 17.
    • -
    • 4.4 In the event of a malfunction, defect or suspected error relating to the integration of a product or service supplied to the Supplier by a third party, the Supplier will provide reasonable and prompt assistance to the Client to identify the problem and who is responsible for resolving it.
    • -
    -

    5.Delivery and Provision of RoyalPay Cross-Border Payment Services

    -
      -

      5.1 The Client engages the Supplierto provide the RoyalPay Cross-Border Payment Services and the Supplier agrees to use reasonable endeavours to provide the RoyalPay Cross-Border Payment Services(together with any applicable documentation or guidance pertaining to the Clients use of the RoyalPay Cross-Border Payment Services)to the Client, in accordance with the terms and conditions of this Agreement.

      -
    • 5.2 The Supplier shall endeavour to provide a reasonably commercial level of availability of the RoyalPay Cross-Border Payment Services for twenty-four (24) hours a day, seven (7) days a week, with at 99.98% up time (annualised), excluding:
    • -
        -
      • (c) any planned maintenance periods of which the Supplier will provide the Client with at least seven (7) Business Days prior written notice of;
      • -
      • (d) any unscheduled maintenance periods which the Supplier will endeavour to perform outside of the Suppliers normal business hours. In situations where unscheduled maintenance is required, the Supplier shall use its best efforts to provide the Client with at least six (6) hours notice in advance of such maintenance taking place; and
      • -
      • (e) any communications, banking, terminal and external systems failures which are outside of the control of the Supplier.
      • -
      -
    • 5.3 The Supplier shall, as part of the provision of the RoyalPay Cross-Border Payment Services, provide to the Client (at no additional cost to the Client) standard customer support during the Suppliers normal business hours in accordance with the Suppliers Service Level Agreement (SLA) which is operative during the Term. In particular, the Supplier shall provide the Client with Level 1, 2 and 3 support (as detailed in the SLA) as part of the provision of the RoyalPay Cross-Border Payment Services.
    • -
    • 5.4 Further to clause 5.3, the Client may (in its sole discretion) elect to purchase additional and/or enhanced support services which shall be provided by the Supplier at the Suppliers hourly rate applicable at the relevant time.
    • -
    • 5.5 The Client acknowledgesthat the Supplieris providing the RoyalPay Cross-Border Payment Services to the Client on a non-exclusive basis and that the Supplier may provide services of the same or a similar nature to any third party.
    • -
    • 5.6 The Suppliermay provide the RoyalPay Cross-Border Payment Services in the manner determined by it in its absolute and sole discretion, so longas in doing so, it does not breach any material provision of this Agreement.
    • -
    • 5.7 The parties acknowledge that the Supplier has entered this Agreement with the Client on the basis that the RoyalPay Cross-Border Payment Services utilise the WeChat Pay payment technology licensed to the Supplier by Tencent Holdings Limited (China). The parties agree that, should the WeChat Pay payment technology become unavailable to the Supplier (for any reason whatsoever), the Supplier shall be entitled, without penalty, to immediately terminate this Agreement by providing written notice of such termination to the Client.
    • -
    • 5.8 The parties acknowledge that the Supplier has entered this Agreement with the Client on the basis that the RoyalPay Cross-Border Payment Services utilise the Alipay payment technologylicensed to the Supplier by Alipay.com Co., Ltd.. The parties agree that, should the Alipaypayment technology become unavailable to the Supplier (for any reason whatsoever), the Supplier shall be entitled, without penalty, to immediately terminate this Agreement by providing written notice of such termination to the Client.
    • -
    • 5.9 The parties acknowledge that the Supplier has entered this Agreement with the Client on the basis that the RoyalPay Cross-Border Payment Services utilise the BestPaypayment technology licensed to the Supplier by China Telecom Orange Finance. The parties agree that, should the BestPaypayment technology become unavailable to the Supplier (for any reason whatsoever), the Supplier shall be entitled, without penalty, to immediately terminate this Agreement by providing written notice of such termination to the Client.
    • -
    • 5.10 The parties acknowledge that the Supplier has entered this Agreement with the Client on the basis that the RoyalPay Cross-Border Payment Services utilise the JDpaypayment technology licensed to the Supplier by Chinabank Payment (Beijing) Technology Co., Ltd. The parties agree that, should the JDpaypayment technology become unavailable to the Supplier (for any reason whatsoever), the Supplier shall be entitled, without penalty, to immediately terminate this Agreement by providing written notice of such termination to the Client.
    • -
    • 5.11 The parties acknowledge that the Supplier has entered this Agreement with the Client on the basis that the RoyalPay Cross-Border Payment Services utilise the CB BankPay payment technology licensed to the Supplier byLakala Payment Co., Ltd, Yeepay Co., Ltd, PnR Data Service Co.,Ltd and other companies. The parties agree that, should the CB BankPay payment technology become unavailable to the Supplier (for any reason whatsoever), the Supplier shall be entitled, without penalty, to immediately terminate this Agreement by providing written notice of such termination to the Client.
    • -
    • 5.12 The parties acknowledge that at any time, the Supplier may become licensed to use other payment technologies to provide the RoyalPay Cross-Border Payment Services, in which event the Supplier will endeavour to provide notice together with any applicable rates and details to the Client.
    • -
    • 5.13 The Client acknowledges that:
    • - -
        -
      • the RoyalPay Cross-Border Payment Services consists of complex software which may never be wholly free from defects, errors, bugs and compatibility issues and, in this respect, the Supplier gives no warranty or representation that the software pertaining to the RoyalPay Cross-Border Payment Services will be wholly free from such defects, errors, bugs or compatibility issues;
      • -
      -

      -
        -
      • complex software may be applied by the Supplier when upgrading existing functionalities of the RoyalPay Cross-Border Payment Services and, where this occurs, the Client shall not be subject to any additional fees or charges as a result of such upgrade, except where such upgrade introduces new functionalities to the RoyalPay Cross-Border Payment Services for which the Client will be notified in advance; and
      • -
      -

      -
        -
      • the Supplier will not, and does not, purport to provide any legal, accountancy, taxation or any other financial advisory services under this Agreement or in relation to the RoyalPay Cross-Border Payment Services, except as otherwise expressly provided herein.
      • -
      -

      -
    • 5.14 The Supplier has no obligation to the Client to rectify any defect or fault in the RoyalPay Cross-Border Payment Services caused or contributed to by:
    • -
        -
      • (a)the acts or omissions of the Client or the Clients Personnel; or
      • -
      • (b)faults or defects that arise in telecommunication services provided to the Client by a third party supplier other than such suppliers engaged or contracted by the Supplier, regardless of whether the costs associated with such services are paid or reimbursed by the Client or relate specifically to the RoyalPay Cross-Border Payment Services provided to the Client.
      • -
      -
    -

    6.RoyalPay Cross-Border Payment Services Fees, Settlement Terms and Refunds

    -
      -
    • 6.1 The details relating to Fees pertaining to the RoyalPay Cross-Border Payment Services, as well as the settlement terms for remittance of payments to the Client that have been made by the Clients customers and the terms and conditions regarding refunds are described in Schedule B.
    • -
    • 6.2 If the Client fails to pay the Fees to the Supplier in accordance with the Payment Terms, the Client is liable to pay the Supplier:
    • -
        -
      • (a)interest at the interest rate set out under the Penalty Interest Rate Act 1983 (Vic)from time to time, calculated daily, on all outstanding amounts from the date upon which payment was due until payment is received by the Supplier in full; and
      • -
      • (b)all reasonable costs and expenses incurred by the Supplier (including legal costs on a full indemnity basis) in relation to the recovery of the Fees and interest from the Client.
      • -
      -
    • 6.3 For the avoidance of doubt, the Client will not be liable for Fees which are not described in Schedule B, other than those that may be agreed to by the Client in writing from time to time.
    • -
    • 6.4 Unless otherwise agreed by the parties in writing, all expenses incurred by the Supplier in the provision of the RoyalPay Cross-Border Payment Services are to be borne by the Supplier.
    • -
    • 6.5 The Supplier may reissue an invoice if any error in the invoice is later discovered. Where:
    • -
        -
      • (a)the Client has overpaid any Fees as a result of such an error, the Clients accountwill be credited with the overpayment or, if the Client has stopped acquiring the RoyalPay Cross-Border Payment Services from the Supplier, the Supplier will refund the overpayment promptly after the Clients request but after deduction of any other amounts due by theClient; or
      • -
      • (b)the Client has underpaid any charges as a result of the error, the Client will be required to pay the correct amount to the Supplier after the invoice is reissued in accordance with the Payment Terms.
      • -
      -
    • 6.6 In the event that the Client fails to promptly notify the Supplier of any changes to, or termination of, its business or contact method which materially impacts the Suppliers settlement process for remittance of payments to the Client, and where the Supplier receives no response from the Client within three (3) Business Days after contacting the Client to ascertain this information, then the Supplier may, upon a customers request and in relation to payments already made by a customer but not yet settled with the Client, disburse or refund such payment directly to the customers nominated account.
    • -
    • 6.7 It would not be settled on both public holidays of Australia and China.
    • -

      - 6.8 In the case of special circumstances, it is subjected to Supplier liquidation notice (e-mail, WeChat, management platform, App and other channels) -
    -

    7.GST

    -
      -
    • 7.1 Unlessotherwise stated in Schedule B, the charges and other amounts payable by the Clientunder this Agreement are calculated or expressedexcludingGST.
    • -
    • 7.2 The Supplier warrants that it is registered for GST and will remain so registered for the duration of the Agreement.
    • -
    • 7.3 The Client warrants that it is registered for GST and will remain so registered for the duration of the Agreement.
    • -
    -

    8.Supplier Obligations, Warranties and Representations

    -
      -
    • 8.1 The Supplier shall be solely responsible for the establishment, integration, operation and management of the RoyalPay Cross-Border Payment Services in accordance with established administrative rules, system functionalities and other applicable terms and conditions, and shall provide all necessary trainings and documentations to facilitate the understanding and operation of Supplier's products and services provided.
    • -
    • 8.2 In addition, the Supplier shall be responsible for receiving, addressing and resolving any complaints that may arise from defects pertaining to the RoyalPay Cross-Border Payment Services.
    • -
    • 8.3 The Supplier represents and warrants that the RoyalPay Cross-Border Payment Services:
    • -
        -
      • (a)do not infringe the Intellectual Property Rights of any third party, other than with respect to the WeChat Pay payment technology that is owned by Tencent Holdings Limited (China), the Alipay payment technology that is owned by Alipay.com Co., Ltd., the BestPaypayment technology that is owned by China Telecom Orange Finance, the JDpay payment technology that is owned by Chinabank Payment (Beijing) Technology Co., Ltd.And the CB BankPay payment technology that is owned by Lakala Payment Co., Ltd, Yeepay Co., Ltd, PnR Data Service Co.,Ltdand other companies; and
      • -
      • (b)will be supplied:
      • -
          -
        • (i)in accordance with the terms of this Agreement,
        • -
        • (ii)in a professional and timely manner, in accordance with best industry practices, and with reasonable care and skill; and
        • -
        • (iii)in accordance with all relevant Laws.
        • -
        -
      -
    • 8.4 The Supplier warrants that it will provide necessary customer support functions relating to business and system enquiries and relating to the RoyalPay Cross-Border Payment Services to the Client in accordance with the terms of the SLA.
    • -
    • 8.5 The Supplier is fully authorised in all commercial and technical capacities by Tencent Holdings Limited (China) to offer the WeChat Pay payment gateway to users in Australia.
    • -
    • 8.6 The Supplier is fully authorised in all commercial and technical capacities by Alipay.com CO., Ltd. (China) to offer the Alipay payment gateway to users in Australia.
    • -
    • 8.7 The Supplier is fully authorised in all commercial and technical capacities by China Telecom Orange Finance (China) to offer the BestPaypayment gateway to users in Australia.
    • -
    • 8.8 The Supplier is fully authorised in all commercial and technical capacities by Chinabank Payment (Beijing) Technology Co., Ltd. to offer the JDpaypayment gateway to users in Australia.
    • -
    • 8.9 The Supplier is fully authorised in all commercial and technical capacities by Lakala Payment Co., Ltd, Yeepay Co., Ltd, PnR Data Service Co.,Ltdand other companiesto offer the CB BankPay payment gateway to users in Australia.
    • -
    • 8.10 The Supplier:
    • -
        -
      • does not represent, warrant or guarantee that any Service will be free of interruptions, delays, faults or errors; and
      • -
      -

      -
        -
      • except as expressly provided in this Agreement, is not liable to the Client or any other third party for any interruptions, delays, faults or errors in connection with the supply of the RoyalPay Cross-Border Payment Services (in part or in full).
      • -
      -

      -
    • 8.11 The Supplier agrees that it will not employ any reverse engineering method aimed at deciphering any computer system or procedures operated by the Client and the Supplier further agrees that it will not copy, amend edit, consolidate, or alter the said computer systems or procedures (including, without limitation, any source programs, object programs, software files, data processing in local computer storage devices, data from the Clients terminals which is transmitted to servers, server data, etc.).
    • -
    • 8.12 The parties agree that the Supplier may, provided the Client has given its express written consent to do so, promote the RoyalPay Cross-Border Payment Services and its business association with the Client by using the Clients name, trademark, marketing materials and any such like details.
    • -
    • 8.13 The Supplier represents and warrants, as at the date of this Agreement, that:
    • -
        -
      • (a)it has the power and has taken all corporate and other action required, to enter into this Agreement and to authorise the execution and delivery of this Agreement and the performance of the Suppliers obligations under this Agreement;
      • -
      • (b)this Agreement constitutes a valid and legally binding obligation of the Supplier in accordance with its terms except to the extent of discretions of courts regarding the availability of equitable remedies and Laws affecting creditors rights generally; and
      • -
      • (c)the execution, delivery and performance of this Agreement does not violate any existing Law or any document or agreement to which the Supplier is a party or which is binding on the Supplier or any of its assets.
      • -
      -
    • 8.14 The Supplier acknowledges that all representations, covenants and warranties in this Agreement are provided on an ongoing basis and will survive the execution, performance and termination of this Agreement.
    • -
    • 8.15 The Suppler is an Australian company incorporated in Melbourne, Victoria and is classified as a finance service company with the official status of Authorised Representative of Flexewallet Pty Ltd (ACN 164 657 032 and Australian Financial Services Licensee 448066) and is legally bound by various compliance regimes for the delivery of services such as the RoyalPay Cross-Border Payment Services.
    • -
    -

    9.Client Obligations, Warranties and Representations

    -
      -
    • 9.1 The Client must:
    • -
        -
      • (a)ensure that, in respect of the RoyalPay Cross-Border Payment Services, the Client meets, and continues to meet all pre-requisites or conditions for supply of the RoyalPay Cross-Border Payment Services;
      • -
      • (b)ensure that its network and systems comply with the relevant specifications provided by the Supplier from time to time and, in this respect, the Client shall be solely responsible for procuring and maintaining its network connections and telecommunications link from its systems to the Suppliers system. The Client is required to notify the Supplier of any system changes that might impact the RoyalPay Cross-Border Payment Services and allow the Supplier to perform any necessary system testing to ensure the full integrity of RoyalPay Cross-Border Payment Services is maintained.
      • -
      • (c)use the RoyalPay Cross-Border Payment Services for its intended purpose;
      • -
      • (d)perform all tasks and provide all materials required of it, and by the dates specified, in this Agreement;
      • -
      • (e)co-operate with the Supplier to allow the Supplier to provide the RoyalPay Cross-Border Payment Services and ensure that the Clients procedures for handling orders and delivering goods and/or services are compatible with the settlement process that forms part of the RoyalPay Cross-Border Payment Services;
      • -
      • (f)provide the Supplier with accurate information regarding the commercial aspects of the Client such as changes to company ownership, corporate structure, business domicile and website details and details of products and/or services offered by the Client which may materially affect the scope of the RoyalPay Cross-Border Payment Services;
      • -
      • (g)provide the Supplier with all information in the Clients possession, custody or control that the Supplier reasonably requires to provide the RoyalPay Cross-Border Payment Services and ensure that all information it gives to the Supplier is correct, current and complete;
      • -
      • (h)in the event that the Supplier reasonably believes or has been given notice of an unauthorised or fraudulent use of the RoyalPay Cross-Border Payment Services, provide the Supplier with all information in the Clients possession, custody or control which may be relevant to the unauthorised or fraudulent use;
      • -
      • (i)comply with all applicable Laws, regulations, codes and standards (including any technical standards of a Government Agency);
      • -
      • (j)comply with all requirements, documentation, user manuals and specifications referred to in the Schedules and any additional documents that are provided by the Supplier to the Client and which the Client has agreed in writing to be bound by, such agreement not to be unreasonably withheld;
      • -
      • (k)conduct and retain backups of any of the Clients data (whether hosted on the Suppliers systems or provided to the Supplier in connection with the RoyalPay Cross-Border Payment Services) to the extent reasonable, having regard to the nature of the data;
      • -
      • (l)immediately report to the Supplier, in writing, any unauthorised use of the RoyalPay Cross-Border Payment Services;
      • -
      • (m)use its best endeavours to display (in accordance with directions of the Supplier) relevant visual merchandise items such as trademarks, logos, branding and advertising materials of the Supplier pertaining to the RoyalPay Cross-Border Payment Services provided pursuant to this Agreement in prominent positions and on the Clients website
      • -
      • (n)not:
      • -
          -
        • (i)employ any reverse engineering method aimed at deciphering any computer system or procedures operated by the Supplier and the Client further agrees that it will not copy, amend edit, consolidate, or alter the said computer systems or procedures (including, without limitation, any source programs, object programs, software files, data processing in local computer storage devices, data from the Suppliers terminals which is transmitted to servers, server data, etc.). In addition, the Client agrees that it will not alter or amend the original functions of the software pertaining to the RoyalPay Cross-Border Payment Services or add further functions to the software pertaining to the RoyalPay Cross-Border Payment Services.
        • -
        • (ii)unreasonably delay any action, approval, direction, determination or decision which is reasonably required of the Client under this Agreement or for the Supplier to provide the RoyalPay Cross-Border Payment Services;
        • -
        • (iii)engage in, or procure, assist or allow any of its Personnel or any other person to engage in, any fraudulent or unauthorised use of the RoyalPay Cross-Border Payment Services. If the Client engages in any such use of the RoyalPay Cross-Border Payment Services, the Client must report such use to the Supplier as soon as it becomes aware of such use; or
        • -
        • (iv)engage in unlawful, harmful, threatening, defamatory, infringing, obscene, harassing, sexually explicit or racially offensive activities or facilitate illegal activities, promote unlawful violent or cause damage or injury to any person or property.
        • -
        -
      -
    • 9.2 The Client shall be solely responsible for:
    • -
    • (a)understanding how to access and use the RoyalPay Cross-Border Payment Services;
    • -
    • (b)each of its Personnel who have access to, or use of, the RoyalPay Cross-Border Payment Services;
    • -
    • (c)any use of the RoyalPay Cross-Border Payment Services, or instruction or direction given, through the Clients login and/or using the Clients passwords;
    • -
    • (d)any use of the RoyalPay Cross-Border Payment Services by the Clients Personnel which is fraudulent or not authorised by the Client or the Supplier;
    • -
    • (e)implementing and maintaining the security of the Clients network and systems. The Client is liable for all Fees resulting from any use of the RoyalPay Cross-Border Payment Services by any person, whether or not authorised by the Client, resulting from a virus, trojan, worm or other malicious computer code, denial of service attacks, a hacking incident (including a SIM, PABX, IP PBX or SIP Gateway device hack), or other means of exploiting a weakness in the Clients network, systems or security measures.
    • -
    • 9.3 Upon request from the Supplier, the Client must (in accordance with various compliance obligations including those set out in the Anti-Money Laundering and Counter-Terrorism Financing Act 2006 (Cth)and the Corporations Act 2001 (Cth)), duly provide to the Supplier within five (5) Business Days of receiving a request from the Supplier, all necessary documentation relating to Know Your Customer / Know Your Customers Business, including (but not limited to) company ultimate beneficial ownership details and identifications, evidence of incorporation, compliance AML/CTF programs and any licensing registrations(if applicable), etc.). Notwithstanding any other clause in this Agreement, failure by the Client to provide such required documentation may result in the immediate termination of this Agreement by the Supplier. Information provided to the Supplier by the Client pursuant to this clause shall be retained by the Supplier for a period of at least seven (7) years.
    • -
    • 9.4 The Client acknowledges and agrees that the Supplier is not liable (whether in contract, tort or otherwise) whatsoever for any Loss suffered or incurred by the Client as a result, whether directly or indirectly, of any fact, matter or circumstance that is within the responsibility of the Client under this clause except to the extent caused or contributed to by the Supplier.
    • -
    • 9.5 The Client acknowledges and agrees that:
    • -
    • (a)if the Supplier acquires products or services from any supplier including a carrier (as defined under the Telecommunications Act) in connection with the supply of the RoyalPay Cross-Border Payment Services, the Client will comply with all reasonable directions given by the Supplier as are necessary for the Supplier to comply with its obligations under any agreement with that Supplier;
    • -
    • (b)the Supplier may:
    • -
        -
      • (i)be required by Law, to retain metadata, information and other content in relation to the Clients use of the RoyalPay Cross-Border Payment Services, intercept the Clients communications and pass on details of the Clients use of the RoyalPay Cross-Border Payment Services (including any retained metadata, information and content) to a Government Agency, a law enforcement authority or other authority;
      • -
      • (ii)monitor the Clients usage of the RoyalPay Cross-Border Payment Services including where requested, or directed, to do so by a Government Agency, a law enforcement authority or other authority; and
      • -
      • (iii)investigate any alleged misuse of the RoyalPay Cross-Border Payment Services by the Client including where requested, or directed, to do so by a Government Agency, a law enforcement authority or other authority.
      • -
      -
    • If the Supplier is so required to retain, intercept, monitor or investigate, then the Supplier will immediately provide the Client with written notice to the extent that the Supplier is permitted to do so by Law.
    • -
    • 9.6 The supply of the RoyalPay Cross-Border Payment Servicesmay rely on:
    • -
        -
      • (a)systems, networks, infrastructure and services provided by a third party (whether or not that third party has an agreement or understanding with the Client) including a third party who provides carriage services; and
      • -
      • (b)the Clients systems, networks and infrastructure (Third Party Facilities).
      • -
      -
    • 9.7 Without limiting any other provision of this Agreement, the Client acknowledges and agrees that:
    • -
        -
      • (a)due to reasons beyond the Suppliers control, a defect or failure in one or more Third Party Facilities may cause a delay, failure or interruption to the RoyalPay Cross-Border Payment Services;
      • -
      • (b)without limiting the Clients entitlements under the SLA, the Supplier is not liable to the Client in any way for any Loss (including Consequential Loss) that the Client may incur or suffer as a result of any such delay, failure or interruption; and
      • -
      • (c)if the Client requires the Supplier to undertake any remedial work to repair the RoyalPay Cross-Border Payment Services affected by such a delay, failure or interruption, the Supplier may charge the Client, and the Client must pay, an additional charge, the amount of which will be agreed in advance, for the remedial work that the Supplier undertakes. The Client acknowledges that in some cases the agreed additional charge will be payable by the Client even if the Supplier commences such remedial work and only discovers, after commencing such remedial work, that the delay, failure or interruption to the RoyalPay Cross-Border Payment Services was caused by a defect or failure in Third Party Facilities.
      • -
      -
    • 9.8 The Client represents and warrants to the Supplier that, as at the date this Agreement is formed:
    • -
        -
      • (a)it has had the opportunity to obtain independent professional advice in relation to the legal, taxation, accounting and financial consequences of this Agreement, and has not relied on the Supplier in relation to any of those matters; and
      • -
      • (b)where the Supplier has provided the Client with information about any of the Suppliers Personnel, each of the Personnel has consented to the Client disclosing the information to the Supplier and for the Supplier to use, or disclose, the information to provide the RoyalPay Cross-Border Payment Services and exercise any rights and perform any obligations in respect of the RoyalPay Cross-Border Payment Services.
      • -
      • (c)it has the power and has taken all corporate and other action required, to enter into this Agreement and to authorise the execution and delivery of this Agreement and the performance of the Clients obligations under this Agreement;
      • -
      • (d)this Agreement constitutes a valid and legally binding obligation of the Client in accordance with its terms except to the extent of discretions of courts regarding the availability of equitable remedies and Laws affecting creditors rights generally; and
      • -
      • (e)the execution, delivery and performance of this Agreement does not violate any existing Law or any document or agreement to which the Client is a party or which is binding on the Client or any of its assets.
      • -
      -
    • 9.9 The Client acknowledges and agrees that the Supplier has the right to permanently or temporarily cease providing the RoyalPay Cross-Border Payment Services, withhold any monies payable to the Client under this Agreement (including unsettled funds), suspend the operation of this Agreement or terminate this Agreement in accordance with clause 15:
    • -
        -
      • (a)if the Supplier suspects on reasonable grounds that the Client does not comply with all applicable Laws, regulations, codes and standardsrequired to provide the RoyalPay Cross-Border Payment Services and the Client fails within a reasonable time or refuses to provide information or documents sufficient to demonstrate that it does comply with all such laws and standards; or
      • -
      • (b)if the Supplier suspects on reasonable grounds that the Client has fraudulently or otherwise misused the RoyalPay Cross-Border Payment Services and the Client fails within a reasonable time or refuses to provide information or documents sufficient to demonstrate that it has not committed such activities; or
      • -
      • (c)if the Client has failed or refused to comply with any of its obligations under this clause 9.
      • -
      -
    • 9.10 The parties acknowledge and agree that in the event an investigation is carried out by the Supplier under clause 9.5(b) and it is reasonably concluded that the Client has fraudulently or otherwise misused the RoyalPay Cross-Border Payment Services causing loss to the Supplier:
    • -
        -
      • (a)the Supplier may issue a written notice to the Client to:
      • -
          -
        • (i)transfer a sum to the Supplier sufficient to cover the loss that the Supplier has or is expected to incur (including any amounts the Supplier has refunded to third parties affected by the Clients misuse of the RoyalPay Cross-Border Payment Services); or
        • -
        • (ii)refund a sum directly to any third parties affected by the Clients misuse of the RoyalPay Cross-Border Payment Services;
        • -
        -
      • (b)the Client is deemed to have given express authorisation to the Supplier to offset or otherwise apply any unsettled funds ordinarily payable to the Client for the purpose of making good any loss caused to the Supplier by the Clients misuse of the RoyalPay Cross-Border Payment Services.
      • -
      -
    • 9.11 The Client acknowledges that all representations, covenants and warranties in this Agreement are provided on an ongoing basis and will survive the execution, performance and termination of this Agreement.
    • -
    -

    10.Confidential Information

    -
      -
    • 10.1 Subject to clause 10.2each party must:
    • -
        -
      • (a)keep confidential the Confidential Information of the other party and must ensure that it does not disclose or permit the disclosure of that Confidential Information to any person; and
      • -
      • (b)take all steps and do all things that are reasonably necessary or prudent or desirable in order to safeguard the confidentiality of the Confidential Information of the other party.
      • -
      -
    • 10.2 A party may disclose the Confidential Information of the other party:
    • -
        -
      • (a)to its Affiliates, employees, agents, advisers or financiers (each a Recipient) if, and only if:
      • -
          -
        • (i)the Recipient reasonably needs to know that Confidential Information in order for that party to comply with is obligations under this Agreement;
        • -
        • (ii)that party has informed the Recipient of the obligations of confidentiality under this Agreement; and
        • -
        • (iii)the Recipient has accepted the obligation to treat the Confidential Information as confidential in the same manner and to the same extent as required of that party;
        • -
        -
      • (b)with the consent of the other party;
      • -
      • (c)in connection with legal or other proceedings relating to this Agreement; or
      • -
      • (d)if compelled by Law or by a Government Agency, court, tribunal or stock exchange.
      • -
      -
    • 10.3 Notwithstanding clause 10.1, each party may:
    • -
        -
      • (a)disclose the other partys Confidential Information to any third party where it is necessary, on a need to know basis, in order to perform this Agreement; and
      • -
      • (b)use or disclose the other partys Confidential Information to make contact with, or to deal directly with, the Clients end users and other Personnel in connection with the provision and invoicing of the RoyalPay Cross-Border Payment Services;
      • -
      -
    • 10.4 For the purposes of this clause, the terms of this Agreement will be considered Confidential Information of each party.
    • -
    • 10.5 The rights and obligations of each party pursuant to this clause, survive the expiry or termination of this Agreement.
    • -
    -

    11.Intellectual Property

    -
      -
    • 11.1 Any Intellectual Property Rights owned by either party prior to entry into this Agreement, or developed independently of this Agreement by either party, will continue to be owned by that party. In particular, all Intellectual Property Rights pertaining to the RoyalPay Cross-Border Payment Services will at all times remain the sole and exclusive property of the Supplier.
    • -
    • 11.2 None of the Suppliers Intellectual Property Rights are transferred to the Client and, unless specifically authorised by this Agreement, the Client cannot and will not use or reproduce such Intellectual Property Rights for any purpose unconnected with this Agreement.
    • -
    • 11.3 The rights and obligations of each party pursuant to this clause survive the expiry or termination of this Agreement.
    • -
    • 11.4 The Supplier will not infringe the Intellectual Property rights of the Client or any other person in the provision of the RoyalPay Cross-Border Payment Services.
    • -
    • 11.5 If either party becomes aware of any infringement or potential infringement of the other partys Intellectual Property Rights, it must immediately notify the other party.
    • -
    • 11.6 Neither party will remove or modify any Intellectual Property Rights labels or ownership designations or symbols from any of the other partys information or data, including the TM, ® or © symbols.
    • -
    -

    12.Privacy

    -
      -
    • 12.1 Each party must comply with the Privacy Act 1988 (Cth) in respect of any personal or sensitive information (as those terms are defined in the Privacy Act 1988 (Cth)) to which it obtains access as a result of its performance of this Agreement.
    • -
    -

    13.Subcontractors

    -
      -
    • 13.1 The Supplier may not sub-contract the whole or any part of its obligations under this Agreement without the prior written consent of the Client, such consent not to be unreasonably withheld but on such reasonable conditions as the Client may impose and such consent may be withdrawn or varied by the Client in its absolute discretion.
    • -
    • 13.2 Prior to engaging any approved subcontractor, the Supplier must enter into agreements with that approved subcontractor that must include terms necessary or desirable for the Supplier to comply with all of its obligations under this Agreement.
    • -
    • 13.3 The Clients consent to a sub-contract will not relieve the Supplier of any liability, obligation, guarantee or indemnity under this Agreement. The Supplier will be liable to the Client for the acts or omissions (including negligent acts or omissions) of all subcontractors and their employees and agents as fully as if they were the acts or omissions of the Supplier or any of its employees or agents.
    • -
    -

    14.Restraint

    -
      -
    • 14.1 Neither party will ridicule or disparage the other.
    • -
    • 14.2 The Client acknowledges that the Supplier has the exclusive right to supply the WeChat Pay/Alipay/BestPay/JDpay/CB BankPaypayment technology in Australia and consequently the Client acknowledges and agrees that it is restrained from entering into any agreement with third parties relating to the provision of a service similar to the RoyalPay Cross-Border Payment Services. The exclusivity shall remain in effect for twelve (12) months from the Commencement Date of this Agreement.
    • -
    -

    15.Termination

    -
      -
    • 15.1 Without prejudice to any other rights or remedies to which the parties may be entitled, either party (TerminatingParty) may immediately terminate this Agreement without liability to the other (Non-TerminatingParty) in the event that the Non-Terminating Party:
    • -
        -
      • (a)commits a material breach of any of the terms of this Agreement and (if such a breach is remediable) fails to remedy that breach within thirty (30) calendar days of the Non-Terminating Party being notified in writing of the breach by the Terminating Party; or
      • -
      • (b)an order is made or a resolution is passed for the winding up of the Non-Terminating Party, or circumstances arise which entitle a court of competent jurisdiction to make a winding-up order in relation to the Non-Terminating Party; or
      • -
      • (c)an order is made for the appointment of an administrator to manage the affairs, business and property of the Non-Terminating Party, or documents are filed with a court of competent jurisdiction for the appointment of an administrator of the Non-Terminating Party, or notice of intention to appoint an administrator is given by the Non-Terminating Party or its directors; or
      • -
      • (d)a receiver is appointed of any of the Non-Terminating Party's assets or undertaking, or if circumstances arise which entitle a court of competent jurisdiction or a creditor to appoint a receiver or manager of the Non-Terminating Party, or if any other person takes possession of or sells the Non-Terminating Partys assets; or
      • -
      • (e)the Non-Terminating Party makes any arrangement or composition with its creditors, or makes an application to a court of competent jurisdiction for the protection of its creditors in any way; or
      • -
      • (f)the Non-Terminating Party ceases, or threatens to cease, to trade; or
      • -
      • (g)the Non-Terminating Party takes or suffers any similar or analogous action in any jurisdiction in consequence of debt.
      • -
      -
    • 15.2 Upon the termination of this Agreement for any reason:
    • -
        -
      • (a)the supply of the RoyalPay Cross-Border Payment Services provided by the Supplier to the Client pursuant to this Agreement shall cease immediately;
      • -
      • (b)each party shall return and make no further use of any equipment, property, documentation and other relevant items (including copies) belonging to the other party; and
      • -
      • (c)each party shall settle all unpaid invoices and expenses incurred under this Agreement.
      • -
      -
    • 15.3 The provisions of Clause 15.1 notwithstanding, the client may terminate this Agreement upon 30 days written notice to the supplier.
    • -
    -

    16.Liability and Indemnity

    -
      -
    • 16.1 Subject to clauses 16.2to 16.11(inclusive), each party indemnifies, holds harmless and keeps indemnified the other party against any Loss incurred or suffered by the indemnified party, resulting directly from any breach by the party providing the indemnity of any provision of this Agreement or any act, omission, misconduct or negligence of the party providing the indemnity, including (without limitation) any costs incurred in enforcing this indemnity.
    • -
    • 16.2 Without limiting any other provision in this Agreement, the Client shall fully indemnify, hold harmless and defend Flexewallet Pty Ltd (Flexewallet Pty Ltd AFSL #448066 which is a wholly owned subsidiary of publicly listed company Novatti Group Limited ASX code: NOV, both incorporated in Melbourne Australia and which has officially registered the Supplier as an Authorised Representative of their licensing regime in order to enable the offering of non-cash products and services) and its directors, officers, employees, agents, shareholders and related bodies corporate from and against all claims, demands, actions, suits, damages, liabilities, losses, settlements, judgments, costs and expenses (including but not limited to reasonable legal fees), whether or not involving a third party claim, which arise out of or relate to:
    • -
        -
      • (a)any breach of any representation or warranty of the Client contained in this Agreement;
      • -
      • (b)any breach or violation of any term, covenant, undertaking or other obligation or duty under this Agreement or under applicable Law, in each case whether or not caused by the negligence of Flexewallet Pty Ltd or any other indemnified party and whether or not the relevant claim has merit.
      • -
      -
    • 16.3 The indemnity in this Clause 16is a continuing obligation, and continues after this Agreement ends. It is not necessary for the indemnified party to suffer loss, incur expense or make payment before enforcing its right under this Clause 16.
    • -
    • 16.4 Subject always to the following clauses, to the maximum extent permitted by Law, the Supplier makes no representation nor gives any guarantee or warranty (including of merchantability, acceptable quality, fitness for any particular purpose or fitness for disclosed result) in connection with the RoyalPay Cross-Border Payment Services.
    • -
    • 16.5 There may be non-excludable statutory guarantees, implied conditions, and warranties or liabilities that the Supplier has to the Client under the Competition and Consumer Act 2010 (Cth)and other consumer protection laws that may apply to the RoyalPay Cross-Border Payment Services and that cannot be excluded (Non-Excludable Conditions or Liabilities).Nothing in this Agreement removes or limits any of the Non-Excludable Conditions or Liabilities.
    • -
    • 16.6 Notwithstanding clause 16.5, to the extent that the Suppliers liability can be limited under the Competition and Consumer Act 2010 (Cth)and other consumer protection laws that may apply to the RoyalPay Cross-Border Payment Services, the Supplier limits its liability to the Client for any breach of or non-compliance with, any of the Non-Excludable Conditions or Liabilities, at the Suppliers sole discretion, to resupplying the RoyalPay Cross-Border Payment Services or payment of, or reimbursement for, the cost of having the RoyalPay Cross-Border Payment Services resupplied, and the Client acknowledges that this limitation of liability is fair and reasonable in all the circumstances.
    • -
    • 16.7 Neither party will be liable to the other for any Consequential Loss suffered or incurred by the other party under, or in connection with this Agreement (whether based in contract, tort (including negligence), statute or otherwise.
    • -
    • 16.8 Either partys total liability to the other for any and all Loss in connection with this Agreement shall be limited to the sum of $50,000.
    • -
    • 16.9 The exclusions and limitations of liability in this clause do not apply to any Loss arising from any fraudulent act or omission of either party or its employees, agents or contractors in connection with the supply or use of the RoyalPay Cross-Border Payment Services.
    • -
    • 16.10 The Suppliers liability for any Loss suffered or incurred by the Client under, or in connection with this Agreement (whether based in contract, tort (including negligence), statute or otherwise) is reduced to the extent that:
    • -
        -
      • (a)the acts or omissions of the Client or the Clients Personnel;
      • -
      • (b)the use of any Third Party Facilities (as defined in clause 9.6); or
      • -
      • (c)the acts, omissions or equipment of a third person
      • -
      • caused or contributed to that Loss.
      • -
      -
    • 16.11 The Suppliers liability to the Client will be reduced to the extent that the Client has not taken reasonable steps to mitigate or avoid the Loss flowing from the event giving rise to the Suppliers liability to the Client.
    • -
    -

    17.Dispute Resolution

    -
      -
    • 17.1 Any dispute arising in connection with this Agreement which cannot be settled by negotiation between the parties in accordance with the procedure detailed in clause 17.2must be submitted for mediation.
    • -
    • 17.2 Prior to referring a matter to mediation, the parties must:
    • -
        -
      • (a)refer the dispute to their respective Contract Managers for consideration who must meet (either in person or via teleconference) and undertake genuine and good faith negotiations with a view to resolving the dispute or difference within five (5) Business Days of referral of the dispute; and
      • -
      • (b)if the respective Contract Managers do not resolve the dispute within five (5) Business Days, the dispute must be referred to the relevant C-level executive (or equivalent) of each party who must meet (either in person or via teleconference) and undertake genuine and good faith negotiations with a view to resolving the dispute or difference within a further ten (10) Business Days.
      • -
      -
    • 17.3 If the process in clause 17.2is unsuccessful or the parties fail or refuse to meet then a mediator will be appointed by the parties acting at all times reasonably and if not so appointed within seven (7) Business Days from actual or scheduled completion of the procedure detailed in clause 17.2, either party may refer the dispute to the President of the Law Institute of Victoria who will appoint a suitable mediator with adequate experience in mediating the type of dispute and issues in question.
    • -
    • 17.4 Mediation must take place in Melbourne, Victoria and the parties may attend mediation by way of audio-visual or such other technological means.
    • -
    • 17.5 During such dispute resolution process, the parties may be legally represented.
    • -
    • 17.6 The parties must act in good faith during the dispute resolution process with a view to resolving the dispute.
    • -
    • 17.7 The dispute resolution process procedure is confidential and any written statements prepared for the mediator or for a party and any discussion between the parties and between the parties and the mediator before or during the mediation, are made on a without prejudice basis and cannot be used in any legal proceedings.
    • -
    • 17.8 Nothing in this clause will prevent a party from seeking urgent equitable relief before an appropriate court or tribunal; or seeking orders to enforce this clause 17.
    • -
    • 17.9 Each party will bear their own costs and the costs of the mediation will be borne equally by the parties to the dispute.
    • -
    • 17.10 The parties must continue to perform their respective obligations under this Agreement pending resolution of a dispute.
    • -
    • 17.11 Resolution in a court or tribunal should only be considered as a last resort and failure to institute court or tribunal proceedings does not amount to a breach of this Agreement or this clause 17.
    • -
    • 17.12 If, in relation to a dispute, a party breaches any provision of this clause 17, each other party need not comply with this clause 17in relation to that dispute.
    • -
    • 17.13 If a party does not observe the procedure in this clause 17then this clause 17may be pleaded as a bar to any proceeding, pending the outcome of the proper observance of the procedure in this clause 17.
    • -
    -

    18.Independent Contractor

    -
      -
    • 18.1 The Client and Supplier acknowledge that they are in a relationship of principal and independent contractor and that the Supplier provides the RoyalPay Cross-Border Services in the capacity of independent contractor only. In no circumstances will the Supplier or any of its employees, agents, officers, advisers or sub-contractors claim or be deemed to be an employee, servant or agent of the Client. Further, the parties agree that:
    • -
        -
      • (a)the liabilities and obligations of the parties arising out of or in connection with this Agreement are several and not joint or joint and several; and
      • -
      • (b)a party does not have the authority to pledge the credit of or to act for the other party or to make representations, warranties or undertakings or assume obligations for or on behalf of the other party; and
      • -
      • (c)a party is not an employee of the other party and does not have any claim against the other party for superannuation, annual leave, public holiday, sick leave, long service leave, or, to the extent permitted by the Law, in respect of any claims under any Workers Compensation legislation, or on any other basis.
      • -
      -
    -

    19.Assignment

    -
      -
    • 19.1 A party must not assign its rights or obligations under this Agreement without the prior written consent of the other party (not be unreasonably withheld).
    • -
    • 19.2 Any Change of Control of a party is deemed to constitute an assignment of this Agreement for the purposes of clause 19.1and a party must not effect a Change of Control without the prior written consent of the other party (not to be unreasonably withheld).
    • -
    -

    20.Inconsistency with Other Agreements

    -
      -
    • 20.1 This Agreement, together with the SLA, constitute the entire agreement between the parties and no alternative agreements, terms, conditions, obligations or other provisions of any nature not contained in this Agreement or the SLA will be of any effect, shall add to or vary the terms and conditions of this Agreement.
    • -
    • 21.Miscellaneous Provisions
    • -
    • 21.1 Any notice to be given by any party to the other must be given by delivery to the other partys address as shown in this Agreement or as notified by any party to the other in writing as the address for notices.
    • -
    • 21.2 This Agreement will be governed by, and construed in accordance with, the Laws in force in the State of Victoria, Australia and the parties agree to submit to the non-exclusive jurisdiction of the courts in the State of Victoria, Australia.
    • -
    • 21.3 The obligations and liabilities imposed and the rights and benefits conferred on the parties under this Agreement will be binding upon and enure in favour of the respective parties and each of their respective successors in title, legal personal representatives and permitted assigns.
    • -
    • 21.4 No variation or waiver of any provision of this Agreement, nor consent to any departure by any party from its terms, will be of any effect unless it is confirmed in writing and then such variation, waiver or consent will be effective only to the extent for which it is made or given.
    • -
    • 21.5 No failure, delay or indulgence on the part of any party in exercising any power or right conferred upon such party under this Agreement will operate as a waiver of such power or right, nor will any single or partial exercise of any such power or right preclude any other future exercise of it, or the exercise of any other power or right under this Agreement.
    • -
    • 21.6 The Supplier shall have no liability to the Client under this Agreement if the Supplier is prevented from or delayed in performing its obligations, or from carrying on its business, or from providing the RoyalPay Cross-border Payment Services by virtue of a Force Majeure Event.
    • -
    • 21.7 If any provision of this Agreement will be invalid or unenforceable in accordance with its terms, it will be read down to the extent of such invalidity or unenforceability or, if incapable of such construction, it will be severed and all other provisions, which are self-sustaining and capable of separate enforcement without regard to the invalid or unenforceable provisions, will be and continue to be valid and enforceable in accordance with their terms.
    • -
    • 21.8 The parties will bear their own costs in connection with the preparation, negotiation and execution of this Agreement.
    • -
    • 21.9 Time is of the essence in this Agreement.
    • -
    • 21.10 This Agreement may be executed in any number of counterparts including by way of a countersigned PDF scanned and emailed between the parties. All counterparts will be taken to constitute one Agreement.
    • -
    -

    22.Glossary

    -
      -
    • Definitions and Interpretation
    • -
    • Definitions: In this Agreement, unless the context otherwise dictates:
    • -
    • -
    • 22.1 Acceptance Testingmeans testing of the RoyalPay Cross-Border Payment Services by the Client in order to determine whether the RoyalPay Cross-Border Payment Services meet the Clients needs and expectations.
    • -
    • 22.2 Agreementmeans these terms and conditions and the Schedules.
    • -
    • 22.3 Affiliatemeans, in respect of a party:
    • -
        -
      • (a)the partys related bodies corporate (as that term is defined in the Corporations Act 2001 (Cth)) or any other bodies corporate associated with the party (including anybody corporate one of whose directors is also a director of the party); and
      • -
      • (b)Without limiting paragraph (a) of this definition, if the Client is a franchisee, its franchisor and each of the franchisors related bodies corporate.
      • -
      -
    • 22.4 BusinessDaymeans a day that falls between Monday and Friday (inclusive) and is not public holiday in bothAustraliaand China.
    • -
    • 22.5 Change of Controlmeans a change in the ownership or control (either directly or indirectly) of more than 50% of the voting share capital of the relevant undertaking or the ability to direct casting of more than 50% of the votes exercisable at general meetings of the relevant undertaking;
    • -
    • 22.6 CommencementDatemeans the date of this Agreement.
    • -
    • 22.7 ConfidentialInformationmeans all information related to the Supplier or the Client and includes, but is not limited to, this Agreement , any alliances, artwork, budgets, business affairs, client details, colour schemes, concepts, copyrightable work, customer list, data, designs, drawings, expertise, financials, formulae, functionality, human resources, ideas, information, Intellectual Property, intentions, inventions, joint ventures, know-how, layout, logos, literary works, market opportunities, methodologies, operations, partners, passwords, patent, personnel, plans, policies, procedures, processes, production information, projections, questions/answers, research, schematics, shareholders, slogans, software code, specifications, statistics, studies, supplier details, systems, trademarks (registered or otherwise), trade secrets, web developments, written materials, in any form or media, whether in writing or oral.
    • -
    • 22.8 ConsequentialLossmeans:
    • -
        -
      • (a)any loss of revenue, loss of profits, loss of anticipated savings or business, pure economic loss, loss of data, loss of value of equipment (other than cost of repair), loss of opportunity or expectation loss even if any of that Loss arises naturally (according to the usual course of things) from the fact, matter or circumstance giving rise to the Loss;
      • -
      • (b)any Loss that is suffered or incurred by a party as a result of a fact, matter or circumstance which does not arise naturally (that is, according to the usual course of things) from the fact, matter or circumstance giving rise to the Loss;
      • -
      • (c)any penalties imposed by a Government Agency; but
      • -
      • (d)this definition does not include PCI Fines.
      • -
      -
    • 22.9 ContractManageris as defined in clause 2.1.
    • -
    • 22.10 Feesmean the fees payable in respect of the RoyalPay Cross-Border Payment Services as detailed in Schedule B.
    • -
    • 22.11 ForceMajeureEventmeans a circumstance beyond a parties reasonable control, including acts or omissions of third party network operators or service providers, other than the partys Affiliates, fire, flood, earthquake, elements of nature or acts of God, acts of war, terrorism, riots, civil disorders, rebellions or revolutions, strikes or lockouts other than industrial action, howsoever described of the party or partys Personnel.
    • -
    • 22.12 GovernmentAgencymeans any governmental, semi-governmental, administrative, fiscal, statutory, judicial or quasi-judicial body, department, commission, authority, tribunal, agency or entity having operation or jurisdiction within Australia or anywhere else in the world.
    • -
    • 22.13 GSTmeans goods and services tax or any similar tax imposed by reason of a supply of goods or services under or in connection with this Agreement;
    • -
    • 22.14 Initial Termis as set out in Schedule B.
    • -
    • 22.15 IntellectualPropertymeans registered and unregistered business names, copyright, patents, trade marks, trade names, domain names, social media handles, know how, designs, plans, ideas, trade secrets, concepts, discoveries, inventions, brands, specifications and similar industrial and commercial intellectual property in Australia and worldwide, whether capable of registration or otherwise, both subsisting now or coming into existence at any time after the Commencement Date and includes the Confidential Information.
    • -
    • 22.16 IntellectualPropertyRightsmeans all and any patents, trademarks, service marks, trade names, registered designs, unregistered design rights, copyrights and rights in confidential information, and all and any other intellectual property rights, whether registered or unregistered, and including all applications and rights to apply for any of the same.
    • -
    • 22.17 Lawincludes any statute, rule, regulation, proclamation, order, ordinance or by-law (whether federal, state, territorial or local), codes of practice, Australian Standards and compliance codes.
    • -
    • 22.18 Lossincludes all loss, damage or liability (including liability to a third party) of any kind.
    • -
    • 22.19 PCI Finemeans any fine or other financial penalty imposed on the Supplier by a bank as a result of the Supplier being non-compliant with the then-current version of the Payment Card Industry Data Security Standard.
    • -
    • 22.20 PaymentTermsis defined in clause Error! Reference source not found..
    • -
    • 22.21 Personnelmeans in respect of a party, the employees, agents, contractors and Affiliates of the party and the employees, agents, contractors of the partys Affiliates and includes, in the case of the Client, the Clients end users of the RoyalPay Cross-Border Payment Services.
    • -
    • 22.22 RenewedTermis defined in clause 3.2.
    • -
    • 22.23 RoyalPay Cross-Border Payment Services mean the services to be supplied by the Supplier to the Client in accordance with this Agreement, namely the services described in Schedule B.
    • -
    • 22.24 Schedulesmean the schedules and appendices to this Agreement.
    • -
    • 22.25 SLAmeans the service level agreement separately provided to the Client by the Supplier and which may be amended by the Supplier in its absolute discretion from time to time.
    • -
    • 22.26 Tax Invoicehas the same meaning as that given in section 195-1 of A New Tax System (Goods and Services Tax) Act 1999 (Cth).
    • -
    • 22.27 Termis defined in clause 3.1.
    • -
    • 22.28 Third Party Facilitiesis defined in clause 9.6.
    • -
    • Interpretation: In this Agreement, unless the context otherwise dictates:
    • -
    • -
    • 22.29 Includes:the words includes, include, including, for example or such as must be read to mean includes, but is not limited to.
    • -
    • 22.30 SingularandPlural:words importing the singular (where appropriate) mean and include the plural and vice versa.
    • -
    • 22.31 Gender:words importing any one gender (where appropriate) mean and include the other genders and vice versa.
    • -
    • 22.32 NaturalPersons:words importing natural persons (where appropriate) mean and include corporations and unincorporated associations and vice versa.
    • -
    • 22.33 Headings:the headings are for convenience of reference only and are not to be construed as affecting the meaning or interpretation of this Agreement.
    • -
    • 22.34 StatutoryEnactments:all references in this Agreement to Law mean and are to be construed as references to that Law as amended or modified, consolidated, re-enacted or replaced from time to time and to the corresponding provisions of any similar Law of any other relevant jurisdiction.
    • -
    • 22.35 ReferencestopartsofthisAgreement:all references in this Agreement to sections, articles, clauses, sub-clauses, paragraphs and schedules mean, and are to be construed as, references to the sections, articles, clauses, sub-clauses, paragraphs and schedules of this Agreement.
    • -
    • 22.36 Party:references to any party to this Agreement or any other document or agreement include its successors, permitted assigns, heirs or legal personal representatives and includes company administrators, liquidators and trustees in bankruptcy.
    • -
    • 22.37 Covenants:any covenants, representations, warranties, indemnities or guarantees made or given by more than one party to another party hereunder are, unless specified otherwise, made or given jointly and severally.
    • -
    • 22.38 Wholeincludespart:a reference to anything includes the whole or any part of that thing and a reference to a group of things or persons includes each thing or person in that group.
    • -
    • 22.39 Partsofspeech:where any word or phrase is given a defined meaning, any other part of speech or other grammatical form of that word or phrase has a corresponding meaning.
    • -
    • 22.40 BusinessDay:Where any obligation under this Agreement falls to be performed on a day other than a Business Day, this Agreement must be construed as requiring that obligation to be performed on the next Business Day.
    • -
    • 22.41 Currency:References to $ or Dollars are references to Australian dollars, unless expressly indicated otherwise.
    • -
    • 22.42 Calendar:a reference to a day, week, month or a year is a reference to a calendar day, week, month or a year.
    • -
    • 22.43 Contraproferentemexcluded:a provision must not be construed against a party merely because that party was responsible for preparing this Agreement or that provision.
    • -
    • 22.44 Pre-Authorisation: refers to system functions which allow the placement of funds on hold for a pre-determined time, giving the Client the full control to exercise the option of completing the transaction at a later date.
    • -
    -
    -
    - - - -
      -
    • CONTRACTING PARTY DETAILS
    • -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    -
    -

    THE SUPPLIER

    -
    -

    THE CLIENT

    -
    -

    Name:

    -
    -

    Tunnel Show Pty Ltd trading as RoyalPay

    -
    - -

    -

    -

    ACN:

    -
    -

    601 619 685

    -
    -

    -
    -

    Address:

    -
    -

    Level 11

    -

    15 William Street
    Melbourne Vic 3000

    -
    -

    -

    -

    {{aggregateFileInfo.address_sub}}

    -
    -

    Contact Person:

    -
    -

    -
    - -

    -

    -

    Position:

    -
    -

    -
    -

    -
    -

    Phone:

    -
    -

    -
    - -

    -

    -

    Fax:

    -
    -

    -
    -

    -
    -

    Email:

    -
    -

    -
    - - -

    -

    - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Legal Representative:

    -
    - - -

    -

    -

    Position:

    -
    - -

    -

    -

    Phone:

    -
    - -

    -

    -

    Fax:

    -
    -
    -

    Email:

    -
    - - -

    -

    -
    - -

    -
      -
    • PARTICULARSOF THE ROYALPAY CROSS-BORDER PAYMENT SERVICES
    • -
    -

    - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Contract Manager (cl. 2)

    -
    -

    -
    -

    Initial Term (cl. 3)

    -
    -

    Twelve(12) months (unless terminated earlier in accordance with the terms of this Agreement)

    -
    -

    Description of the RoyalPay Cross-Border Services

    -
    -

    A software application and platform developed by the Supplier which provides Clients (who have web-based gateway APIs (being application programming interfaces) and point-of-sale payment processing and settlement capabilities in the Chinese currency) with a payment integration system, which:

    -

    (a)utilises the WeChat Pay payment technology that is owned by Tencent Holdings Limited (China) and that is licensed to the Supplier to facilitate third party payments in Australia;

    -

    (b)utilises the Alipay payment technology that is owned by Alipay.com Co., Ltd (China) and is licensed to the Supplier to facilitate third party payments in Australia;

    -

    (c)utilises the BestPaypayment technology that is owned by China Telecom Orange Finance and is licensed to the Supplier to facilitate third party payments in Australia;

    -

    (d)utilises the JDpaypayment technology that is owned by Chinabank Payment (Beijing) Technology Co.,Ltd.and is licensed to the Supplier to facilitate third party payments in Australia;

    -

    (e)utilises CB BankPay Payment technology licensed to the Supplier by Lakala Payment Co., Ltd, Yeepay Co., Ltd, PnR Data Service Co.,Ltdand other companies to facilitate third party payments in Australia;

    -

    (f)processes payments from users of Chinese bank cards and the WeChat Pay/Alipay/BestPay/JDpay/CB BankPay payment technology in Chinese Yuan, converts such payments to the Australian Dollar equivalent and then sends such payments to the Client by utilising settlement functions forming part of the software application;

    -

    (g)allows the Client to access the merchant management portal feature of the software application which facilitates transaction management, reporting and provides transactional analytics; and

    -

    (h)provides the Client with access to additional unique WeChat Pay marketing features including WeChat Lucky Money (an incentive program where payers randomly receive cashbacks) and WeChat Moment (being social media advertising aimed at enhancing a Clients brand awareness).

    -
    -

    Commencement Date

    -
    -

    The date of this Agreement

    -
    -

    Fees

    -
    -

    An integration fee and ongoing maintenance fee for the RoyalPay Cross-Border Payment Services shall be AUD $0, plus GST.

    -

    In addition, the Supplier shall charge a Merchant Service Fee (MSF) to the Client, per transaction, which shall be calculated in a percentage amount. The calculation schedule is as follows:

    -

    ·the MSF is %(GST exclusive) of payments made using the RoyalPay Cross-Border Payment Services; (WeChat Pay)

    -

    ·the MSF is %(GST exclusive) of payments made using the RoyalPay Cross-Border Payment Services; (AlipayOffline)

    -

    ·the MSF is %(GST exclusive) of payments made using the RoyalPay Cross-Border Payment Services; (AlipayOnline)

    -

    ·the MSF is %( GST exclusive) of payments made using the RoyalPay Cross-Border Payment Services; (Bestpay)

    -

    ·the MSF is %(GST exclusive) of payments made using the RoyalPay Cross-Border Payment Services; (JDpay)

    -

    ·the MSF is %(GST exclusive) of payments made using the RoyalPay Cross-Border Payment Services; (CBBankPay)

    -

    ·the Supplier reserves the right to adjust the MSF rate mentioned above without prior consent from the Client. The Supplier will notify the Client of such change through the Suppliers website, portal and/or by email thirty (30) calendar days in advance before the MSF rate is adjusted;

    -

    ·the parties agree that, when calculating the MSF, the figure shall be rounded to two decimal places; and

    -

    ·the Client may elect to pass on the MSF to its customers or to bear the MSF itself, as per system configuration.

    -
    -

    - - - - - - - - - - - -
    -

    Settlement Method

    -
    -

    The Supplier shall, after deducting all agreed service charges payable to the Supplier from the corresponding transaction, remit the balance to the Client by ways of Electronic Fund Transfer to the Client's nominated bank account in the currency of Australian Dollars (AUD). If the Client changes the bank account for any reason, it shall promptly give a valid notification to the Supplier of such change seven (7) calendar days in advance, and shall provide any other information required by the Supplier. Any Loss arising from an un-notified change of bank account details shall be solely borne by the Client.

    -

    Particulars of the bank account nominated by the Client:

    -
      -
    • ·Name of the bank:
    • -
    • ·Country where the bank is located:Australia
    • -
    • ·BSB:
    • -
    • ·Account number:
    • -
    • ·Account name:
    • -
    -
    -

    Settlement Terms

    -
    -

    Settlement Cycle: . Funds will be settled on or beforeBusiness Day after the transaction has occurred.

    -

    For Settlement Cycle T+1: the provision of the above Settlement Cycle notwithstanding, the transaction occurred on Friday will be settled on the following Monday, and the transaction occurred on Saturday and Sunday will be settled on the following Tuesday.

    -

    -

    Settlement Amount Calculation:

    -

    ·If the Client elects to pass on the MSF to its customers, then the Client shall receive the full face-value settlement amount (e.g. the Client shall invoice its customers $100AUD and the Client shall receive $100AUD); or

    -

    ·If the Client elects to bear the MSF itself, then the Client shall receive the full face-value settlement amount minus the MSF applied to the face value (e.g. the Client shall invoice its customers $100AUD and the Client shall receive $100AUD - $100 x MSF)

    -

    The Client acknowledges that the actual time of receipt of the payment is based on the notice that provided by Supplier.

    -

    The Client shall not be affected by any foreign exchange movement regarding payment processing and settlement, as indicated above in the Settlement Amount Calculation. During the payment process, the Clients customers will be prompted with daily AUD/CNY spot rate on the payment page.

    -

    The Client shall not be subject to any chargebacks in the event of transaction fraud, technical error or administrative error unless caused or contributed to by the Client. Any and all investigative and transactional duties in such events will be carried out by Tencent Holdings Limited (China), the provider of WeChat Pay technology; Alipay.com Co., Ltd. (China), the provider of Alipay payment technology;China Telecom Orange Finance, the provider of BestPaypayment technology; Chinabank Payment Technology, the provider of JDpay payment technology; andLakala Payment Co., Ltd, Yeepay Co., Ltd, PnR Data Service Co.,Ltdand other companies, the providers of CB BankPay technology.

    -
    -

    - - - - - - - -
    -

    Refund Process

    -
    -

    Any authorisation-only or non-delivery or disputes or defects or warranty issues etc., arising from the Client's services rendered to its customers may incur refunds in the normal course of business after a transaction has been completed, which shall be dealt with in accordance with the following procedures:

    -

    ·the Client shall be solely responsible for investigating and initiating refunds to its customers;

    -

    ·if the related refund amount has been settled to the Client by the Supplier, the Client shall be solely responsible for processing the refund amount as per the Client's refund policy with its customers;

    -

    ·if the related refund amount has not been settled to the Client by the Supplier, the Client can either: a) refund the amount as per the Client's refund policy to its customers, using its own funds prior to receiving the settlement amount; or b) the Client may make a refund request to the Supplier and the Supplier shall debit directly the refund amount from the unsettled amount payable to Client in order to initiate the refund;

    -

    ·Due to settlement turnarounds and bank operations, it is possible that the unsettled funds with the Client may be insufficient to cover the actual refund amount, in which case the Client shall make the refund request to the Supplier at a later time when the required amount becomes available, given that the Client continues accumulating further unsettled transactions or alternatively, the Client may resort to a combination of method a) and b) above;

    -

    ·except in the event that the Client ceases its business functions and is unable to refund its customers, the Supplier may request during the application process, a refundable security deposit to be paid by the Client upfront in order to cover such refund scenarios;

    -

    ·the Client shall reserve the right to investigate the transaction before the refund is given and shall ultimately decide whether or not the refund is to be given; and

    -

    ·the Supplier shall not impose any handling fee for any refund request.

    -
    -


    Service Level Agreement

    -

    Key contact details:

    - - - - - - - -
    -

    Client Support

    -
    -

    Email: info@royalpay.com.au

    -

    Contact: Customer Service Officer

    -
    -

    - - - - - - - -
    -

    Commercial Support

    -
    -

    Email: Mona.Zhang@royalpay.com.au

    -

    Contact: MonaZhang

    -
    -

    - - - - - - - -
    -

    Technical Support

    -
    -

    Email: leo.huang@royalpay.com.au

    -

    Contact: Leo Huang

    -
    -

    - - - - - - - -
    -

    Financial Support

    -
    -

    Email: accountofficer@royalpay.com.au

    -

    Contact: Account Officer

    -
    -

    - - - - - - - -
    -

    Compliance Support

    -
    -

    Email: Compliance@royalpay.com.au

    -

    Contact: Compliance

    -
    -

    -

    Recommended Information to be included in the support email:

    -


    - Nature of the issue
    - - Date and time of occurrence
    - - Impact on operation

    -


    Level of Support:

    -


    RoyalPay provides three (3) levels of support: Level 1, Level 2, Level 3. The Client needs to identify the nature of the issue and appropriate level of support in order for RoyalPay to achieve optimal client support experience, and Client should use always use Level 1 support as priority support option.

    -


    Level 1 support functions include:

    -


    - First level of contact for Client Service Representatives
    - General facilitation of day-to day operations
    - System monitoring, including regular checking of system mail, error logs, alarms, system performance, utilisation and capacity, user logins, etc
    - Access and interpretation of system logs and traces
    - Archiving of data and backup related to RoyalPay platform(if applicable)
    - Ensuring and maintaining remote access
    - Loading authorised software update
    - Attend to escalated problems from the Client Service Department
    - Attend to internal business support
    - System, and where practical, network reporting
    - Within reason and on a best endeavours basis, RoyalPay will provide limited reporting based fault recognition, isolation and forward to Level 2

    -


    Level 2 support functions include:

    -

    - Diagnosis of Hardware and Software faults
    - - Monitoring progress
    - - Problem resolution
    - - Where the Client has purchased hardware directly from RoyalPay
    - - RoyalPay will process hardware faults through to the original hardware vendors standard support infrastructure and leverage off standing agreements and nominated response times
    - - Escalation to Head Office/Technical Team or Level 3 support as required

    -


    Level 3 support functions include:

    -

    - Any problem as escalated from Level 2.
    - Interaction with Level 1 & 2 support and 3rd parties as relevant.
    - Acting as interface with 3rd Party software support organisations

    -

    -

    Support not included:

    -

    - Rectification of defects or errors resulting from any modification of the system not approved by RoyalPay
    - - Rectification of defects or errors resulting from use of the system in combination with anything not forming part of the original intent of the system
    - - Rectification of a fault in anything not forming part of the system
    - Any modification of the system which represents a departure from the specifications
    - - Electrical or environmental adjustment or damage caused by electrical or environmental factors
    - - Repair or damage arising out of misuse or unauthorised use of the system by or any person
    - - Furnishing accessories
    - - Any rectification arising from any substitution, alteration or relocation of the System made by any person that is not approved by RoyalPay
    - - Rectification of errors or defects which are the subject of a warranty under another agreement
    - - Any rectification arising from failing to install supplied updates or upgrades
    - - Any defect arising from the use of the system other than in accordance with applicable user ocumentation
    - - Rectification of errors or defects resulting from improper operation of the system by any person
    - - Any defect arising from misuse, negligence or abuse of the software and/or database(s)
    - - Any rectification arising from failing to comply with its obligations under these terms.
    - -Maintenance of hardware or items external to the system, or for added accessories for which maintenance charges have not been paid
    - - Engineering modifications (other than those normally performed as part of RoyalPay support)
    - - Supply and installation of consumables, or damage caused by use of incompatible consumables
    - - Rectification of problems caused by the connection of or use of third party products, hardware and /or software which are not maintained by RoyalPay
    - - Refurbishment of product, or damage or wear due to overuse or use outside published specifications
    - - Hardware and/or Software covered by third party maintenance agreements

    -

    -

    Support Priority and Response time:

    -

    The normal response time is 9am – 6pm, Mon – Fri (Excluding public holidaysin both Australia and China)

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Criticality

    -
    -

    Description

    -
    -

    Client Notification Time

    -
    -

    Response Time

    -
    -

    Resolution

    -
    -

    1

    -
    -

    RoyalPay system is down

    -
    -

    Instantaneous

    -
    -

    2 hours

    -
    -

    5 hours

    -
    -

    2

    -
    -

    Major problem inhibiting operation

    -
    -

    Instantaneous

    -
    -

    4 hours

    -
    -

    12 hours

    -
    -

    3

    -
    -

    Minor problem causing inconvenience

    -
    -

    Instantaneous

    -
    -

    24 hours

    -
    -

    14 days

    -
    -

    4

    -
    -

    Other commercial/financial request

    -
    -

    N/A

    -
    -

    48 hours

    -
    -

    Tentative

    -
    -


    Emergency/After Hour Contact:

    -


    To ensure high availability and reliability of RoyalPays uninterrupted services, any serious issue/after hour escalation contact details might be established by agreed methods between RoyalPay and the Client. Once established, an amended SLA shall be advised to the Client.

    -

    -

    -

    Execution Page

    -

    -

    Executed as an agreement by being signed in accordance with section 127 of the Corporations Act2001 (Cth) by:

    -

    -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Tunnel Show Pty Ltd (ACN 601 619 685) trading as RoyalPay

    -
    -

    Signature of Director/Secretary:

    -
    -

    -
    -

    -
    -

    Print Full Name:

    -
    -

    Yangfan Ge

    -
    -

    -
    -

    Position:

    -
    -

    Director

    -
    -

    Director/Secretary

    -
    -

    Date:

    -
    - -

    -

    -

    -
    -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Client Name/ACN:

    -
    -

    Signature of Director/Secretary: -

    - -
    - - -

    -
    -

    Print Full Name:

    - -
    - - -

    -
    -

    Position:

    -
    -

    Director

    -
    -

    Director/Secretary

    -
    -

    Date:

    -
    - -

    -

    -

    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/templates/customer_service.html b/src/main/resources/templates/customer_service.html deleted file mode 100644 index 6a28a917e..000000000 --- a/src/main/resources/templates/customer_service.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html deleted file mode 100644 index bcde76edb..000000000 --- a/src/main/resources/templates/error.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - -

    -

    - - - \ No newline at end of file diff --git a/src/main/resources/templates/letter_of_offer.pdf b/src/main/resources/templates/letter_of_offer.pdf deleted file mode 100644 index 926fd473b..000000000 Binary files a/src/main/resources/templates/letter_of_offer.pdf and /dev/null differ diff --git a/src/main/resources/templates/mail/account_bind_email.html b/src/main/resources/templates/mail/account_bind_email.html deleted file mode 100644 index ad9d8b188..000000000 --- a/src/main/resources/templates/mail/account_bind_email.html +++ /dev/null @@ -1,31 +0,0 @@ - -Dear : -

    - Your account() is in the process of binding a mailbox, the verification code is ,valid within 5 minutes. -

    -尊敬的,您好: -

    - 您的账户()正在进行绑定邮箱的操作,验证码是,5分钟内有效。 -

    -
    -

    Best Regards

    -

    -
    - Contact Us
    - Email:
    - info@royalpay.com.au
    - Tel:
    - 1300 10 77 50
    -
    - Service WeChat Account:
    -
    - Level 14, 383 Kent Street, Sydney NSW 2000
    -
    - Level 11, 15 William Street, Melbourne VIC 3000 -

    -

    Tunnel Show Pty Ltd trading as RoyalPay
    - Representative of AFSL licensee 448066 -

    - diff --git a/src/main/resources/templates/mail/account_reset_email.html b/src/main/resources/templates/mail/account_reset_email.html deleted file mode 100644 index 0ef170f16..000000000 --- a/src/main/resources/templates/mail/account_reset_email.html +++ /dev/null @@ -1,34 +0,0 @@ - -Dear : -

    - You are requesting a password reset service with a verification code of , valid for 5 minutes. Please do not provide this verification code to anyone. -

    -

    - Reset Password > -

    -尊敬的,您好: -

    - 您正在申请密码重置服务,验证码为,5分钟内有效,请勿向任何人提供此验证码。 -

    -
    -

    Best Regards

    -

    -
    - Contact Us
    - Email:
    - info@royalpay.com.au
    - Tel:
    - 1300 10 77 50
    -
    - Service WeChat Account:
    -
    - Level 14, 383 Kent Street, Sydney NSW 2000
    -
    - Level 11, 15 William Street, Melbourne VIC 3000 -

    -

    Tunnel Show Pty Ltd trading as RoyalPay
    - Representative of AFSL licensee 448066 -

    - diff --git a/src/main/resources/templates/mail/gateway_email_notice.html b/src/main/resources/templates/mail/gateway_email_notice.html deleted file mode 100644 index e2bbfbff9..000000000 --- a/src/main/resources/templates/mail/gateway_email_notice.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -
    -
    -
    - -
    -
    -

    您好,

    -

    您有一笔收款信息如下:

    -
    -

    RoyalPay到账提醒:

    -
      -
    • 支付渠道:
    • -
    • 订单编号:
    • -
    • 收款金额: 
    • -
    • 到账时间:
    • -
    -
    - 此致
    - RoyalPay -
    -
    - -
    - - - diff --git a/src/main/resources/templates/mail/hf_email_notice.html b/src/main/resources/templates/mail/hf_email_notice.html deleted file mode 100644 index d71bbe71d..000000000 --- a/src/main/resources/templates/mail/hf_email_notice.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -
    -
    -
    - -
    -
    -

    您好,

    -

    您有一笔收款信息如下:

    -
    -

    RoyalPay到账提醒:

    -
      -
    • 支付渠道:汇付
    • -
    • 订单编号:
    • -
    • 收款金额: 
    • -
    • 到账时间:
    • -
    -
    - 此致
    - RoyalPay -
    -
    - -
    - - - \ No newline at end of file diff --git a/src/main/resources/templates/mail/kyc_email_notice.html b/src/main/resources/templates/mail/kyc_email_notice.html deleted file mode 100644 index a8e8e84fd..000000000 --- a/src/main/resources/templates/mail/kyc_email_notice.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - -
    -
    -
    - -
    -
    -

    您好,

    -

    商户:需要您协助上传KYC材料。(申请时间:)

    -

    请尽快联系商户,您可以帮助商户提交材料或填写无法提供材料文件的原因。

    -

    商户联系人:

    -

    联系电话:

    -

    邮箱:

    - - 此致
    - RoyalPay -
    -
    - -
    - - - diff --git a/src/main/resources/templates/mail/new_client_notice.html b/src/main/resources/templates/mail/new_client_notice.html deleted file mode 100644 index 3c6c555fd..000000000 --- a/src/main/resources/templates/mail/new_client_notice.html +++ /dev/null @@ -1,188 +0,0 @@ - -
    -

    Dear :

    -

    I'm happy to let you know - that your RoyalPay Cross-border Payment account has been set up.
    - 很高兴通知您,贵司RoyalPay跨境全支付已经开通

    -

    I'm - happy to let you know - Congratulations, you have passed the compliance review and be granted a RoyalPay account. - You can start to do IT integration. At the same time, please contact BD regarding the invoice of security - deposit. We will set up your account live in the production environment after receiving the security deposit - from your company. -
    - 恭喜您已通过 CardPayment 合规审核,您可开始做IT对接. 请联系BD沟通支付保证金事宜。我司会在收到贵司提交的保证金后,开启您的 CardPayment 权限。

    - -

    Please kindly log on the - website below to manage your accounts and transactions:
    - 请登录这个网站查询管理所有交易

    -
    -
    - Manager Account -
    -
    -
    -
    - Account Name: -
    -
    -
    -
    -
    - Log on website: -
    - -
    -
    -
    -
    - p/w: -
    -
    -
    -
    -
    -
    -
    - attention -
    -
      -
    • The password can be changed any time when you login. 您登陆后可以任意修改密码
    • -
    • It's recommended to change your password as soon as first login. 建议首次登陆后就修改您的密码
    • -
    • You can set up different accounts for the staff. (At the category:"Accounts") - 您可以为您的员工配置其他账号(在Accounts菜单内) -
    • -
    - -
    -
    Please find the User Guide here :
    - -
    or
    - -
    -
    -
    您可以点击链接下载用户手册 :
    - -
    - -
    -
    -
    (If - you - cannot open the link above, you can copy and paste this url to your - browser.如果您无法点击上面的链接,可以复制当前url到浏览器地址栏 -
    -
    https://www.royalpay.com.au/downloads/royalpay_user_guide.pdf -
    -
    )
    -
    -
    - -

    You can search "RoyalPay" in APP - Store to download APP for IOS,which helps check your payment receiving records.

    -

    - 您可以在APP Store里搜索"RoyalPay"下载royalpay的app,来进行收款和接收到账提醒等。 -

    -


    -

    - -
    - -

    Online RoyalPay - Cross-border - Payment is also available! The development of the document (API) is - here.

    -

    - 如需接入网站支付系统,可将下方API链接及授权信息发给IT团队

    - -
    -
    - Chinse version: -
    - -
    - English version: -
    - -
    - -
    -
    - -
    - -
    - -
    - Please - contact us via any - way displaying below if you have any questions. Thank you for choosing - RoyalPay. -
    -
    - 十分感谢您对RoyalPay皇家支付的信任和支持。如果您有任何问题,随时可以按以下方式与我们联系。谢谢! -
    - -
    - -

    Best Regards

    - - -
    - -
    - -
    -
    - -
    Tel:
    1300 10 77 50
    -
    Level 14, 383 Kent Street, Sydney NSW 2000
    -
    Tunnel Show Pty Ltd trading as RoyalPay
    -
    -
    -
    -
    Service WeChat Account:
    -
    - -
    -
    Level 11, 15 William Street, Melbourne VIC 3000
    -
    Representative of AFSL licensee 448066
    -
    - -
    - - -
    -
    - - diff --git a/src/main/resources/templates/mail/register_application.html b/src/main/resources/templates/mail/register_application.html deleted file mode 100644 index 8e4e8fc38..000000000 --- a/src/main/resources/templates/mail/register_application.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/mail/reset_password.html b/src/main/resources/templates/mail/reset_password.html deleted file mode 100644 index 88f5b04f3..000000000 --- a/src/main/resources/templates/mail/reset_password.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/mail/risk_operator_notice.html b/src/main/resources/templates/mail/risk_operator_notice.html deleted file mode 100644 index ff1bb5c47..000000000 --- a/src/main/resources/templates/mail/risk_operator_notice.html +++ /dev/null @@ -1,24 +0,0 @@ - -

    Dear :

    -

    您好,您于创建的风控事件单已经接收到了商户()的风控材料,请及时审核。

    -

    Best Regards

    -

    -
    - Contact Us
    - Email:
    - info@royalpay.com.au
    - Tel:
    - 1300 10 77 50
    -
    - Service WeChat Account:
    -
    - Level 14, 383 Kent Street, Sydney NSW 2000
    -
    - Level 11, 15 William Street, Melbourne VIC 3000 -

    -

    Tunnel Show Pty Ltd trading as RoyalPay
    - Representative of AFSL licensee 448066 -

    - diff --git a/src/main/resources/templates/mail/risk_upload.html b/src/main/resources/templates/mail/risk_upload.html deleted file mode 100644 index 5521a4b92..000000000 --- a/src/main/resources/templates/mail/risk_upload.html +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - - RoyalPay | Risk Materials - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -

    -
    -
    -
    -
    -
    -

    1、物流公司发货单据照片 - 要求:每笔交易对应的物流单必须提供,且单据必须清晰可见
    - Photos of logistics companies’ goods-delivery documents - Requirement: The logistics order record corresponding to each transaction must be provided, and details of records should be clearly visible. -

    -

    1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;
    - Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc; -

    -
    -
    -
    - -
    -   
    -
    - {{file1Progress.value}}% - -
    -
    -
    -
    -
    -

    2、用户购买虚拟物品需要提供聊天记录、订单信息、发货凭证截图、虚拟物品最终消费场景(例如何种游戏、软件)、提供消费场景网址/下载链接 - 要求:每笔交易对应的截图必须清晰可见
    - Users need to provide chat records, order information, screenshots of delivery documents, final consumption scenarios of virtual goods (such as games, software); provide consumer scene URL / download link. - Requirement: The screenshot corresponding to each transaction must be clearly visible. -

    -

    2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);
    - Provide related shopping lists, invoices. (Please provide the invoices, amount of which matches that of the abnormal transaction); -

    -
    -
    -
    - -
    -   
    -
    - {{file2Progress.value}}% - -
    -
    - -
    -
    -
    -

    3、购物小票/发票存根照片 - 照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称 - 购物金额等
    - Photos of shopping receipts/ invoice stubs - Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc. -

    -

    3.提供相应的发货证明,报关单(若有消费者在国内购买,请提供物流单据或报关单);
    - Relative proof of delivery, customs declaration (If the consumer purchased from China, please provide shipping receipt or customs declaration); -

    -
    -
    -
    - -
    -   
    -
    - {{file3Progress.value}}% - -
    -
    -
    -
    -
    -

    4、显示商户门牌号码和店头名称的照片 - 要求:清晰可见,至少一张
    - Photos of Merchant Street number & Merchant name - Requirement: At least one visible photo -

    -

    4.提供您的门店照片(门店照及店铺内的照片各一张, 一张可以看到商户名的门头照,一张可以看到相关商品或服务的店内照片);
    - Photos of the store ( one of each front-store and in-store); -

    -
    -
    -
    - -
    -   
    -
    - {{file4Progress.value}}% - -
    -
    - -
    -
    -
    -

    5、显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片 - 要求:照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张
    - Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) - Requirements: The photos (at least three) showing merchant activities including actual selling-goods or services obviously -

    -

    5.其他可以还原交易背景的资料,如和消费者的聊天记录等,来佐证被查单号交易的真实性;
    - Other materials that can verify the payment scenario, for example, chatting history, to prove the truth of the transactions; -

    -
    -
    -
    - -
    -   
    -
    - {{file5Progress.value}}% - -
    -
    - -
    -
    -
    -

    6、其他图片
    - Other pictures -

    -
    -
    -
    - -
    -   
    -
    - {{file6Progress.value}}% - -
    -
    - -
    -
    - -
    - - - - -
    - -
    -
    -
    -
    - -
    - Submit -
    - -
    -
    - - -
    - -
    -
    - - -
    -
    - - diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html deleted file mode 100644 index 22a5d8207..000000000 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ /dev/null @@ -1,247 +0,0 @@ - -
    - Dear : -

    - - ,您提交的风控材料已被拒绝。 - - 拒绝理由:。 - - 请于 - - 下午5:00(悉尼时间)前 - 提供腾讯支付宝被查商户 - ()的以下材料: -

    - -

    - Your submission of risk materials has been rejected. - - Reasons for rejection:. - - Please submit the following risk materials of merchant () - before (Sydney time). -

    - -

    1、请提供以下被查单号的小票, 物流单据(如有邮寄产品的情况), 以及消费者与买家的聊天记录等来佐证被查交易单号。 被查交易单号如下:

    -

    1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

    -

    1、请提供以下被查单号的交易相关发票,对应的物流单据(如有邮寄产品的情况), 以及体现消费场景的聊天截图等来佐证被查交易单号。 被查交易单号如下:

    -

    1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

    -

    1、请提供以下被查单号的交易相关票据,对应消费项目的行程单、机票、酒店预定凭证等, 以及体现消费场景的聊天截图等来佐证被查交易单号。 被查交易单号如下:

    -

    1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

    -

    1、请提供以下被查单号的交易相关票据,详细购买的具体课程、服务、咨询明细, 以及体现消费场景的聊天截图等来佐证被查交易单号。 被查交易单号如下:

    -

    1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Order IDAmountInput AmountAUD AmountExchange RateStatusCreate TimeGateway
    -

    2、

    -

    如果提交的材料不齐, 则有关停支付的风险。感谢,辛苦。

    - -

    材料请通过APP在规定时间内进行上传,或请联系BD,由BD在后台进行上传。

    -

    - If you can not provide qualified materials on time, the payment channels would be suspended or restricted with amount limit. Please be sure to assist the investigation. Thanks. -

    -

    - The materials can be uploaded by RoyalPay APP within the required time, or contact with BD. -

    -

    Submit Risk Materials

    -
    -
    - 尊敬的RoyalPay商户 :
    - Dear RoyalPay merchant :
    -

    您提交的风控材料已被拒绝。
    - The risk materials you submitted has been rejected -

    -

    - 拒绝理由:。 -

    -

    近期由于我们的风控系统检测到您的交易异常,已暂时将您的清算周期调整为T+,还请您提供以下材料,还原附件中列明的交易的真实背景:
    - RoyalPay's risk management system recently has identified abnormal transactions from your records, clean days has been adjusted to T+.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:

    -

    1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;
    -   Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc;

    -

    2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);
      -   Provide related shopping lists, invoices. (Please provide the invoices, amount of which matches that of the abnormal transaction);

    -

    3.提供相应的发货证明,报关单(若有消费者在国内购买,请提供物流单据或报关单);
    -   Relative proof of delivery, customs declaration (If the consumer purchased from China, please provide shipping receipt or customs declaration);

    -

    4.提供您的门店照片(门店照及店铺内的照片各一张, 一张可以看到商户名的门头照,一张可以看到相关商品或服务的店内照片);
    -     Photos of the store ( one of each front-store and in-store);

    -

    5.其他可以还原交易背景的资料,如和消费者的聊天记录等,来佐证被查单号交易的真实性;
    -   Other materials that can verify the payment scenario, for example, chatting history, to prove the truth of the transactions;

    -

    注:以上证件需原件扫描件/数码拍摄件,且照片内容需真实有效,不得做任何修改。

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PartnerOrder IDPlatform Transaction IDOrder DescriptionCustomer IDTotal AmountInput AmountPay AmountExchange RateClearing AmountGatewayCreate TimeStatusPay Time
    -

    -

    请查收关于被抽查的订单交易的相关信息,并在下午6:00 (悉尼时间)前将所需材料直接回复该邮件,未能按时提交完整证明材料,支付渠道将被关停,请您务必配合调查。感谢。
    - Please find sampled transactions in attachment, and reply required materials to this email before 6:00 pm (AEST). If you can not provide qualified materials on time, the payment channels would be suspended or restricted with amount limit. Please be sure to assist the investigation. Thanks.

    - - - -

    Submit Risk Materials

    -

    材料请通过APP在规定时间内进行上传,或请联系BD,由BD在后台进行上传。

    -
    -
    - 尊敬的RoyalPay商户 :
    - Dear RoyalPay merchant :
    -

    我司风控系统检测到您短期内后台交易存在异常行为(单人多次大金额交易退款频繁),触发平台风控预警,特此提醒:请勿使用平台进行违规交易,一经核查将关闭支付权限。请知悉。
    - RoyalPay's risk management system has identified abnormal transactions from your records in a short time(Single person pays large sums several timesfrequent refund transactions),which triggered the platform risk control warning. Here reminds: Do not use the platform for illegal transactions. Once verified, the payment authority will be closed.

    -
    -
    - - Dear UPay merchant :
    - 尊敬的UPay商户 :
    -
    -

    - You have received a Chargeback for the following transaction from the Cardholder's bank. - The transaction funds have been temporarily frozen.You have been charged the Chargeback Fee 40AUD as indicated - in your Pricing Schedule and the original transaction amount has been debited from your account balance. - Please provide the materials in English by - by 6:00 pm (Sydney time). -
    - 您已收到来自持卡人银行的Chargeback。因此该交易款已被暂时冻结,并从您的账户余额中扣除Chargeback Fee 40AUD。请在 - - 下午6:00(悉尼时间)前 - 提供以下英文版材料: -

    -

    - If you have already reversed this transaction, please provide details of the refund so that we can return the - debit to the Cardholder's bank. - If you have not refunded this transaction, or if an error has occurred, do not process a refund to the - Cardholder's account.
    - 如果您已处理退款,请提供退款详情,以便我们将借记的款项退回持卡人的银行。如果您未退款,或者发生了错误,请不要向持卡人的帐户进行退款。 -

    -
    -
    The relevant transaction details: (交易详情):
    -
    Order ID:
    -
    Date & Time:
    -
    Card Number:
    -
    Customer Name:
    -
    Customer Address:
    -
    Amount:
    -
    Reason:
    -
    - -

    - Please send (Where applicable): -

    - -

    1. A legible copy of the signed authority and/or receipts from the Cardholder.

    -

    1、持卡人签名授权书和/或收据的清晰副本

    -

    2. Copy of any tax invoice/s and/or signed disclosure of cancellation policy.

    -

    2、任何税务发票和/或签署的披露取消政策的副本

    -

    3. Any transaction Information relating to the sale of any digital goods purchased online.

    -

    3、与在线购买的任何数字商品的销售有关的任何交易信息

    -

    4. Description of the goods/services supplied and/or proof of delivery/collection of goods.

    -

    4、提供的商品/服务的说明和/或交付/收货的证明。(消费者买了什么,商家卖了什么,消费者收没收到货,如何收到的)

    -

    5. Copy of Mail Order/telephone order transaction receipt.

    -

    5、邮件订单/电话订单交易收据的副本

    -

    6. Cardholder identification or any form of communication with the Cardholder, including email - correspondence.

    -

    6、持卡人身份或与持卡人的任何形式的通信,包括电子邮件通信。

    - -

    Chargeback将会扣除$40作为Chargeback Fee,同时扣除对应订单交易额,申诉成功后将返还订单交易额,还请及时提交材料。 - 感谢,辛苦。

    - -

    材料请通过APP在规定时间内进行上传,或请联系BD,由BD在后台进行上传。

    -

    - Chargeback issue will take $40 for chargeback fee and minus the fee of the transaction. If you win the - chargeback. Transaction amount will be returned to your account. Please be sure to assist the - investigation. - Thanks. -

    -

    - The materials can be uploaded by RoyalPay APP within the required time, or contact with BD. -

    -

    Submit - Risk Materials

    -
    -
    - -

    了解更多关于我司风控事宜。Click into the link to see more about our risk management work.

    -

    顺颂商祺
    - Sincerely -

    -

    - RoyalPay 风控团队
    - RoyalPay Risk Management Team -

    -

    -
    - Contact Us
    - Email:
    - info@royalpay.com.au
    - Tel:
    - 1300 10 77 50
    -
    - Service WeChat Account:
    -
    - Level 14, 383 Kent Street, Sydney NSW 2000
    -
    - Level 11, 15 William Street, Melbourne VIC 3000 -

    -

    Tunnel Show Pty Ltd trading as RoyalPay
    - Representative of AFSL licensee 448066 -

    - diff --git a/src/main/resources/templates/mail/risk_urge_mail.html b/src/main/resources/templates/mail/risk_urge_mail.html deleted file mode 100644 index 25ff3931d..000000000 --- a/src/main/resources/templates/mail/risk_urge_mail.html +++ /dev/null @@ -1,31 +0,0 @@ - -Dear RoyalPay Merchant/BD : -

    您好,您的风控材料—】 - 已逾期 - 提交期限即将于到期 - ,请及时提交风控材料。未能按时提交完整证明材料,支付渠道将被关停,请您务必配合调查。感谢。

    -

    Your deadline for submission of risk materials for 】 - has expired - is about to expire by - , please submit the risk materials in time.If you can not provide qualified materials on time, the payment channels would be suspended or restricted with amount limit. Please be sure to assist the investigation. Thanks.

    -

    Best Regards

    -

    -
    - Contact Us
    - Email:
    - info@royalpay.com.au
    - Tel:
    与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰 - 1300 10 77 50
    -
    - Service WeChat Account:
    -
    - Level 14, 383 Kent Street, Sydney NSW 2000
    -
    - Level 11, 15 William Street, Melbourne VIC 3000 -

    -

    Tunnel Show Pty Ltd trading as RoyalPay
    - Representative of AFSL licensee 448066 -

    - diff --git a/src/main/resources/templates/mail/rservices_email_notice.html b/src/main/resources/templates/mail/rservices_email_notice.html deleted file mode 100644 index a3547c0db..000000000 --- a/src/main/resources/templates/mail/rservices_email_notice.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - -
    -
    -
    - -
    -
    -

    您好,

    -

    您申请的已付费成功:

    -
    -

    RoyalPay付费成功通知:

    -
      -
    • 签约内容:
    • -
    • 支付金额: 
    • -
    • 签约时间:
    • -
    • 申请人:
    • -
    -
    - RoyalPay客服与技术支持在此期间将竭诚为您服务,如有疑问或需帮助,请拨打我们的客服电话:1300 107 750或添加RoyalPay官方客服号:royalpay_1详询。
    - 此致
    - RoyalPay -
    -
    - -
    - - - diff --git a/src/main/resources/templates/mail/settlement_mail.html b/src/main/resources/templates/mail/settlement_mail.html deleted file mode 100644 index 6ca340d91..000000000 --- a/src/main/resources/templates/mail/settlement_mail.html +++ /dev/null @@ -1,31 +0,0 @@ - - -
    -

    Dear Flexewallet,

    -
    -
    -

    Please find the attached settlement files data up to

    -

    -

    -

    File Validation:

    -

    -

      -
    • -
    -

    -
    -
    -

    Best Regards,

    -

    RoyalPay Finance team

    -

    Tunnel Show Pty Ltd trading as RoyalPay

    -

    Representative of AFS Licensee 448066

    -

    ------------------------------

    -

    Lv.11,15 William Street, Melbourne 3000

    -

    Lv.14, 383 Kent Street, Sydney, NSW 2000

    -

    P: 1300 1077 50

    -

    E: settlement@royalpay.com.au

    -

    www.royalpay.com.au

    -
    - - - diff --git a/src/main/resources/templates/mail/shopify_merchant_application.html b/src/main/resources/templates/mail/shopify_merchant_application.html deleted file mode 100644 index 73e96627b..000000000 --- a/src/main/resources/templates/mail/shopify_merchant_application.html +++ /dev/null @@ -1,22 +0,0 @@ - - -
    Registration application from Shopify store:
    -
    -
    Partner Code:
    -
    Company Name:
    -
    Address:
    -
    Suburb:
    -
    State:
    -
    Country:
    -
    Contact Person:
    -
    Contact Phone:
    -
    Contact Email:
    -
    Shopify Store Host:
    -
    -
    -
    Please deal with it in time!
    -
    -

    -
    -
           
    - \ No newline at end of file diff --git a/src/main/resources/templates/mail/subscribe_mail.html b/src/main/resources/templates/mail/subscribe_mail.html deleted file mode 100644 index 4c763330d..000000000 --- a/src/main/resources/templates/mail/subscribe_mail.html +++ /dev/null @@ -1,7 +0,0 @@ - - -
    - -
    - - diff --git a/src/main/resources/templates/mail/test_merchant_password.html b/src/main/resources/templates/mail/test_merchant_password.html deleted file mode 100644 index 361f20a22..000000000 --- a/src/main/resources/templates/mail/test_merchant_password.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
    序号商户角色用户名密码
    adminManagerCashier
    - \ No newline at end of file diff --git a/src/main/resources/templates/mail/verify_mail.html b/src/main/resources/templates/mail/verify_mail.html deleted file mode 100644 index 5fa6b2a3b..000000000 --- a/src/main/resources/templates/mail/verify_mail.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - RoyalPay | Reset Password - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/templates/manager_bind_success.html b/src/main/resources/templates/manager_bind_success.html deleted file mode 100644 index f83b8c260..000000000 --- a/src/main/resources/templates/manager_bind_success.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - Success - - - - - - - -
    -
    Success -
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/partner_apply_info.html b/src/main/resources/templates/partner_apply_info.html deleted file mode 100644 index 1bcd7c570..000000000 --- a/src/main/resources/templates/partner_apply_info.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - RoyalPay Partner Applies - - - - - -
    -
    - -
    -
    -
    -
    Basic Info.
    -
    -
    -
    -

    Company Name

    -
    -
    - -
    -
    -
    -
    -

    Address

    -
    -
    - -
    -
    -
    -
    -

    State

    -
    -
    - -
    -
    -
    -
    Contact Info.
    -
    -
    -
    -

    Contact Person

    -
    -
    - -
    -
    -
    -
    -

    Phone No.

    -
    -
    - -
    -
    -
    -
    -

    E-mail

    -
    -
    - -
    -
    -
    -
    -
    BD Info.
    - -
    -
    -
    -
    -

    Organization

    -
    -
    - -
    -
    - -
    -
    -
    -
    -

    Organization

    -
    -
    - -
    -
    -
    -
    -

    BD Name

    -
    -
    - -
    -
    -
    -
    -
    - -
    Status
    - -
    -
    -
    -
    -

    Status

    -
    -
    - 待审核 -
    -
    -
    -
    -
    -
    -

    Status

    -
    -
    - 已分配BD处理 -
    -
    -
    -
    -
    -
    -

    Status

    -
    -
    - BD审核通过 -
    -
    -
    -
    -
    -
    -

    Status

    -
    -
    - 初审未通过 -
    -
    -
    -
    -
    -
    -

    Status

    -
    -
    - BD审核未通过 -
    -
    -
    -
    -
    -
    -
    - Save - Refuse -
    -
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/paynotice.html b/src/main/resources/templates/paynotice.html deleted file mode 100644 index dd9376d14..000000000 --- a/src/main/resources/templates/paynotice.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - Payment Notice - - - - - - - - - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -

    Price

    -
    -
    [[${order['currency']}]] [[${#numbers.formatDecimal(order['total_amount'],1,2)}]] -
    -
    -
    -
    -

    Customer

    -
    -
    - -
    -
    -
    -
    -

    Customer Paid

    -
    -
    [[${order['currency']}]] - [[${#numbers.formatDecimal(order['customer_payment_amount'],1,2)}]] -
    -
    -
    -
    -
    -

    RoyalPay Subsidies

    -
    -
    [[${order['currency']}]] - [[${#numbers.formatDecimal(order['coupon_payment_amount'],1,2)}]] -
    -
    -
    - -
    -
    -

    Title

    -
    -
    -
    -
    -
    -

    Remark

    -
    -
    -
    -
    -
    -

    Status

    -
    -
    -
    -
    -
    -

    Trade Time

    -
    -
    -
    -
    -
    -

    Order ID

    -
    -
    -
    -
    -
    -
    -

    Partner Order ID

    -
    -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/pdf/letter_of_offer.pdf b/src/main/resources/templates/pdf/letter_of_offer.pdf deleted file mode 100644 index 926fd473b..000000000 Binary files a/src/main/resources/templates/pdf/letter_of_offer.pdf and /dev/null differ diff --git a/src/main/resources/templates/pdf/promotional_offer.pdf b/src/main/resources/templates/pdf/promotional_offer.pdf deleted file mode 100644 index e40bc6b3b..000000000 Binary files a/src/main/resources/templates/pdf/promotional_offer.pdf and /dev/null differ diff --git a/src/main/resources/templates/pdf/terms_and_conditions.pdf b/src/main/resources/templates/pdf/terms_and_conditions.pdf deleted file mode 100644 index d8b3fc93b..000000000 Binary files a/src/main/resources/templates/pdf/terms_and_conditions.pdf and /dev/null differ diff --git a/src/main/resources/templates/promotion.html b/src/main/resources/templates/promotion.html deleted file mode 100644 index 5cbd6c5c9..000000000 --- a/src/main/resources/templates/promotion.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - RoyalPay红包返现福利 - - - - - - - - - - -
    - - -

    推荐微信支付成功 微信福利红包返现

    -

    1RMB-188RMB不等

    -

    敬请参与

    - -

    (每单消费需要满50澳币)

    - -

    -

    -

    立刻参与

    -

    -

    -

    RoyalPay皇家支付 -

    -
    - - - - \ No newline at end of file diff --git a/src/main/resources/templates/promotion_alipay.html b/src/main/resources/templates/promotion_alipay.html deleted file mode 100644 index 98c17c6c5..000000000 --- a/src/main/resources/templates/promotion_alipay.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - RoyalPay红包返现福利 - - - - - - - - - - -
    -
    - 活动 -
    -
    - -
    -
    - -
    - - - -
    -
    - -
    - -
    -
    - - -
    -
    -
    - 活动时间 :2017.10.20 - 2017.12.31 -
    -
    -
    -
    -
    - 凡签约商户推荐用户使用支付宝支付成功满20澳币,即可获得支付宝随机福利红包返现1~188元人民币不等。 - 商户当天完成指定交易笔(30/60/100笔),即可获得红包翻倍奖励(188元封顶), - 商户红包通过商户支付宝账户发放。 -
    -
    -
    - -
    -
    -
    - 参与方法 -
    -
    -
    -
    -
    - 方法一: 用支付宝扫码从相册选择图片进入活动页面,输入活动邀请码进行绑定。

    - - - 方法二: 进入商户后台活动页面,使用支付宝扫描页面中的二维码进入活动页面,输入活动邀请码进行绑定。 - -
    -
    -
    - -
    -
    -
    - 红包规则 -
    -
    -
    -
    -
    - 以商家单日交易100笔为例,该商户每日可领取的红包情况如下: -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    -   第1-29笔 -   常规随机红包1~188元人民币 -
    -   第30笔 -   随机红包1~188元人民币 红包金额×2 -
    -   第31-59笔 -   常规随机红包1~188元人民币 -
    -   第60笔 -   随机红包1~188元人民币 红包金额×3 -
    -   第61-99笔 -   常规随机红包1~188元人民币 -
    -   第100笔 -   随机红包1~188元人民币 红包金额×5 -
    -   第100笔以上 -   常规随机红包1~188元人民币 -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/refund_audit.html b/src/main/resources/templates/refund_audit.html deleted file mode 100644 index 62698590c..000000000 --- a/src/main/resources/templates/refund_audit.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Refund Audition - - - - - - - - - - - -
    -
    -
    -
    -

    Order Fee

    -
    -
    [[${order['currency']}]] [[${order['customer_payment_amount']}]]
    -
    -
    -
    -

    Refund Fee

    -
    -
    [[${refund['currency']}]] [[${refund['amount']}]]
    -
    -
    -
    -

    Applyer

    -
    -
    -
    -
    -
    -

    Apply Time

    -
    -
    -
    -
    -
    -

    Order Title

    -
    -
    -
    -
    -
    -

    >Order Detail<

    -
    -
    >
    -
    -
    -
    -

    Order ID

    -
    -
    -
    -
    > -
    -

    Partner Order ID

    -
    -
    -
    -
    -
    -

    Apply Time

    -
    -
    -
    -
    - -
    - Agree - Disagree -
    -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/refund_audit_list.html b/src/main/resources/templates/refund_audit_list.html deleted file mode 100644 index 73ea5e5a3..000000000 --- a/src/main/resources/templates/refund_audit_list.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - Refund Auditions List - - - - - - - - -
    -
    -
    -
    - -
    -
    -

    -
    -
    -
    -
    -
    -
    -
    - Refund audit completed! -
    -
    -
    -
    -
    -
    -
    You have refunds pending review
    - -
    -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/refund_review.html b/src/main/resources/templates/refund_review.html deleted file mode 100644 index 32fe898da..000000000 --- a/src/main/resources/templates/refund_review.html +++ /dev/null @@ -1,223 +0,0 @@ - - -
    - - Refund Audition - - - - - - - - - - -
    - - -
    -
    - -
    -
    -
    -
    Refund Info.
    -
    -
    -
    -

    Merchant Name

    -
    -
    -
    -
    -
    -

    Avaliable Fee

    -
    -
    -
    -
    -
    -

    Refund Fee

    -
    -
    -
    -
    -
    -

    Opeartor

    -
    -
    -
    -
    -
    -

    Apply Time

    -
    -
    -
    -
    -
    -
    -

    Remark

    -
    -
    -
    -
    -
    -
    -

    Order ID

    -
    -
    -
    -
    -
    -

    Trade Time

    -
    -
    -
    -
    -
    -

    Follow BD

    -
    -
    -
    -
    -
    -
    -
    Refund Auditon Status
    -
    -
    -
    -

    Status

    -
    -
    -
    -
    -
    - -
    -
    Refund Auditon Status
    -
    -
    -
    -

    Status

    -
    -
    -
    -
    -
    -
    -

    Remark

    -
    -
    -
    -
    -
    -
    -
    -
    -
    - Agree - Disagree -
    -
    - - - \ No newline at end of file diff --git a/src/main/resources/templates/refund_review_client.html b/src/main/resources/templates/refund_review_client.html deleted file mode 100644 index fb371c9e5..000000000 --- a/src/main/resources/templates/refund_review_client.html +++ /dev/null @@ -1,118 +0,0 @@ - - -
    - - Refund Audition - - - - - - -
    -
    -
    - -
    -
    -
    -
    Refund Info.
    -
    -
    -
    -

    Merchant Name

    -
    -
    -
    -
    -
    -

    Avaliable Fee

    -
    -
    -
    -
    -
    -

    Refund Fee

    -
    -
    -
    -
    -
    -

    Opeartor

    -
    -
    -
    -
    -
    -

    Apply Time

    -
    -
    -
    -
    -
    -
    -

    Remark

    -
    -
    -
    -
    -
    -
    -

    Order ID

    -
    -
    -
    -
    -
    -

    Trade Time

    -
    -
    -
    -
    -
    - -
    Refund Auditon Status
    - -
    -
    -
    -
    -

    Status

    -
    -
    -
    -
    -
    -
    -
    -

    Status

    -
    -
    审核未通过,请与RoyalPay联系
    -
    -
    -
    -
    -
    -

    Remark

    -
    -
    -
    -
    -
    -
    -
    -

    Status

    -
    -
    RoyalPay审核中
    -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/src/main/resources/templates/refund_status.html b/src/main/resources/templates/refund_status.html deleted file mode 100644 index 7a56e0d0e..000000000 --- a/src/main/resources/templates/refund_status.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - Refund Status - - - - - - - - - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    -

    Order ID

    -
    -
    -
    -
    -
    -

    Order Amount

    -
    -
    - [[${order['currency']}]] [[${#numbers.formatDecimal(order['customer_payment_amount'],1,2)}]] -
    -
    -
    -
    -

    Refund Amount

    -
    -
    - [[${order['currency']}]] [[${#numbers.formatDecimal(refund['amount'],1,2)}]] -
    -
    -
    -
    -

    Refund Time

    -
    -
    -
    -
    -
    -

    Refund Status

    -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/register_account.html b/src/main/resources/templates/register_account.html deleted file mode 100644 index 147c1789e..000000000 --- a/src/main/resources/templates/register_account.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - RoyalPay - Register Account - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - - diff --git a/src/main/resources/templates/reports/arrival_notice.html b/src/main/resources/templates/reports/arrival_notice.html deleted file mode 100644 index 9b7280ce4..000000000 --- a/src/main/resources/templates/reports/arrival_notice.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    - - diff --git a/src/main/resources/templates/reports/daily_report.html b/src/main/resources/templates/reports/daily_report.html deleted file mode 100644 index e97ad6f4d..000000000 --- a/src/main/resources/templates/reports/daily_report.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    -
    - 交易 - - KPI -
    -
    -
    -
    -
    -
    Total 较昨日数据
    -
    -
    -
    -
    入账
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    出账
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    清算额
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    净交易
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    手续费
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    平台手续费
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    渠道成本手续费
    -
    -       -
    - - -
    -
    -
    -
    -
    -
    税费
    -
    -       -
    - - -
    -
    -
    -
    -
    - Channel - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - diff --git a/src/main/resources/templates/reports/green_channel.html b/src/main/resources/templates/reports/green_channel.html deleted file mode 100644 index dfa178470..000000000 --- a/src/main/resources/templates/reports/green_channel.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    即将过期

    -
    - - - - - - - - - - - - - - - - - - - - -
    BDtotalpartner code
    -
    - -

    已经过期

    -
    - - - - - - - - - - - - - - - - - - - - - -
    BDtotalpartner code
    -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/reports/green_channel_bd.html b/src/main/resources/templates/reports/green_channel_bd.html deleted file mode 100644 index 018d7b2b7..000000000 --- a/src/main/resources/templates/reports/green_channel_bd.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    即将过期

    -
    - - - - - - - - - - - - - - -
    partner code
    -
    - -

    已经过期

    -
    - - - - - - - - - - - - - - - -
    partner code
    -
    - -
    - - - \ No newline at end of file diff --git a/src/main/resources/templates/reports/securepay_settlement.html b/src/main/resources/templates/reports/securepay_settlement.html deleted file mode 100644 index ac88ccfa7..000000000 --- a/src/main/resources/templates/reports/securepay_settlement.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - settlement - - - - - -
    -
    - - -
    -
    -
    -
    -
    - -

    - - -
    -
    - Tunnel Show Pty Ltd trading as
    - ABN 16 601 619 685 Representative of AFSL
    - Level 11, 15 William Street, Melbourne, Victoria -

    -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Transaction IDClient Order IdTransaction TimeChannelExchange RateTransaction TypeCurrency Total AmountSurcharge RateSettle amountTransaction Feegst
    -
    - - diff --git a/src/main/resources/templates/reports/week_report.html b/src/main/resources/templates/reports/week_report.html deleted file mode 100644 index 2f49bdeed..000000000 --- a/src/main/resources/templates/reports/week_report.html +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    All Region
    -
    -
    -
    -
    -
    -
    日期
    -
    金额 -
    -
    订单数
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    本周交易总额
    -
    -
    -
    -
    较上周比较
    -
    - - - -
    -
    -
    -
    - -
    -
    Melbourne
    -
    -
    -
    -
    -
    -
    日期
    -
    金额 -
    -
    订单数
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    本周交易总额
    -
    -
    -
    -
    较上周比较
    -
    - - - -
    -
    -
    -
    - -
    -
    Sydney
    -
    -
    -
    -
    -
    -
    日期
    -
    金额 -
    -
    订单数
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    本周交易总额
    -
    -
    -
    -
    较上周比较
    -
    - - - -
    -
    -
    -
    - -
    -
    BD交易量数据排名
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/reports/week_report_partners.html b/src/main/resources/templates/reports/week_report_partners.html deleted file mode 100644 index 19b2e3ae6..000000000 --- a/src/main/resources/templates/reports/week_report_partners.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    本周交易总额
    -
    -
    - -
    -
    -
    较上周比较
    -
    - - - -
    -
    -
    -
    -
    新增商户总数
    -
    -
    -
    -
    -
    - -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/shopify/auth_back.html b/src/main/resources/templates/shopify/auth_back.html deleted file mode 100644 index afe68c072..000000000 --- a/src/main/resources/templates/shopify/auth_back.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Auth - - - - - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -

    - This authorization is successful! -

    -
    -
    -
    -
    - -
    -
    - ©2015-2021 RoyalPay. -
    -
    - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/testMerchantPassword.html b/src/main/resources/templates/testMerchantPassword.html deleted file mode 100644 index 9ff89608d..000000000 --- a/src/main/resources/templates/testMerchantPassword.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -
    商户角色用户名密码
    adminManagerCashier
    - \ No newline at end of file diff --git a/src/main/resources/templates/wechat_bind.html b/src/main/resources/templates/wechat_bind.html deleted file mode 100644 index c5b3056a5..000000000 --- a/src/main/resources/templates/wechat_bind.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - Bind Success - - - - - - - -
    Success -
    -
    - - - - - -

    Make sure you have followed our Wechat Official Account in case you can't receive the latest payment - notification. -

    -

    - -
    - -
    - - \ No newline at end of file diff --git a/src/main/resources/templates/wx_test.html b/src/main/resources/templates/wx_test.html deleted file mode 100644 index 710034bc4..000000000 --- a/src/main/resources/templates/wx_test.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - RoyalPay Payment - - - - - - - - - - -
    - - \ No newline at end of file diff --git a/src/main/resources/wx_industry.json b/src/main/resources/wx_industry.json deleted file mode 100644 index 87d26b077..000000000 --- a/src/main/resources/wx_industry.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "327": "鞋包服饰", - "328": "酒店行业", - "329": "教育行业", - "330": "国际物流", - "331": "其它服务行业", - "332": "数码电器", - "333": "母婴", - "334": "化妆品", - "335": "食品", - "336": "综合商城", - "337": "文具/办公用品", - "338": "其它货物贸易行业", - "339": "机票行业", - "356": "软件服务", - "357": "旅游票务", - "358": "国际租车", - "359": "医疗服务(出国)", - "360": "医疗服务(不出国)", - "361": "留学教育(网络教育)", - "362": "留学教育(一年及以下)", - "363": "留学教育(一年以上)" -} \ No newline at end of file diff --git a/src/main/ui/3614585395.txt b/src/main/ui/3614585395.txt deleted file mode 100644 index 62199cf9a..000000000 --- a/src/main/ui/3614585395.txt +++ /dev/null @@ -1 +0,0 @@ -ae353db63a041ba84f932eb760b9415e \ No newline at end of file diff --git a/src/main/ui/EbaSsLBpam.txt b/src/main/ui/EbaSsLBpam.txt deleted file mode 100644 index 97bb3fdae..000000000 --- a/src/main/ui/EbaSsLBpam.txt +++ /dev/null @@ -1 +0,0 @@ -1dd6d097298adb52873a6d614aba9bbb diff --git a/src/main/ui/HVSnmTGr8B.txt b/src/main/ui/HVSnmTGr8B.txt deleted file mode 100644 index c48d57676..000000000 --- a/src/main/ui/HVSnmTGr8B.txt +++ /dev/null @@ -1 +0,0 @@ -2037ffb83b877c2b0dba98a20f4391d6 \ No newline at end of file diff --git a/src/main/ui/IyaMtAHCc6.txt b/src/main/ui/IyaMtAHCc6.txt deleted file mode 100644 index 04f21f8bc..000000000 --- a/src/main/ui/IyaMtAHCc6.txt +++ /dev/null @@ -1 +0,0 @@ -8a269da4e115610c6176bd016e1ef40d \ No newline at end of file diff --git a/src/main/ui/KPI9flnfeK.txt b/src/main/ui/KPI9flnfeK.txt deleted file mode 100644 index 8ee23d84e..000000000 --- a/src/main/ui/KPI9flnfeK.txt +++ /dev/null @@ -1 +0,0 @@ -c325a4e10d7b8db8d7024adb48473ae9 \ No newline at end of file diff --git a/src/main/ui/MP_verify_8lb7qo78Ssfr5yBD.txt b/src/main/ui/MP_verify_8lb7qo78Ssfr5yBD.txt deleted file mode 100644 index 702b1ac18..000000000 --- a/src/main/ui/MP_verify_8lb7qo78Ssfr5yBD.txt +++ /dev/null @@ -1 +0,0 @@ -8lb7qo78Ssfr5yBD \ No newline at end of file diff --git a/src/main/ui/SRChoE1QZN.txt b/src/main/ui/SRChoE1QZN.txt deleted file mode 100644 index 2d99e5dc4..000000000 --- a/src/main/ui/SRChoE1QZN.txt +++ /dev/null @@ -1 +0,0 @@ -f2f97656020f8839d638986e22a2b24f diff --git a/src/main/ui/SujatfHJ9y.txt b/src/main/ui/SujatfHJ9y.txt deleted file mode 100644 index 7c40f0895..000000000 --- a/src/main/ui/SujatfHJ9y.txt +++ /dev/null @@ -1 +0,0 @@ -7d9901ce4720709f2a6a1e93c90089e8 \ No newline at end of file diff --git a/src/main/ui/TCDMmLPl5d.txt b/src/main/ui/TCDMmLPl5d.txt deleted file mode 100644 index 17dc00813..000000000 --- a/src/main/ui/TCDMmLPl5d.txt +++ /dev/null @@ -1 +0,0 @@ -917c6c95c3328f8103f6a57e05cecf58 \ No newline at end of file diff --git a/src/main/ui/ThpF4ynxys.txt b/src/main/ui/ThpF4ynxys.txt deleted file mode 100644 index ad7b19e02..000000000 --- a/src/main/ui/ThpF4ynxys.txt +++ /dev/null @@ -1 +0,0 @@ -c3f95b314379ea9f052cd937c13a7e84 \ No newline at end of file diff --git a/src/main/ui/aMvAawcxLY.txt b/src/main/ui/aMvAawcxLY.txt deleted file mode 100644 index 945e91c49..000000000 --- a/src/main/ui/aMvAawcxLY.txt +++ /dev/null @@ -1 +0,0 @@ -8deca24ad50d52d83c7a141ad2951c89 \ No newline at end of file diff --git a/src/main/ui/all_locations.html b/src/main/ui/all_locations.html deleted file mode 100644 index 0ead36432..000000000 --- a/src/main/ui/all_locations.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Geocoding service - - - - - - -
    - - - - - - \ No newline at end of file diff --git a/src/main/ui/annual_bill.html b/src/main/ui/annual_bill.html deleted file mode 100644 index 026901e6a..000000000 --- a/src/main/ui/annual_bill.html +++ /dev/null @@ -1,1172 +0,0 @@ - - - - 2018澳洲市场跨境支付大数据 - - - - - - -
    -
    滑动查看
    -
    - -
    -
    - -
    -
    - - -
    - - -
    - -
    - - -
    - -
    - - -
    - - -
    -
    -
    成交订单
    -
    数据分析
    -
    - -
    - 2018跨境支付订单量迅猛增长 -
    - -
    -
    -
    - -
    -
    - -
    - -
      -
    • 2018年成交订单数
    • -
    • - 1168万 -
    • - -
    • 较去年增长
    • -
    • - 0 - % -
    • -
    • 每日成交订单数
    • -
    • 0
    • -
    - -
    - - -
    -
    -
    - -
    - -
    - 接入RoyalPay跨境支付服务的商户规模不断扩大 -
    - -
    -
    -
    - -
    - -
    - -
      -
    • 选择RoyalPay完成跨境支付的商家数量
    • -
    • 16,000
    • - -
    - -
    - - -
    -
    -
    - -
    - -
    - 使用RoyalPay跨境支付服务的用户持续增长 -
    - -
    -
    -
    - -
    - -
      -
    • 2018年通过RoyalPay完成线上&线下的用户达
    • -
    • - - 300 - 万人 -
    • -
    • 较去年增长
    • -
    • - - - - - 321.53 - % -
    • -
    • 平均每天超
    • -
    • - - 8,219 - - -
      - -
      -
    • -
    - -
    - - -
    -
    -
    - -
    - -
    - 如果每笔交易都打印一张收营小票,将它们展开来可以铺满 - 8个悉尼歌剧院。 -
    - -
    -
    -
    - -
      -
    • 2018年每月流水超
    • -
    • - - - 81,588,990 - - AUD -
    • -
    • 平均每一分钟就有超过
    • -
    • - 23 - 笔新交易 -
    • -
    • 支付系统管理后台,每月商户登录超
    • -
    • - 1 - 万次 -
    • -
    • - -
    • -
    - -
    - - -
    -
    -
    - -
    - -
    - 新兴场景不断涌现,预计2019年将会达到猛增期 -
    - -
    -
    -
    - -
    - -
    -
      -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    - -
      -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • -
    • - - -
    • - -
    -
    - -
    - - -
    -
    -
    - -
    - -
    - 维多利亚州商户数量占全澳42%,位居第一 -
    - -
    -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    - -
    - -
    - - -
    -
    -
    - -
    - -
    - 线上数据截止到2018年12月 -
    - -
    -
    -
    - -
    - -
    - -
      -
    • 2018年接入电商网站
    • -
    • - 696 - -
    • -
    • - 月均线上支付次数 - - - 较去年增长 -
    • -
    • - 96,738 - 327% -
    • -
    - -
    - - -
    -
    -
    - -
    - -
    - 线上线下各支付渠道占比 -
    - -
    -
    -
    - -
    -
    - - 线上支付渠道 -
    -
    - - 线下支付渠道 -
    -
    - -
    -
    -
    -
    - 1% -
    -
    - -
    -
    - -
    -
    -
    - 12% -
    -
    - -
    -
    -
    -
    -
    - 1% -
    -
    - -
    -
    - -
    -
    -
    - 1% -
    -
    - -
    -
    -
    -
    -
    - 1% -
    -
    - -
    -
    - -
    -
    -
    - 72% -
    -
    - -
    -
    -
    -
    -
    - 8% -
    -
    - -
    -
    - -
    -
    -
    - 4% -
    -
    - -
    -
    - -
    - - - -
    - - -
    -
    -
    - -
    - -
    - 扫码支付交易笔数在澳洲区域分布 -
    - -
    -
    -
    -
    - -
    - - -
    - - -
    -
    -
    - -
    - -
    - 2018年澳洲境内的线下扫码支付更受女性欢迎 -
    - -
    -
    -
    -
    - -
    - - -
    - - -
    -
    -
    - -
    - -
    - 平均一天24小时内的交易次数统计 -
    - -
    -
    -
    -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - -
    - 体验优化、效率提升、助力商户业绩提升;扫码移动支付 + 多渠道融合->智能无卡支付体验 -
    - -
    -
    -
    - -
    - -
    - - -
    - - -
    -
    - -
    - -
    - RoyalPay作为一家无缝对接中国消费者与澳洲商家的Fintech企业,致力于提供更安全便捷的支付体验, 助力全球跨境支付业务蓬勃发展。感谢您的加入,让我们离智慧生活的新时代又近了一步! -
    -
    -
    - - - -
    - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/ui/application_index.html b/src/main/ui/application_index.html deleted file mode 100644 index 0808aca67..000000000 --- a/src/main/ui/application_index.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - RoyalPay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - -
    -
    -
    - -
    - -
    - - Copyright © 2015-2019 RoyalPay. All rights - reserved.    - - - ( 1300-10-77-50 | - info@royalpay.com.au | - WeChat ) - -
    -
    - - - diff --git a/src/main/ui/auth.html b/src/main/ui/auth.html deleted file mode 100644 index fb5650670..000000000 --- a/src/main/ui/auth.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - RoyalPay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    - - - diff --git a/src/main/ui/citypartner_register.html b/src/main/ui/citypartner_register.html deleted file mode 100644 index 2190a35f9..000000000 --- a/src/main/ui/citypartner_register.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - 下一个城市,RoyalPay在等你 - - - - - - - - - - -
    -
    -
    -
    -
    -
    报名方式
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    - -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - -

    Phone: +61 03 9448 8865

    -

    Email: info@royalpay.com.au

    -

    Address: Level 11/15 William st

    -

    Melbourne VIC 3000

    -
    -
    -
    - - RoyalPay服务号 -
    -
    - - RoyalPay官方客服 -
    -
    -
    -
    - - \ No newline at end of file diff --git a/src/main/ui/data/rp_industry_apply.json b/src/main/ui/data/rp_industry_apply.json deleted file mode 100644 index 78d4b9f5d..000000000 --- a/src/main/ui/data/rp_industry_apply.json +++ /dev/null @@ -1,188 +0,0 @@ -[ - { - "children": [ - { - "children": [], - "label": "机票 Plane ticket", - "mccCode": "10001" - }, - { - "children": [], - "label": "旅游行业 tourist industry", - "mccCode": "10002" - }, - { - "children": [], - "label": "私人定制旅游 Customized travel", - "mccCode": "10003" - }, - { - "children": [], - "label": "租车 Car Rental", - "mccCode": "10004" - }, - { - "children": [], - "label": "巴士 Bus", - "mccCode": "10005" - } - ], - "label": "旅游出行 Tourism trips", - "mccCode": "1" - }, - { - "children": [ - { - "children": [], - "label": "饭店 Restaurant", - "mccCode": "20001" - }, - { - "children": [], - "label": "奶茶店 Milk tea shop", - "mccCode": "20002" - }, - { - "children": [], - "label": "烧烤 BBQ", - "mccCode": "20003" - }, - { - "children": [], - "label": "火锅 Chafing dish", - "mccCode": "20004" - }, - { - "children": [], - "label": "咖啡 Coffee", - "mccCode": "20005" - }, - { - "children": [], - "label": "酒吧 Bar", - "mccCode": "20006" - } - ], - "label": "餐饮 Food and beverage industry", - "mccCode": "2" - }, - { - "children": [ - { - "children": [], - "label": "公众号服务商 Office Account Provider", - "mccCode": "50001" - }, - { - "children": [], - "label": "各种媒体类宣传 Media", - "mccCode": "50002" - } - ], - "label": "传媒 media industry", - "mccCode": "5" - }, - { - "children": [ - { - "label": "超市 Supermarket", - "mccCode": "70001" - }, - { - "children": [], - "label": "服装店 Clothes shop", - "mccCode": "70002" - }, - { - "children": [], - "label": "鞋店 Shoe shop", - "mccCode": "70003" - },{ - "children": [], - "label": "箱包 Bags", - "mccCode": "70005" - } - ], - "label": "零售 Retail", - "mccCode": "7" - }, - { - "children": [ - { - "children": [], - "label": "桌游吧 Board Game", - "mccCode": "80001" - }, - { - "children": [], - "label": "网吧 Net Bar", - "mccCode": "80007" - } - ], - "label": "休闲娱乐 Leisure entertainment", - "mccCode": "8" - }, - { - "children": [ - { - "children": [], - "label": "摄影 Photography", - "mccCode": "90001" - }, - { - "children": [], - "label": "通讯运营商 Communication operators", - "mccCode": "90003" - }, - { - "children:":[], - "label":"软件服务 Software maintenance", - "mccCode":"90005" - } - ], - "label": "其他服务类 Other Services", - "mccCode": "9" - }, - { - "children": [ - { - "children": [], - "label": "酒店 Hotel", - "mccCode": "100001" - }, - { - "children": [], - "label": "汽车旅馆 Motel", - "mccCode": "100002" - } - ], - "label": "酒店 Hotel", - "mccCode": "10" - }, - { - "children": [ - { - "children": [], - "label": "代购 Daigou", - "mccCode": "110001" - }, - { - "children": [], - "label": "物流(大宗出口贸易) Logistics", - "mccCode": "110002" - }, - { - "children": [], - "label": "红酒出口 Red wine exports", - "mccCode": "110003" - }, - { - "children": [], - "label": "综合电商 e-Commerce", - "mccCode": "110004" - } - ], - "label": "出口贸易 Export Business", - "mccCode": "11" - } -] \ No newline at end of file diff --git a/src/main/ui/favicon.ico b/src/main/ui/favicon.ico deleted file mode 100644 index 2853c5a77..000000000 Binary files a/src/main/ui/favicon.ico and /dev/null differ diff --git a/src/main/ui/forget_password.html b/src/main/ui/forget_password.html deleted file mode 100644 index 82159bf77..000000000 --- a/src/main/ui/forget_password.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - RoyalPay | Reset Password - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/ui/ico/android-icon-144x144.png b/src/main/ui/ico/android-icon-144x144.png deleted file mode 100644 index 9feb9fedd..000000000 Binary files a/src/main/ui/ico/android-icon-144x144.png and /dev/null differ diff --git a/src/main/ui/ico/android-icon-192x192.png b/src/main/ui/ico/android-icon-192x192.png deleted file mode 100644 index d1d0bcb7a..000000000 Binary files a/src/main/ui/ico/android-icon-192x192.png and /dev/null differ diff --git a/src/main/ui/ico/android-icon-36x36.png b/src/main/ui/ico/android-icon-36x36.png deleted file mode 100644 index 12c914d36..000000000 Binary files a/src/main/ui/ico/android-icon-36x36.png and /dev/null differ diff --git a/src/main/ui/ico/android-icon-48x48.png b/src/main/ui/ico/android-icon-48x48.png deleted file mode 100644 index d108007d5..000000000 Binary files a/src/main/ui/ico/android-icon-48x48.png and /dev/null differ diff --git a/src/main/ui/ico/android-icon-72x72.png b/src/main/ui/ico/android-icon-72x72.png deleted file mode 100644 index eec41e298..000000000 Binary files a/src/main/ui/ico/android-icon-72x72.png and /dev/null differ diff --git a/src/main/ui/ico/android-icon-96x96.png b/src/main/ui/ico/android-icon-96x96.png deleted file mode 100644 index b623cb3cc..000000000 Binary files a/src/main/ui/ico/android-icon-96x96.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-114x114.png b/src/main/ui/ico/apple-icon-114x114.png deleted file mode 100644 index 5f50e260d..000000000 Binary files a/src/main/ui/ico/apple-icon-114x114.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-120x120.png b/src/main/ui/ico/apple-icon-120x120.png deleted file mode 100644 index 328053ab5..000000000 Binary files a/src/main/ui/ico/apple-icon-120x120.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-144x144.png b/src/main/ui/ico/apple-icon-144x144.png deleted file mode 100644 index 5fedda2ee..000000000 Binary files a/src/main/ui/ico/apple-icon-144x144.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-152x152.png b/src/main/ui/ico/apple-icon-152x152.png deleted file mode 100644 index 182ef2566..000000000 Binary files a/src/main/ui/ico/apple-icon-152x152.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-180x180.png b/src/main/ui/ico/apple-icon-180x180.png deleted file mode 100644 index 4e3e2e5d8..000000000 Binary files a/src/main/ui/ico/apple-icon-180x180.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-57x57.png b/src/main/ui/ico/apple-icon-57x57.png deleted file mode 100644 index 9555b6490..000000000 Binary files a/src/main/ui/ico/apple-icon-57x57.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-60x60.png b/src/main/ui/ico/apple-icon-60x60.png deleted file mode 100644 index 38f9f8b50..000000000 Binary files a/src/main/ui/ico/apple-icon-60x60.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-72x72.png b/src/main/ui/ico/apple-icon-72x72.png deleted file mode 100644 index 85dd277b6..000000000 Binary files a/src/main/ui/ico/apple-icon-72x72.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-76x76.png b/src/main/ui/ico/apple-icon-76x76.png deleted file mode 100644 index 8f88d4535..000000000 Binary files a/src/main/ui/ico/apple-icon-76x76.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon-precomposed.png b/src/main/ui/ico/apple-icon-precomposed.png deleted file mode 100644 index 4f9ffa095..000000000 Binary files a/src/main/ui/ico/apple-icon-precomposed.png and /dev/null differ diff --git a/src/main/ui/ico/apple-icon.png b/src/main/ui/ico/apple-icon.png deleted file mode 100644 index 135a87949..000000000 Binary files a/src/main/ui/ico/apple-icon.png and /dev/null differ diff --git a/src/main/ui/ico/browserconfig.xml b/src/main/ui/ico/browserconfig.xml deleted file mode 100644 index 02be9aad1..000000000 --- a/src/main/ui/ico/browserconfig.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - #ffffff - - - \ No newline at end of file diff --git a/src/main/ui/ico/favicon-16x16.png b/src/main/ui/ico/favicon-16x16.png deleted file mode 100644 index 93e8207fe..000000000 Binary files a/src/main/ui/ico/favicon-16x16.png and /dev/null differ diff --git a/src/main/ui/ico/favicon-32x32.png b/src/main/ui/ico/favicon-32x32.png deleted file mode 100644 index 2853c5a77..000000000 Binary files a/src/main/ui/ico/favicon-32x32.png and /dev/null differ diff --git a/src/main/ui/ico/favicon-96x96.png b/src/main/ui/ico/favicon-96x96.png deleted file mode 100644 index 8b3f88c05..000000000 Binary files a/src/main/ui/ico/favicon-96x96.png and /dev/null differ diff --git a/src/main/ui/ico/manifest.json b/src/main/ui/ico/manifest.json deleted file mode 100644 index 0edca4a0a..000000000 --- a/src/main/ui/ico/manifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "App", - "icons": [ - { - "src": "\/ico\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "\/ico\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "\/ico\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "\/ico\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "\/ico\/android-icon-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "\/ico\/android-icon-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ] -} \ No newline at end of file diff --git a/src/main/ui/ico/ms-icon-144x144.png b/src/main/ui/ico/ms-icon-144x144.png deleted file mode 100644 index 1ffe9f082..000000000 Binary files a/src/main/ui/ico/ms-icon-144x144.png and /dev/null differ diff --git a/src/main/ui/ico/ms-icon-150x150.png b/src/main/ui/ico/ms-icon-150x150.png deleted file mode 100644 index b41d9babb..000000000 Binary files a/src/main/ui/ico/ms-icon-150x150.png and /dev/null differ diff --git a/src/main/ui/ico/ms-icon-310x310.png b/src/main/ui/ico/ms-icon-310x310.png deleted file mode 100644 index 44a5adf10..000000000 Binary files a/src/main/ui/ico/ms-icon-310x310.png and /dev/null differ diff --git a/src/main/ui/ico/ms-icon-70x70.png b/src/main/ui/ico/ms-icon-70x70.png deleted file mode 100644 index 1742a40fb..000000000 Binary files a/src/main/ui/ico/ms-icon-70x70.png and /dev/null differ diff --git a/src/main/ui/index.html b/src/main/ui/index.html deleted file mode 100644 index 51dfb9fd3..000000000 --- a/src/main/ui/index.html +++ /dev/null @@ -1,1092 +0,0 @@ - - - - - - - RoyalPay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - royalpay -

    Easy Business,Easy Pay

    -
    -
    -
    - -
    -
    - - - - - -
    - - - - -
    - - - - - - -
    -
    - - - - -
    - - Copyright © 2015-2019 RoyalPay. All rights - reserved.    - - - ( 1300-10-77-50 | - info@royalpay.com.au | - WeChat ) - -
    - -
    - - - diff --git a/src/main/ui/login.html b/src/main/ui/login.html deleted file mode 100644 index 3f31265d1..000000000 --- a/src/main/ui/login.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - RoyalPay | Sign in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/ui/login_v1.html b/src/main/ui/login_v1.html deleted file mode 100644 index a7d2ae33f..000000000 --- a/src/main/ui/login_v1.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - RoyalPay | Sign in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/ui/m_login.html b/src/main/ui/m_login.html deleted file mode 100644 index 07f55f910..000000000 --- a/src/main/ui/m_login.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - RoyalPay | 管理登录 - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - - - - - - - - - - - diff --git a/src/main/ui/m_login_v1.html b/src/main/ui/m_login_v1.html deleted file mode 100644 index 52841f779..000000000 --- a/src/main/ui/m_login_v1.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - RoyalPay | 管理登录 - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/ui/manage.html b/src/main/ui/manage.html deleted file mode 100644 index cf5f47f49..000000000 --- a/src/main/ui/manage.html +++ /dev/null @@ -1,1041 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - RoyalPay - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - RoyalPay -

    To Be The Best QRCode Payment Service Provider!

    -
    -
    -
    - -
    - - - - - - - -
    - - - - - - - -
    -
    -
    - - -
    - - Copyright © 2015-2019 RoyalPay. All rights - reserved. -
    - -
    - - - - diff --git a/src/main/ui/managev2.html b/src/main/ui/managev2.html deleted file mode 100644 index 5cc15ab68..000000000 --- a/src/main/ui/managev2.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - RoyalPay - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - RoyalPay -

    To Be The Best QRCode Payment Service Provider!

    -
    -
    - - -
    -
    - - -
    -
    -
    -
    - - Copyright © 2015-2019 RoyalPay. All rights - reserved. -
    -
    - - - diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html deleted file mode 100644 index 6a35011b2..000000000 --- a/src/main/ui/merchant_application.html +++ /dev/null @@ -1,959 +0,0 @@ - - - - - - - RoyalPay | Merchant Application - - - - - - - - - - - - - - - - - - Partner Register - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    - - - - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - - - - -
    -
    -
    - -
    - -
    -
    -
    -
    - - Account Information -
    -
    - - Company Information -
    -
    - - Bank Account -
    -
    - - Submit Materials -
    -
    - - Success -
    -
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    -

    The mailbox is incorrect

    -
    -
    - -
    -
    -
    - {{partner.nation_code}} - - -
    -
    - The phone number has already existed -
    -
    - phone number is also your login id -
    -
    -
    - -
    - -
    - -
    - -
    - 6 to 12 characters, case sensitive -
    -
    - -
    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -

    {{resError}}

    -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    - -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    - -
    - -
    - -
    -

    Required - Field

    -
    -
    - -
    -
    - -
    -
    Merchant Payment Scenario
    -
    -
    -
    - - -
    - -
    - -
    - -
    -

    Required - Field

    -

    Less - Than 200 - Characters(including symbols and spaces)

    -
    -
    -
    - -
    - -
    -
    1:  - -
    - - - - -
    -
    -
    2:  - -
    - - - - -
    -
    - -
    -
    -
    - -
    -
    - -
    -

    {{resError}}

    -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    - -
    - -
    - -
    -
    - - -
    -
    -
    -
    -

      Bank: bank{{bankaccount.bank}}

    -
    -
    -

      City: {{bankaccount.city}}

    -
    -
    -

      Address:  {{bankaccount.address}}

    -
    -
    -

      system:  {{bankaccount.system}}

    -
    -
    -

      postcode:  {{bankaccount.postcode}}

    -
    -
    -

      state:  {{bankaccount.state}}

    -
    -
    -

      branch:  {{bankaccount.branch}}

    -
    -
    -
    -
    - -
    -

    {{resError}}

    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -

      WeChat Rate Value:  {{rate.wechat_rate_value}}%

    -
    -
    -

      Alipay Rate Value(Retail):  {{rate.alipay_rate_value}}%

    -
    - -
    -

      Alipay Rate Value(Online):  {{rate.alipayonline_rate_value}}%

    -
    -
    -

      CB Bankpay Rate Value:  {{rate.cb_bankpay_rate_value}}%

    -
    -
    - - - -
    -
    - - -
    -

    {{resError}}

    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    Congratulations, -
    your RoyalPay account has been registered successfully.
    -
    -
    -
    -
    -
    Notice:
    -

    1. As soon as you create a RoyalPay account, you can use all of RoyalPay's features, including accepting payments from customers.
    - RoyalPay账号注册成功后,您就可以使用RoyalPay所有的功能,包括接受客户的付款。 -

    -

    2. Please use your account ({{partner.contact_phone}}) and password to log on the website https://mpay.royalpay.com.au/.
    - 请使用您的账户({{partner.contact_phone}})和密码来登录这个网址https://mpay.royalpay.com.au/。 -

    -

    3. Before you activate your account, RoyalPay will not execute settlement.Therefore, it is recommended that you submit your compliance materials as soon as possible.
    - 在您激活账号之前,RoyalPay将不执行清算操作。因此,请您尽快提交合规材料。 -

    -

    4. If you have any questions, you can contact our customer service.
    - 若有任何疑问,请联系我们客服。 -

    -

    - 查看合同 -

    -
    -
    -
    - -
    -

    {{resError}}

    -
    -
    -
    -
    -
    -
    - -
    - - -
    - -
    -
    - - -
    -
    - - diff --git a/src/main/ui/one_locations.html b/src/main/ui/one_locations.html deleted file mode 100644 index 8ffdce2f6..000000000 --- a/src/main/ui/one_locations.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - Merchant Locations - - - - - - - -
    - - - - - - - \ No newline at end of file diff --git a/src/main/ui/partner_register.html b/src/main/ui/partner_register.html deleted file mode 100644 index 740f391de..000000000 --- a/src/main/ui/partner_register.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - - - RoyalPay | Partner Application - - - - - - - - - - - - - - - Partner Register - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - -
    - -
    -
    - - - -
    - -
    - - Required Field -
    - -
    - - Required Field -
    - -
    - - Required Field -
    - - - - - - - - - - - - - - - - - - -
    - - Required Field -
    - - - - - - - - - - - - - - - - - - - - - -
    - - Required Field -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - Required Field -
    -
    -
    - - -
    -

    Required Field

    -
    -
    - -
    - -
    -

    {{resError}}

    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    -
    - - diff --git a/src/main/ui/partner_register_success.html b/src/main/ui/partner_register_success.html deleted file mode 100644 index 103aa1fbf..000000000 --- a/src/main/ui/partner_register_success.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - RoyalPay | Partner Application - - - - - - - - Partner Register | Success - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - - - - -
    - -

    We have received your wechat payment application, our staff will contact with you soon,

    -

    please keep your phone online.

    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    - - diff --git a/src/main/ui/rdjRRcCkVr.txt b/src/main/ui/rdjRRcCkVr.txt deleted file mode 100644 index d6b1ed6af..000000000 --- a/src/main/ui/rdjRRcCkVr.txt +++ /dev/null @@ -1 +0,0 @@ -89e1f60e5d01470f00ae272d8af6b446 \ No newline at end of file diff --git a/src/main/ui/register.html b/src/main/ui/register.html deleted file mode 100644 index 0a6345dd5..000000000 --- a/src/main/ui/register.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - Geocoding service - - - - - - -
    - - -
    -
    - - - - \ No newline at end of file diff --git a/src/main/ui/risk_upload_success.html b/src/main/ui/risk_upload_success.html deleted file mode 100644 index 45a6ddaf3..000000000 --- a/src/main/ui/risk_upload_success.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - Risk Materials | Success - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - - - - -
    - -

    We have received your materials, our risk manager will review soon,

    -

    please wait for result.

    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    - - diff --git a/src/main/ui/rp.html b/src/main/ui/rp.html deleted file mode 100644 index cf5fa6812..000000000 --- a/src/main/ui/rp.html +++ /dev/null @@ -1,1153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - RoyalPay In World - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    -
    -
    - -
    -
    - - diff --git a/src/main/ui/search_locations.html b/src/main/ui/search_locations.html deleted file mode 100644 index f1263731a..000000000 --- a/src/main/ui/search_locations.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Merchant Locations - - - - - - - -
    - - - - - - - \ No newline at end of file diff --git a/src/main/ui/service_client.html b/src/main/ui/service_client.html deleted file mode 100644 index 4ff9bfcd6..000000000 --- a/src/main/ui/service_client.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/main/ui/service_client_app.html b/src/main/ui/service_client_app.html deleted file mode 100644 index e8cc439f6..000000000 --- a/src/main/ui/service_client_app.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - -
    - -
    - - \ No newline at end of file diff --git a/src/main/ui/service_client_app_outside.html b/src/main/ui/service_client_app_outside.html deleted file mode 100644 index 2eef92363..000000000 --- a/src/main/ui/service_client_app_outside.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/ui/service_contact_list.html b/src/main/ui/service_contact_list.html deleted file mode 100644 index c853ca00e..000000000 --- a/src/main/ui/service_contact_list.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - -
    -
      -
    -
    - - \ No newline at end of file diff --git a/src/main/ui/service_contact_list_app.html b/src/main/ui/service_contact_list_app.html deleted file mode 100644 index 998e0ef0a..000000000 --- a/src/main/ui/service_contact_list_app.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - -
    -
      -
    -
    - - \ No newline at end of file diff --git a/src/main/ui/service_customer.html b/src/main/ui/service_customer.html deleted file mode 100644 index d557dbecd..000000000 --- a/src/main/ui/service_customer.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/ui/sign_test.html b/src/main/ui/sign_test.html deleted file mode 100644 index f0c45d6bf..000000000 --- a/src/main/ui/sign_test.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Gateway Sign Test - - - - - -
    -
    -
    -

    Sign Test Page

    -
    -
    -
    -
    - - -

    Required!

    -
    -
    - - -

    Required!

    -
    -
    - - -

    Required!

    -
    -
    - - -

    Required!

    -
    -
    - -
    -
    -
    -
    -
    - -

    -
    -
    - -

    -
    -
    - -

    -
    -
    - -

    -
    - -
    -
    -
    - - \ No newline at end of file diff --git a/src/main/ui/static/actapp/app_act_list.js b/src/main/ui/static/actapp/app_act_list.js deleted file mode 100644 index 126563019..000000000 --- a/src/main/ui/static/actapp/app_act_list.js +++ /dev/null @@ -1,103 +0,0 @@ -define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular) { - 'use strict'; - var app = angular.module('appAct', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']); - app.config(['$stateProvider', function ($stateProvider) { - $stateProvider.state('appAct', { - url: '/appAct/list', - templateUrl: '/static/actapp/templates/act_app_list.html', - controller: 'appActListCtrl' - }).state('appAct.new', { - url: '/appAct/new', - templateUrl: '/static/actapp/templates/act_app_detail.html', - controller: 'appActNewCtrl' - }).state('appAct.detail', { - url: '/{act_id}/detail', - templateUrl: '/static/actapp/templates/act_app_detail.html', - controller: 'appActDetailCtrl', - resolve: { - actDetail: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/manager/app/act/'+ $stateParams.act_id+'/act_detail'); - }] - } - }) - }]); - app.controller('appActListCtrl', ['$scope', '$state', '$http','commonDialog','$filter', function ($scope, $state, $http,commonDialog,$filter) { - $scope.pagination = {}; - $scope.params = {}; - $scope.loadActAppList = function (page) { - var params = angular.copy($scope.params); - params.page = page || $scope.pagination.page || 1; - $http.get('/manager/app/act/list', {params: params}).then(function (resp) { - $scope.app_acts = resp.data.data; - $scope.pagination = resp.data.pagination; - }); - }; - $scope.publishedOrIsValid = function (act) { - $scope.act = {}; - $scope.act.act_id = act.act_id; - $scope.act.is_valid = !act.is_valid; - $http.put('/manager/app/act/published/'+$scope.act.act_id, $scope.act.is_valid).then(function (resp) { - commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'}); - $scope.loadActAppList(1); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }; - $scope.loadActAppList(1); - - }]); - app.controller('appActNewCtrl', ['$rootScope', '$scope', '$http', 'commonDialog','$state','$filter', function ($rootScope, $scope, $http, commonDialog,$state,$filter) { - $scope.actDetail = {}; - $scope.ctrl = {dateInput: false}; - $scope.submit = function (form) { - $scope.errmsg = null; - if (form.$invalid) { - angular.forEach(form, function (item, key) { - if (key.indexOf('$') < 0) { - item.$dirty = true; - } - }); - return; - } - if ($scope.actDetail.active_date) { - $scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd'); - } - if ($scope.actDetail.expire_date) { - $scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd'); - } - $http.put('/manager/app/act', $scope.actDetail).then(function (resp) { - commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'}); - $state.go('^.detail',{act_id:resp.data.act_id},{reload:true}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - } - }]); - app.controller('appActDetailCtrl', ['$rootScope', '$scope', '$http', 'commonDialog', 'actDetail','$state','$filter', function ($rootScope, $scope, $http, commonDialog,actDetail,$state,$filter) { - $scope.actDetail = actDetail.data; - $scope.ctrl = {dateInput: false}; - $scope.actDetail.active_date = new Date($scope.actDetail.active_date); - $scope.actDetail.expire_date = new Date($scope.actDetail.expire_date); - if($scope.actDetail.msg_start_date){ - $scope.actDetail.msg_start_date = new Date($scope.actDetail.msg_start_date); - } - if($scope.actDetail.msg_end_date){ - $scope.actDetail.msg_end_date = new Date($scope.actDetail.msg_end_date); - } - $scope.submit = function () { - if ($scope.actDetail.active_date) { - $scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd'); - } - if ($scope.actDetail.expire_date) { - $scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd'); - } - $http.put('/manager/app/act/' + $scope.actDetail.act_id, $scope.actDetail).then(function (resp) { - commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'}); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - } - }]); - return app; -}); diff --git a/src/main/ui/static/actapp/templates/act_app_detail.html b/src/main/ui/static/actapp/templates/act_app_detail.html deleted file mode 100644 index b9ed670c9..000000000 --- a/src/main/ui/static/actapp/templates/act_app_detail.html +++ /dev/null @@ -1,117 +0,0 @@ -
    -
    -

    APP_ACTIVITY

    - -
    -
    -
    -
    -
    -
    -
    - Edit Article -
    -
    -
    -
    -
    - -
    - -
    -

    Title is required

    -
    -
    -
    -
    -
    - -
    -
    - -
    -

    Active Date is required

    -
    -
    - ~ -
    - -
    -

    Expire Date is required

    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/bd_sale_analysis.html b/src/main/ui/static/analysis/templates/bd_sale_analysis.html deleted file mode 100644 index 7fac5442d..000000000 --- a/src/main/ui/static/analysis/templates/bd_sale_analysis.html +++ /dev/null @@ -1,236 +0,0 @@ - -
    -

    BD Sale

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - -
    - Today -
    -
    - Yesterday -
    - - - -
    - This Year -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -

    BD Sales

    - - Export - - -
    -
    -
    -
    -

    BD销售数据统计

    -
    -
    -
    -

    BD销售数据统计

    - - - - - - - - - - - - - - - - - - - -
    RankingBDAUD AmountRefund FeeNew Merchants
    - - 0 -
    -
    -
    -
    -
    -
    -

    {{chooseBdName}} 商户类别分布

    -
    -
    -
    -

    {{chooseBdName}} 商户类别交易量分布

    -
    -
    -
    -
    - -

    {{chooseBdName}} 商户销售排行

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    RankingPartnerAUD AmountRankingPartner AUD Amount
    - - {{sale[0].short_name}} - - - - {{sale[1].short_name}} - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/bd_upload_material.html b/src/main/ui/static/analysis/templates/bd_upload_material.html deleted file mode 100644 index 00983f23b..000000000 --- a/src/main/ui/static/analysis/templates/bd_upload_material.html +++ /dev/null @@ -1,203 +0,0 @@ -
    - - -
    -
    -
    -
    -
    -

    - 1、物流公司发货单据照片 - 要求:每笔交易对应的物流单必须提供,且单据必须清晰可见
    - Photos of logistics companies’ goods-delivery documents - Requirement: The logistics order record corresponding to each transaction must be provided, - and details of records should be clearly visible. -

    -

    - 1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;
    - Please explain the relative payment scenario/business activities, - for example, online store, QR code payment, payment at the store, etc; -

    -
    -
    -
    - -
    -   
    -
    - {{file1Progress.value}}% - -
    -
    -
    -
    -
    -

    - 2、用户购买虚拟物品需要提供聊天记录、订单信息、发货凭证截图、 - 虚拟物品最终消费场景(例如何种游戏、软件)、提供消费场景网址/下载链接 - 要求:每笔交易对应的截图必须清晰可见
    - Users need to provide chat records, order information, screenshots of delivery documents, - final consumption scenarios of virtual goods (such as games, software); - provide consumer scene URL / download link. - Requirement: The screenshot corresponding to each transaction must be clearly visible. -

    -

    - 2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);
    - Provide related shopping lists, invoices. - (Please provide the invoices, amount of which matches that of the abnormal transaction); -

    -
    -
    -
    - -
    -   
    -
    - {{file2Progress.value}}% - -
    -
    - -
    -
    -
    -

    - 3、购物小票/发票存根照片 - 照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称 - 购物金额等
    - Photos of shopping receipts/ invoice stubs - Requirement: The photos should be clear and must show Merchant name, - Business address, Transaction time, Product information, Quantity purchased, etc. -

    -

    - 3.提供相应的发货证明,报关单(若有消费者在国内购买,请提供物流单据或报关单);
    - Relative proof of delivery, customs declaration - (If the consumer purchased from China, please provide shipping receipt or customs declaration); -

    -
    -
    -
    - -
    -   
    -
    - {{file3Progress.value}}% - -
    -
    -
    -
    -
    -

    - 4、显示商户门牌号码和店头名称的照片 - 要求:清晰可见,至少一张
    - Photos of Merchant Street number & Merchant name - Requirement: At least one visible photo -

    -

    - 4.提供您的门店照片(门店照及店铺内的照片各一张, 一张可以看到商户名的门头照,一张可以看到相关商品或服务的店内照片);
    - Photos of the store ( one of each front-store and in-store); -

    -
    -
    -
    - -
    -   
    -
    - {{file4Progress.value}}% - -
    -
    - -
    -
    -
    -

    - 5、显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片 - 要求:照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张
    - Photos of internal environment of merchant business - (such as in-store merchandise display, checkout counter, etc.) - Requirements: The photos (at least three) - showing merchant activities including actual selling-goods or services obviously -

    -

    - 5.其他可以还原交易背景的资料,如和消费者的聊天记录等,来佐证被查单号交易的真实性;
    - Other materials that can verify the payment scenario, for example, - chatting history, to prove the truth of the transactions; -

    -
    -
    -
    - -
    -   
    -
    - {{file5Progress.value}}% - -
    -
    - -
    -
    -
    -

    6、其他图片
    - Other pictures -

    -
    -
    -
    - -
    -   
    -
    - {{file6Progress.value}}% - -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    - Submit -
    - -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/cbbank_channel_trans_analysis.html b/src/main/ui/static/analysis/templates/cbbank_channel_trans_analysis.html deleted file mode 100644 index f387ddcea..000000000 --- a/src/main/ui/static/analysis/templates/cbbank_channel_trans_analysis.html +++ /dev/null @@ -1,221 +0,0 @@ - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - - -
    - Yesterday -
    - - - -
    - This Year -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    CBBank 各平台交易总额 -
    - - - -
    -
    -
    -
    -
    -
    -
    Bestpay
    -
    -
    - -
    - -
    -
    -
    -
    -
    JD Pay
    -
    -
    - -
    - -
    -
    -
    -
    -
    HF Pay
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    RPay+
    -
    -
    - -
    -
    -
    -
    -
    -
    Yeepay
    -
    -
    - -
    -
    -
    -
    -
    -
    LakalaPay
    -
    -
    - -
    -
    -
    -
    -
    -
    Card Payment
    -
    -
    - -
    -
    -
    -
    -
    -
    Direct Debit
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    CBBank Channel logs
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    Channel Name交易商户数付款金额退款金额净交易额总手续费成本手续费平台手续费
    -
    -
    -
    -
    -
    -
    -
    diff --git a/src/main/ui/static/analysis/templates/channels_analysis.html b/src/main/ui/static/analysis/templates/channels_analysis.html deleted file mode 100644 index 021044d45..000000000 --- a/src/main/ui/static/analysis/templates/channels_analysis.html +++ /dev/null @@ -1,192 +0,0 @@ - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - -
    - Today -
    -
    - Yesterday -
    - - - - - - - Alipay数据导出 - -
    -
    -
    - - - - - - - - - - - -
    - -
    -

    - - - |  - All - -

    -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    交易分布
    -
    - -
    -
    -
    -
    -

    交易分布

    -
    -
    -
    -
    -
    -

    交易列表

    - - - - - - - - - - - - - - - - - - - - - -
    ChannelsTotal Amount (AUD)Total ordersTransaction PartnersEnable Partners
    Alipay+Alipay+(Online)
    -
    -
    -
    -
    - -
    -
    -
    -
    交易总金额变化趋势
    -
    -
    -
    -
    -
    -
    订单数变化趋势
    -
    -
    -
    -
    -
    -
    客单价变化趋势
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/cheat_monitor_risk.html b/src/main/ui/static/analysis/templates/cheat_monitor_risk.html deleted file mode 100644 index 5a450f844..000000000 --- a/src/main/ui/static/analysis/templates/cheat_monitor_risk.html +++ /dev/null @@ -1,366 +0,0 @@ - -
    -

    Risk Records

    - -
    -
    -
    -
    -
    -
    -
    通用支付限额
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    微信支付限额
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    支付宝支付限额
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    用户关单率检测 检测用户当日订单
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    商户刷单监测 (监测十小时内订单,触发监控,将发送告警消息于开发者
    -
    -
    - -
    -
    - -
    - ~ -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    商户关单率预警 (检测当日订单,触发预警,将发送告警消息于开发者,商户所属BD
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    商户退款预警 (触发预警,将发送告警消息于开发者
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    - - - - diff --git a/src/main/ui/static/analysis/templates/cheat_risk.html b/src/main/ui/static/analysis/templates/cheat_risk.html deleted file mode 100644 index 65bd1acf3..000000000 --- a/src/main/ui/static/analysis/templates/cheat_risk.html +++ /dev/null @@ -1,109 +0,0 @@ -
    -

    Risk Monitor

    - -
    -
    -
    -
    -
    -
    - -
    - ~ -
    - -
    - - - -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    PartnerCustomer idAmountTypeType DescribeBDTime
    - {{log.short_name}}({{log.client_moniker}}) - {{log.customer_id}}{{log.amount}}{{log.type}}{{log.type|risk_type_filter}}{{log.bd_user_name}}{{log.create_time}}
    - -
    -
    -
    - - -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/clearing_logs.html b/src/main/ui/static/analysis/templates/clearing_logs.html deleted file mode 100644 index 9bb940b3d..000000000 --- a/src/main/ui/static/analysis/templates/clearing_logs.html +++ /dev/null @@ -1,33 +0,0 @@ - -
    -
    -

    Settlement logs

    - -
    -
    -
    -
    Settlement Dates
    -
    -
    - - - -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/client_active_rate_view.html b/src/main/ui/static/analysis/templates/client_active_rate_view.html deleted file mode 100644 index 7f4e75285..000000000 --- a/src/main/ui/static/analysis/templates/client_active_rate_view.html +++ /dev/null @@ -1,27 +0,0 @@ -
    -
    -
    - - - -
    -
    -
    -
    - - - -
    -
    -
    -

    -

    -

    -

    -

    -

    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/client_rate_review_detail_dialog.html b/src/main/ui/static/analysis/templates/client_rate_review_detail_dialog.html deleted file mode 100644 index 8f058362d..000000000 --- a/src/main/ui/static/analysis/templates/client_rate_review_detail_dialog.html +++ /dev/null @@ -1,22 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/client_rate_review_dialog.html b/src/main/ui/static/analysis/templates/client_rate_review_dialog.html deleted file mode 100644 index 6fabd2a9e..000000000 --- a/src/main/ui/static/analysis/templates/client_rate_review_dialog.html +++ /dev/null @@ -1,23 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/client_rates.html b/src/main/ui/static/analysis/templates/client_rates.html deleted file mode 100644 index 412b2d5bd..000000000 --- a/src/main/ui/static/analysis/templates/client_rates.html +++ /dev/null @@ -1,77 +0,0 @@ -
    -

    Partner Active Rate

    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - ~ -
    - - - -
    -
    -
    -
    - - -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/client_rates_analysis.html b/src/main/ui/static/analysis/templates/client_rates_analysis.html deleted file mode 100644 index b09737024..000000000 --- a/src/main/ui/static/analysis/templates/client_rates_analysis.html +++ /dev/null @@ -1,71 +0,0 @@ -
    -
    Analysis
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    - -
    - -
    %
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/client_rates_analysis_bd_view.html b/src/main/ui/static/analysis/templates/client_rates_analysis_bd_view.html deleted file mode 100644 index 18225ac99..000000000 --- a/src/main/ui/static/analysis/templates/client_rates_analysis_bd_view.html +++ /dev/null @@ -1,73 +0,0 @@ -
    -
    Analysis
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    - -
    - -
    %
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    - -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/customer_analysis.html b/src/main/ui/static/analysis/templates/customer_analysis.html deleted file mode 100644 index e291bb9e4..000000000 --- a/src/main/ui/static/analysis/templates/customer_analysis.html +++ /dev/null @@ -1,337 +0,0 @@ - -
    -

    Customer Transaction Analysis

    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - -
    - Today -
    -
    - Yesterday -
    - - - -
    - This Year -
    -
    -
    - -
    -
    - -
    - - -
    -
    -

    Customer List

    - Total Amount:{{customers_analysis.total_amount}} - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    Nick NameCustomer openIdAmount(AUD) - - Orders - - Max Order(AUD)
    - - - {{customer.nickname}} - - - - {{customer.nickname}} - - - - {{customer.nickname}} - - - - {{customer.nickname}} -
    -
    - - -
    -
    -
    -

    用户画像

    -
    -
    -
    -
    - - -

    {{one_customer.nickname}}

    - -

    性别:女

    -

    性别:男

    -

    性别:未知

    - - -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    Order IDPartnerPay AmountPay TimeStatusOperation
    - - - - - - - - - - - {{order.order_id}} - {{order.short_name}}( - ) - - - - - - -
    -
    - - -
    -
    -
    -
    diff --git a/src/main/ui/static/analysis/templates/dialog_customized_settle.html b/src/main/ui/static/analysis/templates/dialog_customized_settle.html deleted file mode 100644 index 4b2dda267..000000000 --- a/src/main/ui/static/analysis/templates/dialog_customized_settle.html +++ /dev/null @@ -1,29 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/dialog_holiday_config.html b/src/main/ui/static/analysis/templates/dialog_holiday_config.html deleted file mode 100644 index 991e03d13..000000000 --- a/src/main/ui/static/analysis/templates/dialog_holiday_config.html +++ /dev/null @@ -1,43 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/holiday_directive.html b/src/main/ui/static/analysis/templates/holiday_directive.html deleted file mode 100644 index 9216ad4f4..000000000 --- a/src/main/ui/static/analysis/templates/holiday_directive.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    -
    - -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/manage_customers_orders.html b/src/main/ui/static/analysis/templates/manage_customers_orders.html deleted file mode 100644 index db3d77c35..000000000 --- a/src/main/ui/static/analysis/templates/manage_customers_orders.html +++ /dev/null @@ -1,155 +0,0 @@ -Ye -
    -

    Customers Analysis

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - - - - - - - - - - - - -
    - This Year -
    - -
    -
    - -
    -

    - All | - Wechat Pay | - Alipay | - AlipayOnline | - Alipay+ | - Alipay+(Online) | - - - RPay + | - - Card Payment - -

    -
    -
    - - - - - - - - - - -
    - -
    -

    - - - |  - All - -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    Trading customer quantity trends
    -
    -
    -
    -
    - - -
    -
    Per customer transaction trends
    -
    -
    -
    -
    -
    -
    -
    -
    diff --git a/src/main/ui/static/analysis/templates/merchant_amount_analysis.html b/src/main/ui/static/analysis/templates/merchant_amount_analysis.html deleted file mode 100644 index 0535d2d78..000000000 --- a/src/main/ui/static/analysis/templates/merchant_amount_analysis.html +++ /dev/null @@ -1,210 +0,0 @@ - -
    -

    Transaction Amount Analysis

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - -
    -
    -
    - -
    - ~ -
    - -
    - -
    - Today -
    -
    - Yesterday -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    List of Client

    - Excel -
    -
    - - - - - - - - - - - - - - - - - - - -
    Partner CodeShort nameBd nameStateAmount
    -
    - -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/new_riskEvent.html b/src/main/ui/static/analysis/templates/new_riskEvent.html deleted file mode 100644 index 75d7172a2..000000000 --- a/src/main/ui/static/analysis/templates/new_riskEvent.html +++ /dev/null @@ -1,366 +0,0 @@ -
    -

    New RiskEvent

    -
    - -
    -
    -
    -
    -
    -
    RiskEvent Basic Information
    -
    -
    -
    - -
    - -
    -

    required field -

    -
    -
    -
    -
    - -
    - -
    -

    required field -

    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -

    required field -

    -
    -
    -
    - -
    - -
    - -
    -

    required field -

    -
    -
    -
    - -
    - -
    - - -
    -

    required field -

    -
    -
    -
    - -
    - -
    - -
    -

    Required Field -

    -

    Less Than 6 Letters -

    -

    - Only Uppercase Letters and Numbers are allowed -

    -
    -
    -
    - -
    - -
    - -
    -

    required field -

    -
    -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    MerchantOrder IDChannelChannel Order IDAmountTransaction TimeOperation
    - -
    -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - - -
    - -
    -
    - - -
    -
    - -
    - -
    - -
    -

    required field -

    -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    - - cancel - -
    -
    -
    diff --git a/src/main/ui/static/analysis/templates/org_sale_analysis.html b/src/main/ui/static/analysis/templates/org_sale_analysis.html deleted file mode 100644 index f85c3c73b..000000000 --- a/src/main/ui/static/analysis/templates/org_sale_analysis.html +++ /dev/null @@ -1,208 +0,0 @@ - -
    -

    - City Partner Sale -

    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - -
    - Today -
    -
    - Yesterday -
    - - - -
    - - -
    - -
    - -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    交易分布
    -
    -
    -
    - - - - -
    -

    各组织机构交易量分布($)

    -
    -
    -
    - - - - - - - - - - - - - -
    OrganizationAmount ($)
    - -
    -
    -
    -

    {{chooseOrg}} 合伙人商户交易量排名

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    RankingPartnerAUD AmountRankingPartnerAmount
    - - {{sale[0].client_moniker}} - - - - {{sale[1].client_moniker}} - -
    - -
    - -
    -
    -
    - -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/partner_card.html b/src/main/ui/static/analysis/templates/partner_card.html deleted file mode 100644 index eb3c5d342..000000000 --- a/src/main/ui/static/analysis/templates/partner_card.html +++ /dev/null @@ -1,391 +0,0 @@ - -
    -
    -

    - Partner Dashboard — {{basicinfo.short_name}} -

    - -
    -
    -
    -
    - - - -
    -
    -
    - -
    -
    - Partner Code - -

    - {{basicinfo.client_moniker}} -

    - -
    - - Company Name - -

    {{basicinfo.company_name}}

    - -
    - - Tag - -

    - 自主申请 - BD签约 - 主管分配 - {{basicinfo.sector}} - {{basicinfo.industry|partner_industry}} - T+{{basicinfo.clean_days}} -

    - {{basicinfo.rate_value.wechat_rate_value}}%   - {{basicinfo.rate_value.ali_rate_value}}%   - {{basicinfo.rate_value.best_rate_value}}% -
    -

    -
    - - -
    - BD - -

    - {{basicinfo.bd_user_name}} -

    - -
    - - Location - -

    {{basicinfo.address}} {{basicinfo.suburb}}

    - -
    - - Conditions - -

    - Approve Time :{{basicinfo.approve_time|limitTo:10}} - First Transaction Time :{{basicinfo.transaction_time}} -

    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - Trading Volume - -
    -
    -
    -
    -
    - -
    - Transactions - -
    -
    -
    -
    -
    - -
    - Refund Amount - -
    -
    -
    -
    -
    - -
    - UNSETTLED - - -
    -
    -
    -
    -
    -
    -
    -
    -

    Trading History

    - - - - - - -
    - -
    -
    -
    -

    - -

    -
    - -
    - -
    -

    - 交易类型分布-交易量 -

    -
    -
    - -
    - -
    - - - -
    - -
    - -
    -
    - -
    - -
    -
    -

    Customers Analysis

    - - - - - - -
    - -
    -
    -
    -
    - -
    - -
    - -
    - - -
    - -
    - - -
    - Avg Old Customers (Day) - {{avgOrderAndCustomer.old_customers.toFixed(0)||0}} - -
    -
    -
    - - {{(avgOrderAndCustomer.old_customers/avgOrderAndCustomer.customers*100).toFixed(2)}}% - -
    - -
    - -
    - - -
    - Avg New Customers (Day) - {{avgOrderAndCustomer.new_customers.toFixed(0)||0}} - -
    -
    -
    - - {{(avgOrderAndCustomer.new_customers/avgOrderAndCustomer.customers*100).toFixed(2)}}% - -
    - -
    - - -
    -
    -
    -
    -
    -

    Transaction Time Analysis

    - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Clearing Logs

    - -
    -
    - - - - - - - - - - - - - - - - - - - - -
    DateTransaction Amountto MerchantService FeeOperation
    - - - -
    - -
    - - - -
    -
    -
    -
    -
    -

    Login Logs

    -
    -
    - - - - - - - - - - - - - - - - - - - -
    TimeClientUserIPMethod
    -
    - - -
    - -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/partner_customers_orders.html b/src/main/ui/static/analysis/templates/partner_customers_orders.html deleted file mode 100644 index 4dd6c3249..000000000 --- a/src/main/ui/static/analysis/templates/partner_customers_orders.html +++ /dev/null @@ -1,140 +0,0 @@ - -
    -

    Customers Analysis

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - - - - - - - - - - - - -
    - This Year -
    -
    - - -
    - -
    -
    - -
    -

    - All | - Wechat Pay | - Alipay | - AlipayOnline | - Alipay+ | - Alipay+(Online) | - RPay + | - - Card Payment - -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    Trading customer quantity trends
    -
    -
    -
    -
    -
    -
    Per customer transaction trends
    -
    -
    -
    -
    - - - - - - - -
    -
    -
    -
    diff --git a/src/main/ui/static/analysis/templates/partner_trans_analysis.html b/src/main/ui/static/analysis/templates/partner_trans_analysis.html deleted file mode 100644 index 718eb47c1..000000000 --- a/src/main/ui/static/analysis/templates/partner_trans_analysis.html +++ /dev/null @@ -1,138 +0,0 @@ - -
    -

    Transaction Analysis

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - - - - - - - - - - - - -
    - This Year -
    -
    - - -
    - -
    -
    - -
    -

    - All | - Wechat Pay | - Alipay | - AlipayOnline | - Alipay+ | - Alipay+(Online) | - - Card Payment - -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    Trading amount trends
    -
    -
    -
    -
    -
    -
    Trading order quantity trends
    -
    -
    -
    -
    - - - - - - - -
    -
    -
    -
    diff --git a/src/main/ui/static/analysis/templates/partners_analysis.html b/src/main/ui/static/analysis/templates/partners_analysis.html deleted file mode 100644 index 5910ad56b..000000000 --- a/src/main/ui/static/analysis/templates/partners_analysis.html +++ /dev/null @@ -1,269 +0,0 @@ - -
    -
    -

    Merchant statistics

    - -
    -
    -
    -
    -
    - -
    - Waiting Compliance - {{analysis.wp}} - 其中自助开通:{{analysis.a_wp}} -
    -
    -
    -
    -
    - -
    - Pass - {{analysis.pass}} - 其中自助开通:{{analysis.z_pass+analysis.a_pass}} -
    -
    -
    -
    -
    - -
    - Temp SubMerchantID - -
    -
    -
    -
    -
    - -
    - 自助开通 - {{analysis.quick_pass}} - waiting compliance:{{analysis.a_wp}} -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - -
    - -
    -

    - - - |  - All - -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -

    各类型商家数量分布

    -
    -
    -
    -

    {{partners_type.partner_type}} 行业列表

    - - - - - - - - - - - - - -
    TypePartners
    -
    -
    -
    - -
    -
    -
    -
    -
    -

    商户清算周期分布

    -
    -
    -
    -
    -

    - - - -

    -

    -

    清算周期列表

    -
    - - - - - - - - - - - - - -
    Clean DaysPartners
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - - - - - - - - - - - - -
    - This Year -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    新增商户数量变化
    -
    -
    -
    -
    - -
    -
    交易商户数量变化
    -
    -
    -
    -
    - -
    -
    商户分布 - 商户数量:{{locations.length}} -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/pre_refund.html b/src/main/ui/static/analysis/templates/pre_refund.html deleted file mode 100644 index e480e3237..000000000 --- a/src/main/ui/static/analysis/templates/pre_refund.html +++ /dev/null @@ -1,35 +0,0 @@ -
    -

    商户欠款列表

    - -
    - -
    - -
    -
    - -
    -
    -
    - - - diff --git a/src/main/ui/static/analysis/templates/pre_refund_partners.html b/src/main/ui/static/analysis/templates/pre_refund_partners.html deleted file mode 100644 index e573471fe..000000000 --- a/src/main/ui/static/analysis/templates/pre_refund_partners.html +++ /dev/null @@ -1,50 +0,0 @@ -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    商户编码欠费金额(AUD)最后交易时间
    -
    - -
    -
    -
    -
    -
    -
    -
    - diff --git a/src/main/ui/static/analysis/templates/refund_analysis.html b/src/main/ui/static/analysis/templates/refund_analysis.html deleted file mode 100644 index 572b1b0be..000000000 --- a/src/main/ui/static/analysis/templates/refund_analysis.html +++ /dev/null @@ -1,188 +0,0 @@ - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - ~ -
    - -
    - -
    - Today -
    -
    - Yesterday -
    - - - -
    - This Year -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    退款额变化趋势 -
    -
    -
    -
    - -
    -
    -
    {{refundTotal.startDate}} ~ - {{refundTotal.endDate}}退款笔数排行(前20名) -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - -
    RankingPartner - Refund Amount - - - - - Refund Counts - - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html deleted file mode 100644 index 2281b51dd..000000000 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ /dev/null @@ -1,722 +0,0 @@ -
    -
    -
    - -
    - - -
    - -
    -
    -
    - -
    -
    -
    -
    -