|
@@ -1,15 +1,5 @@
|
|
|
package com.fs.store.service.impl;
|
|
|
|
|
|
-import java.lang.reflect.Field;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.nio.charset.Charset;
|
|
|
-import java.sql.Timestamp;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
import cn.hutool.core.net.URLDecoder;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
@@ -41,7 +31,6 @@ import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.erp.domain.*;
|
|
|
import com.fs.erp.dto.*;
|
|
|
-import com.fs.erp.service.IErpGoodsService;
|
|
|
import com.fs.erp.service.IErpOrderService;
|
|
|
import com.fs.his.config.FsErpConfig;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
@@ -50,6 +39,7 @@ import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.pay.pay.domain.RefundResult;
|
|
|
import com.fs.pay.pay.service.PayService;
|
|
|
+import com.fs.pay.service.IPayService;
|
|
|
import com.fs.store.config.StoreConfig;
|
|
|
import com.fs.store.config.StoreIntegralConfig;
|
|
|
import com.fs.store.constants.StoreConstants;
|
|
@@ -58,11 +48,11 @@ import com.fs.store.dto.*;
|
|
|
import com.fs.store.enums.*;
|
|
|
import com.fs.store.mapper.FsStoreCartMapper;
|
|
|
import com.fs.store.mapper.FsStoreOrderItemMapper;
|
|
|
+import com.fs.store.mapper.FsStoreOrderMapper;
|
|
|
import com.fs.store.mapper.FsUserAddressMapper;
|
|
|
import com.fs.store.param.*;
|
|
|
import com.fs.store.service.*;
|
|
|
import com.fs.store.vo.*;
|
|
|
-import com.fs.pay.service.IPayService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.wx.pay.config.WxPayProperties;
|
|
|
import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
|
|
@@ -80,15 +70,24 @@ import org.springframework.aop.framework.AopContext;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.fs.store.mapper.FsStoreOrderMapper;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
+import java.lang.reflect.Field;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.nio.charset.Charset;
|
|
|
+import java.sql.Timestamp;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.*;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
import static com.fs.store.constants.StoreConstants.DELIVERY;
|
|
|
|
|
|
/**
|
|
@@ -207,6 +206,12 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
@Autowired
|
|
|
@Qualifier("k9OrderServiceImpl")
|
|
|
private IErpOrderService k9OrderService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderAuditService orderAuditService;
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderAuditLogService orderAuditLogService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询订单
|
|
|
*
|
|
@@ -1343,6 +1348,10 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
storeOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
|
|
|
storeOrder.setPayTime(new Date());
|
|
|
fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
|
|
|
+
|
|
|
+ // 添加订单审核
|
|
|
+ addOrderAudit(order);
|
|
|
+
|
|
|
//非处方直接提交OMS
|
|
|
// if(order.getIsPrescribe().equals(0)){
|
|
|
// createOmsOrder(order.getId());
|
|
@@ -1364,6 +1373,44 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加审核
|
|
|
+ * @param order 订单信息
|
|
|
+ */
|
|
|
+ private void addOrderAudit(FsStoreOrder order) {
|
|
|
+ if (!getAuditSwitch()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ FsStoreOrderAudit orderAudit = new FsStoreOrderAudit();
|
|
|
+ orderAudit.setOrderId(order.getId());
|
|
|
+ orderAudit.setCompanyId(order.getCompanyId());
|
|
|
+ orderAudit.setCompanyUserId(order.getCompanyUserId());
|
|
|
+ orderAudit.setAuditStatus(OrderAuditStateEnum.COMPANY_PENDING.getValue());
|
|
|
+ orderAudit.setCreateTime(LocalDateTime.now());
|
|
|
+ orderAuditService.save(orderAudit);
|
|
|
+
|
|
|
+ FsStoreOrderAuditLog auditLog = new FsStoreOrderAuditLog();
|
|
|
+ auditLog.setAuditId(orderAudit.getId());
|
|
|
+ auditLog.setOrderId(order.getId());
|
|
|
+ auditLog.setContent("系统:提交审核");
|
|
|
+ auditLog.setCreateTime(LocalDateTime.now());
|
|
|
+ orderAuditLogService.save(auditLog);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取是否需要订单审核
|
|
|
+ * @return boolean
|
|
|
+ */
|
|
|
+ private boolean getAuditSwitch() {
|
|
|
+ try {
|
|
|
+ String json = configService.selectConfigByKey("store.config");
|
|
|
+ StoreConfig config = JSONUtil.toBean(json,StoreConfig.class);
|
|
|
+ return config.getAuditSwitch() == 1;
|
|
|
+ } catch (Exception e) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public boolean containsAddress(String companyName) {
|
|
|
String[] items= {"新疆","西藏","内蒙古","海南"};
|
|
@@ -2170,6 +2217,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
storeOrder.setIsPayRemain(1);
|
|
|
fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
|
|
|
|
|
|
+ // 添加审核
|
|
|
+ addOrderAudit(order);
|
|
|
+
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|