写法一:
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.ArchivesUserTypeEnumjava一个类可以有多个构造方法,根据传参类型和个数来匹配执行哪个构造方法。public class Member { public Member(){  ...
java限制1个方法同一时间只能被一个线程访问public synchronized void setOrderPay(){ }加上synchronized 修饰符即可...
Java5 引入了一种主要用于数组的增强型 for 循环,类似js中的for inpublic class Member { public static void main(String[]&...
java判断字符是否是一个字母System.out.println(Character.isLetter('a'));java判断字符是否是一个数字System.out.println(Character.isDigit('0'));java判断字符是否是一个空白Sy...
(1).创建数组double[] myList = new double[size]; //推荐创建方式 double myList[] = new double[size];  ...
(1).java获取当前日期时间Date date = new Date(); System.out.println(date.toString());输出Fri Jul 02 10:29:55 CST 2021(2).java获取时间戳秒/毫秒D...