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())) {
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
Pattern iphoneVerification = Pattern.compile(regular.getRegular().replace("/", ""));
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error(regular.getTips());
if (!"手机号".equals(regular.getRegularName())){
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
Pattern iphoneVerification = Pattern.compile(regular.getRegular().replace("/", ""));
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error("多媒体账号格式错误");
}
}
}
}
......@@ -158,9 +159,17 @@ public class DankuanController {
return ResponseData.error("多媒体账号不能为空");
}
// 校验多媒体密码
if (StringUtils.isNotBlank(orderCustomerPwd)) {
if (!CheckPwd.checkPassword(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为8~12位的数字加字母组合");
// 广美学校判断
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())) {
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
Pattern iphoneVerification = Pattern.compile(regular.getRegular().replace("/", ""));
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error(regular.getTips());
if (!"手机号".equals(regular.getRegularName())){
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
Pattern iphoneVerification = Pattern.compile(regular.getRegular().replace("/", ""));
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error("多媒体账号格式错误");
}
}
}
}
......@@ -192,9 +195,17 @@ public class RongHeController {
return ResponseData.error("多媒体账号不能为空");
}
// 校验多媒体密码
if (StringUtils.isNotBlank(orderCustomerPwd)) {
if (!CheckPwd.checkPassword(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为8~12位的数字加字母组合");
// 广美学校判断
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);
}
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