写法一:
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.ArchivesUserTypeEnum字节(Byte)是计量单位,表示数据量多少,是计算机信息技术用于计量存储容量的一种计量单位,通常情况下一字节等于八位。字符(Character)计算机中使用的字母、数字、字和符号,比如'A'、'B'、'$'、'&'等。一般在英文...
public class test { public static void main(String[] args) { &...
java一个类可以有多个构造方法,根据传参类型和个数来匹配执行哪个构造方法。public class Member { public Member(){  ...
java限制1个方法同一时间只能被一个线程访问public synchronized void setOrderPay(){ }加上synchronized 修饰符即可...
(1).final 修饰符通常和 static 修饰符一起使用来创建类常量。(2).父类中的 final 方法可以被子类继承,但是不能被子类重写,声明 final 方法的主要目的是防止该方法的内容被修改。public class Member {  ...
(1).创建数组double[] myList = new double[size]; //推荐创建方式 double myList[] = new double[size];  ...