Commit 8548bcb6 by 陈浩建

宽带

parent bc0de1ae
...@@ -111,7 +111,9 @@ public class DankuanController { ...@@ -111,7 +111,9 @@ public class DankuanController {
@RequestParam("orderNumber") String orderNumber, @RequestParam("orderCustomerStudentId") String orderCustomerStudentId, @RequestParam("orderNumber") String orderNumber, @RequestParam("orderCustomerStudentId") String orderCustomerStudentId,
@RequestParam("orderCustomerAccount") String orderCustomerAccount, @RequestParam("orderCustomerPwd") String orderCustomerPwd, @RequestParam("orderCustomerAccount") String orderCustomerAccount, @RequestParam("orderCustomerPwd") String orderCustomerPwd,
@RequestParam("orderSetMeal") String orderSetMeal, @RequestParam("productId") String productId, @RequestParam("orderSetMeal") String orderSetMeal, @RequestParam("productId") String productId,
@RequestParam("webOrderAmount") String webOrderAmount, @RequestParam("partner") String partner) throws Exception { @RequestParam("webOrderAmount") String webOrderAmount, @RequestParam("partner") String partner, @RequestParam(value = "setMealIndex") String setMealIndex) throws Exception {
// 号码验证
if (!IDCardUtil.IDCardValidate(orderNumber)) { if (!IDCardUtil.IDCardValidate(orderNumber)) {
return ResponseData.error("您的身份证输入有误,请重新输入!"); return ResponseData.error("您的身份证输入有误,请重新输入!");
} }
...@@ -152,7 +154,7 @@ public class DankuanController { ...@@ -152,7 +154,7 @@ public class DankuanController {
orderV.setOrderSeq(orderViews.get(0).getOrderSeq()); orderV.setOrderSeq(orderViews.get(0).getOrderSeq());
return ResponseData.error(orderV, "当前身份证号已有订单存在!"); return ResponseData.error(orderV, "当前身份证号已有订单存在!");
} }
String orderSeq = "YRYM" + ProduceIdUtil.getId(); String orderSeq = RandomUtil.RandomNumber(20);
Product product = productMapper.selectById(productId); Product product = productMapper.selectById(productId);
OrderView orderView = new OrderView(); OrderView orderView = new OrderView();
orderView.setOrderName(orderName); orderView.setOrderName(orderName);
...@@ -167,6 +169,7 @@ public class DankuanController { ...@@ -167,6 +169,7 @@ public class DankuanController {
orderView.setOrderDate(new Date()); orderView.setOrderDate(new Date());
orderView.setOrderUniversityName(product.getProductUniversity()); orderView.setOrderUniversityName(product.getProductUniversity());
orderView.setStatus(OrderStatus.NOTPAID.getId()); orderView.setStatus(OrderStatus.NOTPAID.getId());
orderView.setHehuorenId(partner);
orderView.setOrderRegion(product.getProductRegion()); orderView.setOrderRegion(product.getProductRegion());
orderView.setPayType("1"); orderView.setPayType("1");
orderView.setWebOrderAmount(webOrderAmount); orderView.setWebOrderAmount(webOrderAmount);
...@@ -185,6 +188,7 @@ public class DankuanController { ...@@ -185,6 +188,7 @@ public class DankuanController {
Order order =(Order) res.getData(); Order order =(Order) res.getData();
orderV.setOrderRf2(order.getId()); orderV.setOrderRf2(order.getId());
} }
orderView.setSetMealIndex(setMealIndex);
Integer insert = orderViewMapper.insert(orderView); Integer insert = orderViewMapper.insert(orderView);
if (insert == 1) { if (insert == 1) {
orderV.setOrderId(orderView.getOrderId()); orderV.setOrderId(orderView.getOrderId());
...@@ -242,7 +246,7 @@ public class DankuanController { ...@@ -242,7 +246,7 @@ public class DankuanController {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String currentTimeStr = simpleDateFormat.format(new Date()); String currentTimeStr = simpleDateFormat.format(new Date());
String productId = "519"; String productId = "519";
/* if (StringUtils.isBlank(orderView.getOrderseqthd())) { if (StringUtils.isBlank(orderView.getOrderseqThd())) {
JSONObject productJsonObject = getProductId(currentTimeStr); JSONObject productJsonObject = getProductId(currentTimeStr);
if (productJsonObject.toString().indexOf("list") == -1) { if (productJsonObject.toString().indexOf("list") == -1) {
return ResponseData.error("未找到产品信息,如有疑问请联系客服!"); return ResponseData.error("未找到产品信息,如有疑问请联系客服!");
...@@ -257,13 +261,13 @@ public class DankuanController { ...@@ -257,13 +261,13 @@ public class DankuanController {
break; break;
} }
} }
}*/ }
String saleId = "1475"; // 销售id String saleId = "1475"; // 销售id
/* JSONObject saleJsonObject = getSaleId(productId, currentTimeStr); // 获取销售ID JSONObject saleJsonObject = getSaleId(productId, currentTimeStr); // 获取销售ID
log.info("----------调用智能平台的获取销售品接口返回值:" + saleJsonObject); log.info("----------调用智能平台的获取销售品接口返回值:" + saleJsonObject);
JSONArray saleList = saleJsonObject.getJSONArray("list"); JSONArray saleList = saleJsonObject.getJSONArray("list");
JSONObject itmeJson = JSONObject.parseObject(saleList.get(0).toString()); JSONObject itmeJson = JSONObject.parseObject(saleList.get(0).toString());
saleId = itmeJson.getString("saleId");*/ saleId = itmeJson.getString("saleId");
JSONObject submitOrderJsonObject = getOrderInfo(schoolMap, orderView, currentTimeStr, productId, saleId, "", "00000", "0元", "00000"); JSONObject submitOrderJsonObject = getOrderInfo(schoolMap, orderView, currentTimeStr, productId, saleId, "", "00000", "0元", "00000");
String orderNum = (String) submitOrderJsonObject.get("orderNumber"); String orderNum = (String) submitOrderJsonObject.get("orderNumber");
if (StringUtils.isNotBlank(orderNum)) { if (StringUtils.isNotBlank(orderNum)) {
...@@ -292,6 +296,43 @@ public class DankuanController { ...@@ -292,6 +296,43 @@ public class DankuanController {
*/ */
@RequestMapping(value = "toSubmisOrderPreser", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/plain;charset=UTF-8") @RequestMapping(value = "toSubmisOrderPreser", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/plain;charset=UTF-8")
public void toSubmisOrderPreser(HttpServletRequest request) throws Exception { public void toSubmisOrderPreser(HttpServletRequest request) throws Exception {
String orderseq = request.getParameter("ORDERSEQ");//orderseq
String uptranseq = request.getParameter("UPTRANSEQ"); // 穗易付平台,支付流水号uptranseq
String orderamount = request.getParameter("ORDERAMOUNT");//orderamount 价格
String orderreqtranseq = request.getParameter("ORDERREQTRANSEQ"); // 穗易付订单号 orderreqtranseq
/*String orderseq = "4iz818f1u74kznypf3w81";
String uptranseq = "2019082922001464810523969803"; // 穗易付平台,支付流水号
String orderamount = "30";
String orderreqtranseq = "GZCTPAY20190829384046979"; // 穗易付订单号*/
log.info("----------异步请求接受参数订单号:" + orderseq);
log.info("----------异步请求接受参数支付流水号:" + uptranseq);
log.info("----------异步请求接受参数订单金额:" + orderamount);
log.info("----------异步请求接受参数穗易付订单号:" + orderreqtranseq);
Wrapper<OrderView> wrapper = new EntityWrapper<>();
wrapper.eq("orderSeq", orderseq);
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("orderReqtranSeq", orderreqtranseq);
dataMapping.put("uptranseq", uptranseq);
dataMapping.put("order_payment_time", new Date());
dataMapping.put("status", "已支付");
orderViewMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
Wrapper<Order> objectEntityWrapper = new EntityWrapper<>();
objectEntityWrapper.eq("order_number", orderseq);
Map<String, Object> dataMapping2 = new HashMap<>();
dataMapping2.put("order_status", "未下单");
orderMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping2), objectEntityWrapper);
List<Order> orders = orderMapper.selectList(objectEntityWrapper);
appMapper.inserOrderHis(orders.get(0).getId(), "支付完成,未下单!", new Date(), orders.get(0).getCustomerName());
}
/**
* 支付完成回调接口--(旧)
*
* @param request
* @throws Exception
*/
public void toSubmisOrderPreser1(HttpServletRequest request) throws Exception {
OrderView orderMap = null; OrderView orderMap = null;
Map<String, Object> schoolMap = null; Map<String, Object> schoolMap = null;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
...@@ -301,7 +342,7 @@ public class DankuanController { ...@@ -301,7 +342,7 @@ public class DankuanController {
String uptranseq = request.getParameter("UPTRANSEQ"); // 穗易付平台,支付流水号uptranseq String uptranseq = request.getParameter("UPTRANSEQ"); // 穗易付平台,支付流水号uptranseq
String orderamount = request.getParameter("ORDERAMOUNT");//orderamount 价格 String orderamount = request.getParameter("ORDERAMOUNT");//orderamount 价格
String orderreqtranseq = request.getParameter("ORDERREQTRANSEQ"); // 穗易付订单号 orderreqtranseq String orderreqtranseq = request.getParameter("ORDERREQTRANSEQ"); // 穗易付订单号 orderreqtranseq
/*String orderseq = "4iz818f1u74kznypf3w81"; /*String orderseq = "4iz818f1u74kznypf3w81";
String uptranseq = "2019082922001464810523969803"; // 穗易付平台,支付流水号 String uptranseq = "2019082922001464810523969803"; // 穗易付平台,支付流水号
String orderamount = "30"; String orderamount = "30";
String orderreqtranseq = "GZCTPAY20190829384046979"; // 穗易付订单号*/ String orderreqtranseq = "GZCTPAY20190829384046979"; // 穗易付订单号*/
...@@ -404,18 +445,17 @@ public class DankuanController { ...@@ -404,18 +445,17 @@ public class DankuanController {
* @return * @return
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value = "orderPay", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/plain;charset=UTF-8") @RequestMapping(value = "orderPay")
@ResponseBody public ResponseData<Object> toPaymentPlatformPage(@RequestParam("orderId") String orderId, @RequestParam("ipay") String ipay, @RequestParam("userId") String userId, HttpServletRequest request, HttpServletResponse response) throws Exception {
public String toPaymentPlatformPage(@RequestParam("orderId") String orderId, @RequestParam("ipay") String ipay, @RequestParam("userId") String userId, HttpServletRequest request, HttpServletResponse response) throws Exception { String result = JsoupMethodZhifu(orderId, ipay, userId, request, response);
JsoupMethodZhifu(orderId, ipay, userId, request, response); return ResponseData.success(result);
return null;
} }
/** /**
* @author ljh * @author ljh
* @Description:支付请求 * @Description:支付请求
*/ */
public void JsoupMethodZhifu(String orderId, String ipay, String userId, public String JsoupMethodZhifu(String orderId, String ipay, String userId,
HttpServletRequest request, HttpServletResponse response) throws Exception { HttpServletRequest request, HttpServletResponse response) throws Exception {
log.info("----------首先发送支付请求接口----------"); log.info("----------首先发送支付请求接口----------");
//查询订单信息 //查询订单信息
...@@ -450,13 +490,14 @@ public class DankuanController { ...@@ -450,13 +490,14 @@ public class DankuanController {
if (Constant.Payment1.equals(ipay)) { if (Constant.Payment1.equals(ipay)) {
//支付成功回调的页面 //支付成功回调的页面
// String MERCHANTURL = Constant.TOMCATURL + "/dankuan/toPaymentSuccessPage?id=" + userId +"orderId="+id; // String MERCHANTURL = Constant.TOMCATURL + "/dankuan/toPaymentSuccessPage?id=" + userId +"orderId="+id;
String MERCHANTURL = "http://hhrcode.winsun-aly.com/#/hhr/dkSuccessful?id="+userId+"&"+"orderId="+id; String MERCHANTURL = "http://3715zj2369.qicp.vip/#/hhr/dkSuccessful?id="+userId+"&"+"orderId="+id;
map.put("MERCHANTURL", MERCHANTURL); map.put("MERCHANTURL", MERCHANTURL);
} }
//单宽回调后端接口地址 //单宽回调后端接口地址
// map.put("BACKDROPURL", Constant.TOMCATURL + "/dankuan/toSubmisOrderPreser"); // map.put("BACKDROPURL", Constant.TOMCATURL + "/dankuan/toSubmisOrderPreser");
map.put("BACKDROPURL", "http://hhrcode.winsun-aly.com/ciop/dankuan/toSubmisOrderPreser.do"); //测试地址
map.put("BACKDROPURL", "http://3715zj2369.qicp.vip/ciop/dankuan/toSubmisOrderPreser.do");
String str = "ORDERSEQ=" + orderView.getOrderSeq() + "&ORDERDATE=" + ft.format(orderdate) + "&ORDERAMOUNT=" + orderView.getWebOrderAmount() + "&KEY=" + Constant.APPK;//商户标识 String str = "ORDERSEQ=" + orderView.getOrderSeq() + "&ORDERDATE=" + ft.format(orderdate) + "&ORDERAMOUNT=" + orderView.getWebOrderAmount() + "&KEY=" + Constant.APPK;//商户标识
...@@ -476,8 +517,17 @@ public class DankuanController { ...@@ -476,8 +517,17 @@ public class DankuanController {
Document doc = null; Document doc = null;
String result = ""; String result = "";
String qrcode = ""; String qrcode = "";
//Jsoup用post提交,超时6秒钟, // Jsoup用post提交,超时6秒钟,
doc = Jsoup.connect("https://gzdxpay.mini189.cn/web/order-pay.action").data(map).timeout(20000).ignoreContentType(true).post(); // 旧地址 https://gzdxpay.mini189.cn/web/order-pay.action
// 新环境测试地址 https://gzctpay.mini189.cn/previewpay/orderPay/order-pay
// 新环境正式地址 https://gzctpay.mini189.cn/pay/orderPay/order-pay
doc =
Jsoup.connect("https://gzctpay.mini189.cn/pay/orderPay/order-pay")
.proxy("172.18.101.170", 3128)
.data(map)
.timeout(20000)
.ignoreContentType(true)
.post();
//获取回调信息 //获取回调信息
String i = doc.text().trim(); String i = doc.text().trim();
log.info(i); log.info(i);
...@@ -520,8 +570,9 @@ public class DankuanController { ...@@ -520,8 +570,9 @@ public class DankuanController {
order.setLzgh(school.getLzgh()); order.setLzgh(school.getLzgh());
orderMapper.insert(order); orderMapper.insert(order);
appMapper.inserOrderHis(id, "支付请求提交!", new Date(), orderView.getOrderName()); appMapper.inserOrderHis(id, "支付请求提交!", new Date(), orderView.getOrderName());
response.sendRedirect(result); return result;
} }
return null;
} }
/** /**
...@@ -817,11 +868,11 @@ public class DankuanController { ...@@ -817,11 +868,11 @@ public class DankuanController {
setMeal = setMeal.replace("包月", ""); setMeal = setMeal.replace("包月", "");
setMeal = setMeal.replace("包年", ""); setMeal = setMeal.replace("包年", "");
} }
if (setMeal.contains("20M")) { if (setMeal.equals("20M")) {
setMeal = "20M下行速率/4M上行速率"; setMeal = "20M下行速率/4M上行速率";
} else if (setMeal.contains("2M")) { } else if (setMeal.equals("2M")) {
setMeal = "2M下行速率/512K上行速率"; setMeal = "2M下行速率/512K上行速率";
} else if (setMeal.contains("50M")) { } else if (setMeal.equals("50M")) {
setMeal = "50M下行速率/10M上行速率"; setMeal = "50M下行速率/10M上行速率";
} }
propertyMap.put("value", setMeal); propertyMap.put("value", setMeal);
......
...@@ -8,10 +8,7 @@ import com.winsun.bean.*; ...@@ -8,10 +8,7 @@ import com.winsun.bean.*;
import com.winsun.constant.Constant; import com.winsun.constant.Constant;
import com.winsun.constant.OrderStatus; import com.winsun.constant.OrderStatus;
import com.winsun.mapper.*; import com.winsun.mapper.*;
import com.winsun.utils.BeanUtil; import com.winsun.utils.*;
import com.winsun.utils.MD5Utils;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import com.winsun.utils.ProduceIdUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
...@@ -33,6 +30,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -33,6 +30,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -96,6 +94,19 @@ public class RongHeController { ...@@ -96,6 +94,19 @@ public class RongHeController {
return ResponseData.success(objMap); return ResponseData.success(objMap);
} }
/**
* 宽带下单获取产品信息
*
*/
@RequestMapping("/selectProductManage")
public ResponseData<Object> selectProductManage(@RequestParam("id") String id){
Map<String,Object> map = productMapper.queryProductById(id).get(0);
if(map.size()>0){
map.put("id",id);
return ResponseData.success(map);
}
return ResponseData.error("查询数据出错!");
}
/** /**
* 支付平台异步更新后台地址,主要对订单进去保存和提交订单到智能平台上 * 支付平台异步更新后台地址,主要对订单进去保存和提交订单到智能平台上
...@@ -110,13 +121,13 @@ public class RongHeController { ...@@ -110,13 +121,13 @@ public class RongHeController {
@RequestParam("orderCustomerAccount") String orderCustomerAccount, @RequestParam("orderCustomerPwd") String orderCustomerPwd, @RequestParam("orderCustomerAccount") String orderCustomerAccount, @RequestParam("orderCustomerPwd") String orderCustomerPwd,
@RequestParam("orderSetMeal") String orderSetMeal, @RequestParam("productId") String productId, @RequestParam("orderSetMeal") String orderSetMeal, @RequestParam("productId") String productId,
@RequestParam("webOrderAmount") String webOrderAmount, @RequestParam("partner") String partner, @RequestParam("webOrderAmount") String webOrderAmount, @RequestParam("partner") String partner,
@RequestParam("banLiPhone") String banLiPhone, @RequestParam("rhTime") String rhTime) throws Exception { @RequestParam("banLiPhone") String banLiPhone, @RequestParam("rhTime") String rhTime, @RequestParam(value = "setMealIndex") String setMealIndex){
Wrapper<OrderView> orderViewWrapper = new EntityWrapper<>(); Wrapper<OrderView> orderViewWrapper = new EntityWrapper<>();
orderViewWrapper.eq(StringUtils.isNotBlank(orderNumber), "orderNumber", orderNumber); orderViewWrapper.eq(StringUtils.isNotBlank(orderNumber), "orderNumber", orderNumber);
orderViewWrapper.ne("status", OrderStatus.INVALID.getId()); orderViewWrapper.ne("status", OrderStatus.INVALID.getId());
List<OrderView> orderViews = orderViewMapper.selectList(orderViewWrapper); List<OrderView> orderViews = orderViewMapper.selectList(orderViewWrapper);
OrderView orderV = new OrderView(); OrderView orderV = new OrderView();
if (orderViews.size() != 0) { if (orderViews.size() != 0) {
if (StringUtils.isNotBlank(orderViews.get(0).getUptranseq())) { if (StringUtils.isNotBlank(orderViews.get(0).getUptranseq())) {
...@@ -147,8 +158,19 @@ public class RongHeController { ...@@ -147,8 +158,19 @@ public class RongHeController {
orderV.setOrderSeq(orderViews.get(0).getOrderSeq()); orderV.setOrderSeq(orderViews.get(0).getOrderSeq());
return ResponseData.error(orderV, "当前身份证号已有订单存在!"); return ResponseData.error(orderV, "当前身份证号已有订单存在!");
} }
String orderSeq = "YRYM" + ProduceIdUtil.getId();
String mealStr = null;
String byStr = null;
String prices = null;
Integer index = 0;
String orderSeq = RandomUtil.RandomNumber(20);
Product product = productMapper.selectById(productId); Product product = productMapper.selectById(productId);
UniversityInfo universityInfo = universityInfoMapper.selectById(product.getUniversityId());
String[] rateArry = product.getProductRhRate().split(","); // 年月(包年,包月)
String[] mealArry = product.getProductMeal().split(","); // 套餐 (4M,8M,20M等)
String[] priceArry = product.getProductPrice().split(","); // 金额(300,30)
String expenses = universityInfo.getExpenses();
OrderView orderView = new OrderView(); OrderView orderView = new OrderView();
orderView.setOrderSeq(orderSeq); // 订单号码 orderView.setOrderSeq(orderSeq); // 订单号码
orderView.setOrderName(orderName); // 姓名 orderView.setOrderName(orderName); // 姓名
...@@ -158,14 +180,37 @@ public class RongHeController { ...@@ -158,14 +180,37 @@ public class RongHeController {
orderView.setOrderCustomerAccount(orderCustomerAccount);// 多媒体账号 orderView.setOrderCustomerAccount(orderCustomerAccount);// 多媒体账号
orderView.setOrderCustomerPwd(orderCustomerPwd);// 多媒体密码 orderView.setOrderCustomerPwd(orderCustomerPwd);// 多媒体密码
orderView.setOrderSetMeal(orderSetMeal);// 套餐 orderView.setOrderSetMeal(orderSetMeal);// 套餐
if ("".equals(setMealIndex) && !setMealIndex.matches("[0-9]*")) {
if (orderSetMeal.indexOf("包年") != -1) {
mealStr = orderSetMeal.replace("包年", "");
byStr = "包年";
} else {
mealStr = orderSetMeal.replace("包月", "");
byStr = "包月";
}
for (int i = 0; i < priceArry.length; i++) {
if (byStr.equals(rateArry[i]) && mealStr.equals(mealArry[i])) {
prices = priceArry[i] + "元";
break;
}
}
}else {
index = Integer.parseInt(setMealIndex);
mealStr = mealArry[index];
byStr = rateArry[index];
prices = priceArry[index] + "元";
}
orderView.setExpenses(expenses+byStr);
orderView.setProductName(product.getProductTitle());// 产品名称 orderView.setProductName(product.getProductTitle());// 产品名称
orderView.setOrderDate(new Date()); // 提交时间 orderView.setOrderDate(new Date()); // 提交时间
orderView.setOrderUniversityName(product.getProductUniversity()); // 学校 orderView.setOrderUniversityName(product.getProductUniversity()); // 学校
orderView.setStatus(OrderStatus.NOTPAID.getId()); orderView.setStatus(OrderStatus.NOTPAID.getId());
orderView.setHehuorenId(partner);
orderView.setOrderRegion(product.getProductRegion()); // 区域 orderView.setOrderRegion(product.getProductRegion()); // 区域
orderView.setPayType("1"); // 支付方式 orderView.setPayType("1"); // 支付方式
orderView.setOrderRf2(rhTime); orderView.setOrderRf2(rhTime);
orderView.setWebOrderAmount(webOrderAmount); // 产品价格 orderView.setWebOrderAmount(webOrderAmount); // 产品价格
// 支付平台:0翼支付网厅|1支付宝|3微信
if (webOrderAmount.equals("0")) { if (webOrderAmount.equals("0")) {
orderView.setIPay("0"); // 支付平台 orderView.setIPay("0"); // 支付平台
} else { } else {
...@@ -174,13 +219,19 @@ public class RongHeController { ...@@ -174,13 +219,19 @@ public class RongHeController {
orderView.setCustomerId("xyzxyql"); // 接入商 orderView.setCustomerId("xyzxyql"); // 接入商
orderView.setOrderCustomerType("学生"); // 用户类别 orderView.setOrderCustomerType("学生"); // 用户类别
if (webOrderAmount.equals("0")) { if (webOrderAmount.equals("0")) {
ResponseData<Object> res = createOrder(productId, orderView, partner, rhTime); ResponseData<Object> res = null;
try {
res = createOrder(productId, orderView, partner, rhTime);
} catch (Exception e) {
e.printStackTrace();
}
if (!res.isSuccess()) { if (!res.isSuccess()) {
return res; return res;
} }
Order order =(Order) res.getData(); Order order =(Order) res.getData();
orderV.setOrderRf2(order.getId()); orderV.setOrderRf2(order.getId());
} }
orderView.setSetMealIndex(setMealIndex);
Integer insert = orderViewMapper.insert(orderView); Integer insert = orderViewMapper.insert(orderView);
if (insert == 1) { if (insert == 1) {
orderV.setOrderId(orderView.getOrderId()); orderV.setOrderId(orderView.getOrderId());
...@@ -191,13 +242,18 @@ public class RongHeController { ...@@ -191,13 +242,18 @@ public class RongHeController {
return ResponseData.error("提交失败!"); return ResponseData.error("提交失败!");
} }
public ResponseData<Object> createOrder(String productId, OrderView orderView, String userId, String rhTime) throws Exception { public ResponseData<Object> createOrder(String productId, OrderView orderView, String userId, String rhTime){
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
String id = uuid.split("-")[0] + uuid.split("-")[1]; String id = uuid.split("-")[0] + uuid.split("-")[1];
Order order = new Order(); Order order = new Order();
order.setId(id); order.setId(id);
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
Date parse = simpleDateFormat1.parse(rhTime); Date parse = null;
try {
parse = simpleDateFormat1.parse(rhTime);
} catch (ParseException e) {
e.printStackTrace();
}
order.setRhTime(parse); order.setRhTime(parse);
order.setOrderNumber(orderView.getOrderSeq()); order.setOrderNumber(orderView.getOrderSeq());
order.setOrderStatus(OrderStatus.NOTPAID.getName()); order.setOrderStatus(OrderStatus.NOTPAID.getName());
...@@ -206,7 +262,7 @@ public class RongHeController { ...@@ -206,7 +262,7 @@ public class RongHeController {
order.setContactNumber(orderView.getOrderPhone()); order.setContactNumber(orderView.getOrderPhone());
order.setIdCard(orderView.getOrderNumber()); order.setIdCard(orderView.getOrderNumber());
order.setCreateTime(new Date()); order.setCreateTime(new Date());
order.setUserType("5"); order.setUserType("3");
order.setNetNumber(orderView.getOrderCustomerAccount()); order.setNetNumber(orderView.getOrderCustomerAccount());
order.setNetPassword(orderView.getOrderCustomerPwd()); order.setNetPassword(orderView.getOrderCustomerPwd());
order.setUserSchool(orderView.getOrderUniversityName()); order.setUserSchool(orderView.getOrderUniversityName());
...@@ -268,15 +324,22 @@ public class RongHeController { ...@@ -268,15 +324,22 @@ public class RongHeController {
} }
@RequestMapping(value = "orderPay", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/plain;charset=UTF-8") /**
@ResponseBody * 支付接口
public String toPaymentPlatformPage(@RequestParam("orderId") String orderId, @RequestParam("ipay") String ipay, *
@RequestParam("userId") String userId, HttpServletRequest request, * @param orderId
HttpServletResponse response, @RequestParam("rhTime") String rhTime) throws Exception { * @param ipay
JsoupMethodZhifu(orderId, ipay, userId, request, response, rhTime); * @param userId
return null; * @param request
* @param response
* @return
* @throws Exception
*/
@RequestMapping(value = "orderPay")
public ResponseData<Object> toPaymentPlatformPage(@RequestParam("orderId") String orderId, @RequestParam("ipay") String ipay, @RequestParam("userId") String userId, @RequestParam("rhTime") String rhTime, HttpServletRequest request, HttpServletResponse response) throws Exception {
String result = JsoupMethodZhifu(orderId, ipay, userId, request, response,rhTime);
return ResponseData.success(result);
} }
@RequestMapping("/selectUniversity") @RequestMapping("/selectUniversity")
public ResponseData<UniversityInfo> selectUniversity(@RequestParam("universityId") String universityId) { public ResponseData<UniversityInfo> selectUniversity(@RequestParam("universityId") String universityId) {
UniversityInfo universityInfo = universityInfoMapper.selectById(universityId); UniversityInfo universityInfo = universityInfoMapper.selectById(universityId);
...@@ -288,7 +351,7 @@ public class RongHeController { ...@@ -288,7 +351,7 @@ public class RongHeController {
* @author ljh * @author ljh
* @Description:支付请求 * @Description:支付请求
*/ */
public void JsoupMethodZhifu(String orderId, String ipay, String userId, public String JsoupMethodZhifu(String orderId, String ipay, String userId,
HttpServletRequest request, HttpServletResponse response, String rhTime) throws Exception { HttpServletRequest request, HttpServletResponse response, String rhTime) throws Exception {
log.info("----------首先发送支付请求接口----------"); log.info("----------首先发送支付请求接口----------");
//查询订单信息 //查询订单信息
...@@ -322,14 +385,14 @@ public class RongHeController { ...@@ -322,14 +385,14 @@ public class RongHeController {
if (Constant.Payment1.equals(ipay)) { if (Constant.Payment1.equals(ipay)) {
//支付成功回调的页面 //支付成功回调的页面
/* String MERCHANTURL = Constant.TOMCATURL + "/dankuan/toSubmisOrderPreser?id=" + userId +"orderId="+id;*/ /* String MERCHANTURL = Constant.TOMCATURL + "/dankuan/toSubmisOrderPreser?id=" + userId +"orderId="+id;*/
/* String MERCHANTURL = "http://167460x6b0.51mypc.cn/ciop/rongHe/toSubmisOrderPreser?id=" + userId +"orderId="+id;*/ /* String MERCHANTURL = "http://167460x6b0.51mypc.cn/ciop/rongHe/toSubmisOrderPreser?id=" + userId +"orderId="+id;*/
String MERCHANTURL = "http://hhrcode.winsun-aly.com/#/hhr/dkSuccessful?id="+userId+"&"+"orderId="+id; String MERCHANTURL = "http://3715zj2369.qicp.vip/#/hhr/dkSuccessful?id="+userId+"&"+"orderId="+id;
map.put("MERCHANTURL", MERCHANTURL); map.put("MERCHANTURL", MERCHANTURL);
} }
//单宽回调后端接口地址 // 融合回调后端接口地址
// map.put("BACKDROPURL", Constant.TOMCATURL + "/dankuan/toSubmisOrderPreser"); // map.put("BACKDROPURL", Constant.TOMCATURL + "/rongHe/toSubmisOrderPreser");
map.put("BACKDROPURL", "http://hhrcode.winsun-aly.com/ciop/rongHe/toSubmisOrderPreser.do"); map.put("BACKDROPURL", "http://3715zj2369.qicp.vip/ciop/rongHe/toSubmisOrderPreser.do");
String str = "ORDERSEQ=" + orderView.getOrderSeq() + "&ORDERDATE=" + ft.format(orderdate) + "&ORDERAMOUNT=" + orderView.getWebOrderAmount() + "&KEY=" + Constant.APPK;//商户标识 String str = "ORDERSEQ=" + orderView.getOrderSeq() + "&ORDERDATE=" + ft.format(orderdate) + "&ORDERAMOUNT=" + orderView.getWebOrderAmount() + "&KEY=" + Constant.APPK;//商户标识
//* 将值转换为大写 *//* //* 将值转换为大写 *//*
...@@ -348,8 +411,17 @@ public class RongHeController { ...@@ -348,8 +411,17 @@ public class RongHeController {
Document doc = null; Document doc = null;
String result = ""; String result = "";
String qrcode = ""; String qrcode = "";
//Jsoup用post提交,超时6秒钟, // Jsoup用post提交,超时6秒钟,
doc = Jsoup.connect("https://gzdxpay.mini189.cn/web/order-pay.action").data(map).timeout(20000).ignoreContentType(true).post(); // 旧地址 https://gzdxpay.mini189.cn/web/order-pay.action
// 新环境测试地址 https://gzctpay.mini189.cn/previewpay/orderPay/order-pay
// 新环境正式地址 https://gzctpay.mini189.cn/pay/orderPay/order-pay
doc =
Jsoup.connect("https://gzctpay.mini189.cn/pay/orderPay/order-pay")
.proxy("172.18.101.170", 3128)
.data(map)
.timeout(20000)
.ignoreContentType(true)
.post();
//获取回调信息 //获取回调信息
String i = doc.text().trim(); String i = doc.text().trim();
log.info(i); log.info(i);
...@@ -362,7 +434,11 @@ public class RongHeController { ...@@ -362,7 +434,11 @@ public class RongHeController {
String ORDERSEQ = (String) json.get("ORDERSEQ"); String ORDERSEQ = (String) json.get("ORDERSEQ");
String msg = (String) json.get("msg"); String msg = (String) json.get("msg");
if (StringUtils.isNotBlank(msg) && msg.equals("success")) { if (StringUtils.isNotBlank(msg) && msg.equals("success")) {
dataMapping.put("payType", PAYTYPE + "");
log.info("====默认受理未付费,之后可通过提交订单到智能平台后再更新状态====");
dataMapping.put("status", "未支付"); dataMapping.put("status", "未支付");
log.info("====保存到本地数据库 ====");
orderViewMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper); orderViewMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
Order order = new Order(); Order order = new Order();
order.setId(id); order.setId(id);
...@@ -372,7 +448,8 @@ public class RongHeController { ...@@ -372,7 +448,8 @@ public class RongHeController {
order.setContactNumber(orderView.getOrderPhone()); order.setContactNumber(orderView.getOrderPhone());
order.setIdCard(orderView.getOrderNumber()); order.setIdCard(orderView.getOrderNumber());
order.setCreateTime(new Date()); order.setCreateTime(new Date());
order.setUserType("5"); order.setUserType("3");
order.setKapin("融合办理");
order.setNetNumber(orderView.getOrderCustomerAccount()); order.setNetNumber(orderView.getOrderCustomerAccount());
order.setNetPassword(orderView.getOrderCustomerPwd()); order.setNetPassword(orderView.getOrderCustomerPwd());
order.setUserSchool(orderView.getOrderUniversityName()); order.setUserSchool(orderView.getOrderUniversityName());
...@@ -395,8 +472,9 @@ public class RongHeController { ...@@ -395,8 +472,9 @@ public class RongHeController {
order.setRhTime(parse); order.setRhTime(parse);
orderMapper.insert(order); orderMapper.insert(order);
appMapper.inserOrderHis(id, "支付请求提交!", new Date(), orderView.getOrderName()); appMapper.inserOrderHis(id, "支付请求提交!", new Date(), orderView.getOrderName());
response.sendRedirect(result); return result;
} }
return null;
} }
/** /**
...@@ -502,7 +580,7 @@ public class RongHeController { ...@@ -502,7 +580,7 @@ public class RongHeController {
} }
plaintext = plaintext.concat(Constant.ZHANGSHIKEY); plaintext = plaintext.concat(Constant.ZHANGSHIKEY);
String sign = MD5Utils.md5(plaintext).toUpperCase();//md5加密 String sign = MD5Utils.md5(plaintext).toUpperCase();//md5加密
qParams.add(new BasicNameValuePair("sign", sign));//签名,必填 qParams.add(new BasicNameValuePair("sign", sign));//签名,必填
JSONObject resultDataJson = null; JSONObject resultDataJson = null;
try { try {
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
......
...@@ -3,15 +3,11 @@ package com.winsun.controller; ...@@ -3,15 +3,11 @@ package com.winsun.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.auth.core.common.model.ResponseData; import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.bean.KdPhone; import com.winsun.bean.*;
import com.winsun.bean.Order; import com.winsun.mapper.*;
import com.winsun.bean.Regular;
import com.winsun.bean.XshInventory;
import com.winsun.mapper.KdPhoneMapper;
import com.winsun.mapper.OrderMapper;
import com.winsun.mapper.RegularMapper;
import com.winsun.mapper.XshInventoryMapper;
import com.winsun.smsUtils.SendSmsAndMail; import com.winsun.smsUtils.SendSmsAndMail;
import com.winsun.utils.MessageUtil;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import com.winsun.utils.RandomUtil; import com.winsun.utils.RandomUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -46,6 +42,8 @@ public class codeManagerController { ...@@ -46,6 +42,8 @@ public class codeManagerController {
@Autowired @Autowired
private XshInventoryMapper xshInventoryMapper; private XshInventoryMapper xshInventoryMapper;
@Autowired @Autowired
private AuthCodeMapper authCodeMapper;
@Autowired
@Qualifier("redisStringTemplate") @Qualifier("redisStringTemplate")
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
...@@ -65,10 +63,25 @@ public class codeManagerController { ...@@ -65,10 +63,25 @@ public class codeManagerController {
wrapper2.eq("business_number",phone); wrapper2.eq("business_number",phone);
List<Order> list1 = orderMapper.selectList(wrapper2); List<Order> list1 = orderMapper.selectList(wrapper2);
if(list.size()>0 || list1.size()>0){ if(list.size()>0 || list1.size()>0){
// 生成6位随机数 // 生成6位随机数
String veCode = String.valueOf((int) ((RandomUtil.getSecrityRandom() * 9 + 1) * 100000)); int veCode = (int) ((RandomUtil.getSecrityRandom() * 9 + 1) * 100000);
//MessageUtil.sent(packageUpgrade.getAccNbr(),"4","您获取的验证码为:"+s+",半小时内有效。"); // MessageUtil.sent(packageUpgrade.getAccNbr(),"4","您获取的验证码为:"+s+",半小时内有效。");
redisTemplate.opsForValue().set(phone, veCode, 240, TimeUnit.MINUTES); // 新框架短信验证码保存在Redis,但由于业务需要使用原来方式,存在数据库里
redisTemplate.opsForValue().set(phone, String.valueOf(veCode), 240, TimeUnit.MINUTES);
AuthCode authCode = new AuthCode();
authCode.setId(phone);
authCode.setUserAuthCode(veCode);
Wrapper<AuthCode> authCodeWrapper = new EntityWrapper<>();
authCodeWrapper.eq("id",phone);
Map<String,Object> map2 = new HashMap<>();
map2.put("user_authcode",veCode);
List<AuthCode> auth = authCodeMapper.queryAuthCode(phone);
if(auth.size()>0){
authCodeMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(map2),authCodeWrapper);
}else{
authCodeMapper.insert(authCode);
}
SendSmsAndMail.sendSms(phone,veCode + "","7"); SendSmsAndMail.sendSms(phone,veCode + "","7");
log.info("验证码:" + veCode); log.info("验证码:" + veCode);
map.put("code",1); map.put("code",1);
......
#############################################################################
#ػFTP
#
ftp_host=127.0.0.1
ftp_port=21
ftp_username=root
ftp_password=qUDZj/w2Rus=
ftp_sys=E:/FTP
hhr_img=/datas/apps/web/tomcats/apache-tomcat-7.0.100-hhr/hhrphoto
#hhr_img=D:/a
sign_img=/datas/apps/web/tomcats/apache-tomcat-7.0.100-hhr/hhr-sign-img
#sign_img=D:/a
yrym_sign=rQXPSHvWvHasj17#5L70ux3KvlWNqoVQ
...@@ -55,11 +55,16 @@ public class OrderView implements Serializable { ...@@ -55,11 +55,16 @@ public class OrderView implements Serializable {
@TableField(value = "orderDate") @TableField(value = "orderDate")
private Date orderDate; private Date orderDate;
/** /**
* 订单状态 * 订单状态
*/ */
@TableField(value = "status") @TableField(value = "status")
private String status; private String status;
/** /**
* 合伙人id
*/
@TableField(value = "hehuoren_id")
private String hehuorenId;
/**
* 区域 * 区域
*/ */
@TableField(value = "order_region") @TableField(value = "order_region")
...@@ -149,5 +154,11 @@ public class OrderView implements Serializable { ...@@ -149,5 +154,11 @@ public class OrderView implements Serializable {
*/ */
@TableField(value = "orderSeqTHD") @TableField(value = "orderSeqTHD")
private String orderseqThd; private String orderseqThd;
/**
* 套餐下标
*/
@TableField(value = "set_meal_index")
private String setMealIndex;
} }
\ No newline at end of file
package com.winsun.bean; package com.winsun.bean;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
...@@ -25,110 +26,138 @@ public class Product implements Serializable { ...@@ -25,110 +26,138 @@ public class Product implements Serializable {
/** /**
* 宽带标题 * 宽带标题
*/ */
@TableField("product_title")
private String productTitle; private String productTitle;
/** /**
* 创建人 * 创建人
*/ */
@TableField("product_creater")
private String productCreater; private String productCreater;
/** /**
* 最后更新时间 * 最后更新时间
*/ */
@TableField("product_last_update_time")
private Date productLastUpdateTime; private Date productLastUpdateTime;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField("product_create_time")
private Date productCreateTime; private Date productCreateTime;
/** /**
* 区域 * 区域
*/ */
@TableField("product_region")
private String productRegion; private String productRegion;
/** /**
* *
*/ */
@TableField("product_introduction_pic1")
private String productIntroductionPic1; private String productIntroductionPic1;
/** /**
* 套餐及资费 * 套餐及资费
*/ */
@TableField("product_meal_price")
private String productMealPrice; private String productMealPrice;
/** /**
* 资费介绍 * 资费介绍
*/ */
@TableField("product_set_meal_introduction")
private String productSetMealIntroduction; private String productSetMealIntroduction;
/** /**
* 了解产品 * 了解产品
*/ */
@TableField("product_introduction")
private String productIntroduction; private String productIntroduction;
/** /**
* 状态0正常,1下架 * 状态0正常,1下架
*/ */
private String productState = "0"; @TableField("product_state")
private String productState;
/** /**
* 适用学校 * 适用学校
*/ */
@TableField("product_university")
private String productUniversity; private String productUniversity;
/** /**
* 标识 * 标识
*/ */
@TableField("identifying")
private String identifying; private String identifying;
/** /**
* 融合资费介绍 * 融合资费介绍
*/ */
@TableField("product_rf2")
private String productRf2; private String productRf2;
/** /**
* 小白卡套餐id * 小白卡套餐id
*/ */
@TableField("product_school_abbreviated")
private String productSchoolAbbreviated; private String productSchoolAbbreviated;
/** /**
* 资费 * 资费
*/ */
@TableField("product_price")
private String productPrice; private String productPrice;
/** /**
* 融合资费 * 融合资费
*/ */
@TableField("product_rh_Price")
private String productRhPrice; private String productRhPrice;
/** /**
* 宽带速率 * 宽带速率
*/ */
@TableField("product_meal")
private String productMeal; private String productMeal;
/** /**
* 包年包月情况 * 包年包月情况
*/ */
@TableField("product_rate")
private String productRate; private String productRate;
/** /**
* 融合包年包月情况 * 融合包年包月情况
*/ */
@TableField("product_rh_rate")
private String productRhRate; private String productRhRate;
/** /**
* 资费正则Id * 资费正则Id
*/ */
@TableField("product_introduction_pic2")
private String productIntroductionPic2; private String productIntroductionPic2;
@TableField("product_introduction_pic3")
private String productIntroductionPic3; private String productIntroductionPic3;
@TableField("product_introduction_pic4")
private String productIntroductionPic4; private String productIntroductionPic4;
@TableField("product_introduction_pic5")
private String productIntroductionPic5; private String productIntroductionPic5;
@TableField("university_id")
private int universityId; private int universityId;
/** /**
* 是否显示融合时间 * 是否显示融合时间
*/ */
@TableField("show_rh_time")
private String showRhTime; private String showRhTime;
} }
package com.winsun.bean; package com.winsun.bean;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
...@@ -22,108 +23,133 @@ public class UniversityInfo implements Serializable { ...@@ -22,108 +23,133 @@ public class UniversityInfo implements Serializable {
private int universityId; private int universityId;
/** /**
* 学校名称 * 学校名称
*/ */
@TableField("university_name")
private String universityName; private String universityName;
/** /**
*所在区域 *所在区域
*/ */
@TableField("university_region")
private String universityRegion; private String universityRegion;
/** /**
*外线方式 *外线方式
*/ */
@TableField("university_exterior_lines")
private String universityExteriorLines; private String universityExteriorLines;
/** /**
*揽装工号 *揽装工号
*/ */
@TableField("university_package_number")
private String universityPackageNumber; private String universityPackageNumber;
/** /**
*创建人 *创建人
*/ */
@TableField("university_creater")
private String universityCreater; private String universityCreater;
/** /**
*创建时间 *创建时间
*/ */
@TableField("university_create_time")
private Date universityCreateTime; private Date universityCreateTime;
/** /**
*最后更新时间 *最后更新时间
*/ */
@TableField("university_last_update_time")
private Date universityLastUpdateTime; private Date universityLastUpdateTime;
/** /**
*装机地址 *装机地址
*/ */
@TableField("university_installed_address")
private String universityInstalledAddress; private String universityInstalledAddress;
/** /**
*允许上网终端类型 *允许上网终端类型
*/ */
@TableField("university_terminal_type")
private String universityTerminalType; private String universityTerminalType;
/** /**
*用户类别 *用户类别
*/ */
@TableField("university_user_category")
private String universityUserCategory; private String universityUserCategory;
/** /**
*用户类型 *用户类型
*/ */
@TableField("university_user_type")
private String universityUserType; private String universityUserType;
/** /**
*月租类型 *月租类型
*/ */
@TableField("university_monthly_rent_type")
private String universityMonthlyRentType; private String universityMonthlyRentType;
/** /**
*'计费属性' *'计费属性'
*/ */
@TableField("university_charging_attribute")
private String universityChargingAttribute; private String universityChargingAttribute;
/** /**
*最大在线数 *最大在线数
*/ */
@TableField("university_online_number")
private String universityOnlineNumber; private String universityOnlineNumber;
/** /**
*一人一号多终端:0否 1是 *一人一号多终端:0否 1是
*/ */
@TableField("university_one_man_terminal")
private String universityOneManTerminal; private String universityOneManTerminal;
/** /**
*是否FTTH+HUB:0否 1是 *是否FTTH+HUB:0否 1是
*/ */
@TableField("university_is_ftth_hub")
private String universityIsFtthHub; private String universityIsFtthHub;
/** /**
*地址 *地址
*/ */
@TableField("university_installed_address_ID")
private String universityInstalledAddressId; private String universityInstalledAddressId;
/** /**
*学校联系号码 *学校联系号码
*/ */
@TableField("university_contact_phone")
private String universityContactPhone; private String universityContactPhone;
/** /**
*收费模式 *收费模式
*/ */
@TableField("university_charge_mode")
private String universityChargeMode; private String universityChargeMode;
/** /**
* *
*/ */
@TableField("university_domain_name")
private String universityDomainName; private String universityDomainName;
/** /**
*对用户显示的融合套餐 *对用户显示的融合套餐
*/ */
@TableField("rh_package")
private String rhPackage; private String rhPackage;
/** /**
*融合资费 *融合资费
*/ */
@TableField("expenses")
private String expenses; private String expenses;
/** /**
*标识 *标识
*/ */
@TableField("identifying")
private String identifying; private String identifying;
/** /**
*融合办理,短信通知的提速的速率 *融合办理,短信通知的提速的速率
*/ */
@TableField("speed")
private String speed; private String speed;
/** /**
*公众号的名字 *公众号的名字
*/ */
@TableField("public_number")
private String publicNumber; private String publicNumber;
} }
package com.winsun.constant; package com.winsun.constant;
import javax.net.ssl.*;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/** /**
* @author ljh * @author ljh
* @Description:常量类 * @Description:常量类
...@@ -21,6 +27,8 @@ public class Constant { ...@@ -21,6 +27,8 @@ public class Constant {
/*支付参数*/ /*支付参数*/
public final static String CLIENTNUMBER = "xyzxyql"; //商户标识,由穗易付平台统一分配 public final static String CLIENTNUMBER = "xyzxyql"; //商户标识,由穗易付平台统一分配
public final static String APPK = "E805F0305C455BA7C5BAE3796C6500BD"; //KEY 商户标识,由穗易付平台统一分配 public final static String APPK = "E805F0305C455BA7C5BAE3796C6500BD"; //KEY 商户标识,由穗易付平台统一分配
public final static String KEY = "E805F0305C455BA7C5BAE3796C6500BD"; //商户标识,由穗易付平台统一分配
public final static String USERNAME = "apitest"; //智能平台提供测试的账号 public final static String USERNAME = "apitest"; //智能平台提供测试的账号
public final static String USERNAMEKEY = "46b97294d4dac3f62ee42f3ab2804f68"; //智能平台提供的测试key public final static String USERNAMEKEY = "46b97294d4dac3f62ee42f3ab2804f68"; //智能平台提供的测试key
public final static String ZHENGSHIAUCCON = "ruany"; //智能平台提供的正式账号 public final static String ZHENGSHIAUCCON = "ruany"; //智能平台提供的正式账号
...@@ -64,5 +72,37 @@ public class Constant { ...@@ -64,5 +72,37 @@ public class Constant {
public final static String ROLE2 = "2"; // 用户权限:1管理员 2测试人员 3工作人员 4学校人员 public final static String ROLE2 = "2"; // 用户权限:1管理员 2测试人员 3工作人员 4学校人员
public final static String ROLE3 = "3"; // 用户权限:1管理员 2测试人员 3工作人员 4学校人员 public final static String ROLE3 = "3"; // 用户权限:1管理员 2测试人员 3工作人员 4学校人员
public final static String ROLE4 = "4"; // 用户权限:1管理员 2测试人员 3工作人员 4学校人员 public final static String ROLE4 = "4"; // 用户权限:1管理员 2测试人员 3工作人员 4学校人员
/** 信任任何站点 */
public static void trustEveryone() {
try {
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, new X509TrustManager[] { new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
} }, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
} catch (Exception e) {
e.printStackTrace();
}
}
} }
...@@ -2,6 +2,8 @@ package com.winsun.mapper; ...@@ -2,6 +2,8 @@ package com.winsun.mapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
...@@ -16,6 +18,20 @@ import java.util.Map; ...@@ -16,6 +18,20 @@ import java.util.Map;
@Mapper @Mapper
@Component @Component
public interface HhrUserMapper extends BaseMapper<HhrUser> { public interface HhrUserMapper extends BaseMapper<HhrUser> {
@Select("select u.area ,u.name ,u.school,u.phone_num " +
"from hhr_user u " +
"left join hhr_user_school us on u.id = us.user_id " +
"where u.id=#{partner}")
List<Map<String, Object>> findPartnerById2(@Param("partner") String partner);
@Select("select uuu.name ddname,sch.lzgh " +
"from hhr_user u " +
"left join hhr_user_school us on u.id = us.user_id " +
"left join hhr_school sch on sch.id = us.school_id " +
"left join hhr_supervisor_school ss on us.school_id = ss.school " +
"left join hhr_user uuu on uuu.id = ss.user_id " +
"where u.id=#{partner}")
List<Map<String, Object>> findSupervisorByPartnerId(@Param("partner") String partner);
/** /**
* 统计所有订单数 * 统计所有订单数
......
...@@ -33,4 +33,13 @@ public interface OrderViewMapper extends BaseMapper<OrderView> { ...@@ -33,4 +33,13 @@ public interface OrderViewMapper extends BaseMapper<OrderView> {
@Insert("insert into`hhr_order_history`(order_id, status, create_date) values(#{id}, #{status}, #{createTime})") @Insert("insert into`hhr_order_history`(order_id, status, create_date) values(#{id}, #{status}, #{createTime})")
int insertOrderHistory(@Param("id")String id,@Param("status")String status,@Param("createTime") Timestamp createTime); int insertOrderHistory(@Param("id")String id,@Param("status")String status,@Param("createTime") Timestamp createTime);
@Select("select * from order_view where orderSeq = #{orderSeq}")
Map<String, Object> queryorderSeq(@Param("orderSeq")String orderSeq);
@Update("update hhr_order set rh_time = #{rhTime} where orderSeq=#{orderSeq}")
int updatePayRhTime(@Param("rhTime") String rhTime, @Param("orderSeq") String orderSeq);
@Select("select * from order_view where orderNumber=#{orderNumber} and status !=#{status} ")
List<Map<String,Object>> orderViewToStatusList(@Param("orderNumber")String orderNumber,@Param("status")String status);
} }
...@@ -4,11 +4,26 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -4,11 +4,26 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.Package; import com.winsun.bean.Package;
import com.winsun.bean.Product; import com.winsun.bean.Product;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
@Component @Component
public interface ProductMapper extends BaseMapper<Product> { public interface ProductMapper extends BaseMapper<Product> {
@Select("SELECT * FROM `product_manage` WHERE product_id = (SELECT b.`bandproduct_id` FROM hhr_user_school a LEFT JOIN hhr_school b ON a.`school_id`=b.`id` WHERE a.user_id=#{partner})")
List<Map<String, Object>> findMoreUniversity(@Param("partner") String partner);
@Select(" SELECT pm.product_university as universityName,pm.product_region as productRegion," +
" pm.product_title productName " +
" FROM hhr_user u " +
" LEFT JOIN hhr_user_school us ON u.`id`=us.`user_id`" +
" LEFT JOIN hhr_school s ON us.`school_id`=s.`id` " +
" LEFT JOIN product_manage pm ON s.bandproduct_id=pm.product_id" +
" WHERE u.`id`= #{id}")
List<Map<String,Object>> queryProductById(@Param("id")String id);
} }
...@@ -50,4 +50,10 @@ public interface SchoolMapper extends BaseMapper<School> { ...@@ -50,4 +50,10 @@ public interface SchoolMapper extends BaseMapper<School> {
@Delete("delete from hhr_supervisor_school where user_id = #{userId}") @Delete("delete from hhr_supervisor_school where user_id = #{userId}")
int deleteSupervisorSchoolByUserId(@Param("userId") String userId); int deleteSupervisorSchoolByUserId(@Param("userId") String userId);
@Select("SELECT s.* FROM hhr_user u" +
" LEFT JOIN hhr_user_school us ON u.`id`=us.`user_id`" +
" LEFT JOIN hhr_school s ON s.`id`=us.`school_id`" +
" WHERE u.id=#{id}")
Map<String, Object> querySchoolById(@Param("id") String id);
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.plugins.Page; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.plugins.Page;
import com.winsun.bean.UniversityInfo; import com.winsun.bean.UniversityInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
...@@ -17,4 +18,5 @@ public interface UniversityInfoMapper extends BaseMapper<UniversityInfo> { ...@@ -17,4 +18,5 @@ public interface UniversityInfoMapper extends BaseMapper<UniversityInfo> {
List<Map<String, Object>> getBroadBandConfigList(Page page, List<Map<String, Object>> getBroadBandConfigList(Page page,
@Param("productUniversity") String productUniversity, @Param("productRegion") String productRegion); @Param("productUniversity") String productUniversity, @Param("productRegion") String productRegion);
} }
package com.winsun.utils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
/**
* Base64流转图片工具类
* @author calvin
*/
public class Base64ToImgUtils {
public static String base64ToImg(String imgData, String hhr_img) throws IOException {
String filePath = "";
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
uuid = uuid.substring(1, 12);
SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat sd2 = new SimpleDateFormat("yyyyMM");
String orderNumber = "YRYM" + sd.format(new Date()) + uuid;
Date date = new Date();
String createdate = sd2.format(date);
File file = new File(hhr_img + "/" + createdate+ "/" + sd.format(date) + "/"+ orderNumber);
if (!file.exists() && !file.isDirectory()) {
file.mkdirs();
}
if (!imgData.isEmpty()) {
String name = orderNumber;
String base64Data = imgData.split(",")[1];
String houzhui = imgData.split(",")[0].split("/")[1].split(";")[0];
/**
* 2.解码成字节数组
*/
filePath = hhr_img + "/" + createdate+ "/" + sd.format(date) + "/"+ orderNumber +"/" + "O" + name +"."+ houzhui;
java.util.Base64.Decoder decoder = java.util.Base64.getDecoder();
byte[] bytes = decoder.decode(base64Data);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(filePath);
fos.write(bytes);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fos != null){
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return filePath;
}
}
package com.winsun.utils; package com.winsun.utils;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.Random;
/** /**
* 随机数工具类 * 随机数工具类
...@@ -34,4 +35,19 @@ public class RandomUtil { ...@@ -34,4 +35,19 @@ public class RandomUtil {
} }
return 0; return 0;
} }
/* 组成20个随机数的订单号 */
public static String RandomNumber(int length){
String str="1234567890abcdefghijklmnopqrstuvwxyz";
Random random=new Random();
StringBuffer sb=new StringBuffer();
for(int i=0;i<length;i++){
int number =random.nextInt(36);
sb.append(str.charAt(number));
}
return sb.toString();
}
} }
package com.winsun.utils;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Created by wangwenbo on 2018/5/24.
*/
/* 签名验证相关utilS*/
public class SignUtil {
/**
* 将输入的参数转换成sign
* @param param 请求的参数(不包含sign,否则会把sign当作数据一齐处理)
* @param appKey 指定的秘钥
* @return
*/
public static String createUnifiedOrderSign(final Map<String,String> param, String appKey) {
List<String> keies = new ArrayList<>();
keies.addAll(param.keySet());
Collections.sort(keies);
List<String> datas = new ArrayList<>();
keies.forEach(key -> {
datas.add(key + "=" + param.getOrDefault(key, ""));
});
datas.add(appKey);
return DigestUtils.md5Hex(StringUtils.join(datas, "&")).toLowerCase();
}
private static final String TOKEN = "supperapp"; // 加密token
/***
* MD5加密 生成32位md5码 速度比较快 性能高 安全强度比sha1要低
*
* @param 待加密字符串
* @return 返回32位md5码
*/
public static String md5EncodeSignature(String inStr) throws Exception {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
e.printStackTrace();
return "";
}
byte[] byteArray = inStr.getBytes("UTF-8");
byte[] md5Bytes = md5.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
/***
* SHA加密 生成40位SHA码 加密速度比md5慢 性能比md5低 安全强度比md5高
*
* @param 待加密字符串
* @return 返回40位SHA码
*/
public static String shaEncodeSignature(String inStr) throws Exception {
MessageDigest sha = null;
try {
sha = MessageDigest.getInstance("SHA");
} catch (Exception e) {
e.printStackTrace();
return "";
}
byte[] byteArray = inStr.getBytes("UTF-8");
byte[] md5Bytes = sha.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
/**
* 签名加密
*
* @param inStr
* @param type
* 加密方式 1,MD5 2,SHA
* @return
*/
public static String signature(String inStr, int type) {
String encodeStr = "";
int sel = type;
if (sel == 0) {
try {
encodeStr = md5EncodeSignature(TOKEN+":"+ inStr);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
encodeStr = shaEncodeSignature(TOKEN+":" + inStr);
} catch (Exception e) {
e.printStackTrace();
}
}
return encodeStr;
}
//把一个字符串中的大写转为小写,小写转换为大写
public static String exChange(String str){
StringBuffer sb = new StringBuffer();
if(str!=null){
for(int i=0;i<str.length();i++){
char c = str.charAt(i);
if(Character.isLowerCase(c)){
sb.append(Character.toUpperCase(c)); // 小转大
}else{
sb.append(c);
}
}
}
return sb.toString();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment