Commit 37a678cf by 伍思炜

新智能平台对接开发

parent 400080d8
......@@ -134,23 +134,24 @@ public class DankuanController {
String campus = request.getParameter("campus");
String regularId = request.getParameter("productIntroductionPic2");
if (sell != null && StringUtils.isNumeric(sell)) {
} else {
sell = "";
}
// 校验多媒体账号
if (StringUtils.isNotBlank(orderCustomerAccount)) {
if (StringUtils.isNotBlank(regularId)){
Wrapper<Regular> wrapper = new EntityWrapper<>();
Regular regular = regularMapper.selectById(regularId);
if (StringUtils.isNotBlank(regular.getRegular())) {
if (!"手机号".equals(regular.getRegularName())){
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
Pattern iphoneVerification = Pattern.compile(regular.getRegular().replace("/", ""));
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error(regular.getTips());
return ResponseData.error("多媒体账号格式错误");
}
}
}
}
......@@ -158,10 +159,18 @@ public class DankuanController {
return ResponseData.error("多媒体账号不能为空");
}
// 校验多媒体密码
if (StringUtils.isNotBlank(orderCustomerPwd)) {
// 广美学校判断
if (StringUtils.isNotBlank(productId) && "84".equals(productId)){
if (!orderNumber.substring(10).equals(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为身份证8位");
}
}else {
if (!CheckPwd.checkPassword(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为8~12位的数字加字母组合");
}
}
} else {
return ResponseData.error("多媒体账号的密码不能为空");
}
......
......@@ -176,15 +176,18 @@ public class RongHeController {
sell = "";
}
// 校验多媒体账号
if (StringUtils.isNotBlank(orderCustomerAccount)) {
if (StringUtils.isNotBlank(regularId)){
Wrapper<Regular> wrapper = new EntityWrapper<>();
Regular regular = regularMapper.selectById(regularId);
if (StringUtils.isNotBlank(regular.getRegular())) {
if (!"手机号".equals(regular.getRegularName())){
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
Pattern iphoneVerification = Pattern.compile(regular.getRegular().replace("/", ""));
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error(regular.getTips());
return ResponseData.error("多媒体账号格式错误");
}
}
}
}
......@@ -192,10 +195,18 @@ public class RongHeController {
return ResponseData.error("多媒体账号不能为空");
}
// 校验多媒体密码
if (StringUtils.isNotBlank(orderCustomerPwd)) {
// 广美学校判断
if (StringUtils.isNotBlank(productId) && "84".equals(productId)){
if (!orderNumber.substring(10).equals(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为身份证8位");
}
}else {
if (!CheckPwd.checkPassword(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为8~12位的数字加字母组合");
}
}
} else {
return ResponseData.error("多媒体账号的密码不能为空");
}
......
......@@ -3,10 +3,12 @@ package com.winsun.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.Regular;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface RegularMapper extends BaseMapper<Regular> {
@Select("select * from hhr_zzpz_manage where regular_name = #{regularName}")
Regular selectByRegularName(String regularName);
}
......@@ -92,8 +92,11 @@ public class IntelligenceSendOrder {
log.info("订单号:" + ORDERSEQ + ",在order_view表中无记录,无法进行智能平台下单");
return;
}
//产品价格
ORDERAMOUNT = orderMap.get("webOrderAmount") != null ? orderMap.get("webOrderAmount").toString() : "0";
//穗易付订单号
ORDERREQTRANSEQ = orderMap.get("orderReqtranSeq") != null ? orderMap.get("orderReqtranSeq").toString() : "";
//支付平台流水号
UPTRANSEQ = orderMap.get("uptranseq") != null ? orderMap.get("uptranseq").toString() : "";
// 根据学校名称,获取该学校信息
......@@ -165,15 +168,15 @@ public class IntelligenceSendOrder {
// 3、提交订单到智能平台
JSONObject submitOrderJsonObject =
getOrderInfo(
schoolMap,
orderMap,
currentTimeStr,
productId,
saleId,
ORDERSEQ,
UPTRANSEQ,
ORDERAMOUNT,
ORDERREQTRANSEQ,
schoolMap, //宽带订单对应的学校信息
orderMap, //宽带订单信息
currentTimeStr, //当前时间
productId, //产品ID
saleId, //销售员ID
ORDERSEQ, //kd_order_id 宽带ID
UPTRANSEQ, //支付平台流水号
ORDERAMOUNT, //产品价格
ORDERREQTRANSEQ, //穗易付订单号
0);
log.info(
"----------调用单宽带接口(提交订单至智能平台)并返回参数信息---status:"
......@@ -347,16 +350,16 @@ public class IntelligenceSendOrder {
* @throws Exception
*/
private JSONObject getOrderInfo(
Map<String, Object> schoolMap,
Map<String, Object> orderMap,
String currentTimeStr,
String productId,
String saleId,
String ORDERSEQ,
String UPTRANSEQ,
String ORDERAMOUNT,
String ORDERREQTRANSEQ,
int count)
Map<String, Object> schoolMap, //宽带订单对应的学校信息
Map<String, Object> orderMap, //宽带订单信息
String currentTimeStr, //当前时间
String productId, //产品ID
String saleId, //销售项ID
String ORDERSEQ, //kd_order_id 宽带ID
String UPTRANSEQ, //支付平台流水号
String ORDERAMOUNT, //产品价格
String ORDERREQTRANSEQ, //穗易付订单号
int count) //0
throws Exception {
log.info("前置提交参数:schoolMap:" + schoolMap+",orderMap:"+orderMap);
List<NameValuePair> qParams = new ArrayList<NameValuePair>();
......@@ -417,20 +420,20 @@ public class IntelligenceSendOrder {
qParams.add(new BasicNameValuePair("deliveryCity", "广州市")); // 配送地址-市,必填
signMap.put("deliveryCity", "广州市");
String addressDistrict = null;
String address = null;
String addressID = null;
String landId = null;
String universityTerminalType = null;
String universityUserCategory = null;
String universityUserType = null;
String universityMonthlyRentType = null;
String universityChargingAttribute = null;
String universityOnlineNumber = null;
String universityOneManTerminal = null;
String universityIsFtthHub = null;
String universityExteriorLines = null;
String universityChargeMode = null;
String addressDistrict = null; //所在区域
String address = null; //装机地址
String addressID = null; //地址ID
String landId = null; //揽装工号
String universityTerminalType = null; //允许上网终端类型
String universityUserCategory = null; //用户类别
String universityUserType = null; //用户类型
String universityMonthlyRentType = null; //月租类型
String universityChargingAttribute = null; //计费属性
String universityOnlineNumber = null; //最大在线数
String universityOneManTerminal = null; //一人一号多终端:0否 1是
String universityIsFtthHub = null; //是否FTTH+HUB:0否 1是
String universityExteriorLines = null; //外线方式
String universityChargeMode = null; //收费模式
if (BeanUtil.isNotBlank(schoolMap)) {
addressDistrict = (String) schoolMap.get("universityRegion");
address = (String) schoolMap.get("universityInstalledAddress");
......@@ -471,15 +474,10 @@ public class IntelligenceSendOrder {
signMap.put("deliveryDistrict", addressDistrict);
qParams.add(new BasicNameValuePair("deliveryAddress", address)); // 配送地址-详细地址,必填
signMap.put("deliveryAddress", address);
qParams.add(
new BasicNameValuePair("deliveryContact", (String) orderMap.get("orderName"))); // 报装联系人,必填
qParams.add(new BasicNameValuePair("deliveryContact", (String) orderMap.get("orderName"))); // 报装联系人,必填
signMap.put("deliveryContact", (String) orderMap.get("orderName"));
qParams.add(
new BasicNameValuePair(
"deliveryContactPhone", (String) orderMap.get("orderPhone"))); // 报装联系电话,必填
qParams.add(new BasicNameValuePair("deliveryContactPhone", (String) orderMap.get("orderPhone"))); // 报装联系电话,必填
signMap.put("deliveryContactPhone", (String) orderMap.get("orderPhone"));
qParams.add(new BasicNameValuePair("invoiced", "0")); // 是否需要发票 0:否 1:是,必填
signMap.put("invoiced", "0");
qParams.add(new BasicNameValuePair("invoiceTitle", "")); // 若需要发票,发票抬头,必填
......@@ -494,19 +492,11 @@ public class IntelligenceSendOrder {
signMap.put("comarketingLanId", "");
qParams.add(new BasicNameValuePair("groupComarketingLanId", "")); // 集团协销工号,选填
signMap.put("groupComarketingLanId", "");
qParams.add(
new BasicNameValuePair(
"orderOutNum",
(String)
orderMap.get(
"orderSeq"))); // 外部订单编号,选填!;通过API接口下单,必须传入一个外部接入商的订单编号,该编号与智能营销系统编号一一对应
qParams.add(new BasicNameValuePair("orderOutNum", (String) orderMap.get("orderSeq"))); // 外部订单编号,选填!;通过API接口下单,必须传入一个外部接入商的订单编号,该编号与智能营销系统编号一一对应
signMap.put("orderOutNum", (String) orderMap.get("orderSeq"));
qParams.add(new BasicNameValuePair("orderSource", "校园宽带自助受理")); // 订单来源 ,选填
signMap.put("orderSource", "校园宽带自助受理");
qParams.add(
new BasicNameValuePair(
"orderSourceNum",
(String) orderMap.get("orderSeq"))); // 订单来源单号,选填; 与订单来源对应,用于业务上记录订单的来源订单编号
qParams.add(new BasicNameValuePair("orderSourceNum", (String) orderMap.get("orderSeq"))); // 订单来源单号,选填; 与订单来源对应,用于业务上记录订单的来源订单编号
signMap.put("orderSourceNum", (String) orderMap.get("orderSeq"));
qParams.add(new BasicNameValuePair("salePointCode", "")); // 销售点编码,选填
signMap.put("salePointCode", "");
......@@ -518,13 +508,10 @@ public class IntelligenceSendOrder {
signMap.put("agent", "");
qParams.add(new BasicNameValuePair("copyied", "0")); // 是否收取复印件(0:否 1:是),必填
signMap.put("copyied", "0");
qParams.add(
new BasicNameValuePair(
"deliveryContactPhone", (String) orderMap.get("orderPhone"))); // 联系人电话 ,必填
qParams.add(new BasicNameValuePair("deliveryContactPhone", (String) orderMap.get("orderPhone"))); // 联系人电话 ,必填
signMap.put("deliveryContactPhone", (String) orderMap.get("orderPhone"));
qParams.add(new BasicNameValuePair("deliveryContactPhone2", "")); // 联系人电话2,选填
signMap.put("deliveryContactPhone2", "");
qParams.add(new BasicNameValuePair("addressId", addressID)); // 地址Id,客户类型为2时,必填
signMap.put("addressId", addressID);
......@@ -541,8 +528,7 @@ public class IntelligenceSendOrder {
if (ORDERAMOUNT.equals("0.01") || ORDERAMOUNT.equals("0.02")) {
paymentMap.put("payType", "2");
} else {
paymentMap.put(
"payType", "4"); // 缴费方式,必填(例:payType:1);1:银行划账2:现金支付3:代理商打款4:穗易付5:原套餐缴费方式6:支付宝划扣8:装维上门收取
paymentMap.put("payType", "4"); // 缴费方式,必填(例:payType:1);1:银行划账2:现金支付3:代理商打款4:穗易付5:原套餐缴费方式6:支付宝划扣8:装维上门收取
}
if("xjzf".equals(orderMap.get("customerId"))) {
......@@ -550,9 +536,7 @@ public class IntelligenceSendOrder {
}
paymentMap.put("tag", ""); // 费用项标识,选填
paymentMap.put(
"bank",
""); // 缴费银行,缴费方式为“银行划账”时必填
paymentMap.put("bank", ""); // 缴费银行,缴费方式为“银行划账”时必填
// :[中国银行|中国工商银行|中国农业银行|民生银行|招商银行|中信银行|商业银行|广东发展银行|光大银行|华夏银行|兴业银行|浦发银行|广州农村商业银行|广州银行|深圳发展银行|交通银行|中国建设银行|邮政储蓄]
paymentMap.put("bankNumber", ""); // 银行账号,缴费方式为“银行划账”时必填
paymentMap.put("bankOwner", ""); // //银行账号持有人,缴费方式为“银行划账”时必填
......@@ -934,8 +918,7 @@ public class IntelligenceSendOrder {
Map<String, Object> schoolMap = new HashMap<>();
List<Map<String, Object>> list1 = new ArrayList<>();
List<Map<String, Object>> hehuoren_id =
universityInfoMapper.selectProductManager(order.getHehuorenId());
List<Map<String, Object>> hehuoren_id = universityInfoMapper.selectProductManager(order.getHehuorenId());
if (hehuoren_id.size() > 0 && hehuoren_id.get(0).get("university_id") != null) {
Wrapper<UniversityInfo> universityInfoWrapper = new EntityWrapper<>();
universityInfoWrapper.eq("university_id", hehuoren_id.get(0).get("university_id").toString());
......@@ -953,11 +936,11 @@ public class IntelligenceSendOrder {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String currentTimeStr = simpleDateFormat.format(new Date());
if (order.getUserType().toString().equals("3")) {
String UPTRANSEQ = "";
String UPTRANSEQ = "";//支付平台流水号
if (orderMap.get("uptranseq") != null) {
UPTRANSEQ = orderMap.get("uptranseq").toString();
}
// 穗易付平台,支付流水号
// 产品价格
String ORDERAMOUNT = "";
if (orderMap.get("webOrderAmount").toString().equals("0")) {
ORDERAMOUNT = "0元";
......@@ -967,7 +950,7 @@ public class IntelligenceSendOrder {
setPriceIndex(schoolMap, orderMap, ORDERAMOUNT);
// 穗易付订单号
String ORDERREQTRANSEQ = "";
if (orderMap.get("orderReqtranSeq") != null) {
ORDERREQTRANSEQ = orderMap.get("orderReqtranSeq").toString(); // 穗易付订单号
......@@ -1111,20 +1094,20 @@ public class IntelligenceSendOrder {
new BasicNameValuePair("addressCity", "广州市")); // 报装地址-市 办理类型,若选择[新宽新移][新宽旧移],此项必填
signMap.put("addressCity", "广州市");
String addressDistrict = null;
String address = null;
String addressID = null;
String landId = null;
String universityTerminalType = null;
String universityUserCategory = null;
String universityUserType = null;
String universityMonthlyRentType = null;
String universityChargingAttribute = null;
String universityOnlineNumber = null;
String universityOneManTerminal = null;
String universityIsFtthHub = null;
String universityExteriorLines = null;
String universityChargeMode = null;
String addressDistrict = null; //所在区域
String address = null; //装机地址
String addressID = null; //地址ID
String landId = null; //揽装工号
String universityTerminalType = null; //允许上网终端类型
String universityUserCategory = null; //用户类别
String universityUserType = null; //用户类型
String universityMonthlyRentType = null; //月租类型
String universityChargingAttribute = null; //计费属性
String universityOnlineNumber = null; //最大在线数
String universityOneManTerminal = null; //一人一号多终端:0否 1是
String universityIsFtthHub = null; //是否FTTH+HUB:0否 1是
String universityExteriorLines = null; //外线方式
String universityChargeMode = null; //收费模式
if (BeanUtil.isNotBlank(schoolMap)) {
addressDistrict = (String) schoolMap.get("universityRegion");
address = (String) schoolMap.get("universityInstalledAddress");
......
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.winsun.utils;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
//智能平台5.0加密
public class ZnptSignUtils {
private static final char[] hexChars = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
private static final String MAC_NAME = "HmacSHA1";
private static final String ENCODING = "UTF-8";
private static final String macKey = "";
private final SecretKeySpec secretKey;
public ZnptSignUtils() {
try {
byte[] data = macKey.getBytes(ENCODING);
this.secretKey = new SecretKeySpec(data, MAC_NAME);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
private String toHex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (byte aByte : bytes) {
sb.append(hexChars[(aByte >> 4) & 0xF]).append(hexChars[aByte & 0xF]);
}
return sb.toString();
}
/**
* @param message
* @return 生成签名串
* @throws UnsupportedEncodingException
* @throws NoSuchAlgorithmException
* @throws InvalidKeyException
*/
public String macSHA1(String message) throws
UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
Mac mac = Mac.getInstance(MAC_NAME);
mac.init(secretKey);
byte[] text = message.getBytes(ENCODING);
return "sha1=" + toHex(mac.doFinal(text));
}
}
\ No newline at end of file
......@@ -153,6 +153,12 @@
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="idCard != null and idCard != ''">
and id_card = #{idCard}
</if>
<if test="netNumber != null and netNumber != ''">
and net_number like concat(#{netNumber},'%')
</if>
<if test="hehuorenIds != null and hehuorenIds.size > 0">
and hehuoren_id in
<foreach collection="hehuorenIds" item="hehuorenId" open="(" close=")" separator=",">
......@@ -574,6 +580,9 @@
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="idCard != null and idCard != ''">
and id_card = #{idCard}
</if>
<if test="hehuorenIds != null and hehuorenIds.size > 0">
and hehuoren_id in
<foreach collection="hehuorenIds" item="hehuorenId" open="(" close=")" separator=",">
......
......@@ -561,7 +561,6 @@ public class OrderController extends BaseController {
broadBandOrder.setPageStart((broadBandOrder.getPageNo() - 1) * broadBandOrder.getPageSize());
List<BroadBandOrder> broadBandOrders = orderMapper.selectBroadBandOrderList(page, broadBandOrder);
page.setRecords(broadBandOrders);
return ResponseData.success(page);
}
......@@ -1438,7 +1437,7 @@ public class OrderController extends BaseController {
}
ShiroUser user = getShiroUser();
// 当前是否有数据权限
boolean hasDataPermission = user.getRoleNames().stream().anyMatch(data -> StringUtils.equalsAny(data, "活动上单员", "数据管理员", "超级管理员", "快递公司"));
boolean hasDataPermission = user.getRoleNames().stream().anyMatch(data -> StringUtils.equalsAny(data, "活动上单员", "数据管理员", "超级管理员", "快递公司","县分管理员(订单)"));
if (!hasDataPermission) {
return ResponseData.error("无数据权限!");
}
......
......@@ -136,6 +136,9 @@ public class RhPhoneController extends BaseController {
RhPhone rhPhone=new RhPhone();
Map<String, Object> map = listMap.get(i);
rhPhone.setPhone(map.get("a").toString());
Wrapper<RhPhone> wrapper = new EntityWrapper<>();
wrapper.eq("phone",rhPhone);
rhPhoneMapper.delete(wrapper);
rhPhoneMapper.insert(rhPhone);
}
return ResponseData.success(error.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