1. 修改了提现记录列表的Bug
2. 修改了动态表单因为开启cache缓存导致数据不全不更新的Bug(不使用缓存) 3. 调试控制台增加了调试接口的配置 4. 修改了企业认证的功能
This commit is contained in:
parent
3463e730aa
commit
d064421d27
@ -0,0 +1,30 @@
|
||||
package cn.com.tenlion.systemcard.enums;
|
||||
|
||||
/**
|
||||
* 2021年9月22日16:07:40
|
||||
* 审核日志表类型枚举
|
||||
*/
|
||||
public enum AuditTypeEnum {
|
||||
|
||||
CERTIFICATION("shopCertificationServiceImpl", "企业认证");
|
||||
|
||||
private String type;
|
||||
|
||||
private String typeName;
|
||||
|
||||
AuditTypeEnum(String type, String typeName) {
|
||||
this.type = type;
|
||||
this.typeName = typeName;
|
||||
}
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
// public static ArrayList<Map<String, String>> getType() {
|
||||
// return type;
|
||||
// }
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package cn.com.tenlion.systemcard.filter;
|
||||
|
||||
import cn.com.tenlion.systemcard.enums.AuditTypeEnum;
|
||||
import cn.com.tenlion.systemcard.service.shopauditlog.IShopAuditLogUpdateService;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* explain:获取应用上下文并获取所有的审核记录实现类
|
||||
* @author yang
|
||||
* @date 2021/1/5
|
||||
*/
|
||||
@Component
|
||||
public class AuditServiceLocator implements ApplicationContextAware {
|
||||
|
||||
/**
|
||||
* 用于保存接口实现类名及对应的类
|
||||
*/
|
||||
private Map<String, IShopAuditLogUpdateService> map = new HashMap<String, IShopAuditLogUpdateService>();
|
||||
|
||||
/**
|
||||
* 获取应用上下文并获取相应的接口实现类
|
||||
* @param applicationContext
|
||||
* @throws BeansException
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
//根据接口类型返回相应的所有bean
|
||||
map = applicationContext.getBeansOfType(IShopAuditLogUpdateService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有实现集合
|
||||
* @return
|
||||
*/
|
||||
public Map<String, IShopAuditLogUpdateService> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应服务
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public IShopAuditLogUpdateService getService(String key) {
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package cn.com.tenlion.systemcard.util;
|
||||
|
||||
import org.apache.commons.collections4.BidiMap;
|
||||
import org.apache.commons.collections4.bidimap.TreeBidiMap;
|
||||
|
||||
import javax.xml.bind.ValidationException;
|
||||
import java.util.Map;
|
||||
|
||||
public class BusinessLicenseCheckUtil {
|
||||
|
||||
static String baseCode = "0123456789ABCDEFGHJKLMNPQRTUWXY";
|
||||
static char[] baseCodeArray = baseCode.toCharArray();
|
||||
static int[] wi = {1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28};
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(validateUnifiedCreditCode("91140100095819667W"));
|
||||
System.out.println(validateUnifiedCreditCode("612727199303151514"));
|
||||
System.out.println(validateUnifiedCreditCode("ces "));
|
||||
System.out.println(validateUnifiedCreditCode("CEE"));
|
||||
System.out.println(validateUnifiedCreditCode("测试"));
|
||||
System.out.println(validateUnifiedCreditCode("测试彻底的的35465465qqq"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成供较验使用的 Code Map
|
||||
*
|
||||
* @return BidiMap
|
||||
*/
|
||||
static BidiMap<Character, Integer> generateCodes() {
|
||||
BidiMap<Character, Integer> codes = new TreeBidiMap<>();
|
||||
for (int i = 0; i < baseCode.length(); i++) {
|
||||
codes.put(baseCodeArray[i], i);
|
||||
}
|
||||
return codes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 较验社会统一信用代码
|
||||
*
|
||||
* @param unifiedCreditCode 统一社会信息代码
|
||||
* @return 符合: true
|
||||
*/
|
||||
public static boolean validateUnifiedCreditCode(String unifiedCreditCode) {
|
||||
if ((unifiedCreditCode.equals("")) || unifiedCreditCode.length() != 18) {
|
||||
return false;
|
||||
}
|
||||
Map<Character, Integer> codes = generateCodes();
|
||||
int parityBit;
|
||||
try {
|
||||
parityBit = getParityBit(unifiedCreditCode, codes);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return parityBit == codes.get(unifiedCreditCode.charAt(unifiedCreditCode.length() - 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取较验码
|
||||
*
|
||||
* @param unifiedCreditCode 统一社会信息代码
|
||||
* @param codes 带有映射关系的国家代码
|
||||
* @return 获取较验位的值
|
||||
*/
|
||||
static int getParityBit(String unifiedCreditCode, Map<Character, Integer> codes) throws Exception {
|
||||
char[] businessCodeArray = unifiedCreditCode.toCharArray();
|
||||
|
||||
int sum = 0;
|
||||
for (int i = 0; i < 17; i++) {
|
||||
char key = businessCodeArray[i];
|
||||
if (baseCode.indexOf(key) == -1) {
|
||||
throw new Exception("第" + String.valueOf(i + 1) + "位传入了非法的字符" + key);
|
||||
}
|
||||
sum += (codes.get(key) * wi[i]);
|
||||
}
|
||||
int result = 31 - sum % 31;
|
||||
return result == 31 ? 0 : result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user