|
@@ -21,6 +21,7 @@ import com.fs.api.vo.ProductListVO;
|
|
|
import com.fs.common.config.FSSysConfig;
|
|
import com.fs.common.config.FSSysConfig;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
|
|
+import com.fs.common.core.domain.entity.SysDictData;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.event.TemplateBean;
|
|
import com.fs.common.event.TemplateBean;
|
|
|
import com.fs.common.event.TemplateEvent;
|
|
import com.fs.common.event.TemplateEvent;
|
|
@@ -62,9 +63,12 @@ import com.fs.his.dto.FsStoreOrderAmountScrmStatsQueryDto;
|
|
|
import com.fs.his.dto.FsStoreOrderItemDTO;
|
|
import com.fs.his.dto.FsStoreOrderItemDTO;
|
|
|
import com.fs.his.enums.FsStoreOrderLogEnum;
|
|
import com.fs.his.enums.FsStoreOrderLogEnum;
|
|
|
import com.fs.his.enums.FsStoreOrderStatusEnum;
|
|
import com.fs.his.enums.FsStoreOrderStatusEnum;
|
|
|
|
|
+import com.fs.his.enums.FsUserIntegralLogTypeEnum;
|
|
|
import com.fs.his.mapper.*;
|
|
import com.fs.his.mapper.*;
|
|
|
import com.fs.his.param.FsStoreOrderSalesParam;
|
|
import com.fs.his.param.FsStoreOrderSalesParam;
|
|
|
|
|
+import com.fs.his.param.FsUserAddIntegralTemplateParam;
|
|
|
import com.fs.his.service.IFsPrescribeService;
|
|
import com.fs.his.service.IFsPrescribeService;
|
|
|
|
|
+import com.fs.his.service.IFsUserIntegralLogsService;
|
|
|
import com.fs.his.service.IFsUserWatchService;
|
|
import com.fs.his.service.IFsUserWatchService;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.vo.FsInquiryOrderVO;
|
|
import com.fs.his.vo.FsInquiryOrderVO;
|
|
@@ -104,6 +108,7 @@ import com.fs.hisStore.domain.*;
|
|
|
import com.fs.hisStore.enums.*;
|
|
import com.fs.hisStore.enums.*;
|
|
|
import com.fs.hisStore.service.*;
|
|
import com.fs.hisStore.service.*;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
|
|
+import com.fs.system.service.ISysDictTypeService;
|
|
|
import com.fs.wx.miniapp.config.WxMaProperties;
|
|
import com.fs.wx.miniapp.config.WxMaProperties;
|
|
|
import com.fs.wx.order.domain.FsWxExpressTask;
|
|
import com.fs.wx.order.domain.FsWxExpressTask;
|
|
|
import com.fs.wx.order.dto.*;
|
|
import com.fs.wx.order.dto.*;
|
|
@@ -379,6 +384,13 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsStoreCartScrmService fsStoreCartScrmService;
|
|
private IFsStoreCartScrmService fsStoreCartScrmService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysDictTypeService sysDictTypeService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsUserIntegralLogsService userIntegralLogsService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsStoreProductPackageScrmMapper fsStoreProductPackageMapper;
|
|
|
|
|
+
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
|
public void initErpServiceMap() {
|
|
public void initErpServiceMap() {
|
|
|
erpServiceMap = new HashMap<>();
|
|
erpServiceMap = new HashMap<>();
|
|
@@ -1820,6 +1832,13 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
companyService.addCompanyMoney(order);
|
|
companyService.addCompanyMoney(order);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //套餐包赠送积分
|
|
|
|
|
+ try {
|
|
|
|
|
+ sendIntegral(order);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("赠送积分错误:{},订单号:{}", e.getMessage(), order.getOrderCode());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
FsErpConfig erpConfig = configUtil.getErpConfig();
|
|
FsErpConfig erpConfig = configUtil.getErpConfig();
|
|
|
Integer erpType = erpConfig.getErpType();
|
|
Integer erpType = erpConfig.getErpType();
|
|
@@ -1859,6 +1878,43 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 套餐包赠送积分
|
|
|
|
|
+ * @param order
|
|
|
|
|
+ */
|
|
|
|
|
+ private void sendIntegral(FsStoreOrderScrm order) {
|
|
|
|
|
+ //如果是套餐包赠送积分
|
|
|
|
|
+ Integer orderCreateType = order.getOrderCreateType();
|
|
|
|
|
+ Long packageId = order.getPackageId();
|
|
|
|
|
+ if (orderCreateType != null && order.getUserId() != null && packageId !=null) {
|
|
|
|
|
+ List<SysDictData> sysDictData = sysDictTypeService.selectDictDataByType("store_order_create_type");
|
|
|
|
|
+ if (sysDictData != null && !sysDictData.isEmpty()){
|
|
|
|
|
+ String dictValue = "";
|
|
|
|
|
+ for (SysDictData dictData : sysDictData) {
|
|
|
|
|
+ String dictLabel = dictData.getDictLabel();
|
|
|
|
|
+ if (StringUtils.isNotBlank(dictLabel) && "套餐".equals(dictLabel)){
|
|
|
|
|
+ dictValue = dictData.getDictValue();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(dictValue)){
|
|
|
|
|
+ //查询套餐赠送积分
|
|
|
|
|
+ FsStoreProductPackageScrm fsStoreProductPackage = fsStoreProductPackageMapper.selectFsStoreProductPackageById(packageId);
|
|
|
|
|
+ if (fsStoreProductPackage != null && fsStoreProductPackage.getIntegral() != null && fsStoreProductPackage.getIntegral()>0){
|
|
|
|
|
+ //赠送积分
|
|
|
|
|
+ FsUserAddIntegralTemplateParam integralTemplateParam = new FsUserAddIntegralTemplateParam();
|
|
|
|
|
+ integralTemplateParam.setUserId(order.getUserId());
|
|
|
|
|
+ integralTemplateParam.setLogType(FsUserIntegralLogTypeEnum.TYPE_2.getValue()); //消费获取积分
|
|
|
|
|
+ integralTemplateParam.setBusinessId(order.getId().toString());
|
|
|
|
|
+ integralTemplateParam.setPoints(fsStoreProductPackage.getIntegral());
|
|
|
|
|
+ userIntegralLogsService.addIntegralTemplate(integralTemplateParam);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public BigDecimal selectFsStoreOrderByPayPriceCount(FsStoreOrderStatisticsParam param) {
|
|
public BigDecimal selectFsStoreOrderByPayPriceCount(FsStoreOrderStatisticsParam param) {
|
|
|
return fsStoreOrderMapper.selectFsStoreOrderByPayPriceCount(param);
|
|
return fsStoreOrderMapper.selectFsStoreOrderByPayPriceCount(param);
|
|
@@ -2452,6 +2508,8 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //退积分 todo
|
|
|
|
|
+
|
|
|
orderStatusService.create(order.getId(), OrderLogEnum.REFUND_ORDER_SUCCESS.getValue(),
|
|
orderStatusService.create(order.getId(), OrderLogEnum.REFUND_ORDER_SUCCESS.getValue(),
|
|
|
OrderLogEnum.REFUND_ORDER_SUCCESS.getDesc());
|
|
OrderLogEnum.REFUND_ORDER_SUCCESS.getDesc());
|
|
|
if (order.getTuiUserId() != null && order.getTuiUserId() > 0) {
|
|
if (order.getTuiUserId() != null && order.getTuiUserId() > 0) {
|