|
@@ -35,6 +35,7 @@ import com.fs.erp.domain.ErpOrderPayment;
|
|
|
import com.fs.erp.dto.ErpOrderResponse;
|
|
import com.fs.erp.dto.ErpOrderResponse;
|
|
|
import com.fs.erp.service.IErpOrderService;
|
|
import com.fs.erp.service.IErpOrderService;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
import com.fs.his.config.FsSysConfig;
|
|
|
|
|
+import com.fs.his.config.IntegralConfig;
|
|
|
import com.fs.his.domain.*;
|
|
import com.fs.his.domain.*;
|
|
|
import com.fs.his.dto.ErpRemarkDTO;
|
|
import com.fs.his.dto.ErpRemarkDTO;
|
|
|
import com.fs.his.enums.*;
|
|
import com.fs.his.enums.*;
|
|
@@ -45,6 +46,7 @@ import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.utils.PhoneUtil;
|
|
import com.fs.his.utils.PhoneUtil;
|
|
|
import com.fs.his.utils.RedisCacheUtil;
|
|
import com.fs.his.utils.RedisCacheUtil;
|
|
|
import com.fs.his.vo.*;
|
|
import com.fs.his.vo.*;
|
|
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.qw.domain.QwUser;
|
|
import com.fs.qw.domain.QwUser;
|
|
|
import com.fs.qw.mapper.QwUserMapper;
|
|
import com.fs.qw.mapper.QwUserMapper;
|
|
|
import com.fs.tzBankPay.doman.PayType;
|
|
import com.fs.tzBankPay.doman.PayType;
|
|
@@ -165,6 +167,9 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisCacheUtil redisCacheUtil;
|
|
private RedisCacheUtil redisCacheUtil;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysConfigService configService;
|
|
|
/**
|
|
/**
|
|
|
* 查询积分商品订单
|
|
* 查询积分商品订单
|
|
|
*
|
|
*
|
|
@@ -305,6 +310,16 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
|
|
|
if (Objects.isNull(integralGoods)) {
|
|
if (Objects.isNull(integralGoods)) {
|
|
|
return R.error("商品不存在");
|
|
return R.error("商品不存在");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 检查兑换功能是否关闭
|
|
|
|
|
+ String integralJson = configService.selectConfigByKey("his.integral");
|
|
|
|
|
+ if (StringUtils.isNotEmpty(integralJson)) {
|
|
|
|
|
+ IntegralConfig integralConfig = JSONUtil.toBean(integralJson, IntegralConfig.class);
|
|
|
|
|
+ if (Integer.valueOf(0).equals(integralConfig.getIntegralExchangeOpen())) {
|
|
|
|
|
+ return R.error("兑换功能维护中,暂不支持兑换");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if(integralGoods.getStock()<=0L){
|
|
if(integralGoods.getStock()<=0L){
|
|
|
return R.error("库存不足");
|
|
return R.error("库存不足");
|
|
|
}
|
|
}
|
|
@@ -454,6 +469,15 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
|
|
|
throw new CustomException("地址不存在");
|
|
throw new CustomException("地址不存在");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 检查兑换功能是否关闭
|
|
|
|
|
+ String integralJson = configService.selectConfigByKey("his.integral");
|
|
|
|
|
+ if (StringUtils.isNotEmpty(integralJson)) {
|
|
|
|
|
+ IntegralConfig integralConfig = JSONUtil.toBean(integralJson, IntegralConfig.class);
|
|
|
|
|
+ if (Integer.valueOf(0).equals(integralConfig.getIntegralExchangeOpen())) {
|
|
|
|
|
+ throw new CustomException("兑换功能维护中,暂不支持兑换");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Wrapper<FsIntegralCart> wrapper = Wrappers.<FsIntegralCart>lambdaQuery()
|
|
Wrapper<FsIntegralCart> wrapper = Wrappers.<FsIntegralCart>lambdaQuery()
|
|
|
.eq(FsIntegralCart::getUserId, user.getUserId())
|
|
.eq(FsIntegralCart::getUserId, user.getUserId())
|
|
|
.in(FsIntegralCart::getId, param.getIds());
|
|
.in(FsIntegralCart::getId, param.getIds());
|