add file
@@ -0,0 +1,39 @@
|
||||
package cn.pluss.platform;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.retry.annotation.EnableRetry;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import org.springframework.web.context.request.RequestContextListener;
|
||||
|
||||
|
||||
@MapperScan("cn.pluss.platform.mapper")
|
||||
@SpringBootApplication(scanBasePackages = "cn.pluss.platform")
|
||||
@EnableRetry
|
||||
@EnableAsync
|
||||
public class WapApplication extends SpringBootServletInitializer{
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WapApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(WapApplication.class, args);
|
||||
logger.info("WapApplication Service Start Success");
|
||||
}
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
return builder.sources(WapApplication.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RequestContextListener requestContextListenerBean() {
|
||||
return new RequestContextListener();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.pluss.platform.controller.component;
|
||||
|
||||
import cn.pluss.platform.entity.MerchantOrder;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
import cn.pluss.platform.merchantProfit.MerchantProfitService;
|
||||
import cn.pluss.platform.realFans.RealFansService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
|
||||
@RabbitListener(queues = "payCallback")
|
||||
public class PayCallbackConsumer {
|
||||
|
||||
@Resource
|
||||
private MerchantProfitService merchantProfitService;
|
||||
|
||||
@Resource
|
||||
private MerchantOrderService merchantOrderService;
|
||||
|
||||
@Resource
|
||||
private RealFansService realFansService;
|
||||
|
||||
@RabbitHandler
|
||||
public void process(String msg) {
|
||||
log.info("接受到的消息内容为:{}", msg);
|
||||
MerchantOrder order = JSON.parseObject(msg, MerchantOrder.class);
|
||||
if(!"1".equals(order.getStatus())){
|
||||
return;
|
||||
}
|
||||
if(!"1".equals(order.getOrderType())){
|
||||
realFansService.createFansProfit(order);
|
||||
}
|
||||
merchantProfitService.createOrderProfitV2(order,"1");
|
||||
MerchantOrder update = new MerchantOrder();
|
||||
update.setId(order.getId());
|
||||
update.setProfitShareMoney(order.getProfitShareMoney());
|
||||
update.setFansShareMoney(order.getFansShareMoney());
|
||||
merchantOrderService.updateById(update);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package cn.pluss.platform.controller.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import org.springframework.web.accept.ContentNegotiationManager;
|
||||
import org.springframework.web.servlet.View;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;
|
||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
|
||||
import org.thymeleaf.spring5.SpringTemplateEngine;
|
||||
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
|
||||
import org.thymeleaf.spring5.view.ThymeleafViewResolver;
|
||||
import org.thymeleaf.templatemode.TemplateMode;
|
||||
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;
|
||||
import org.thymeleaf.templateresolver.ITemplateResolver;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
/**
|
||||
* 主要配置多视图实现的视图解析器相关bean实例,将该视图解析器注册到容器中
|
||||
* <p>
|
||||
* <p>
|
||||
* 其实关键点在于两个:
|
||||
* 1、配置order属性
|
||||
* 2、配置viewnames属性
|
||||
**/
|
||||
@Configuration
|
||||
public class ViewResolverConfiguration{
|
||||
|
||||
|
||||
@Bean
|
||||
public ViewResolver contentNegotiatingViewResolver(ContentNegotiationManager manager) {
|
||||
ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver();
|
||||
resolver.setContentNegotiationManager(manager);
|
||||
List<ViewResolver> resolvers = new ArrayList<ViewResolver>();
|
||||
resolvers.add(jsonViewResolver());
|
||||
resolvers.add(jspViewResolver());
|
||||
resolvers.add(thymeleafViewResolver());
|
||||
resolver.setViewResolvers(resolvers);
|
||||
return resolver;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ViewResolver jsonViewResolver() {
|
||||
return new ViewResolver() {
|
||||
@Override
|
||||
public View resolveViewName(String viewName, Locale locale) throws Exception {
|
||||
MappingJackson2JsonView view = new MappingJackson2JsonView();
|
||||
view.setPrettyPrint(true);
|
||||
return view;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ViewResolver jspViewResolver() {
|
||||
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
|
||||
viewResolver.setPrefix("/WEB-INF/jsp/");
|
||||
viewResolver.setSuffix(".jsp");
|
||||
viewResolver.setContentType("text/html");
|
||||
viewResolver.setOrder(2);
|
||||
return viewResolver;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ViewResolver thymeleafViewResolver() {
|
||||
|
||||
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
|
||||
|
||||
viewResolver.setTemplateEngine(thymeleafTemplateEngine());
|
||||
viewResolver.setCharacterEncoding("UTF-8");
|
||||
viewResolver.setOrder(0);
|
||||
// Important!!
|
||||
// th_page1.html, th_page2.html, ...
|
||||
// 可以删除
|
||||
viewResolver.setViewNames(new String[] { "th_*","*/th_*"});
|
||||
|
||||
return viewResolver;
|
||||
}
|
||||
|
||||
// Thymeleaf template engine with Spring integration
|
||||
@Bean
|
||||
public SpringTemplateEngine thymeleafTemplateEngine() {
|
||||
|
||||
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
|
||||
templateEngine.setTemplateResolver(thymeleafTemplateResolver());
|
||||
templateEngine.setEnableSpringELCompiler(true);
|
||||
|
||||
return templateEngine;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SpringResourceTemplateResolver springResourceTemplateResolver() {
|
||||
return new SpringResourceTemplateResolver();
|
||||
}
|
||||
|
||||
// Thymeleaf template resolver serving HTML 5
|
||||
@Bean
|
||||
public ITemplateResolver thymeleafTemplateResolver() {
|
||||
|
||||
ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
|
||||
templateResolver.setPrefix("templates/");
|
||||
templateResolver.setCacheable(false);
|
||||
templateResolver.setSuffix(".html");
|
||||
templateResolver.setTemplateMode(TemplateMode.HTML);
|
||||
templateResolver.setCharacterEncoding("UTF-8");
|
||||
|
||||
return templateResolver;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.pluss.platform.controller.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import cn.pluss.platform.entity.MerchantMenber;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author yuchen
|
||||
*
|
||||
* @Description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AuthFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain arg2)
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest request=(HttpServletRequest) req;
|
||||
log.info("requestURI : {}", request.getRequestURI());
|
||||
log.info("requestMethod : {}", request.getMethod());
|
||||
log.info("requestParams : {}", request.getParameterMap());
|
||||
HttpServletResponse response= (HttpServletResponse) resp;
|
||||
MerchantMenber merchantMenber = (MerchantMenber) request.getSession().getAttribute("sessionMerchantMenber");
|
||||
String url = request.getRequestURI();
|
||||
if(merchantMenber==null) {
|
||||
if(!url.contains("CallBack")
|
||||
&& !url.contains("wechat")
|
||||
&& !url.contains("merchant")
|
||||
&& !url.contains("myVIPCard")
|
||||
&& !url.contains("resources")
|
||||
&& !url.contains("openCardSuccess")
|
||||
&& !url.contains("vipOpenCard")
|
||||
&& !url.contains("auth")
|
||||
&& !url.contains("jft")
|
||||
&& !url.contains("getMemberInfo")
|
||||
&& !url.contains("aliPay")
|
||||
&& !url.contains("test")
|
||||
&& !url.contains("life")
|
||||
&& !url.contains("getPhoneCode")
|
||||
&& !url.contains("api")
|
||||
&& !url.contains("user")
|
||||
&& !url.contains("activity")
|
||||
&& !url.contains("kaptcha")
|
||||
&& !url.contains("aliyun")) {
|
||||
request.getRequestDispatcher("/vip/myVIPCard").forward(req, resp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
arg2.doFilter(request, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.ali.AliPayNotifyService;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.deviceMerchantBuy.DeviceMerchantBuyService;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.pay.ApiPayService;
|
||||
import cn.pluss.platform.util.*;
|
||||
import cn.pluss.platform.wap.HttpUrlConnection;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.internal.util.AlipaySignature;
|
||||
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
|
||||
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
||||
import lombok.Setter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuchen
|
||||
*
|
||||
* @Description 授权应用获取token控制器
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("aliPay")
|
||||
public class AliPayController {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private AliPayNotifyService aliPayNotifyService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AliPayController.class);
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private DeviceMerchantBuyService deviceMerchantBuyService;
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*/
|
||||
final static Base64.Encoder encoder = Base64.getEncoder();
|
||||
|
||||
@Resource
|
||||
private ApiPayService apiPayService;
|
||||
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() throws UnsupportedEncodingException {
|
||||
String userId = request.getParameter("userId");
|
||||
if (userId == null) {
|
||||
return "aliPay/fail";
|
||||
}
|
||||
byte[] textByte = userId.getBytes("UTF-8");
|
||||
String returnUrl = ParametersUtil.ALI_RETURN_URL;
|
||||
userId = encoder.encodeToString(textByte);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("https://openauth.alipay.com/oauth2/appToAppBatchAuth.htm?");
|
||||
sb.append("app_id=" + ParametersUtil.ALI_APP_ID);
|
||||
sb.append("&application_type=WEBAPP,MOBILEAPP");
|
||||
sb.append("&redirect_uri=" + returnUrl);
|
||||
sb.append("&state=" + userId);
|
||||
request.setAttribute("returnUrl", sb);
|
||||
return "aliPay/aliPay";
|
||||
}
|
||||
|
||||
@GetMapping("/returnUrl")
|
||||
public String returnUrl(String orderNumber){
|
||||
request.setAttribute("orderNumber",orderNumber);
|
||||
request.setAttribute("appId",ParametersUtil.ZY_ALI_APP_ID);
|
||||
return "th_alipay";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* aliCallBack:(设备订单支付宝回调通知). <br/>
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*
|
||||
* @author Administrator
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping("/aliCallBack")
|
||||
public String aliCallBack(HttpServletRequest request) {
|
||||
Map<String, Object> srcParam = HttpUrlConnection.convertRequestParamsToMap(this.request);
|
||||
Map<String, String> params = new HashMap<>();
|
||||
|
||||
for (Map.Entry<String, Object> entry : srcParam.entrySet()) {
|
||||
params.put(entry.getKey(), (String) entry.getValue());
|
||||
}
|
||||
|
||||
try {
|
||||
boolean signVerified = AlipaySignature.rsaCheckV1(params, ParametersUtil.ZY_PUB, "UTF-8", "RSA2");
|
||||
if (signVerified) {
|
||||
String tradeStatus = params.get("trade_status");
|
||||
logger.info("=====tradeStatus=====" + tradeStatus);
|
||||
if ("TRADE_SUCCESS".equals(tradeStatus)) {
|
||||
String tradeNumber = params.get("trade_no");
|
||||
String orderNumber = params.get("out_trade_no");// 商家订单号
|
||||
String consumTime = params.get("gmt_payment");// 交易付款时间
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setOrderNo(orderNumber);
|
||||
deviceMerchantBuy = deviceMerchantBuyService.queryDeviceMerchantBuy(deviceMerchantBuy);
|
||||
if ("1".equals(deviceMerchantBuy.getStatus())) {
|
||||
return "success";
|
||||
}
|
||||
deviceMerchantBuy.setStatus("1");
|
||||
deviceMerchantBuy.setTransNo(tradeNumber);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
deviceMerchantBuy.setTransDt(sdf.parse(consumTime));
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(deviceMerchantBuy);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "failure";
|
||||
}
|
||||
return "failure";
|
||||
}
|
||||
|
||||
/**
|
||||
* aliCallBack:(设备订单支付宝回调通知). <br/>
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*
|
||||
* @author Administrator
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping("/aliCallBackV2")
|
||||
public String aliCallBackV2(HttpServletRequest request) {
|
||||
Map<String, Object> param = HttpUrlConnection.convertRequestParamsToMap(request);
|
||||
try {
|
||||
aliPayNotifyService.commonPayNotify(param);
|
||||
return "success";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "failure";
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/app/getAuthOpenId")
|
||||
@ResponseBody
|
||||
public Result<Object> getAuthOpenId(@RequestBody JSONObject params) {
|
||||
String authCode = params.getString("authCode");
|
||||
if(StringUtil.isEmpty(authCode)){
|
||||
return ResultGenerator.genFailResult("获取授权信息失败!");
|
||||
}
|
||||
String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEWqqQVjebxhtnuGC9yBUFnFJ7R4ZYKJ/110WYdww/N2YDQPmOqYLW5d4BSDtjZmYlMwG/QFO2NIf5tMz1vtN4/Px9PUIlEFYkdTNAr4kQeQ/cEpj+jymZZ1cpGnZnFBiGYuSsovGIe5CmeegYBMKreuTzjZP5tsGMH2UQ9bEsc4q2y74VGV8j0ealA5Z9fh9aIF+CSi0SfftGuc3n0SSDIWB/ZOFVEkcuVbO/qbIM+2xFkS2RbKKlDW88cdHr9cSPY9A4b8c9aiaHUHWHCHRCKMZsgY8ANGrvCRC4sgMaX96UKk+0Ioy5lI0lkdHr5Yal/NExyWRwTZEugIaSMWF5AgMBAAECggEAR61iWbCXhQEQrmcn3R+SYut5r9HYa730gwsGYb93HnU+Bd0WSbB7by4lwMQBhZ9bCiJJe+22aCKi0RSdOykRFaDMjHa0b6YdQLlH/GwT6pvlfuWDfbjCapWQmm3+WWyEq6K6/NNxwtxIRiAXFYrecken3k56KO5UezI1Za3pOYzB2kRaIoJ0/jqpQPUBhbdIQ8CkztHmXmWb57CmuvlKHjc5YlxGS+vRTdRY6ifSbwFrcJgiO43zOmDjKJdnrmAaSVjZX4pThu4xZsOQLRJb6gWy6/Ia6rExF2dd0JsCOukt3TTvk3/qL/RIdvQ1AqKMQvlC65hxW9AjboC8nFpgEQKBgQC6izerAMaVDNaeWWJz6FioWrFtEDLg8HZNf76ydoYlB3867dK1IXGImItLsLAeH2oPs0WnDO4vBXRDHeyaYlYaeQWHrF/bK6nshs4Bbp7T1PL/S84glm5vFfW8RwWiKclFDaHj5xicN3sPJDyhebeiqRNefpWXhQWD9wiU2R0HCwKBgQC1okIEi+FKeWz2GZ0FMSt7A962yNQBx8DrDHOS62vo5U6YcbT2gepzjySToppkavyV08qJ3diQW3M4sBZAd/83TixogwiohMxtqxK4EKl/NzeWs/OxJB/5MHavlhthCpZ6jPJUXsz2xRqdSSsYVZ6QXXeWCXkfuKLaXHR9ChK8CwKBgCYdsic3xlvIPsYmP26tiAgGWACP8cVyfMnDE2UFwM0qJf4VgBtQlREzEitKFAJjqtlAaTgD9VsYQzQ/lgvJkgxgtBePyhpPZq4UsV0rjDp+ZZRymdCgzDnYg9iPrn//B8gbS/v0SVwKHhPu9JCN/U64O2Pwe4J1RLY9MLyxTDQXAoGAbtYs4wlY2VFvpF3M67Ytiku6RGAYv11d5BEdFbKDjwMfCveYLjTpFMtszoqTHGQM7oDnP2oZFT44+Ya6jWysWNtjTgNn7S3cca/LJHdGd1MCoPv+4UHiIPXp9wvqeTU0zmPkHIgdGxj8PK7BlX/p2r6ukugE+c550jZI/2R+OjECgYEAktRz2ujFsF+HVdRyT/0QRIEW9RSEzTO2oEjXQXA0XOqvKB56A4Bx27W/Bvpl4FUPEDUl+n0xZvA9rWYvkz8aIQPU7Lp8BMBu6y2MYKaljKkXhyNOZVfJdHClRjLjIIZGMqqyfQgdQwv+IewolWwEYCgJEzd0J7m2lCImnatMjMo=";
|
||||
String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4Dlipw4sxS6I9xMbUAiPSQkfD+8JkGAdLQo5+7MpjYAHPBGakMNfOOZgFO6PDeMvnJtRhSrw0fIRK+S382Xx3kg9TXa2NW6J4tJ+limKEv4HKEH3a0ocNdVtjmyl5CoPlhuZVtktuan+3DVMLdHDXABOyRad447DWJkExpKqu79lAcvySzzgRwXPgDnvbOGrAiPIMJ0esp+aw9gGraais+EcYnptMTvbwlFiADcgPEyVf7htIVdxyZtBLiZl1ltYX9W69Fk6prP7/wYccy4uOyu2uhHS0AmMQrbXZg4EmpAUoY7ckUOqplP0+/nJlJLB1jMxkXWzDqnCanU9pEL3sQIDAQAB";
|
||||
//实例化客户端 参数:正式环境URL,Appid,商户私钥 PKCS8格式,字符编码格式,字符格式,支付宝公钥,签名方式
|
||||
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","2021003101623191",privateKey,"json","GBK",publicKey,"RSA2");
|
||||
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
|
||||
// 值为authorization_code时,代表用code换取
|
||||
request.setGrantType("authorization_code");
|
||||
//授权码,用户对应用授权后得到的
|
||||
request.setCode(authCode);
|
||||
AlipaySystemOauthTokenResponse response = null;
|
||||
try {
|
||||
response = alipayClient.execute(request);
|
||||
//刷新令牌,上次换取访问令牌时得到。见出参的refresh_token字段
|
||||
request.setRefreshToken(response.getAccessToken());
|
||||
//返回成功时 就将唯一标识返回
|
||||
if(response.isSuccess()){
|
||||
return ResultGenerator.genSuccessResult("获取成功",response.getUserId());
|
||||
} else {
|
||||
return ResultGenerator.genFailResult("授权失败");
|
||||
}
|
||||
} catch (AlipayApiException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ResultGenerator.genFailResult("授权失败");
|
||||
}
|
||||
|
||||
@PostMapping("/orderPay")
|
||||
@ResponseBody
|
||||
public Result<Object> orderPay(String authCode,String orderNumber) {
|
||||
if(StringUtil.isEmpty(authCode)){
|
||||
return ResultGenerator.genFailResult("授权码信息为空");
|
||||
}
|
||||
if(StringUtil.isEmpty(orderNumber)){
|
||||
return ResultGenerator.genFailResult("订单号为空");
|
||||
}
|
||||
AlipaySystemOauthTokenResponse tokenResponse = AliUtil.getAliUserIdV2(authCode, ParametersUtil.ZY_PRI, ParametersUtil.ZY_PUB, ParametersUtil.ZY_ALI_APP_ID);
|
||||
return apiPayService.orderPay(tokenResponse.getUserId(),orderNumber);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String openid = "o_q_P5bPxk3JvvfGEHrDcDYxbl3o";
|
||||
JSONObject result = new JSONObject(10);
|
||||
result.put("merchantCode","M800202107223018811");
|
||||
result.put("method","trans_wap_pay");
|
||||
result.put("subject","测试123");
|
||||
result.put("ip","127.0.0.1");
|
||||
result.put("payWay","ZFBZF");
|
||||
result.put("paySource","01");
|
||||
result.put("mercOrderNo",StringUtil.getBillno());
|
||||
result.put("payAmt","0.20");
|
||||
result.put("notifyUrl","https://www.baici.com");
|
||||
// String str = SignUtils.getSignContent(result) +"&key=efaa811e9f004429b5dc070c410405c8";
|
||||
String str = SignUtils.getSignContent(result) +"&key=4c8d277b0f274604af68e590cc0b3e6b";
|
||||
String ckeckSign = MD5Util.MD5Encode(str, "UTF-8");
|
||||
result.put("sign",ckeckSign);
|
||||
System.out.println("支付参数:"+result.toJSONString());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.ali.device.AliDeviceService;
|
||||
import cn.pluss.platform.alidevice.AliScanCodeDevicePayEntity;
|
||||
import cn.pluss.platform.alidevice.AliScanCodeDevicePayEnum;
|
||||
import cn.pluss.platform.alidevice.RespDeviceEntity;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*阿里云设备管理类
|
||||
*@author: bzg
|
||||
*@time: 2021/12/22 11:26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "aliyun/device")
|
||||
public class AliYunDeviceController {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Qualifier("aliScanCodeDeviceService")})
|
||||
private AliDeviceService aliScanCodeDeviceService;
|
||||
|
||||
|
||||
/**
|
||||
* 反扫阿里云扫码王设备支付接口
|
||||
* @date: 2021/12/27 11:35
|
||||
* @param payEntity:
|
||||
* @return cn.pluss.platform.alidevice.RespDeviceEntity
|
||||
*/
|
||||
@RequestMapping(value = "/pay/barcode",method = RequestMethod.POST)
|
||||
public RespDeviceEntity payBarCode(@RequestBody AliScanCodeDevicePayEntity payEntity){
|
||||
return aliScanCodeDeviceService.orderPay(payEntity, AliScanCodeDevicePayEnum.BARCODE.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 主扫阿里云扫码王设备支付接口
|
||||
* @date: 2021/12/27 11:36
|
||||
* @param payEntity:
|
||||
* @return cn.pluss.platform.alidevice.RespDeviceEntity
|
||||
*/
|
||||
@RequestMapping(value = "/pay/qrcode",method = RequestMethod.POST)
|
||||
public RespDeviceEntity payQrCode(@RequestBody AliScanCodeDevicePayEntity payEntity){
|
||||
return aliScanCodeDeviceService.orderPay(payEntity, AliScanCodeDevicePayEnum.QRCODE.getCode());
|
||||
}
|
||||
/**
|
||||
* 阿里云设备扫码王订单查询接口
|
||||
* @date: 2021/12/27 11:36
|
||||
* @param payEntity:
|
||||
* @return cn.pluss.platform.alidevice.RespDeviceEntity
|
||||
*/
|
||||
@RequestMapping(value = "/order/query",method = RequestMethod.POST)
|
||||
public RespDeviceEntity orderQuery(@RequestBody AliScanCodeDevicePayEntity payEntity){
|
||||
return aliScanCodeDeviceService.orderQuery(payEntity.getTrace());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取阿里云云设备状态接口V1
|
||||
* @date: 2021/12/27 11:37
|
||||
* @return java.lang.Integer
|
||||
*/
|
||||
@RequestMapping(value = "/status/v1",method = RequestMethod.POST)
|
||||
public RespDeviceEntity getStatusV1(@RequestBody AliScanCodeDevicePayEntity payEntity){
|
||||
return aliScanCodeDeviceService.getDeviceStatusV1(payEntity.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取阿里云扫码王设备状态接口V2
|
||||
* @date: 2021/12/27 11:37
|
||||
* @param payEntity:
|
||||
* @return cn.pluss.platform.alidevice.AliScanCodeDeviceStatus
|
||||
*/
|
||||
@RequestMapping(value = "/status/v2",method = RequestMethod.POST)
|
||||
public RespDeviceEntity getStatusV2(@RequestBody AliScanCodeDevicePayEntity payEntity){
|
||||
return aliScanCodeDeviceService.getDeviceStatusV2(payEntity.getCode());
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 设备绑定接口 测试
|
||||
// * @date: 2021/12/27 14:45
|
||||
// * @param deviceNo:
|
||||
// * @return cn.pluss.platform.alidevice.RespDeviceEntity
|
||||
// */
|
||||
// @RequestMapping(value = "/bind/{deviceNo}",method = RequestMethod.POST)
|
||||
// @ResponseBody
|
||||
// public Result<Object> payBarCode(@PathVariable("deviceNo") String deviceNo){
|
||||
// return aliScanCodeDeviceService.bindDevice(deviceNo,"1791");
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.ApiMercSplitService;
|
||||
import cn.pluss.platform.api.SplitReq;
|
||||
import cn.pluss.platform.api.Result;
|
||||
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;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* 接口商户分账设置控制器
|
||||
* @author crystal
|
||||
* @date 2022/6/29 14:07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/api")
|
||||
public class ApiMercSplitController {
|
||||
|
||||
@Resource
|
||||
private ApiMercSplitService apiMercSplitService;
|
||||
/**
|
||||
* 商户分账
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/split")
|
||||
public Result<Object> splitOperat(@RequestBody SplitReq req){
|
||||
return apiMercSplitService.splitOperat(req);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.appletInfo.AppletInfoService;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.enums.SubAppLetInfo;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.notify.NotifyMessageService;
|
||||
import cn.pluss.platform.pay.ApiPayService;
|
||||
import cn.pluss.platform.util.*;
|
||||
import cn.pluss.platform.wechat.WxConstants;
|
||||
import cn.pluss.platform.wx.WxAccessTokenRequest;
|
||||
import cn.pluss.platform.wx.WxCommonService;
|
||||
import cn.pluss.platform.wx.WxOpenidResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 下游上送订单接口类
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "/api")
|
||||
public class ApiPayController {
|
||||
|
||||
/**
|
||||
* 日志打印 log
|
||||
*/
|
||||
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
|
||||
@Autowired
|
||||
private MerchantOrderService merchantOrderService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private NotifyMessageService notifyMessageService;
|
||||
|
||||
@Autowired
|
||||
private ApiPayService apiPayService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private WxCommonService wxCommonService;
|
||||
|
||||
@Autowired
|
||||
private AppletInfoService appletInfoService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/trans/pay",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public JSONObject apiPay(@RequestBody String json, HttpServletRequest request){
|
||||
logger.info("============>交易接口下单,请求交易数据:{}<============",json);
|
||||
try {
|
||||
String ip = IpUtils.getIpAddr(request);
|
||||
return apiPayService.pay(json,ip);
|
||||
}catch (Exception e){
|
||||
return ResultGenerator.genFailJsonResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序退款接口
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/trans/refund",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<JSONObject> refund(@RequestBody JSONObject params){
|
||||
return apiPayService.refund(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* api退款接口
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/trans/refund.do",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<JSONObject> apiRefund(@RequestBody JSONObject params){
|
||||
return apiPayService.apiRefund(params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 小程序订单查询
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/refund/query",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<Object> refundQuery(@RequestBody JSONObject params){
|
||||
return apiPayService.refundQuery(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序取消支付
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/mqtt/pay/cancel",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<JSONObject> cancel(@RequestBody JSONObject params){
|
||||
String storeId = Optional.ofNullable(params.getString("storeId")).orElseThrow(() -> new MsgException("店铺ID不能为空"));
|
||||
String money = params.getString("money");
|
||||
MerchantStore store = merchantStoreService.queryMerchantStore(new MerchantStore().setId(Integer.valueOf(storeId)));
|
||||
if(store != null){
|
||||
QueryWrapper<MerchantBaseInfo> queryWrapper = new QueryWrapper<MerchantBaseInfo>().eq("merchantCode",store.getMerchantCode());
|
||||
List<MerchantBaseInfo> list = merchantBaseInfoService.list(queryWrapper);
|
||||
if(!list.isEmpty()){
|
||||
params.put("mercId",list.get(0).getId());
|
||||
params.put("money",money);
|
||||
params.put("userId",list.get(0).getUserId());
|
||||
notifyMessageService.sendCancelPayMessage(params);
|
||||
return ResultGenerator.genSuccessResult("推送成功!",null);
|
||||
}
|
||||
}
|
||||
return ResultGenerator.genFailResult("推送失败!",null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:小程序获取openid
|
||||
* @date: 2021/10/13 13:46
|
||||
* @param params:
|
||||
* @return cn.pluss.platform.api.Result<com.alibaba.fastjson.JSONObject>
|
||||
*/
|
||||
@RequestMapping(value = "/wxapp/getOpenId",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<Object> getOpenId(@RequestBody JSONObject params){
|
||||
String code = params.getString("code");
|
||||
if(StringUtil.isEmpty(code)){
|
||||
return ResultGenerator.genFailResult("缺失参数!");
|
||||
}
|
||||
String appid = StringUtil.isNotEmpty(params.getString("appid")) ? params.getString("appid") : SubAppLetInfo.SYB.getAppid();
|
||||
AppletInfo applet = appletInfoService.getAppletInfoByAppId(appid);
|
||||
MsgException.checkNull(applet,"小程序配置信息异常!");
|
||||
String appSecret = applet.getSecret();
|
||||
try {
|
||||
WxAccessTokenRequest request = WxAccessTokenRequest.buidWxToken(appid,appSecret,code, WxConstants.WX_APPLET_OPENID_URL);
|
||||
WxOpenidResponse wxOpenId = wxCommonService.getWxOpenId(request);
|
||||
return ResultGenerator.genSuccessResult("获取成功!",wxOpenId);
|
||||
}catch (Exception e){
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:小程序获取订单
|
||||
* @date: 2021/10/13 13:46
|
||||
* @param params:
|
||||
* @return cn.pluss.platform.api.Result<com.alibaba.fastjson.JSONObject>
|
||||
*/
|
||||
@RequestMapping(value = "/wxapp/getOrder",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<Object> getOrder(@RequestBody JSONObject params){
|
||||
String openid = params.getString("openid");
|
||||
if(StringUtil.isEmpty(openid)){
|
||||
return ResultGenerator.genFailResult("缺失参数!");
|
||||
}
|
||||
QueryWrapper<MerchantOrder> queryWrapper = new QueryWrapper<MerchantOrder>()
|
||||
.eq("mercUserId",openid).eq("status","1");
|
||||
List<MerchantOrder> list = merchantOrderService.list(queryWrapper);
|
||||
return ResultGenerator.genSuccessResult("获取成功",list);
|
||||
}
|
||||
|
||||
/**
|
||||
*内部微信小程序支付
|
||||
* @date: 2021/12/24 13:32
|
||||
* @param params:
|
||||
* @return cn.pluss.platform.api.Result<java.lang.Object>
|
||||
*/
|
||||
@RequestMapping(value = "/wxapp/pay",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public JSONObject wxappPay(@RequestBody JSONObject params){
|
||||
try {
|
||||
return apiPayService.wxappPay(params);
|
||||
}catch (Exception e){
|
||||
return ResultGenerator.genFailJsonResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/applet/orderPay")
|
||||
@ResponseBody
|
||||
public Result<Object> orderPay(@RequestBody JSONObject params) {
|
||||
String userId = params.getString("userId");
|
||||
String orderNumber = params.getString("orderNumber");
|
||||
return apiPayService.orderPay(userId,orderNumber);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String openid = "oPhYX5BsUDxDgGOQ8GNLhanMR3f8";
|
||||
String key = "5d7d4c33067b4489bcca25f034f46551";
|
||||
String merchantCode = "M800202206280ff7f1";
|
||||
String method = "trans_pay";
|
||||
String notifyUrl = "https://www.shouyinbei.net/wap/notify/sxfCallBack";
|
||||
// String returnUrl = "https://www.baidu.com";
|
||||
String mercOrderNo = StringUtil.generateMixStr(3).toUpperCase(Locale.ROOT) + StringUtil.getBillno();
|
||||
JSONObject params = new JSONObject(10);
|
||||
params.put("merchantCode",merchantCode);
|
||||
params.put("method",method);
|
||||
params.put("mercOrderNo",mercOrderNo);
|
||||
params.put("payAmt","0.20");
|
||||
params.put("notifyUrl",notifyUrl);
|
||||
params.put("payWay","WXZF");
|
||||
params.put("payType","02");
|
||||
params.put("subject","测试订单");
|
||||
// params.put("userId",openid);
|
||||
String signContent = SignUtils.getSignContent(params) + "&key="+key;
|
||||
String sign = MD5Util.MD5Encode(signContent, "UTF-8");
|
||||
params.put("sign",sign);
|
||||
System.out.println("param==>" + params.toJSONString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.util.ParametersUtil;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 因客户端错误的代码,添加的额外接口,临时使用
|
||||
*/
|
||||
@Controller
|
||||
public class ExtraController {
|
||||
|
||||
/**
|
||||
* @TODO 下个版本安卓修改后,该接口需要删除
|
||||
*/
|
||||
@GetMapping(value = "/wap/merchant/toUpGradeAuth")
|
||||
public void toUpGradeAuth(String userId, HttpServletResponse response) {
|
||||
String domain_wap = ParametersUtil.domain + "/wap";
|
||||
try {
|
||||
response.sendRedirect(domain_wap + "/merchant/toUpGradeAuth?userAppId=" + userId);
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.ResponseBody;
|
||||
|
||||
import cn.pluss.platform.entity.SystemConfig;
|
||||
import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("platform")
|
||||
public class HomeController {
|
||||
@Autowired
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/console", method = RequestMethod.GET)
|
||||
public String index(HttpServletRequest request) {
|
||||
|
||||
List<SystemConfig> systemConfigList=systemConfigService.querySystemConfigList(null);
|
||||
request.setAttribute("systemConfigList", systemConfigList);
|
||||
return "index/index";
|
||||
}
|
||||
@RequestMapping(value = "/first", method = RequestMethod.GET)
|
||||
public String first() {
|
||||
|
||||
System.out.println(111);
|
||||
return "index/first";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/logout", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> login() {
|
||||
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("result", 2);
|
||||
// 从SecurityUtils里边创建一个 subject
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
|
||||
// 执行认证登陆
|
||||
try {
|
||||
subject.logout();
|
||||
result.put("result", 1);
|
||||
result.put("url", "/login");
|
||||
} catch (Exception uae) {
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.jfShop.JfShopHandler;
|
||||
import cn.pluss.platform.other.JfShopParam;
|
||||
import cn.pluss.platform.other.JfShopAccount;
|
||||
import cn.pluss.platform.other.JfShopValidTask;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author crystal
|
||||
* @date 2022/5/16 14:43
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/jf/shop")
|
||||
public class JfShopController {
|
||||
|
||||
@Resource
|
||||
private JfShopHandler jfShopHandler;
|
||||
|
||||
/**
|
||||
* 新版积分商城积分数量获取接口
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/get/account")
|
||||
public Result<JfShopAccount> getAccount(@RequestBody JfShopParam param){
|
||||
return jfShopHandler.getAccount(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分详情
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/integral/page")
|
||||
public Object page(@RequestBody JfShopParam param){
|
||||
return jfShopHandler.page(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分商城新增接口
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/integral/operate")
|
||||
public Result<Object> operate(@RequestBody JfShopParam param){
|
||||
return jfShopHandler.operate(param);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取积分商城任务完成进度
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/task/status")
|
||||
public Result<Object> getTaskStatus(@RequestBody JfShopValidTask param){
|
||||
return jfShopHandler.getTaskStatus(param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.dto.jft.JftPayDataDTO;
|
||||
import cn.pluss.platform.entity.JftReceiptInfo;
|
||||
import cn.pluss.platform.entity.JftReceiptOrder;
|
||||
import cn.pluss.platform.jft.JftReceiptInfoService;
|
||||
import cn.pluss.platform.jft.JftReceiptOrderService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import mob.push.api.http.Http;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* 缴费通入口
|
||||
* @author crystal
|
||||
* @date 2022/6/22 17:28
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "jft")
|
||||
public class JftController {
|
||||
|
||||
@Resource
|
||||
private JftReceiptInfoService jftReceiptInfoService;
|
||||
|
||||
@Resource
|
||||
private JftReceiptOrderService jftReceiptOrderService;
|
||||
|
||||
@RequestMapping(value = "/auth")
|
||||
public ModelAndView auth(HttpServletRequest request, HttpServletResponse response, String tk){
|
||||
try {
|
||||
JftReceiptInfo receiptInfo = jftReceiptInfoService.wapCheckTk(tk,request);
|
||||
response.sendRedirect(receiptInfo.getJumpUrl());
|
||||
return null;
|
||||
}catch (Exception e){
|
||||
ModelAndView view = new ModelAndView("merchant/errorInfo");
|
||||
request.setAttribute("error",e.getMessage());
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/pay")
|
||||
public String pay(HttpServletRequest request,HttpServletResponse response,String tk,String auth_code,String userId){
|
||||
try {
|
||||
jftReceiptInfoService.getPayInfo(request,response,tk,auth_code,userId);
|
||||
return "jft/th_jft_pay";
|
||||
}catch (Exception e){
|
||||
request.setAttribute("error",e.getMessage());
|
||||
return "merchant/errorInfo2";
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/jump")
|
||||
public String pay(HttpServletRequest request,String orderNumber){
|
||||
JftReceiptOrder orderInfo = jftReceiptOrderService.getOrderByNo(orderNumber);
|
||||
JftReceiptInfo receiptInfo = jftReceiptInfoService.getById(orderInfo.getRid());
|
||||
request.setAttribute("merchantName",orderInfo.getMerchantName());
|
||||
request.setAttribute("payTypeDesc",orderInfo.getPayTypeDesc());
|
||||
request.setAttribute("amount",orderInfo.getAmount());
|
||||
request.setAttribute("pName",receiptInfo.getProjectName());
|
||||
request.setAttribute("orderNumber",orderInfo.getOrderNumber());
|
||||
request.setAttribute("date", DateUtils.toString(orderInfo.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
|
||||
return "jft/th_jft_success";
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起支付
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/tradePay")
|
||||
@ResponseBody
|
||||
public Result<Object> tradePay(JftPayDataDTO dto,HttpServletRequest request){
|
||||
return jftReceiptOrderService.tradePay(dto,request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.constants.Constant;
|
||||
import com.google.code.kaptcha.impl.DefaultKaptcha;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
*获取图形验证码
|
||||
*@author: bzg
|
||||
*@time: 2021/12/20 11:30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "kaptcha")
|
||||
public class KaptchaController {
|
||||
|
||||
@Autowired
|
||||
private DefaultKaptcha defaultKaptcha;
|
||||
|
||||
@GetMapping("/get")
|
||||
public void getKaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
//设置响应头
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setContentType("image/jpeg");
|
||||
|
||||
String text = defaultKaptcha.createText();
|
||||
HttpSession session = request.getSession();
|
||||
//将验证码存入session
|
||||
session.setAttribute(Constant.LOGIN_VALIDATE_CODE, text);
|
||||
//创建验证码图片
|
||||
BufferedImage image = defaultKaptcha.createImage(text);
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
ImageIO.write(image, "jpg", os);
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// write the data out
|
||||
ImageIO.write(image, "jpg", out);
|
||||
try {
|
||||
out.flush();
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.MerchantMemberCode;
|
||||
import cn.pluss.platform.life.LifeApiHandler;
|
||||
import cn.pluss.platform.life.LifeParam;
|
||||
import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 java.sql.ResultSet;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* 生活圈apiController
|
||||
* @author crystal
|
||||
* @date 2022/6/7 15:00
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "life")
|
||||
public class LifeApiController {
|
||||
|
||||
@Resource
|
||||
private LifeApiHandler lifeApiHandler;
|
||||
|
||||
/**
|
||||
* 生活圈获取会员卡过期时间
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/card/expire")
|
||||
public Result<Object> getCardExpire(){
|
||||
String value = lifeApiHandler.getCardExpire();
|
||||
return ResultGenerator.genSuccessResult("获取成功",value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡刷新code
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/card/refresh")
|
||||
public Result<Object> refreshCardCode(MerchantMemberCode code){
|
||||
return lifeApiHandler.refreshCardCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商户信息
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/merchant/info")
|
||||
public Result<Object> getMerchantInfo(LifeParam param){
|
||||
return lifeApiHandler.getMerchantInfo(param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("login")
|
||||
public class LoginController {
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "index/login";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/doLogin", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> login(@RequestParam("loginName") String username, @RequestParam("password") String password) {
|
||||
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("result", 2);
|
||||
// 从SecurityUtils里边创建一个 subject
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
// 在认证提交前准备 token(令牌)
|
||||
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
|
||||
// 执行认证登陆
|
||||
try {
|
||||
subject.login(token);
|
||||
result.put("result", 1);
|
||||
result.put("redirectUri", "/platform/console");
|
||||
} catch (Exception uae) {
|
||||
result.put("message", "用户名或者密码错误");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.deviceStock.DeviceStockService;
|
||||
import cn.pluss.platform.entity.DeviceStock;
|
||||
import cn.pluss.platform.entity.OfficialGoods;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.officialGoods.exchange.OfficialGoodsExchangeService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantDevice")
|
||||
public class MerchantDeviceController {
|
||||
|
||||
@Autowired
|
||||
private UserAppService uaService;
|
||||
|
||||
@Autowired
|
||||
private OfficialGoodsExchangeService officialGoodsExchangeService;
|
||||
|
||||
@Autowired
|
||||
private DeviceStockService dsService;
|
||||
|
||||
/**
|
||||
* 流量卡充值开始页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/simChargeIndex")
|
||||
public String simChargeIndex(HttpServletRequest request, String token) {
|
||||
try {
|
||||
request.setAttribute("token", token);
|
||||
return "device/simChargeIndex";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
request.setAttribute("error", "拒绝访问!");
|
||||
return "merchant/errorInfo2";
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/simOrder")
|
||||
public String simOrder(HttpServletRequest request, String token, String snNo) {
|
||||
try {
|
||||
LambdaQueryWrapper<DeviceStock> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(DeviceStock::getDeviceNo, snNo).or().eq(DeviceStock::getSnNo, snNo);
|
||||
DeviceStock one = dsService.getOne(qWrapper.last("limit 1"));
|
||||
if (one == null) {
|
||||
throw new MsgException("设备编号不存在");
|
||||
}
|
||||
|
||||
if (!one.getCode().contains("4G")) {
|
||||
throw new MsgException("该设备编码不需要通信服务费");
|
||||
}
|
||||
|
||||
if (!"3".equals(one.getStatus())) {
|
||||
throw new MsgException("该设备暂未绑定商户");
|
||||
}
|
||||
|
||||
request.setAttribute("token", token);
|
||||
request.setAttribute("snNo", snNo);
|
||||
request.setAttribute("device", one);
|
||||
return "device/order";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
request.setAttribute("error", e.getMessage());
|
||||
return "merchant/errorInfo2";
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/simOrder")
|
||||
@ResponseBody
|
||||
public Result<Object> createSimChargeOrder(HttpServletRequest request, OfficialGoods goods, String token) {
|
||||
LambdaQueryWrapper<DeviceStock> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(DeviceStock::getDeviceNo, goods.getAddress()).or().eq(DeviceStock::getSnNo, goods.getAddress());
|
||||
DeviceStock one = dsService.getOne(qWrapper.last("limit 1"));
|
||||
if (one == null) {
|
||||
throw new MsgException("设备编号不存在");
|
||||
}
|
||||
|
||||
if (!one.getCode().contains("4G")) {
|
||||
throw new MsgException("该设备编码不需要通信服务费");
|
||||
}
|
||||
|
||||
if (!"3".equals(one.getStatus())) {
|
||||
throw new MsgException("该设备暂未绑定商户");
|
||||
}
|
||||
|
||||
UserApp own = new UserApp();
|
||||
own.setUserId(1791L);
|
||||
own = uaService.getOne(new QueryWrapper<>(own));
|
||||
|
||||
goods.setId(10086);
|
||||
goods.setIsPostage(1);
|
||||
goods.setPostageFee(BigDecimal.ZERO);
|
||||
goods.setDeductValue(BigDecimal.TEN);
|
||||
goods.setGoodPrice(BigDecimal.TEN);
|
||||
goods.setDeductRule(1);
|
||||
return officialGoodsExchangeService.exchange(goods, own);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.pay.PayService;
|
||||
import cn.pluss.platform.ryx.pay.RyxPayService;
|
||||
import cn.pluss.platform.sxf.pay.SxfPayService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* 统一接收支付成功异步地址
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/notify")
|
||||
public class PayNotifyController {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Qualifier("ysPayOldService")})
|
||||
private PayService ysPayOldService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Qualifier("ysPayService")})
|
||||
private PayService ysPayService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Lazy})
|
||||
private SxfPayService sxfPayService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Lazy})
|
||||
private RyxPayService ryxPayService;
|
||||
|
||||
@RequestMapping(value = "/sxfCallBack",method = RequestMethod.POST)
|
||||
public Map<String,String> sxfCallBack(@RequestBody Map<String, String> map) {
|
||||
log.info("【随行付】异步回调开始,【随行付】回调参数:{}<=====================",JSONObject.toJSONString(map));
|
||||
return (Map<String, String>) sxfPayService.payNotifyCallBack(map);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/old/ysCallBack",method = RequestMethod.POST)
|
||||
public String oldYsCallBack(@RequestParam Map<String,String> params) {
|
||||
log.info("【银盛】旧版接口异步回调开始,【银盛】回调参数:{}<=====================",JSONObject.toJSONString(params));
|
||||
return (String) ysPayOldService.payNotifyCallBack(params);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ysCallBack",method = RequestMethod.POST)
|
||||
public String ysCallBack(@RequestParam Map<String,String> params) {
|
||||
log.info("【银盛】新版异步回调开始,【银盛】回调参数:{}<=====================",JSONObject.toJSONString(params));
|
||||
return (String) ysPayService.payNotifyCallBack(params);
|
||||
}
|
||||
@RequestMapping(value = "/ryxCallBack",method = RequestMethod.POST)
|
||||
public String ryxCallBack(@RequestParam Map<String,String> params) {
|
||||
log.info("【瑞银信】异步回调开始,【瑞银信】回调参数:{}<=====================",JSONObject.toJSONString(params));
|
||||
return (String) ryxPayService.payNotifyCallBack(params);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.enums.UserRoleEnum;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*用户相关controller
|
||||
*@author: bzg
|
||||
*@time: 2022/2/16 10:14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "/user")
|
||||
public class UserController {
|
||||
|
||||
@Resource
|
||||
private UserAppService userAppService;
|
||||
|
||||
private final String ERROR_PATH = "merchant/errorInfo";
|
||||
|
||||
private final String ERROR_NAME = "error";
|
||||
|
||||
@GetMapping(value = "/agent/children")
|
||||
public ModelAndView bstAgentChildrenList(ModelAndView view,String token,HttpServletRequest request){
|
||||
view.setViewName(ERROR_PATH);
|
||||
try {
|
||||
userAppService.checkWapToken(token,request,UserRoleEnum.ZY_BST);
|
||||
view.setViewName("user/th_agent_list");
|
||||
view.addObject("token",token);
|
||||
return view;
|
||||
}catch (Exception e){
|
||||
view.addObject(ERROR_NAME,e.getMessage());
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(value = "/agent/open")
|
||||
public ModelAndView bstOpenAgent(ModelAndView view,String token,HttpServletRequest request){
|
||||
view.setViewName(ERROR_PATH);
|
||||
try {
|
||||
UserApp userApp = userAppService.checkWapToken(token,request,UserRoleEnum.ZY_BST);
|
||||
view.setViewName("user/th_agent");
|
||||
view.addObject("uid",userApp.getUserId());
|
||||
view.addObject("token",token);
|
||||
return view;
|
||||
}catch (Exception e){
|
||||
view.addObject(ERROR_NAME,e.getMessage());
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "/agent/save")
|
||||
@ResponseBody
|
||||
public Result<Object> bstSaveAgent(@RequestParam Map<String,Object> params){
|
||||
try {
|
||||
userAppService.bstSaveAgent(params);
|
||||
return ResultGenerator.genSuccessResult("注册成功");
|
||||
}catch (Exception e){
|
||||
return ResultGenerator.genFailResult(e.getMessage(),null);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "/agent/page")
|
||||
@ResponseBody
|
||||
public Result<Object> page(Page<UserApp> page,
|
||||
String token, HttpServletRequest request){
|
||||
try {
|
||||
UserApp userApp = userAppService.checkWapToken(token,request,UserRoleEnum.ZY_BST);
|
||||
QueryWrapper<UserApp> queryWrapper = new QueryWrapper<UserApp>().eq("parentId",userApp.getUserId())
|
||||
.eq("userType","agent");
|
||||
page = userAppService.page(page, queryWrapper);
|
||||
return ResultGenerator.genSuccessResult("获取成功",page);
|
||||
}catch (Exception e){
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,506 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.constants.Constant;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.pay.ApiPayService;
|
||||
import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
import cn.pluss.platform.util.*;
|
||||
import cn.pluss.platform.wap.MD5Util;
|
||||
import cn.pluss.platform.wechat.WxConstants;
|
||||
import cn.pluss.platform.wx.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import cn.pluss.platform.deviceMerchantBuy.DeviceMerchantBuyService;
|
||||
import cn.pluss.platform.wap.XmlUtil;
|
||||
import cn.pluss.platform.leshua.LeshuaService;
|
||||
import cn.pluss.platform.merchantMenber.MerchantMenberService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
|
||||
/**
|
||||
* @author yuchen
|
||||
*
|
||||
* @Description
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
@RequestMapping("wechat")
|
||||
public class WechantController {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired,@Lazy})
|
||||
private UserAppService userAppService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private WxPayNotifyService wxPayNotifyService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private LeshuaService leshuaService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private DeviceMerchantBuyService deviceMerchantBuyService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantMenberService merchantMenberService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private ApiPayService apiPayService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private WxCommonService wxCommonService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
* goUpgradePage:(跳转到升级页面). <br/>
|
||||
*
|
||||
*
|
||||
* @author Administrator
|
||||
* @param userId
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@GetMapping(value = "/goUpgradePage")
|
||||
public ModelAndView goUpgradePage(String userId) {
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("wechat/goUpgradePage");
|
||||
setUpVipAmtResult(modelAndView,"twoUpVipAmount",2);
|
||||
setUpVipAmtResult(modelAndView,"threeUpVipAmount",3);
|
||||
modelAndView.addObject("userId", userId);
|
||||
UserApp userApp=new UserApp();
|
||||
userApp.setUserId(Long.valueOf(userId));
|
||||
userApp=userAppService.queryUserApp(userApp);
|
||||
if(null!=userApp) {
|
||||
modelAndView.addObject("level", userApp.getLevel());
|
||||
}
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
public void setUpVipAmtResult(ModelAndView modelAndView, String propertyKey,int level) {
|
||||
String configValue = systemConfigService.querySystemConfigValue(propertyKey);
|
||||
if(StringUtil.isNotEmpty(configValue)){
|
||||
if(configValue.contains("-")){
|
||||
modelAndView.addObject(propertyKey, configValue.split("-")[0]);
|
||||
//modelAndView.addObject(shapeKey, propertyValue.split("-")[1]);
|
||||
}
|
||||
}else{
|
||||
if(level == 2){
|
||||
modelAndView.addObject(propertyKey, 999);
|
||||
//modelAndView.addObject(shapeKey, 500);
|
||||
}else{
|
||||
modelAndView.addObject(propertyKey, 9999);
|
||||
//modelAndView.addObject(shapeKey, 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* jumpUrl:(乐刷支付完成后的跳转地址). <br/>
|
||||
*
|
||||
*
|
||||
* @author Administrator
|
||||
* @param orderNumber
|
||||
* @param
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@GetMapping("/jumpUrl")
|
||||
public ModelAndView jumpUrl(String orderNumber) {
|
||||
log.info("====订单号====" + orderNumber);
|
||||
if (orderNumber.contains("?")) {
|
||||
String str[] = orderNumber.split("[?]");
|
||||
orderNumber = str[0];
|
||||
}
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
Map<String, String> reqMap = new HashMap<String, String>(16);
|
||||
Map<String, Object> mapLeshua = new HashMap<String, Object>(16);
|
||||
try {
|
||||
reqMap.put("service", "query_status");
|
||||
reqMap.put("merchant_id", ParametersUtil.LESHUALIU);
|
||||
reqMap.put("third_order_id", orderNumber);
|
||||
reqMap.put("nonce_str", StringUtil.getBillno());
|
||||
String requestPay = leshuaService.requestPay(reqMap, ParametersUtil.leshuapaykey, true);
|
||||
mapLeshua = XmlUtil.toMapLeshua(requestPay);
|
||||
String resp_code = (String) mapLeshua.get("resp_code");
|
||||
if ("0".equals(resp_code)) {
|
||||
String result_code = (String) mapLeshua.get("result_code");
|
||||
if ("0".equals(result_code)) {
|
||||
String status = (String) mapLeshua.get("status");
|
||||
if ("2".equals(status)) {
|
||||
modelAndView.setViewName("merchant/paySuccess");
|
||||
} else {
|
||||
modelAndView.setViewName("merchant/payFail");
|
||||
}
|
||||
} else {
|
||||
modelAndView.addObject("message", "支付结果查询错误");
|
||||
modelAndView.setViewName("merchant/error");
|
||||
}
|
||||
} else {
|
||||
modelAndView.addObject("message", "支付结果查询错误");
|
||||
modelAndView.setViewName("merchant/error");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
modelAndView.addObject("message", "支付结果查询错误");
|
||||
modelAndView.setViewName("merchant/error");
|
||||
}
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
// public static Set<String> resExcludedSignParams() {
|
||||
// Set<String> exludedSignParams = new HashSet<String>(2);
|
||||
// exludedSignParams.add("sign");
|
||||
// exludedSignParams.add("error_code");
|
||||
// return exludedSignParams;
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
* getMerchantInfo:(得到商户名称,门店名称). <br/>
|
||||
*
|
||||
*
|
||||
* @author Administrator
|
||||
* @param merchantCode
|
||||
* @param storeId
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
// private MerchantStore getMerchantInfo(String merchantCode, String storeId) {
|
||||
// // 因害怕表数据有误 分别根据merchantCode 查商家表 storeId查门店表
|
||||
// MerchantStore merchantStore = new MerchantStore();
|
||||
// merchantStore.setStoreId(storeId);
|
||||
// MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
// merchantBaseInfo.setMerchantCode(merchantCode);
|
||||
// List<MerchantBaseInfo> queryMerchantBaseInfoList = merchantBaseInfoService
|
||||
// .queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
// if (queryMerchantBaseInfoList != null && queryMerchantBaseInfoList.size() > 0) {
|
||||
// merchantBaseInfo = queryMerchantBaseInfoList.get(0);
|
||||
// merchantStore.setMerchantCode(merchantCode);
|
||||
// } else {
|
||||
// merchantBaseInfo = null;
|
||||
// merchantStore = null;
|
||||
// return merchantStore;
|
||||
// }
|
||||
// List<MerchantStore> queryMerchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
// if (queryMerchantStoreList != null && queryMerchantStoreList.size() > 0) {
|
||||
// merchantStore = queryMerchantStoreList.get(0);
|
||||
// merchantStore.setMerchantName(merchantBaseInfo.getMerchantName());
|
||||
// } else {
|
||||
// merchantStore = null;
|
||||
// }
|
||||
// return merchantStore;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 从request中获取请求方IP
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static String getIpAddress(HttpServletRequest request) {
|
||||
String ip = request.getHeader("x-forwarded-for");
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("HTTP_CLIENT_IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
// 若以上方式均为获取到ip则证明获得客户端并没有采用反向代理直接使用getRemoteAddr()获取客户端的ip地址
|
||||
ip = request.getRemoteAddr();
|
||||
}
|
||||
// 多个路由时,取第一个非unknown的ip
|
||||
final String[] arr = ip.split(",");
|
||||
for (final String str : arr) {
|
||||
if (!"unknown".equalsIgnoreCase(str)) {
|
||||
ip = str;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* wechatCallBack:(设备订单微信回调通知). <br/>
|
||||
*
|
||||
*
|
||||
* @author Administrator
|
||||
* @param request
|
||||
* @param response
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping(value = "/wechatCallBack")
|
||||
public void wechatCallBack(HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
InputStream is = request.getInputStream();
|
||||
String xml = XmlUtil.toUTF8(is);
|
||||
Map<String, Object> notifyMap = XmlUtil.toMap(xml);// 将微信发的xml转map
|
||||
if ("SUCCESS".equals(notifyMap.get("result_code"))) {
|
||||
String ordersSn = (String) notifyMap.get("out_trade_no");// 商户订单号
|
||||
String transaction_id = (String) notifyMap.get("transaction_id");
|
||||
// String amountpaid = (String) notifyMap.get("total_fee");// 实际支付的订单金额:单位 分
|
||||
// String openid = (String) notifyMap.get("openid");// 用户openid
|
||||
String time_end = (String) notifyMap.get("time_end");// 支付完成时间
|
||||
// Double amount=Double.valueOf(amountpaid)*100;
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setOrderNo(ordersSn);
|
||||
deviceMerchantBuy = deviceMerchantBuyService.queryDeviceMerchantBuy(deviceMerchantBuy);
|
||||
if ("1".equals(deviceMerchantBuy.getStatus())) {
|
||||
response.getWriter().write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
|
||||
return;
|
||||
}
|
||||
deviceMerchantBuy.setStatus("1");
|
||||
deviceMerchantBuy.setTransNo(transaction_id);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
deviceMerchantBuy.setTransDt(sdf.parse(time_end));
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(deviceMerchantBuy);
|
||||
}
|
||||
is.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* wechatCallBack:(设备订单微信回调通知). <br/>
|
||||
*
|
||||
*
|
||||
* @author Administrator
|
||||
* @param request
|
||||
* @param response
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping(value = "/wechatCallBackV2")
|
||||
public void wechatCallBackV2(HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
InputStream is = request.getInputStream();
|
||||
String xml = XmlUtil.toUTF8(is);
|
||||
is.close();
|
||||
// 将微信发的xml转map
|
||||
assert xml != null : "无有效参数";
|
||||
|
||||
Map<String, Object> notifyMap = XmlUtil.toMap(xml);
|
||||
|
||||
wxPayNotifyService.commonPayNotify(notifyMap);
|
||||
|
||||
response.getWriter().write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("attentionCallBack")
|
||||
public void wechatNotice(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String signature = request.getParameter("signature");
|
||||
// 时间戳
|
||||
String timestamp = request.getParameter("timestamp");
|
||||
// 随机数
|
||||
String nonce = request.getParameter("nonce");
|
||||
// 随机字符串
|
||||
String echostr = request.getParameter("echostr");
|
||||
InputStream is = request.getInputStream();
|
||||
// 处理微信请求
|
||||
if (!StringUtil.isEmpty(echostr)) {
|
||||
// 响应消息
|
||||
PrintWriter out = response.getWriter();
|
||||
out.print(echostr);
|
||||
out.close();
|
||||
// this.sendMessages(echostr);
|
||||
response.setContentType("text/json; charset=utf-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.getWriter().print(echostr);
|
||||
}
|
||||
String xml = readRequestMsg(request);
|
||||
Map<String, Object> map = XmlUtil.toMap(xml);
|
||||
String MsgType = (String) map.get("MsgType");
|
||||
//openId
|
||||
String openId = (String) map.get("FromUserName");
|
||||
WxAccessTokenRequest tokenRequest = WxAccessTokenRequest.buidWxToken(ParametersUtil.APPID,ParametersUtil.APPSECRET,null, WxConstants.WX_USER_INFO_URL);
|
||||
log.info("【微信消息接收】解析消息内容为:{}", JSON.toJSONString(map));
|
||||
if("event".equals(MsgType)) {
|
||||
String eventKey = (String) map.get("EventKey");
|
||||
if("VIEW".equals(map.get("Event"))){
|
||||
request.getRequestDispatcher(eventKey).forward(request,response);
|
||||
}else if("subscribe".equals(map.get("Event"))||"SCAN".equals(map.get("Event"))){
|
||||
//关注公众号 消息回复
|
||||
if("subscribe".equals(map.get("Event"))){
|
||||
StringBuilder backMsgXml = new StringBuilder("<xml>");
|
||||
backMsgXml.append("<ToUserName><![CDATA["+openId+"]]></ToUserName>");
|
||||
backMsgXml.append("<FromUserName><![CDATA["+(String) map.get("ToUserName")+"]]></FromUserName>");
|
||||
backMsgXml.append("<CreateTime>"+System.currentTimeMillis()+"</CreateTime>");
|
||||
backMsgXml.append("<MsgType><![CDATA[text]]></MsgType>");
|
||||
backMsgXml.append("<Content><![CDATA[你好,欢迎关注收银呗生活圈!]]></Content>");
|
||||
backMsgXml.append("</xml>");
|
||||
response.setContentType("text/xml; charset=utf-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.getWriter().write(backMsgXml.toString());
|
||||
}
|
||||
WxUserInfoResponse wxUserInfo = wxCommonService.getWxUserInfo(tokenRequest, openId);
|
||||
if(StringUtil.isNotEmpty(eventKey)){
|
||||
eventKey = eventKey.replace("qrscene_","");
|
||||
String[] data = null;
|
||||
if(eventKey.contains("_")){
|
||||
data = eventKey.split("_");
|
||||
}else if(eventKey.contains(",")){
|
||||
data = eventKey.split(",");
|
||||
}else{
|
||||
MsgException.throwException("分隔符有误!");
|
||||
}
|
||||
//商户id
|
||||
String merchantCode = data[0];
|
||||
//门店id
|
||||
String storeId = data[1];
|
||||
//手机号
|
||||
String phone = data[2];
|
||||
MerchantMenber merchantMenber=new MerchantMenber();
|
||||
merchantMenber.setPhone(phone);
|
||||
merchantMenber.setStoreId(storeId);
|
||||
merchantMenber.setMerchantCode(merchantCode);
|
||||
List<MerchantMenber> queryMerchantMenberList = merchantMenberService.queryMerchantMenberList(merchantMenber);
|
||||
if(queryMerchantMenberList!=null&&queryMerchantMenberList.size()>0) {
|
||||
merchantMenber = queryMerchantMenberList.get(0);
|
||||
if(StringUtil.isBlank(merchantMenber.getOpenid())){
|
||||
merchantMenber.setOpenid(openId);
|
||||
if(wxUserInfo != null){
|
||||
wxUserInfo.buildMember(merchantMenber,null);
|
||||
}
|
||||
merchantMenberService.updateMerchantMenber(merchantMenber);
|
||||
try {
|
||||
MerchantStore store = merchantStoreService.getStoreByMerchantCode(merchantMenber.getMerchantCode());
|
||||
|
||||
JSONObject miniprogram = new JSONObject();
|
||||
miniprogram.put("appid",ParametersUtil.APPLETS_APPID);
|
||||
miniprogram.put("pagepath","pages/card/index?storeId="+store.getId()+"&phone="+merchantMenber.getPhone());
|
||||
String first = "恭喜您成为本店会员,祝你生活愉快!";
|
||||
String remark = "如对此卡有疑问或查询会员更多优惠信息,可以点此进入小程序中查看!";
|
||||
double usableRechargeFee = merchantMenber.getUsableRechargeFee() == null ? 0 : StringUtil.bigDecimal(merchantMenber.getUsableRechargeFee());
|
||||
double usableGiveFee = merchantMenber.getUsableGiveFee() == null ? 0 : StringUtil.bigDecimal(merchantMenber.getUsableGiveFee());
|
||||
String useFee = BigDecimal.valueOf(usableRechargeFee + usableGiveFee).setScale(2,BigDecimal.ROUND_HALF_DOWN).toString();
|
||||
String[] array = {store.getStoreName(),merchantMenber.getPhone(),store.getStoreName()+"会员卡",useFee+"元"};
|
||||
WxTemolateRequest tempRequest = new WxTemolateRequest(openId,WxConstants.VIP_CARD_SUCCESS_TEMPLATE_ID,null,miniprogram)
|
||||
.buildData(first,remark,array);
|
||||
//发送开卡成功消息模板
|
||||
wxCommonService.sendTemplateMsg(tempRequest,tokenRequest);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(StringUtil.isNotEmpty(wxUserInfo.getUnionid())){
|
||||
merchantMenberService.updateByUnionId(openId,wxUserInfo.getUnionid());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
StringBuilder backMsgXml = new StringBuilder("<xml>");
|
||||
backMsgXml.append("<ToUserName><![CDATA["+openId+"]]></ToUserName>");
|
||||
backMsgXml.append("<FromUserName><![CDATA["+(String) map.get("ToUserName")+"]]></FromUserName>");
|
||||
backMsgXml.append("<CreateTime>"+System.currentTimeMillis()+"</CreateTime>");
|
||||
backMsgXml.append("<MsgType><![CDATA[text]]></MsgType>");
|
||||
backMsgXml.append("<Content><![CDATA[您好~很高兴为您服务\n<a href='https://gffhax2lhf4de.cschat.antcloud.com.cn/index.htm?tntInstId=1Jp_K9x2&scene=SCE00323632'>点此接入在线客服</a>]]></Content>");
|
||||
backMsgXml.append("</xml>");
|
||||
response.setContentType("text/xml; charset=utf-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.getWriter().write(backMsgXml.toString());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 读取request数据
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public String readRequestMsg(HttpServletRequest request) {
|
||||
java.io.BufferedReader bis = null;
|
||||
String line = null;
|
||||
String result = "";
|
||||
try {
|
||||
bis = new java.io.BufferedReader(new java.io.InputStreamReader(request.getInputStream(), "UTF-8"));
|
||||
while ((line = bis.readLine()) != null) {
|
||||
result += line + "\r\n";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
bis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("/orderPay")
|
||||
@ResponseBody
|
||||
public Result<Object> orderPay(@RequestBody JSONObject params) {
|
||||
String openid = params.getString("openid");
|
||||
String orderNumber = params.getString("orderNumber");
|
||||
return apiPayService.orderPay(openid,orderNumber);
|
||||
}
|
||||
|
||||
@PostMapping("/getAddress")
|
||||
@ResponseBody
|
||||
public Result<Object> getAddress(String lat ,String lng) {
|
||||
String location = lat + "," + lng;
|
||||
String key = "5G5BZ-BXLC3-BRM32-3LPUU-HVBFF-ULBRS";
|
||||
String sercetKey = "LTDOFZ9utWc85jxPZdUzS2VelRCcqGf2";
|
||||
String method = "/ws/geocoder/v1";
|
||||
|
||||
String reqParams = "key="+ key +"&location="+location + "&output=json";
|
||||
String signStr = method + "?"+reqParams + sercetKey;
|
||||
String sign = MD5Util.MD5Encode(signStr).toLowerCase(Locale.ROOT);
|
||||
String url = Constant.TENCENT_GET_ADDRESS_URL + "?" + reqParams + "&sig=" + sign;
|
||||
JSONObject response = restTemplate.getForObject(url, JSONObject.class);
|
||||
Integer status = response.getInteger("status");
|
||||
if(status != 0){
|
||||
return ResultGenerator.genFailResult(response.getString("message"));
|
||||
}
|
||||
JSONObject result = response.getJSONObject("result");
|
||||
JSONObject ad_info = result.getJSONObject("ad_info");
|
||||
String province = ad_info.getString("province");
|
||||
if(StringUtil.isEmpty(province)){
|
||||
province = ad_info.getString("city");
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("获取成功",province);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
//package cn.pluss.platform.controller.job;
|
||||
//
|
||||
//import java.util.Date;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
//import org.springframework.scheduling.annotation.Scheduled;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import com.alipay.api.AlipayApiException;
|
||||
//import com.alipay.api.AlipayClient;
|
||||
//import com.alipay.api.DefaultAlipayClient;
|
||||
//import com.alipay.api.request.AlipayTradeQueryRequest;
|
||||
//import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||
//
|
||||
//import cn.pluss.platform.entity.MerchantOrder;
|
||||
//import cn.pluss.platform.entity.UserApp;
|
||||
//import cn.pluss.platform.wap.HttpUrlConnection;
|
||||
//import cn.pluss.platform.wap.WxPaySignatureUtils;
|
||||
//import cn.pluss.platform.wap.XmlUtil;
|
||||
//import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
//import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
//import cn.pluss.platform.userApp.UserAppService;
|
||||
//import cn.pluss.platform.util.DateUtils;
|
||||
//import cn.pluss.platform.util.StringUtil;
|
||||
//import net.sf.json.JSONObject;
|
||||
//
|
||||
///**
|
||||
// * @author yuchen
|
||||
// *
|
||||
// * @Description
|
||||
// * 定时任务查订单状态为等待付款的订单
|
||||
// */
|
||||
//@Component
|
||||
//@Configuration //1.主要用于标记配置类,兼备Component的效果。
|
||||
//@EnableScheduling // 2.开启定时任务
|
||||
//public class SaticScheduleTask {
|
||||
//
|
||||
// @Autowired
|
||||
// private MerchantOrderService merchantOrderService;
|
||||
//
|
||||
// @Autowired
|
||||
// private SystemConfigService systemConfigService;
|
||||
//
|
||||
// @Autowired
|
||||
// private UserAppService userAppService;
|
||||
//
|
||||
//// @Scheduled(fixedRate=1000*60*30)
|
||||
// private void configureTasks() throws AlipayApiException {
|
||||
// MerchantOrder merchantOrder=new MerchantOrder();
|
||||
// merchantOrder.setStatus("5");
|
||||
// String endTime = DateUtils.formatDateDefault(new Date(),"yyyy-MM-dd 23:59:59");
|
||||
// String startTime = DateUtils.getDay(endTime, (int)0);
|
||||
// merchantOrder.setStartTime(startTime);
|
||||
// merchantOrder.setEndTime(endTime);
|
||||
// List<MerchantOrder> queryMerchantOrderList = merchantOrderService.queryMerchantOrderList(merchantOrder);
|
||||
// for (MerchantOrder m : queryMerchantOrderList) {
|
||||
// merchantOrder.setId(m.getId());
|
||||
// if("wechatPay".equalsIgnoreCase(m.getPayTypeCode())) {
|
||||
// getwechatOrderQuery(merchantOrder);
|
||||
// }else if("aliPay".equalsIgnoreCase(m.getPayTypeCode())) {
|
||||
// getaliPayOrderQuery(merchantOrder);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * getaliPayOrderQuery:(查询支付宝订单 若trade_status=TRADE_SUCCESS 修改订单). <br/>
|
||||
// *
|
||||
// * @author Administrator
|
||||
// * @throws AlipayApiException
|
||||
// * @since JDK 1.8
|
||||
// */
|
||||
// private void getaliPayOrderQuery(MerchantOrder merchantOrder) throws AlipayApiException {
|
||||
// UserApp userApp=new UserApp();
|
||||
// userApp.setMerchantCode(merchantOrder.getMerchantCode());
|
||||
// List<UserApp> queryUserAppList = userAppService.queryUserAppList(userApp);
|
||||
// if(queryUserAppList!=null&&queryUserAppList.size()>0) {
|
||||
// userApp = queryUserAppList.get(0);
|
||||
// }
|
||||
// if(userApp.getAppAuthToken()==null) {
|
||||
// return;
|
||||
// }
|
||||
// AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",systemConfigService.querySystemConfigValue("ALI_APP_ID"),systemConfigService.querySystemConfigValue("PRI"),"json","GBK",systemConfigService.querySystemConfigValue("PUB"),"RSA2");
|
||||
// AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
|
||||
// request.setBizContent("{" +
|
||||
// "\"out_trade_no\":\""+merchantOrder.getOrderNumber()+"\"" +
|
||||
// " }");
|
||||
// AlipayTradeQueryResponse response = alipayClient.execute(request);
|
||||
// request.putOtherTextParam("app_auth_token", userApp.getAppAuthToken());
|
||||
// if(response.isSuccess()){
|
||||
// String body = response.getBody();
|
||||
// JSONObject object = (JSONObject) JSONObject.fromObject(body).get("alipay_trade_query_response");
|
||||
// String tradeStatus = (String) object.get("trade_status");
|
||||
// if("TRADE_SUCCESS".equals(tradeStatus)) {
|
||||
// merchantOrder.setStatus("0");
|
||||
// merchantOrderService.updateMerchantOrder(merchantOrder);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * getwechatOrderQuery:(查询微信订单). <br/>
|
||||
// *
|
||||
// * @author Administrator
|
||||
// * @since JDK 1.8
|
||||
// */
|
||||
// private void getwechatOrderQuery(MerchantOrder merchantOrder) {
|
||||
// UserApp userApp=new UserApp();
|
||||
// userApp.setMerchantCode(merchantOrder.getMerchantCode());
|
||||
// List<UserApp> queryUserAppList = userAppService.queryUserAppList(userApp);
|
||||
// if(queryUserAppList!=null&&queryUserAppList.size()>0) {
|
||||
// userApp = queryUserAppList.get(0);
|
||||
// }
|
||||
// if(userApp.getSubMchId()==null) {
|
||||
// return;
|
||||
// }
|
||||
// Map<String, String> map=new HashMap<String, String>(16);
|
||||
// map.put("appid", systemConfigService.querySystemConfigValue("APPID"));
|
||||
// map.put("mch_id", systemConfigService.querySystemConfigValue("PID"));
|
||||
// map.put("sub_mch_id", userApp.getSubMchId());
|
||||
// map.put("out_trade_no", merchantOrder.getOrderNumber());
|
||||
// map.put("nonce_str", StringUtil.getBillno());
|
||||
// String WX_PAY_KEY = systemConfigService.querySystemConfigValue("KEY");
|
||||
// String sign = WxPaySignatureUtils.signature(map, WX_PAY_KEY);
|
||||
// StringBuffer xml=new StringBuffer();
|
||||
// xml.append("<xml>");
|
||||
// xml.append("<appid>"+ systemConfigService.querySystemConfigValue("APPID") +"</appid>");
|
||||
// xml.append("<mch_id>"+ systemConfigService.querySystemConfigValue("PID") +"</mch_id>");
|
||||
// xml.append("<nonce_str>"+ StringUtil.getBillno() +"</nonce_str>");
|
||||
// xml.append("<out_trade_no>"+ merchantOrder.getOrderNumber() +"</out_trade_no>");
|
||||
// xml.append("<sign>"+ sign +"</sign>");
|
||||
// xml.append("</xml>");
|
||||
// String httpXML = HttpUrlConnection.httpXML("https://api.mch.weixin.qq.com/pay/orderquery", xml.toString());
|
||||
// Map<String, Object> result = XmlUtil.toMap(httpXML);
|
||||
// if("SUCCESS".equals(result.get("return_code"))) {
|
||||
// String tradeState = (String) result.get("trade_state");
|
||||
// if("SUCCESS".equals(tradeState)){
|
||||
// merchantOrder.setStatus("0");
|
||||
// merchantOrderService.updateMerchantOrder(merchantOrder);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.pluss.platform.controller.phonecode;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultCode;
|
||||
import cn.pluss.platform.constants.Constant;
|
||||
import cn.pluss.platform.entity.MerchantMenber;
|
||||
import cn.pluss.platform.entity.PhoneValidateCode;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import cn.pluss.platform.merchantMenber.MerchantMenberService;
|
||||
import cn.pluss.platform.phoneValidateCode.PhoneValidateCodeService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.util.ValidateCodeUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuchen
|
||||
* @Description 验证码
|
||||
*/
|
||||
@Controller
|
||||
public class PhoneCodeController {
|
||||
|
||||
@Autowired
|
||||
private PhoneValidateCodeService phoneValidateCodeService;
|
||||
|
||||
@Autowired
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantMenberService merchantMenberService;
|
||||
|
||||
@Autowired
|
||||
private ValidateCodeUtil validateCodeUtil;
|
||||
|
||||
public Object sevice(String param) throws ClientException {
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setLoginName(param);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
List<UserInfo> queryUserInfoList = userInfoService.queryUserInfoList(userInfo);
|
||||
if (queryUserInfoList != null && queryUserInfoList.size() > 0) {
|
||||
result.put(Constant.RESULT_CODE_FAIL, "手机号已注册");
|
||||
return JSON.toJSONString(result);
|
||||
}
|
||||
|
||||
String checkCode = StringUtil.random(4);
|
||||
Result<Object> objectResult = validateCodeUtil.requestValidateCode(param, checkCode);
|
||||
if (objectResult != null && objectResult.getCode() == ResultCode.FAIL.code()) {
|
||||
result.put(Constant.RESULT_CODE_FAIL, objectResult.getMessage());
|
||||
return JSON.toJSONString(result);
|
||||
}
|
||||
|
||||
PhoneValidateCode phoneValidateCode = new PhoneValidateCode();
|
||||
phoneValidateCode.setPhone(param);
|
||||
phoneValidateCode.setSendDt(new Date());
|
||||
result.put(Constant.RESULT_CODE_SUCCESS, "发送成功");
|
||||
phoneValidateCode.setCode(checkCode);
|
||||
phoneValidateCode.setStatus("1");
|
||||
phoneValidateCodeService.savePhoneValidateCode(phoneValidateCode);
|
||||
String res = JSON.toJSONString(result);
|
||||
System.out.println(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Object seviceVIP(String phone, String storeId) throws ClientException {
|
||||
MerchantMenber merchantMenber = new MerchantMenber();
|
||||
merchantMenber.setPhone(phone);
|
||||
merchantMenber.setStoreId(storeId);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
List<MerchantMenber> queryMerchantMenberList = merchantMenberService.queryMerchantMenberList(merchantMenber);
|
||||
if (queryMerchantMenberList != null && queryMerchantMenberList.size() > 0) {
|
||||
result.put(Constant.RESULT_CODE_FAIL, "该门店已注册会员");
|
||||
return JSON.toJSONString(result);
|
||||
}
|
||||
|
||||
String checkCode = StringUtil.random(4);
|
||||
|
||||
Result<Object> objectResult = validateCodeUtil.requestValidateCode(phone, checkCode);
|
||||
if (objectResult != null && objectResult.getCode() == ResultCode.FAIL.code()) {
|
||||
result.put(Constant.RESULT_CODE_FAIL, objectResult.getMessage());
|
||||
return JSON.toJSONString(result);
|
||||
}
|
||||
|
||||
PhoneValidateCode phoneValidateCode = new PhoneValidateCode();
|
||||
phoneValidateCode.setPhone(phone);
|
||||
phoneValidateCode.setSendDt(new Date());
|
||||
result.put(Constant.RESULT_CODE_SUCCESS, "发送成功");
|
||||
phoneValidateCode.setCode(checkCode);
|
||||
phoneValidateCode.setStatus("1");
|
||||
phoneValidateCodeService.savePhoneValidateCode(phoneValidateCode);
|
||||
return JSON.toJSONString(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
package cn.pluss.platform.controller.systemConfig;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.ResponseBody;
|
||||
|
||||
import cn.pluss.platform.entity.SystemConfig;
|
||||
import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("systemconfig")
|
||||
public class SystemConfigController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
@Autowired
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
//引导页
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "systemConfig/systemconfigList";
|
||||
}
|
||||
|
||||
|
||||
//分页查询
|
||||
@RequestMapping(value = "/querySystemconfigByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> querySystemconfigByPage(Integer currPage,Integer id) {
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
|
||||
List<SystemConfig> systemconfigList=systemConfigService.querySystemConfigPage(map);
|
||||
Integer count=systemConfigService.querySystemConfigPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("systemconfigList", systemconfigList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//查询详情
|
||||
@RequestMapping(value = "/querySystemconfigDetails", method = RequestMethod.GET)
|
||||
public String querySystemconfigDetails(HttpServletRequest request,Integer id,Integer pageIndex) {
|
||||
if(id!=null&&id!=0) {
|
||||
SystemConfig systemconfig=new SystemConfig();
|
||||
systemconfig.setId(id);
|
||||
systemconfig=systemConfigService.querySystemConfig(systemconfig);
|
||||
request.setAttribute("systemconfig", systemconfig);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
|
||||
}
|
||||
|
||||
return "systemConfig/systemconfigDetails";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/querySystemconfigBaseInfo", method = RequestMethod.GET)
|
||||
public String querySystemConfigBaseInfo(HttpServletRequest request ,Integer id){
|
||||
if(id!=null&&id!=0) {
|
||||
SystemConfig systemconfig=new SystemConfig();
|
||||
systemconfig.setId(id);
|
||||
systemconfig=systemConfigService.querySystemConfig(systemconfig);
|
||||
request.setAttribute("systemconfig", systemconfig);
|
||||
}
|
||||
return "systemConfig/systemconfigBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/querySystemconfigExtendsInfo", method = RequestMethod.GET)
|
||||
public String querySystemConfigExtendsInfo(){
|
||||
|
||||
return "systemConfig/systemconfigExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/querySystemconfigFunctionsInfo", method = RequestMethod.GET)
|
||||
public String querySystemConfigFunctionsInfo(){
|
||||
|
||||
return "systemConfig/systemconfigFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*/
|
||||
@RequestMapping(value = "/saveSystemconfig", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveSystemConfig(SystemConfig systemconfig){
|
||||
if(systemconfig.getId()!=null&&systemconfig.getId()!=0){
|
||||
systemConfigService.updateSystemConfig(systemconfig);
|
||||
}else{
|
||||
systemConfigService.saveSystemConfig(systemconfig);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*/
|
||||
@RequestMapping(value = "/updateSystemconfig", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateSystemConfig(Integer id){
|
||||
SystemConfig systemconfig=new SystemConfig();
|
||||
systemconfig.setId(id);
|
||||
systemConfigService.updateSystemConfig(systemconfig);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*/
|
||||
@RequestMapping(value = "/deleteSystemconfig", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteSystemConfig(Integer id){
|
||||
SystemConfig systemconfig=new SystemConfig();
|
||||
systemconfig.setId(id);
|
||||
systemConfigService.deleteSystemConfig(systemconfig);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.pluss.platform.controller.test;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.pay.ApiPayService;
|
||||
import cn.pluss.platform.util.IpUtils;
|
||||
import cn.pluss.platform.util.MD5Util;
|
||||
import cn.pluss.platform.util.SignUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "/test")
|
||||
public class HelloController {
|
||||
|
||||
@Resource
|
||||
private ApiPayService apiPayService;
|
||||
|
||||
@RequestMapping(value = "/callbackV1")
|
||||
@ResponseBody
|
||||
public JSONObject callbackV1(){
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code","SUCCESS");
|
||||
result.put("msg","成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/callbackV2")
|
||||
@ResponseBody
|
||||
public String callbackV2(){
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "testPay")
|
||||
@ResponseBody
|
||||
public Result<Object> payTest(Double payAmt, HttpServletRequest request){
|
||||
String key = "4c8d277b0f274604af68e590cc0b3e6b";
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("mercOrderNo","TEST100"+ StringUtil.genRandomNum(20));
|
||||
params.put("merchantCode","M800202107223018811");
|
||||
params.put("method","trans_wap_pay");
|
||||
params.put("payAmt", BigDecimal.valueOf(payAmt).setScale(2,BigDecimal.ROUND_HALF_UP));
|
||||
params.put("ip","171.83.125.71");
|
||||
params.put("notifyUrl","http://bzgcrystal.natapp1.cc/wap/test/callbackV1");
|
||||
params.put("payWay","WXZF");
|
||||
params.put("subject","测试");
|
||||
params.put("returnUrl","http://www.baidu.com");
|
||||
String sigStr = SignUtils.getSignContent(params)+"&key="+key;
|
||||
String sign = MD5Util.MD5Encode(sigStr, "UTF-8");
|
||||
params.put("sign",sign);
|
||||
JSONObject pay = apiPayService.pay(params.toString(), IpUtils.getIpAddr(request));
|
||||
return ResultGenerator.genSuccessResult("获取成功",pay.getJSONObject("data").getString("orderNumber"));
|
||||
}
|
||||
}
|
||||
7
pluss-wap-page/src/main/resources/application-dev.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
10
pluss-wap-page/src/main/resources/application-prod.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
|
||||
scheduling:
|
||||
enabled: true
|
||||
7
pluss-wap-page/src/main/resources/application-test.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
40
pluss-wap-page/src/main/resources/application.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
server:
|
||||
port: 8084
|
||||
servlet:
|
||||
context-path: /wap
|
||||
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
profiles:
|
||||
include: common, ryx, ys
|
||||
active: dev
|
||||
datasource:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
|
||||
# mvc:
|
||||
# view:
|
||||
# prefix: /WEB-INF/jsp/
|
||||
# suffix: .jsp
|
||||
# thymeleaf:
|
||||
# mode: HTML
|
||||
# encoding: UTF-8
|
||||
# cache: false
|
||||
# prefix: classpath:/templates/
|
||||
# servlet:
|
||||
# content-type: text/html
|
||||
resources:
|
||||
static-locations: classpath:/static
|
||||
rabbitmq:
|
||||
username:
|
||||
password:
|
||||
host:
|
||||
port: 5672
|
||||
|
||||
jpush:
|
||||
environment:
|
||||
# 极光推送开发环境还是线上环境。暂未使用
|
||||
develop: true
|
||||
61
pluss-wap-page/src/main/resources/log4j2.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
|
||||
<!--Configuration后面的status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出-->
|
||||
<!--monitorInterval:Log4j能够自动检测修改配置 文件和重新配置本身,设置间隔秒数-->
|
||||
<configuration status="WARN" monitorInterval="30">
|
||||
<!--先定义所有的appender-->
|
||||
<appenders>
|
||||
<!--这个输出控制台的配置-->
|
||||
<console name="Console" target="SYSTEM_OUT">
|
||||
<!--输出日志的格式-->
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss:SSS} %p - %l - %m%n"/>
|
||||
</console>
|
||||
<!--文件会打印出所有信息,这个log每次运行程序会自动清空,由append属性决定,这个也挺有用的,适合临时测试用-->
|
||||
<File name="log" fileName="${sys:user.home}/wap/log/test.log" append="false">
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n" />
|
||||
</File>
|
||||
<!-- 这个会打印出所有的info及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
|
||||
<RollingFile name="RollingFileInfo" fileName="${sys:user.home}/wap/logs/info.log"
|
||||
filePattern="${sys:user.home}/wap/logs/$${date:yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log">
|
||||
<!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss:SSS} %p - %l - %m%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy modulate="true" interval="1"/>
|
||||
<SizeBasedTriggeringPolicy size="100 MB"/>
|
||||
</Policies>
|
||||
</RollingFile>
|
||||
<RollingFile name="RollingFileWarn" fileName="${sys:user.home}/wap/logs/warn.log"
|
||||
filePattern="${sys:user.home}/wap/logs/$${date:yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log">
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss:SSS} %p - %l - %m%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy modulate="true" interval="1"/>
|
||||
<SizeBasedTriggeringPolicy size="100 MB"/>
|
||||
</Policies>
|
||||
<!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件,这里设置了20 -->
|
||||
<DefaultRolloverStrategy max="20"/>
|
||||
</RollingFile>
|
||||
<RollingFile name="RollingFileError" fileName="${sys:user.home}/wap/logs/error.log"
|
||||
filePattern="${sys:user.home}/wap/logs/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log">
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss:SSS} %p - %l - %m%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy modulate="true" interval="1"/>
|
||||
<SizeBasedTriggeringPolicy size="100 MB"/>
|
||||
</Policies>
|
||||
</RollingFile>
|
||||
</appenders>
|
||||
<!--然后定义logger,只有定义了logger并引入的appender,appender才会生效-->
|
||||
<loggers>
|
||||
<!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
|
||||
<logger name="org.springframework" level="INFO"></logger>
|
||||
<logger name="org.mybatis" level="INFO"></logger>
|
||||
<root level="all">
|
||||
<appender-ref ref="Console"/>
|
||||
<appender-ref ref="RollingFileInfo"/>
|
||||
<appender-ref ref="RollingFileWarn"/>
|
||||
<appender-ref ref="RollingFileError"/>
|
||||
</root>
|
||||
</loggers>
|
||||
</configuration>
|
||||
4
pluss-wap-page/src/main/resources/static/resources/css/DPlayer.min.css
vendored
Normal file
|
After Width: | Height: | Size: 411 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 366 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 420 KiB |
|
After Width: | Height: | Size: 316 KiB |
@@ -0,0 +1,102 @@
|
||||
s{
|
||||
text-decoration:none;
|
||||
}
|
||||
.perport-container .c {
|
||||
font-size: 14px;
|
||||
text-indent: 2em;
|
||||
color: #666666;
|
||||
line-height: 38px;
|
||||
}
|
||||
.perport-container .c b,.perport-container .c i {
|
||||
position: relative;
|
||||
}
|
||||
.perport-container .c b {
|
||||
color: #2e6eab;
|
||||
background: #c1eee1;
|
||||
}
|
||||
.perport-container .c b a,.perport-container .c i a {
|
||||
position: absolute;
|
||||
padding: 0 6px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
top: -20px;
|
||||
left: 10px;
|
||||
font-size: 12px;
|
||||
text-indent: 0;
|
||||
border-radius: 4px 4px 4px 0;
|
||||
background: #646464;
|
||||
color: #fff;
|
||||
}
|
||||
.perport-container .c b s,.perport-container .c i s {
|
||||
padding: 0 4px;
|
||||
}
|
||||
.perport-container .s {
|
||||
background: #FCF0E2;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
border-radius: 0 4px 4px 4px;
|
||||
font-size: 14px;
|
||||
color: #FF8901;
|
||||
line-height: 24px;
|
||||
margin: 12px auto;
|
||||
}
|
||||
.perport-container .s::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 5px;
|
||||
left: 0;
|
||||
top: -9px;
|
||||
pointer-events: none;
|
||||
border-color: transparent transparent #FCF0E2 #FCF0E2;
|
||||
}
|
||||
.perport-container .c b i {
|
||||
color: #FF5844;
|
||||
border-bottom: 1px solid #FF5844;
|
||||
}
|
||||
.list i{
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.green{
|
||||
color:#2e6eab;
|
||||
}
|
||||
.orange{
|
||||
color:#FF8901;
|
||||
}
|
||||
.red{
|
||||
color:#FF5844;
|
||||
}
|
||||
.greenbg{
|
||||
background-color:#2e6eab;
|
||||
}
|
||||
.orangebg{
|
||||
background-color:#FF8901;
|
||||
}
|
||||
.redbg{
|
||||
background-color:#FF5844;
|
||||
}
|
||||
.annotation-side ul li{
|
||||
border-bottom:1px dotted #ccc;
|
||||
padding:10px 0;
|
||||
}
|
||||
.annotation-side ul li .text {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
line-height: 20px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
.praise{
|
||||
background: url(../images/common/unprize.png) no-repeat center;
|
||||
background-size:cover;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
.praise.current{
|
||||
background: url(../images/common/prize.png) no-repeat center;
|
||||
background-size:cover;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
@font-face {font-family: "iconfont";
|
||||
src: url('//at.alicdn.com/t/font_2120528_actmdls1his.eot?t=1603691377947'); /* IE9 */
|
||||
src: url('//at.alicdn.com/t/font_2120528_actmdls1his.eot?t=1603691377947#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAlMAAsAAAAAEaQAAAj/AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEcAqTSJAgATYCJAM4Cx4ABCAFhG0HgVAbFg/IDiUJwcBggKFEcfDPtz/+95mZCz7xC2iQkh3JUJHcxNUhrP4wiJumlMlbTLbdOveLCS27MiusTIpeFK6K3hS5Ors6cBNh/tdcnbch3lxDgzRimtiX4/FR1UZImvB4h4klDQlCWuiU1LBYLjNbs0UsTkSP1n/lYAiIaUoG0OguvWQgEgdDodgKSlUGIhsBuBFdEfr6kQ1dpKMgjNDsY1wAjrjf1y96KhIMnoUPNXF550rQ7ivnbVPYFNoDhtopwLRfGHC7GVigMwAHuheNuAHgADo7FMfKO44DQDW8zqW+5s+bPk96nvW88Hnz5y2fD3m+/GXayzNvm4QaIe5tZmM4SlQLrxqtB0iICHD4pMRfx788gyXDA/kQSg11sZGZwVeOIiTPuAkIEXASCAFwJggOOAsEH7gQhBS4OQgxcEsQQuAhIAh4OZxg4HsawQKfgRMy+N1E9jeLgNxsUAtgFMC2B8BFMLXCFQwRKZU/slzgsKIyNu0B85i1H+uA2U8LWazKPiKWRCDgQTOJ30EKpbQbO9sNwB7XLA8E7fUOu0utMLkQBGI/DEUPuGsoz2D7bDFunTNMQtjMJPIMsZpEMguGSeX22ZXIUzurKEgEpe4N+Q2CBzhfrtWxboOkZ8WHMv8tPPBEbt+43i3yy/yUdoKWESMvhcXMk8Db4IHCjp1dywEFyxGQzFDtrWtKcfjtPJsNgvfaUf5sK2DssQzmMfh1CJRQdDSjGssiFpTNGKemh/amutueictTZYRq7/WmK64V7brSaPnVsZxZGSWDrPtR7nVf07AVR4b2I2QD5MRAXN5fNvYDhQUC+AffaTA4COnvNh2alUZ4zOly7+zDppR+6HrDcIi2+BP2ndmFWD7pXQcv7YDMxy+fP3nybGLzQu/OrUulLChRrNzutW9EURLiMhUiRyOHP8O6aWV58DnhfyoLPNtfQwRUvjqQvPt8sve6VLohyRYsCvqjoQTedKhllmRLkOh7MJDpXg7sN+QWP27zK2azuQfsEsjsSeKtc0UBq3X0LBZrvwUwzrkT+Ru9EHzGVmNJjtigJMaFogesYryZOgghUNxWQO1SOYoj4KuSJh0/zZWEVHEHgIl4W/2AWXVmi5TYsVuc6k5df1pKJyxNvmwAl1mcyRtvtLzI9/dCbg5mlfr1dsi+RKK07XItF5OVFpN7tlQltUuhsScDscDiQtYdMh1OnO0Wg1X+TpxTT+Mguxfd6DMfSZrlkUBrb3TFbRtEIotDjCO6sAhY14tRECLcKAqTM14IKrpUCtk2SBDswIMgM+xLNqwTyQgMbsfhc+oVamT6sCc2RC76RCayacdlOWJmTJ8+Mzou2mHzz4i5eMAZ7fQwrk/8Fn7k0kwCjjHOTB8OXNw5gLcm40oOUSjLN66IUkSVNzlXSOQPXGUoH6QiiuR2aDCmQDmgt3LsMPeBJUMzqnfO0fH3SWMuYbsley9H7Wl6xdiEPh7emEsWEAUDVy7KdR+cl3ksIhfuE4wUpKsIHsFzpQU+Xzt1u1eias7rVqur1R51kOm+uLhea+QkoEWP1l22/U9L0BCrCyuElrD+o7ouJV1uvCpm4FBs+4CKmbUxYLaS4pJ+KYTfFUGKVC8oDWuumM46+UuXVAQh7sf3XO7f/6Y0Ay8DU8bUZ4PESpfDpKackCXg0NqoA04HibUE8QccDmcoDbBWHBfz4XsmpboePnLBQmxkFe1D5MSXkLLjsnlr19p3DK1dx8uOz4JCz/aAPMCYd/k9ms8ruHaCy2Ow2nUWxAcTMUbHz4+9/Udf6919R+qysOK4xf0uxF1oH/6iF7t44PW46/02AjDh0oqkPj8LTvWaFpVeCjTezWZNb2q1dwXC6A/ZDLvJnAJujehMduSsbavJAwslfQdjUL9T4xdo8ju1aL5nQPyzgczWHSJAuq99vyaBlVCkmzYoNnekTDCV9UZNl//bUyATT8rvXF5Pgd4949rCSH8wrMSBJWIzGHJ0V+HHUkXSLaQ5NJwxs7sTp1AOFP9mh88IbxkxI6JZ+MyIlio2bGxxeI1q0RI7MWjfhOmtdqQmTkiJhEJbfnxKeWPuKG7jTtffpEmn5ZU5V0Rtkna26di8YfdCfgt+XAuwM1wcEOGHWx8p/Hb8c2MX5XzrM/RTzSLw2XVghT1m3XpfRQepWZB+gOqfKyrH6N5XezKgidqnu357HLiuBowVvT3yTnf7bWLe6x2fn3wv8VDiXVnX+PgEAHpN/sZr355vZfPZH53tnB/dhK389u156td9Pjri0Nr5MyJGdyXy6j+ljLRZfb+0ASGukN0vUxdh3BK7U7e4YZe0bjQ53eXqlL7mWf3LxNnAxDoANNbbo7Z9qK5xKvwPngJAow8OWskzo73JuAhg1kAfb9NCDlg58492IcwZYoJD8ISmPbC3zGmLuczRsCnBvDbfCVwgee67EKvnjp2n4Lb6Fon+R05+dWiKliTnA9M6CRIIMUNAL7K8lrhRI6yQ6kXJgbl7kqhejX+rxqDVFsh2scxZRVSaAWLRC/LYmGLun0WVzZZn7lRZZW0IaAJsjN8aOPA7W3sk9AY++MOsYzrRtWJCCTpglC1FdWQqWYtCtooRlXMT1pZCLrId/561RznvrH0KBVvHTJdwhwltRSEddWSZgazEykdjVAVdp5TBBsQXH0CqjDVlurrSmRGkTk8lY7lZOe3srmQdqdtjFf0IVZ7BoMSUOroW61IcjqypoTGNjlaTFYasKoNB0yI7WxlbNauCrgUIo9BBUobB2K8Eo5zRnikqoKlDObgBpPPzAyBRYaSGMnQj9T57JiDRoYcaP0YuWeTMYHdFdbPqTaWsnhGoyMNAYUowVVUHTS0YXSiMpEZk0GBo4vOpIanAQBZVK9I0tCCb2lPORVnnU7W/dcSvr0FeP5eRlZMnX4FCRZnTzlJlylVAsIIuq6TqVNwxVcYyy2Aoo9RU2ZgyilP41WlkJYW+ijZqKTYUPYRZ6XI3KC+rqNZrdDqJjDHSUbcG2hg5popSGhloWEUbuVVGavSOW46gNFqqLCc3fCRJjaLqeN+/Yn5aITKaNk5ja/0BAA==') format('woff2'),
|
||||
url('//at.alicdn.com/t/font_2120528_actmdls1his.woff?t=1603691377947') format('woff'),
|
||||
url('//at.alicdn.com/t/font_2120528_actmdls1his.ttf?t=1603691377947') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||
url('//at.alicdn.com/t/font_2120528_actmdls1his.svg?t=1603691377947#iconfont') format('svg'); /* iOS 4.1- */
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-loading:before {
|
||||
content: "\e65b";
|
||||
}
|
||||
|
||||
.icon-zhuangtaijiazai:before {
|
||||
content: "\e69d";
|
||||
}
|
||||
|
||||
.icon-jianpan_shouqi:before {
|
||||
content: "\e82a";
|
||||
}
|
||||
|
||||
.icon-shouqijianpan:before {
|
||||
content: "\e62d";
|
||||
}
|
||||
|
||||
.icon-dian:before {
|
||||
content: "\ec1e";
|
||||
}
|
||||
|
||||
.icon-backspace:before {
|
||||
content: "\e62e";
|
||||
}
|
||||
|
||||
.icon-zuojiantou:before {
|
||||
content: "\e626";
|
||||
}
|
||||
|
||||
.icon-zhifubao:before {
|
||||
content: "\e63b";
|
||||
}
|
||||
|
||||
.icon-gou:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
|
||||
.icon-huiyuanvipqia01:before {
|
||||
content: "\e639";
|
||||
}
|
||||
|
||||
.icon-weixin:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.icon-iconfontjiantou5:before {
|
||||
content: "\e635";
|
||||
}
|
||||
|
||||
.icon-youhuiquan:before {
|
||||
content: "\e8c8";
|
||||
}
|
||||
6
pluss-wap-page/src/main/resources/static/resources/css/jquery-weui.min.css
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* mescroll -- 精致的下拉刷新和上拉加载js框架 ( a great JS framework for pull-refresh and pull-up-loading )
|
||||
* version 1.1.6
|
||||
* 2017-08-27
|
||||
* https://github.com/mescroll/mescroll.git
|
||||
* http://www.mescroll.com
|
||||
* author: wenju < mescroll@qq.com > 文举
|
||||
*
|
||||
* ----- mescroll的html结构解析 ----
|
||||
*
|
||||
<div id="mescroll" class="mescroll">
|
||||
|
||||
//下拉刷新区域 ( mescroll初始化之后自动创建 )
|
||||
<div class="mescroll-downwarp">
|
||||
<div class="downwarp-content">
|
||||
<p class="downwarp-progress"></p> <p class="downwarp-tip">下拉刷新 </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
//界面的具体内容
|
||||
//<div>界面内容</div>
|
||||
//数据列表..
|
||||
//<ul id="dataList" class="data-list">
|
||||
// <li>数据列表</li>
|
||||
|
||||
//空布局 ( 列表无任何数据时, 自动创建显示 )
|
||||
<div class="mescroll-empty">
|
||||
<img class="empty-icon" src="../img/mescroll-empty.png"/>
|
||||
<p class="empty-tip">暂无相关数据~</p>
|
||||
<p class="empty-btn">去逛逛 ></p>
|
||||
</div>
|
||||
|
||||
//</ul>
|
||||
|
||||
//上拉加载区域 ( mescroll初始化之后自动创建 )
|
||||
<div class="mescroll-upwarp">
|
||||
//加载中..
|
||||
<p class="upwarp-progress mescroll-rotate"></p><p class="upwarp-tip">加载中..</p>
|
||||
//无数据
|
||||
<p class="upwarp-nodata">-- END --</p>
|
||||
</div>
|
||||
|
||||
//回到顶部按钮 ( 列表滚动到配置的距离时, 自动创建显示 )
|
||||
<img class="mescroll-totop" src="../img/mescroll-totop.png"/>
|
||||
|
||||
</div>
|
||||
*
|
||||
*/
|
||||
|
||||
/*下拉刷新和上拉加载的滑动区域*/
|
||||
.mescroll {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/*启用硬件加速:动画渲染流畅,解决IOS下拉刷新因隐藏进度条致使的闪屏问题,在下拉刷新和上拉加载触发时启用,结束后移除,避免滥用导致其他兼容性问题*/
|
||||
.mescroll-hardware{
|
||||
-webkit-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
/*下拉刷新区域*/
|
||||
.mescroll-downwarp{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
/*下拉刷新--高度重置的过渡动画*/
|
||||
.mescroll-downwarp-reset{
|
||||
-webkit-transition: height 300ms;
|
||||
transition: height 300ms;
|
||||
}
|
||||
/*下拉刷新--内容区,定位于区域底部*/
|
||||
.mescroll-downwarp .downwarp-content{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
min-height: 30px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
/*上拉加载区域*/
|
||||
.mescroll-upwarp {
|
||||
min-height: 30px;
|
||||
padding: 15px 0;
|
||||
text-align: center;
|
||||
visibility: hidden;/*代替display: none,列表快速滑动到底部能及时显示上拉加载的区域*/
|
||||
}
|
||||
|
||||
/*下拉刷新,上拉加载--提示文本*/
|
||||
.mescroll-downwarp .downwarp-tip,
|
||||
.mescroll-upwarp .upwarp-tip,
|
||||
.mescroll-upwarp .upwarp-nodata {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: gray;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*下拉刷新,上拉加载--旋转进度条*/
|
||||
.mescroll-downwarp .downwarp-progress,
|
||||
.mescroll-upwarp .upwarp-progress {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid gray;
|
||||
margin-right: 8px;
|
||||
border-bottom-color: transparent;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*旋转动画*/
|
||||
.mescroll-rotate{
|
||||
-webkit-animation: mescrollRotate 0.6s linear infinite;
|
||||
animation: mescrollRotate 0.6s linear infinite;
|
||||
}
|
||||
@-webkit-keyframes mescrollRotate {
|
||||
0% { -webkit-transform: rotate(0deg); }
|
||||
100% { -webkit-transform: rotate(360deg); }
|
||||
}
|
||||
@keyframes mescrollRotate {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/*无任何数据的空布局*/
|
||||
.mescroll-empty {
|
||||
width: 100%;
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.mescroll-empty .empty-icon {
|
||||
width: 45%;
|
||||
}
|
||||
.mescroll-empty .empty-tip {
|
||||
margin-top: 6px;
|
||||
font-size: 14px;
|
||||
color: gray;
|
||||
}
|
||||
.mescroll-empty .empty-btn {
|
||||
max-width: 50%;
|
||||
margin: 20px auto;
|
||||
padding: 10px;
|
||||
border: 1px solid #65AADD;
|
||||
border-radius: 6px;
|
||||
background-color: white;
|
||||
color: #65AADD;
|
||||
}
|
||||
.mescroll-empty .empty-btn:active {
|
||||
opacity: .75;
|
||||
}
|
||||
|
||||
/*回到顶部的按钮*/
|
||||
.mescroll-totop {
|
||||
z-index: 9990;
|
||||
position: fixed;
|
||||
right: 10px;
|
||||
bottom: 30px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/*显示动画--淡入*/
|
||||
.mescroll-fade-in{
|
||||
-webkit-animation: mescrollFadeIn .5s linear forwards;
|
||||
animation: mescrollFadeIn .5s linear forwards;
|
||||
}
|
||||
@-webkit-keyframes mescrollFadeIn {
|
||||
0% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
@keyframes mescrollFadeIn {
|
||||
0% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
/*隐藏动画--淡出*/
|
||||
.mescroll-fade-out{
|
||||
pointer-events: none;
|
||||
-webkit-animation: mescrollFadeOut .5s linear forwards;
|
||||
animation: mescrollFadeOut .5s linear forwards;
|
||||
}
|
||||
@-webkit-keyframes mescrollFadeOut {
|
||||
0% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
@keyframes mescrollFadeOut {
|
||||
0% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
|
||||
/*滚动条轨道背景(默认在PC端设置)*/
|
||||
.mescroll-bar::-webkit-scrollbar-track{
|
||||
background-color: transparent;
|
||||
}
|
||||
/*滚动条轨道宽度 (默认在PC端设置)*/
|
||||
.mescroll-bar::-webkit-scrollbar{
|
||||
width: 6px;
|
||||
}
|
||||
/*滚动条游标 (默认在PC端设置)*/
|
||||
.mescroll-bar::-webkit-scrollbar-thumb{
|
||||
border-radius: 6px;
|
||||
background-color: #ccc;
|
||||
}
|
||||
/*滚动条游标鼠标经过的颜色变化 (默认在PC端设置)*/
|
||||
.mescroll-bar::-webkit-scrollbar-thumb:hover{
|
||||
background-color: #aaa;
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
.mobileSelect {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
-webkit-transition: opacity 0.4s, z-index 0.4s;
|
||||
transition: opacity 0.4s, z-index 0.4s;
|
||||
}
|
||||
.mobileSelect * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mobileSelect .grayLayer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: #eee;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 888;
|
||||
display: block;
|
||||
}
|
||||
.mobileSelect .content {
|
||||
width: 100%;
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 889;
|
||||
color: black;
|
||||
-webkit-transition: all 0.4s;
|
||||
transition: all 0.4s;
|
||||
bottom: -350px;
|
||||
left: 0;
|
||||
background: white;
|
||||
}
|
||||
.mobileSelect .content .fixWidth {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
}
|
||||
.mobileSelect .content .fixWidth:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
.mobileSelect .content .btnBar {
|
||||
border-bottom: 1px solid #DCDCDC;
|
||||
font-size: 15px;
|
||||
height: 45px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
line-height: 45px;
|
||||
}
|
||||
.mobileSelect .content .btnBar .cancel,
|
||||
.mobileSelect .content .btnBar .ensure {
|
||||
height: 45px;
|
||||
width: 55px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
.mobileSelect .content .btnBar .cancel {
|
||||
left: 0;
|
||||
color: #666;
|
||||
}
|
||||
.mobileSelect .content .btnBar .ensure {
|
||||
right: 0;
|
||||
color: #1e83d3;
|
||||
}
|
||||
.mobileSelect .content .btnBar .title {
|
||||
font-size: 15px;
|
||||
padding: 0 15%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.mobileSelect .content .panel:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
.mobileSelect .content .panel .wheels {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.mobileSelect .content .panel .wheel {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
float: left;
|
||||
width: 50%;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
-webkit-transition: width 0.3s ease;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
.mobileSelect .content .panel .wheel .selectContainer {
|
||||
display: block;
|
||||
text-align: center;
|
||||
-webkit-transition: -webkit-transform 0.18s ease-out;
|
||||
transition: -webkit-transform 0.18s ease-out;
|
||||
transition: transform 0.18s ease-out;
|
||||
transition: transform 0.18s ease-out, -webkit-transform 0.18s ease-out;
|
||||
}
|
||||
.mobileSelect .content .panel .wheel .selectContainer li {
|
||||
font-size: 15px;
|
||||
display: block;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.mobileSelect .content .panel .selectLine {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
pointer-events: none;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border-top: 1px solid #DCDCDC;
|
||||
border-bottom: 1px solid #DCDCDC;
|
||||
}
|
||||
.mobileSelect .content .panel .shadowMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), color-stop(rgba(255, 255, 255, 0)), to(#ffffff));
|
||||
background: -webkit-linear-gradient(top, #ffffff, rgba(255, 255, 255, 0), #ffffff);
|
||||
background: linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0), #ffffff);
|
||||
opacity: 0.9;
|
||||
pointer-events: none;
|
||||
}
|
||||
.mobileSelect-show {
|
||||
opacity: 1;
|
||||
z-index: 10000;
|
||||
visibility: visible;
|
||||
}
|
||||
.mobileSelect-show .content {
|
||||
bottom: 0;
|
||||
}
|
||||
392
pluss-wap-page/src/main/resources/static/resources/css/reset.css
Normal file
@@ -0,0 +1,392 @@
|
||||
html {
|
||||
-ms-text-size-adjust:none;
|
||||
-webkit-text-size-adjust:none;
|
||||
font-size:100px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding:0;
|
||||
color: #333333;
|
||||
background-color: white;
|
||||
font-size:0.3rem;
|
||||
overflow-x: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow-y:auto;
|
||||
}
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
[hidden],
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
a {
|
||||
background: transparent;
|
||||
text-decoration: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
color: #333;
|
||||
display:block;
|
||||
}
|
||||
li{
|
||||
list-style-type:none;
|
||||
}
|
||||
.red{
|
||||
color:#f00;
|
||||
}
|
||||
a:active {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
div{
|
||||
text-align:center;
|
||||
}
|
||||
button,
|
||||
html input[type="button"],
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
legend {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
p,
|
||||
figure,
|
||||
form,
|
||||
blockquote {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol,
|
||||
li,
|
||||
dl,
|
||||
dd {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
list-style: none outside none;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
.fl{
|
||||
float: left;
|
||||
}
|
||||
.fr{
|
||||
float: right;
|
||||
}
|
||||
.mar1{
|
||||
margin:0.2rem 0.1rem;
|
||||
}
|
||||
.pad1{
|
||||
padding:0.1rem;
|
||||
}
|
||||
.textl{
|
||||
text-align: left;
|
||||
}
|
||||
.textr{
|
||||
text-align: right;
|
||||
}
|
||||
input::-moz-placeholder,
|
||||
textarea::-moz-placeholder {
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder,
|
||||
textarea:-ms-input-placeholder {
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder,
|
||||
textarea::-webkit-input-placeholder {
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
/* 隐藏文字 */
|
||||
|
||||
.offScreen {
|
||||
left: -9999px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
/* WebKit browsers */
|
||||
color: #999;
|
||||
}
|
||||
|
||||
:-moz-placeholder {
|
||||
/* Mozilla Firefox 4 to 18 */
|
||||
color: #999;
|
||||
}
|
||||
|
||||
::-moz-placeholder {
|
||||
/* Mozilla Firefox 19+ */
|
||||
color: #999;
|
||||
}
|
||||
|
||||
:-ms-input-placeholder {
|
||||
/* Internet Explorer 10+ */
|
||||
color: #999;
|
||||
}
|
||||
a,
|
||||
button,
|
||||
input,
|
||||
div {
|
||||
-webkit-tap-highlight-color: rgba(255, 0, 0, 0);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.clearfix:after {
|
||||
content: "\200B";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
}
|
||||
.positionr{
|
||||
position:relative;
|
||||
}
|
||||
.positiona{
|
||||
position:absolute;
|
||||
}
|
||||
.red{
|
||||
color:#df6051;
|
||||
}
|
||||
.fw800{
|
||||
font-weight:800;
|
||||
}
|
||||
/* reset 部分样式重置 end ======================================= */
|
||||
|
||||
|
||||
|
||||
.payBox{
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
position: fixed;
|
||||
background:rgba(0,0,0,0.4);
|
||||
z-index: 3;
|
||||
}
|
||||
.payBox>div{
|
||||
background-color:white;
|
||||
position: absolute;
|
||||
height: 4.2rem;
|
||||
top:22%;
|
||||
margin-right: 0.6rem;
|
||||
margin-left: 0.6rem;
|
||||
border-radius: 0.08rem;
|
||||
/*border: 1rem solid #EEEEEE;
|
||||
border-radius: 10rem;*/
|
||||
}
|
||||
2972
pluss-wap-page/src/main/resources/static/resources/css/weui.css
Normal file
2901
pluss-wap-page/src/main/resources/static/resources/css/weui.min.css
vendored
Normal file
6
pluss-wap-page/src/main/resources/static/resources/css/weui/jquery-weui.min.css
vendored
Normal file
5
pluss-wap-page/src/main/resources/static/resources/css/weui/weui.min.css
vendored
Normal file
7096
pluss-wap-page/src/main/resources/static/resources/css/weuix.css
Normal file
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 289 KiB |
|
After Width: | Height: | Size: 440 KiB |
|
After Width: | Height: | Size: 787 KiB |
|
After Width: | Height: | Size: 790 KiB |
|
After Width: | Height: | Size: 712 KiB |
|
After Width: | Height: | Size: 325 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 735 B |
|
After Width: | Height: | Size: 5.2 KiB |
BIN
pluss-wap-page/src/main/resources/static/resources/images/bg.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 137 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 659 B |
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 9.2 KiB |