写法一:
String erpId=TokenContextHolder.getContext().getCloudErpId();
int userType= TokenContextHolder.getContext().getUserType();
if (userType==1) {
depotId = UserUtil.getUserBranchId(erpId);
SelectArchivesDepotEntity selectArchivesDepotEntity = jmsService.queryDepotById(depotId);
CheckUtil.nullException(selectArchivesDepotEntity, "queryNeedExpressBills-02", "用户[" + erpId + "]未绑定仓店,请绑定后再操作!");
}写法二:
TokenEntity context = TokenContextHolder.getContext();
if (context.getUserType() != ArchivesUserTypeEnum.Depot.getValue()) {
BusinessException.of("BIJmsServiceImpl-setDepotId-01", "当前用户不是店铺用户");
}
String depotId = UserUtil.getUserBranchId(context.getCloudErpId());
if (StringUtils.isEmpty(depotId)) {
BusinessException.of("BIJmsServiceImpl-setDepotId-02", "当前用户没有所属店铺");
}
// com.x3.base.core.archives.ArchivesUserTypeEnumpublic class test { public static void main(String[] args) { &...
java限制1个方法同一时间只能被一个线程访问public synchronized void setOrderPay(){ }加上synchronized 修饰符即可...
(1).创建数组double[] myList = new double[size]; //推荐创建方式 double myList[] = new double[size];  ...
java匹配一个字符串在另外一个字符串中出现的次数,java正则start,java正则end// 正则 String pattern = "\\bgao\\b"; // 字符串 String content ...
(4).java lookingAt匹配字符串和java matches匹配字符串lookingAt不要求整个字符串全匹配,例如me和me_you都是匹配的,但是lookingAt从第一个字符串开始匹配,匹配失败了也不会继续匹配,意味着me和you_me是无法匹配的matches匹配字符串要求全部匹...
假如有个字符串为"fatcatfatcatfat",正则为“cat”当调用appendReplacement(sb, "dog")时appendReplacement方法都会把匹配到的内容替换为dog,并把匹配到字符串的前面几个字符串+dog送给sb里,所以第...